Add more tests
parent
e636d82da5
commit
75d5406943
|
@ -144,12 +144,12 @@ int FibonacciList::rowCount(const QModelIndex &parent) const
|
||||||
return (parent.isValid()) ? 0 : fibonacci_list_row_count(m_d);
|
return (parent.isValid()) ? 0 : fibonacci_list_row_count(m_d);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FibonacciList::insertRows(int row, int count, const QModelIndex &parent)
|
bool FibonacciList::insertRows(int row, int count, const QModelIndex &)
|
||||||
{
|
{
|
||||||
return fibonacci_list_insert_rows(m_d, row, count);
|
return fibonacci_list_insert_rows(m_d, row, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FibonacciList::removeRows(int row, int count, const QModelIndex &parent)
|
bool FibonacciList::removeRows(int row, int count, const QModelIndex &)
|
||||||
{
|
{
|
||||||
return fibonacci_list_remove_rows(m_d, row, count);
|
return fibonacci_list_remove_rows(m_d, row, count);
|
||||||
}
|
}
|
||||||
|
@ -721,12 +721,12 @@ int TimeSeries::rowCount(const QModelIndex &parent) const
|
||||||
return (parent.isValid()) ? 0 : time_series_row_count(m_d);
|
return (parent.isValid()) ? 0 : time_series_row_count(m_d);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TimeSeries::insertRows(int row, int count, const QModelIndex &parent)
|
bool TimeSeries::insertRows(int row, int count, const QModelIndex &)
|
||||||
{
|
{
|
||||||
return time_series_insert_rows(m_d, row, count);
|
return time_series_insert_rows(m_d, row, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TimeSeries::removeRows(int row, int count, const QModelIndex &parent)
|
bool TimeSeries::removeRows(int row, int count, const QModelIndex &)
|
||||||
{
|
{
|
||||||
return time_series_remove_rows(m_d, row, count);
|
return time_series_remove_rows(m_d, row, count);
|
||||||
}
|
}
|
||||||
|
|
22
src/cpp.cpp
22
src/cpp.cpp
|
@ -289,12 +289,12 @@ int %1::rowCount(const QModelIndex &parent) const
|
||||||
return (parent.isValid()) ? 0 : %2_row_count(m_d);
|
return (parent.isValid()) ? 0 : %2_row_count(m_d);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool %1::insertRows(int row, int count, const QModelIndex &parent)
|
bool %1::insertRows(int row, int count, const QModelIndex &)
|
||||||
{
|
{
|
||||||
return %2_insert_rows(m_d, row, count);
|
return %2_insert_rows(m_d, row, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool %1::removeRows(int row, int count, const QModelIndex &parent)
|
bool %1::removeRows(int row, int count, const QModelIndex &)
|
||||||
{
|
{
|
||||||
return %2_remove_rows(m_d, row, count);
|
return %2_remove_rows(m_d, row, count);
|
||||||
}
|
}
|
||||||
|
@ -951,7 +951,6 @@ void writeCppObject(QTextStream& cpp, const Object& o, const Configuration& conf
|
||||||
} else if (p.type.name == "QByteArray") {
|
} else if (p.type.name == "QByteArray") {
|
||||||
cpp << QString(" %1_set(m_d, v.data(), v.size());").arg(base) << endl;
|
cpp << QString(" %1_set(m_d, v.data(), v.size());").arg(base) << endl;
|
||||||
} else {
|
} else {
|
||||||
qWarning() << p.type.cppSetType;
|
|
||||||
cpp << QString(" %1_set(m_d, v);").arg(base) << endl;
|
cpp << QString(" %1_set(m_d, v);").arg(base) << endl;
|
||||||
}
|
}
|
||||||
cpp << "}" << endl;
|
cpp << "}" << endl;
|
||||||
|
@ -961,19 +960,19 @@ void writeCppObject(QTextStream& cpp, const Object& o, const Configuration& conf
|
||||||
for (const Function& f: o.functions) {
|
for (const Function& f: o.functions) {
|
||||||
const QString base = QString("%1_%2")
|
const QString base = QString("%1_%2")
|
||||||
.arg(lcname, snakeCase(f.name));
|
.arg(lcname, snakeCase(f.name));
|
||||||
cpp << QString("%1 %2::%3(")
|
cpp << QString("%1 %2::%3(").arg(f.type.name, o.name, f.name);
|
||||||
.arg(f.type.name, o.name, f.name);
|
|
||||||
for (auto a = f.args.begin(); a < f.args.end(); a++) {
|
for (auto a = f.args.begin(); a < f.args.end(); a++) {
|
||||||
cpp << QString("%1 %2%3").arg(a->type.cppSetType, a->name, a + 1 < f.args.end() ? ", " : "");
|
cpp << QString("%1 %2%3").arg(a->type.cppSetType, a->name, a + 1 < f.args.end() ? ", " : "");
|
||||||
}
|
}
|
||||||
cpp << QString(")%1\n{\n")
|
cpp << QString(")%1\n{\n").arg(f.mut ? "" : " const");
|
||||||
.arg(f.mut ? "" : " const");
|
|
||||||
QString argList;
|
QString argList;
|
||||||
for (auto a = f.args.begin(); a < f.args.end(); a++) {
|
for (auto a = f.args.begin(); a < f.args.end(); a++) {
|
||||||
if (a->type.name == "QString") {
|
if (a->type.name == "QString") {
|
||||||
argList.append(QString(", %2%3.utf16(), %2%3.size()").arg(a->name, a + 1 < f.args.end() ? ", " : ""));
|
argList.append(QString(", %1.utf16(), %1.size()").arg(a->name));
|
||||||
|
} else if (a->type.name == "QByteArray") {
|
||||||
|
argList.append(QString(", %1.data(), %1.size()").arg(a->name));
|
||||||
} else {
|
} else {
|
||||||
argList.append(QString(", %2%3").arg(a->name, a + 1 < f.args.end() ? ", " : ""));
|
argList.append(QString(", %1").arg(a->name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (f.type.name == "QString") {
|
if (f.type.name == "QString") {
|
||||||
|
@ -981,6 +980,11 @@ void writeCppObject(QTextStream& cpp, const Object& o, const Configuration& conf
|
||||||
cpp << QString(" %1(m_d%2, &s, set_qstring);")
|
cpp << QString(" %1(m_d%2, &s, set_qstring);")
|
||||||
.arg(base, argList) << endl;
|
.arg(base, argList) << endl;
|
||||||
cpp << " return s;" << endl;
|
cpp << " return s;" << endl;
|
||||||
|
} else if (f.type.name == "QByteArray") {
|
||||||
|
cpp << QString(" %1 s;").arg(f.type.name) << endl;
|
||||||
|
cpp << QString(" %1(m_d%2, &s, set_qbytearray);")
|
||||||
|
.arg(base, argList) << endl;
|
||||||
|
cpp << " return s;" << endl;
|
||||||
} else {
|
} else {
|
||||||
cpp << QString(" return %1(m_d%2);")
|
cpp << QString(" return %1(m_d%2);")
|
||||||
.arg(base, argList) << endl;
|
.arg(base, argList) << endl;
|
||||||
|
|
12
src/rust.cpp
12
src/rust.cpp
|
@ -157,6 +157,8 @@ pub extern "C" fn %1_%2(ptr: *%3 %4)").arg(lcname, lc, f.mut ? "mut" : "const",
|
||||||
r << ", ";
|
r << ", ";
|
||||||
if (a->type.name == "QString") {
|
if (a->type.name == "QString") {
|
||||||
r << QString("%1_str: *const c_ushort, %1_len: c_int").arg(a->name);
|
r << QString("%1_str: *const c_ushort, %1_len: c_int").arg(a->name);
|
||||||
|
} else if (a->type.name == "QByteArray") {
|
||||||
|
r << QString("%1_str: *const c_char, %1_len: c_int").arg(a->name);
|
||||||
} else {
|
} else {
|
||||||
r << a->name << ": " << a->type.rustType;
|
r << a->name << ": " << a->type.rustType;
|
||||||
}
|
}
|
||||||
|
@ -174,6 +176,7 @@ pub extern "C" fn %1_%2(ptr: *%3 %4)").arg(lcname, lc, f.mut ? "mut" : "const",
|
||||||
r << " let mut " << a->name << " = String::new();\n";
|
r << " let mut " << a->name << " = String::new();\n";
|
||||||
r << QString(" set_string_from_utf16(&mut %1, %1_str, %1_len);\n").arg(a->name);
|
r << QString(" set_string_from_utf16(&mut %1, %1_str, %1_len);\n").arg(a->name);
|
||||||
} else if (a->type.name == "QByteArray") {
|
} else if (a->type.name == "QByteArray") {
|
||||||
|
r << QString(" let %1 = unsafe { slice::from_raw_parts(%1_str as *const u8, %1_len as usize) };\n").arg(a->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (f.mut) {
|
if (f.mut) {
|
||||||
|
@ -192,7 +195,7 @@ pub extern "C" fn %1_%2(ptr: *%3 %4)").arg(lcname, lc, f.mut ? "mut" : "const",
|
||||||
if (f.type.isComplex()) {
|
if (f.type.isComplex()) {
|
||||||
r << " let s: *const c_char = r.as_ptr() as (*const c_char);\n";
|
r << " let s: *const c_char = r.as_ptr() as (*const c_char);\n";
|
||||||
r << " set(d, s, r.len() as i32);\n";
|
r << " set(d, s, r.len() as i32);\n";
|
||||||
} else if (f.type.rustType != "()") {
|
} else {
|
||||||
r << " r\n";
|
r << " r\n";
|
||||||
}
|
}
|
||||||
r << "}\n";
|
r << "}\n";
|
||||||
|
@ -346,12 +349,9 @@ pub trait %1Trait {
|
||||||
const QString lc(snakeCase(f.name));
|
const QString lc(snakeCase(f.name));
|
||||||
QString argList;
|
QString argList;
|
||||||
if (f.args.size() > 0) {
|
if (f.args.size() > 0) {
|
||||||
argList.append(", ");
|
|
||||||
for (auto a = f.args.begin(); a < f.args.end(); a++) {
|
for (auto a = f.args.begin(); a < f.args.end(); a++) {
|
||||||
argList.append(
|
auto t = a->type.name == "QByteArray" ?"&[u8]" :a->type.rustType;
|
||||||
QString("%1: %2%3")
|
argList.append(QString(", %1: %2").arg(a->name, t));
|
||||||
.arg(a->name, a->type.rustType, a + 1 < f.args.end() ? ", " : "")
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
r << QString(" fn %1(&%2self%4) -> %3;\n")
|
r << QString(" fn %1(&%2self%4) -> %3;\n")
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* generated by rust_qt_binding_generator */
|
/* generated by rust_qt_binding_generator */
|
||||||
#![allow(unknown_lints)]
|
#![allow(unknown_lints)]
|
||||||
#![allow(mutex_atomic, needless_pass_by_value)]
|
#![allow(mutex_atomic, needless_pass_by_value)]
|
||||||
use libc::{c_char, c_ushort, c_int, c_void, uint8_t, uint16_t};
|
use libc::{c_char, c_ushort, c_int};
|
||||||
use std::slice;
|
use std::slice;
|
||||||
use std::char::decode_utf16;
|
use std::char::decode_utf16;
|
||||||
|
|
||||||
|
@ -73,8 +73,8 @@ pub unsafe extern "C" fn simple_free(ptr: *mut Simple) {
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn simple_message_get(
|
pub extern "C" fn simple_message_get(
|
||||||
ptr: *const Simple,
|
ptr: *const Simple,
|
||||||
p: *mut c_void,
|
p: *mut QString,
|
||||||
set: fn(*mut c_void, *const c_char, c_int),
|
set: fn(*mut QString, *const c_char, c_int),
|
||||||
) {
|
) {
|
||||||
let o = unsafe { &*ptr };
|
let o = unsafe { &*ptr };
|
||||||
let v = o.message();
|
let v = o.message();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* generated by rust_qt_binding_generator */
|
/* generated by rust_qt_binding_generator */
|
||||||
#![allow(unknown_lints)]
|
#![allow(unknown_lints)]
|
||||||
#![allow(mutex_atomic, needless_pass_by_value)]
|
#![allow(mutex_atomic, needless_pass_by_value)]
|
||||||
use libc::{c_char, c_ushort, c_int, c_void, uint8_t, uint16_t};
|
use libc::{c_char, c_ushort, c_int};
|
||||||
use std::slice;
|
use std::slice;
|
||||||
use std::char::decode_utf16;
|
use std::char::decode_utf16;
|
||||||
|
|
||||||
|
@ -73,8 +73,8 @@ pub unsafe extern "C" fn simple_free(ptr: *mut Simple) {
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn simple_message_get(
|
pub extern "C" fn simple_message_get(
|
||||||
ptr: *const Simple,
|
ptr: *const Simple,
|
||||||
p: *mut c_void,
|
p: *mut QString,
|
||||||
set: fn(*mut c_void, *const c_char, c_int),
|
set: fn(*mut QString, *const c_char, c_int),
|
||||||
) {
|
) {
|
||||||
let o = unsafe { &*ptr };
|
let o = unsafe { &*ptr };
|
||||||
let v = o.message();
|
let v = o.message();
|
||||||
|
|
|
@ -40,5 +40,14 @@ impl PersonTrait for Person {
|
||||||
_ => count
|
_ => count
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn quote(&self, prefix: String, suffix: String) -> String {
|
||||||
|
format!("{}{}{}", prefix, self.user_name, suffix)
|
||||||
|
}
|
||||||
|
fn quote_bytes(&self, prefix: &[u8], suffix: &[u8]) -> String {
|
||||||
|
let prefix = String::from_utf8_lossy(prefix);
|
||||||
|
let suffix = String::from_utf8_lossy(suffix);
|
||||||
|
format!("{}{}{}", prefix, self.user_name, suffix)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,9 @@ pub trait PersonTrait {
|
||||||
fn user_name(&self) -> &str;
|
fn user_name(&self) -> &str;
|
||||||
fn set_user_name(&mut self, value: String);
|
fn set_user_name(&mut self, value: String);
|
||||||
fn double_name(&mut self) -> ();
|
fn double_name(&mut self) -> ();
|
||||||
fn greet(&self, Name: String) -> String;
|
fn greet(&self, name: String) -> String;
|
||||||
|
fn quote(&self, prefix: String, suffix: String) -> String;
|
||||||
|
fn quote_bytes(&self, prefix: &[u8], suffix: &[u8]) -> String;
|
||||||
fn vowels_in_name(&self) -> u8;
|
fn vowels_in_name(&self) -> u8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,14 +99,37 @@ pub extern "C" fn person_user_name_set(ptr: *mut Person, v: *const c_ushort, len
|
||||||
pub extern "C" fn person_double_name(ptr: *mut Person) -> () {
|
pub extern "C" fn person_double_name(ptr: *mut Person) -> () {
|
||||||
let o = unsafe { &mut *ptr };
|
let o = unsafe { &mut *ptr };
|
||||||
let r = o.double_name();
|
let r = o.double_name();
|
||||||
|
r
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn person_greet(ptr: *const Person, Name_str: *const c_ushort, Name_len: c_int, d: *mut QString, set: fn(*mut QString, str: *const c_char, len: c_int)) {
|
pub extern "C" fn person_greet(ptr: *const Person, name_str: *const c_ushort, name_len: c_int, d: *mut QString, set: fn(*mut QString, str: *const c_char, len: c_int)) {
|
||||||
let mut Name = String::new();
|
let mut name = String::new();
|
||||||
set_string_from_utf16(&mut Name, Name_str, Name_len);
|
set_string_from_utf16(&mut name, name_str, name_len);
|
||||||
let o = unsafe { &*ptr };
|
let o = unsafe { &*ptr };
|
||||||
let r = o.greet(Name);
|
let r = o.greet(name);
|
||||||
|
let s: *const c_char = r.as_ptr() as (*const c_char);
|
||||||
|
set(d, s, r.len() as i32);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn person_quote(ptr: *const Person, prefix_str: *const c_ushort, prefix_len: c_int, suffix_str: *const c_ushort, suffix_len: c_int, d: *mut QString, set: fn(*mut QString, str: *const c_char, len: c_int)) {
|
||||||
|
let mut prefix = String::new();
|
||||||
|
set_string_from_utf16(&mut prefix, prefix_str, prefix_len);
|
||||||
|
let mut suffix = String::new();
|
||||||
|
set_string_from_utf16(&mut suffix, suffix_str, suffix_len);
|
||||||
|
let o = unsafe { &*ptr };
|
||||||
|
let r = o.quote(prefix, suffix);
|
||||||
|
let s: *const c_char = r.as_ptr() as (*const c_char);
|
||||||
|
set(d, s, r.len() as i32);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn person_quote_bytes(ptr: *const Person, prefix_str: *const c_char, prefix_len: c_int, suffix_str: *const c_char, suffix_len: c_int, d: *mut QString, set: fn(*mut QString, str: *const c_char, len: c_int)) {
|
||||||
|
let prefix = unsafe { slice::from_raw_parts(prefix_str as *const u8, prefix_len as usize) };
|
||||||
|
let suffix = unsafe { slice::from_raw_parts(suffix_str as *const u8, suffix_len as usize) };
|
||||||
|
let o = unsafe { &*ptr };
|
||||||
|
let r = o.quote_bytes(prefix, suffix);
|
||||||
let s: *const c_char = r.as_ptr() as (*const c_char);
|
let s: *const c_char = r.as_ptr() as (*const c_char);
|
||||||
set(d, s, r.len() as i32);
|
set(d, s, r.len() as i32);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,8 @@ private slots:
|
||||||
void testStringFunction();
|
void testStringFunction();
|
||||||
void testSimpleFunction();
|
void testSimpleFunction();
|
||||||
void testVoidFunction();
|
void testVoidFunction();
|
||||||
|
void testQuoteFunction();
|
||||||
|
void testQuoteBytesFunction();
|
||||||
};
|
};
|
||||||
|
|
||||||
void TestRustObject::testConstructor()
|
void TestRustObject::testConstructor()
|
||||||
|
@ -59,6 +61,28 @@ void TestRustObject::testVoidFunction()
|
||||||
QCOMPARE(person.userName(), QString("KonqiKonqi"));
|
QCOMPARE(person.userName(), QString("KonqiKonqi"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestRustObject::testQuoteFunction()
|
||||||
|
{
|
||||||
|
// GIVEN
|
||||||
|
Person person;
|
||||||
|
person.setUserName("Konqi");
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
auto r = person.quote("<<", ">>");
|
||||||
|
QCOMPARE(r, QString("<<Konqi>>"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void TestRustObject::testQuoteBytesFunction()
|
||||||
|
{
|
||||||
|
// GIVEN
|
||||||
|
Person person;
|
||||||
|
person.setUserName("Konqi");
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
auto r = person.quoteBytes("<<", ">>");
|
||||||
|
QCOMPARE(r, QString("<<Konqi>>"));
|
||||||
|
}
|
||||||
|
|
||||||
void TestRustObject::testStringFunction()
|
void TestRustObject::testStringFunction()
|
||||||
{
|
{
|
||||||
// GIVEN
|
// GIVEN
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
"mut": false,
|
"mut": false,
|
||||||
"arguments": [
|
"arguments": [
|
||||||
{
|
{
|
||||||
"name": "Name",
|
"name": "name",
|
||||||
"type": "QString"
|
"type": "QString"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -33,6 +33,30 @@
|
||||||
"vowelsInName": {
|
"vowelsInName": {
|
||||||
"return": "quint8",
|
"return": "quint8",
|
||||||
"arguments": []
|
"arguments": []
|
||||||
|
},
|
||||||
|
"quote": {
|
||||||
|
"return": "QString",
|
||||||
|
"arguments": [
|
||||||
|
{
|
||||||
|
"name": "prefix",
|
||||||
|
"type": "QString"
|
||||||
|
}, {
|
||||||
|
"name": "suffix",
|
||||||
|
"type": "QString"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"quoteBytes": {
|
||||||
|
"return": "QString",
|
||||||
|
"arguments": [
|
||||||
|
{
|
||||||
|
"name": "prefix",
|
||||||
|
"type": "QByteArray"
|
||||||
|
}, {
|
||||||
|
"name": "suffix",
|
||||||
|
"type": "QByteArray"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,8 @@ extern "C" {
|
||||||
void person_user_name_set(Person::Private*, const ushort *str, int len);
|
void person_user_name_set(Person::Private*, const ushort *str, int len);
|
||||||
void person_double_name(Person::Private*);
|
void person_double_name(Person::Private*);
|
||||||
void person_greet(const Person::Private*, const ushort*, int, QString*, qstring_set);
|
void person_greet(const Person::Private*, const ushort*, int, QString*, qstring_set);
|
||||||
|
void person_quote(const Person::Private*, const ushort*, int, const ushort*, int, QString*, qstring_set);
|
||||||
|
void person_quote_bytes(const Person::Private*, const char*, int, const char*, int, QString*, qstring_set);
|
||||||
quint8 person_vowels_in_name(const Person::Private*);
|
quint8 person_vowels_in_name(const Person::Private*);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,10 +57,22 @@ void Person::doubleName()
|
||||||
{
|
{
|
||||||
return person_double_name(m_d);
|
return person_double_name(m_d);
|
||||||
}
|
}
|
||||||
QString Person::greet(const QString& Name) const
|
QString Person::greet(const QString& name) const
|
||||||
{
|
{
|
||||||
QString s;
|
QString s;
|
||||||
person_greet(m_d, Name.utf16(), Name.size(), &s, set_qstring);
|
person_greet(m_d, name.utf16(), name.size(), &s, set_qstring);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
QString Person::quote(const QString& prefix, const QString& suffix) const
|
||||||
|
{
|
||||||
|
QString s;
|
||||||
|
person_quote(m_d, prefix.utf16(), prefix.size(), suffix.utf16(), suffix.size(), &s, set_qstring);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
QString Person::quoteBytes(const QByteArray& prefix, const QByteArray& suffix) const
|
||||||
|
{
|
||||||
|
QString s;
|
||||||
|
person_quote_bytes(m_d, prefix.data(), prefix.size(), suffix.data(), suffix.size(), &s, set_qstring);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
quint8 Person::vowelsInName() const
|
quint8 Person::vowelsInName() const
|
||||||
|
|
|
@ -23,7 +23,9 @@ public:
|
||||||
QString userName() const;
|
QString userName() const;
|
||||||
void setUserName(const QString& v);
|
void setUserName(const QString& v);
|
||||||
Q_INVOKABLE void doubleName();
|
Q_INVOKABLE void doubleName();
|
||||||
Q_INVOKABLE QString greet(const QString& Name) const;
|
Q_INVOKABLE QString greet(const QString& name) const;
|
||||||
|
Q_INVOKABLE QString quote(const QString& prefix, const QString& suffix) const;
|
||||||
|
Q_INVOKABLE QString quoteBytes(const QByteArray& prefix, const QByteArray& suffix) const;
|
||||||
Q_INVOKABLE quint8 vowelsInName() const;
|
Q_INVOKABLE quint8 vowelsInName() const;
|
||||||
signals:
|
signals:
|
||||||
void userNameChanged();
|
void userNameChanged();
|
||||||
|
|
|
@ -55,12 +55,12 @@ int Persons::rowCount(const QModelIndex &parent) const
|
||||||
return (parent.isValid()) ? 0 : persons_row_count(m_d);
|
return (parent.isValid()) ? 0 : persons_row_count(m_d);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Persons::insertRows(int row, int count, const QModelIndex &parent)
|
bool Persons::insertRows(int row, int count, const QModelIndex &)
|
||||||
{
|
{
|
||||||
return persons_insert_rows(m_d, row, count);
|
return persons_insert_rows(m_d, row, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Persons::removeRows(int row, int count, const QModelIndex &parent)
|
bool Persons::removeRows(int row, int count, const QModelIndex &)
|
||||||
{
|
{
|
||||||
return persons_remove_rows(m_d, row, count);
|
return persons_remove_rows(m_d, row, count);
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,12 +111,12 @@ int List::rowCount(const QModelIndex &parent) const
|
||||||
return (parent.isValid()) ? 0 : list_row_count(m_d);
|
return (parent.isValid()) ? 0 : list_row_count(m_d);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool List::insertRows(int row, int count, const QModelIndex &parent)
|
bool List::insertRows(int row, int count, const QModelIndex &)
|
||||||
{
|
{
|
||||||
return list_insert_rows(m_d, row, count);
|
return list_insert_rows(m_d, row, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool List::removeRows(int row, int count, const QModelIndex &parent)
|
bool List::removeRows(int row, int count, const QModelIndex &)
|
||||||
{
|
{
|
||||||
return list_remove_rows(m_d, row, count);
|
return list_remove_rows(m_d, row, count);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue