diff --git a/demo/src/Bindings.h b/demo/src/Bindings.h --- a/demo/src/Bindings.h +++ b/demo/src/Bindings.h @@ -44,7 +44,7 @@ Processes* processes(); const TimeSeries* timeSeries() const; TimeSeries* timeSeries(); -signals: +Q_SIGNALS: void fibonacciChanged(); void fibonacciListChanged(); void fileSystemTreeChanged(); @@ -70,7 +70,7 @@ quint32 input() const; void setInput(quint32 v); quint64 result() const; -signals: +Q_SIGNALS: void inputChanged(); void resultChanged(); }; @@ -108,14 +108,14 @@ Q_INVOKABLE quint64 fibonacciNumber(int row) const; Q_INVOKABLE quint64 row(int row) const; -signals: +Q_SIGNALS: // new data is ready to be made available to the model with fetchMore() void newDataReady(const QModelIndex &parent) const; private: QHash, QVariant> m_headerData; void initHeaderData(); void updatePersistentIndexes(); -signals: +Q_SIGNALS: }; class FileSystemTree : public QAbstractItemModel @@ -158,14 +158,14 @@ Q_INVOKABLE QVariant fileSize(const QModelIndex& index) const; Q_INVOKABLE qint32 fileType(const QModelIndex& index) const; -signals: +Q_SIGNALS: // new data is ready to be made available to the model with fetchMore() void newDataReady(const QModelIndex &parent) const; private: QHash, QVariant> m_headerData; void initHeaderData(); void updatePersistentIndexes(); -signals: +Q_SIGNALS: void pathChanged(); }; @@ -210,14 +210,14 @@ Q_INVOKABLE quint32 pid(const QModelIndex& index) const; Q_INVOKABLE quint32 uid(const QModelIndex& index) const; -signals: +Q_SIGNALS: // new data is ready to be made available to the model with fetchMore() void newDataReady(const QModelIndex &parent) const; private: QHash, QVariant> m_headerData; void initHeaderData(); void updatePersistentIndexes(); -signals: +Q_SIGNALS: void activeChanged(); }; @@ -259,13 +259,13 @@ Q_INVOKABLE float time(int row) const; Q_INVOKABLE bool setTime(int row, float value); -signals: +Q_SIGNALS: // new data is ready to be made available to the model with fetchMore() void newDataReady(const QModelIndex &parent) const; private: QHash, QVariant> m_headerData; void initHeaderData(); void updatePersistentIndexes(); -signals: +Q_SIGNALS: }; #endif // BINDINGS_H diff --git a/demo/src/Bindings.cpp b/demo/src/Bindings.cpp --- a/demo/src/Bindings.cpp +++ b/demo/src/Bindings.cpp @@ -53,19 +53,19 @@ } inline void fibonacciInputChanged(Fibonacci* o) { - emit o->inputChanged(); + Q_EMIT o->inputChanged(); } inline void fibonacciResultChanged(Fibonacci* o) { - emit o->resultChanged(); + Q_EMIT o->resultChanged(); } inline void fileSystemTreePathChanged(FileSystemTree* o) { - emit o->pathChanged(); + Q_EMIT o->pathChanged(); } inline void processesActiveChanged(Processes* o) { - emit o->activeChanged(); + Q_EMIT o->activeChanged(); } } extern "C" { @@ -923,7 +923,7 @@ set = time_series_set_data_cos(m_d, row, value); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -939,7 +939,7 @@ set = time_series_set_data_sin(m_d, row, value); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -955,7 +955,7 @@ set = time_series_set_data_time(m_d, row, value); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -1107,14 +1107,14 @@ fibonacciInputChanged, fibonacciResultChanged, m_fibonacciList, [](const FibonacciList* o) { - emit o->newDataReady(QModelIndex()); + Q_EMIT o->newDataReady(QModelIndex()); }, [](FibonacciList* o) { - emit o->layoutAboutToBeChanged(); + Q_EMIT o->layoutAboutToBeChanged(); }, [](FibonacciList* o) { o->updatePersistentIndexes(); - emit o->layoutChanged(); + Q_EMIT o->layoutChanged(); }, [](FibonacciList* o, quintptr first, quintptr last) { o->dataChanged(o->createIndex(first, 0, first), @@ -1149,17 +1149,17 @@ [](const FileSystemTree* o, option_quintptr id) { if (id.some) { int row = file_system_tree_row(o->m_d, id.value); - emit o->newDataReady(o->createIndex(row, 0, id.value)); + Q_EMIT o->newDataReady(o->createIndex(row, 0, id.value)); } else { - emit o->newDataReady(QModelIndex()); + Q_EMIT o->newDataReady(QModelIndex()); } }, [](FileSystemTree* o) { - emit o->layoutAboutToBeChanged(); + Q_EMIT o->layoutAboutToBeChanged(); }, [](FileSystemTree* o) { o->updatePersistentIndexes(); - emit o->layoutChanged(); + Q_EMIT o->layoutChanged(); }, [](FileSystemTree* o, quintptr first, quintptr last) { quintptr frow = file_system_tree_row(o->m_d, first); @@ -1216,17 +1216,17 @@ [](const Processes* o, option_quintptr id) { if (id.some) { int row = processes_row(o->m_d, id.value); - emit o->newDataReady(o->createIndex(row, 0, id.value)); + Q_EMIT o->newDataReady(o->createIndex(row, 0, id.value)); } else { - emit o->newDataReady(QModelIndex()); + Q_EMIT o->newDataReady(QModelIndex()); } }, [](Processes* o) { - emit o->layoutAboutToBeChanged(); + Q_EMIT o->layoutAboutToBeChanged(); }, [](Processes* o) { o->updatePersistentIndexes(); - emit o->layoutChanged(); + Q_EMIT o->layoutChanged(); }, [](Processes* o, quintptr first, quintptr last) { quintptr frow = processes_row(o->m_d, first); @@ -1280,14 +1280,14 @@ } , m_timeSeries, [](const TimeSeries* o) { - emit o->newDataReady(QModelIndex()); + Q_EMIT o->newDataReady(QModelIndex()); }, [](TimeSeries* o) { - emit o->layoutAboutToBeChanged(); + Q_EMIT o->layoutAboutToBeChanged(); }, [](TimeSeries* o) { o->updatePersistentIndexes(); - emit o->layoutChanged(); + Q_EMIT o->layoutChanged(); }, [](TimeSeries* o, quintptr first, quintptr last) { o->dataChanged(o->createIndex(first, 0, first), @@ -1428,14 +1428,14 @@ QAbstractItemModel(parent), m_d(fibonacci_list_new(this, [](const FibonacciList* o) { - emit o->newDataReady(QModelIndex()); + Q_EMIT o->newDataReady(QModelIndex()); }, [](FibonacciList* o) { - emit o->layoutAboutToBeChanged(); + Q_EMIT o->layoutAboutToBeChanged(); }, [](FibonacciList* o) { o->updatePersistentIndexes(); - emit o->layoutChanged(); + Q_EMIT o->layoutChanged(); }, [](FibonacciList* o, quintptr first, quintptr last) { o->dataChanged(o->createIndex(first, 0, first), @@ -1498,17 +1498,17 @@ [](const FileSystemTree* o, option_quintptr id) { if (id.some) { int row = file_system_tree_row(o->m_d, id.value); - emit o->newDataReady(o->createIndex(row, 0, id.value)); + Q_EMIT o->newDataReady(o->createIndex(row, 0, id.value)); } else { - emit o->newDataReady(QModelIndex()); + Q_EMIT o->newDataReady(QModelIndex()); } }, [](FileSystemTree* o) { - emit o->layoutAboutToBeChanged(); + Q_EMIT o->layoutAboutToBeChanged(); }, [](FileSystemTree* o) { o->updatePersistentIndexes(); - emit o->layoutChanged(); + Q_EMIT o->layoutChanged(); }, [](FileSystemTree* o, quintptr first, quintptr last) { quintptr frow = file_system_tree_row(o->m_d, first); @@ -1609,17 +1609,17 @@ [](const Processes* o, option_quintptr id) { if (id.some) { int row = processes_row(o->m_d, id.value); - emit o->newDataReady(o->createIndex(row, 0, id.value)); + Q_EMIT o->newDataReady(o->createIndex(row, 0, id.value)); } else { - emit o->newDataReady(QModelIndex()); + Q_EMIT o->newDataReady(QModelIndex()); } }, [](Processes* o) { - emit o->layoutAboutToBeChanged(); + Q_EMIT o->layoutAboutToBeChanged(); }, [](Processes* o) { o->updatePersistentIndexes(); - emit o->layoutChanged(); + Q_EMIT o->layoutChanged(); }, [](Processes* o, quintptr first, quintptr last) { quintptr frow = processes_row(o->m_d, first); @@ -1709,14 +1709,14 @@ QAbstractItemModel(parent), m_d(time_series_new(this, [](const TimeSeries* o) { - emit o->newDataReady(QModelIndex()); + Q_EMIT o->newDataReady(QModelIndex()); }, [](TimeSeries* o) { - emit o->layoutAboutToBeChanged(); + Q_EMIT o->layoutAboutToBeChanged(); }, [](TimeSeries* o) { o->updatePersistentIndexes(); - emit o->layoutChanged(); + Q_EMIT o->layoutChanged(); }, [](TimeSeries* o, quintptr first, quintptr last) { o->dataChanged(o->createIndex(first, 0, first), diff --git a/src/cpp.cpp b/src/cpp.cpp --- a/src/cpp.cpp +++ b/src/cpp.cpp @@ -111,7 +111,7 @@ } } h << R"( -signals: +Q_SIGNALS: // new data is ready to be made available to the model with fetchMore() void newDataReady(const QModelIndex &parent) const; private: @@ -215,15 +215,15 @@ if (o.type == ObjectType::List) { cpp << R"( if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } )"; } else { cpp << R"( if (set) { - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -636,7 +636,7 @@ if (baseType(o) == "QAbstractItemModel") { writeHeaderItemModel(h, o); } - h << "signals:" << endl; + h << "Q_SIGNALS:" << endl; for (auto p: o.properties) { h << " void " << p.name << "Changed();" << endl; } @@ -703,14 +703,14 @@ if (o.type == ObjectType::List) { cpp << QString(R"(, [](const %1* o) { - emit o->newDataReady(QModelIndex()); + Q_EMIT o->newDataReady(QModelIndex()); }, [](%1* o) { - emit o->layoutAboutToBeChanged(); + Q_EMIT o->layoutAboutToBeChanged(); }, [](%1* o) { o->updatePersistentIndexes(); - emit o->layoutChanged(); + Q_EMIT o->layoutChanged(); }, [](%1* o, quintptr first, quintptr last) { o->dataChanged(o->createIndex(first, 0, first), @@ -747,17 +747,17 @@ [](const %1* o, option_quintptr id) { if (id.some) { int row = %2_row(o->m_d, id.value); - emit o->newDataReady(o->createIndex(row, 0, id.value)); + Q_EMIT o->newDataReady(o->createIndex(row, 0, id.value)); } else { - emit o->newDataReady(QModelIndex()); + Q_EMIT o->newDataReady(QModelIndex()); } }, [](%1* o) { - emit o->layoutAboutToBeChanged(); + Q_EMIT o->layoutAboutToBeChanged(); }, [](%1* o) { o->updatePersistentIndexes(); - emit o->layoutChanged(); + Q_EMIT o->layoutChanged(); }, [](%1* o, quintptr first, quintptr last) { quintptr frow = %2_row(o->m_d, first); @@ -1173,7 +1173,7 @@ continue; } cpp << " inline void " << changedF(o, p) << "(" << o.name << "* o)\n"; - cpp << " {\n emit o->" << p.name << "Changed();\n }\n"; + cpp << " {\n Q_EMIT o->" << p.name << "Changed();\n }\n"; } } cpp << "}\n"; diff --git a/tests/test_functions_rust.h b/tests/test_functions_rust.h --- a/tests/test_functions_rust.h +++ b/tests/test_functions_rust.h @@ -28,7 +28,7 @@ Q_INVOKABLE QString quote(const QString& prefix, const QString& suffix) const; Q_INVOKABLE QByteArray quoteBytes(const QByteArray& prefix, const QByteArray& suffix) const; Q_INVOKABLE quint8 vowelsInName() const; -signals: +Q_SIGNALS: void userNameChanged(); }; #endif // TEST_FUNCTIONS_RUST_H diff --git a/tests/test_functions_rust.cpp b/tests/test_functions_rust.cpp --- a/tests/test_functions_rust.cpp +++ b/tests/test_functions_rust.cpp @@ -19,7 +19,7 @@ } inline void personUserNameChanged(Person* o) { - emit o->userNameChanged(); + Q_EMIT o->userNameChanged(); } } extern "C" { diff --git a/tests/test_list_rust.h b/tests/test_list_rust.h --- a/tests/test_list_rust.h +++ b/tests/test_list_rust.h @@ -43,14 +43,14 @@ Q_INVOKABLE QString userName(int row) const; Q_INVOKABLE bool setUserName(int row, const QString& value); -signals: +Q_SIGNALS: // new data is ready to be made available to the model with fetchMore() void newDataReady(const QModelIndex &parent) const; private: QHash, QVariant> m_headerData; void initHeaderData(); void updatePersistentIndexes(); -signals: +Q_SIGNALS: }; class Persons : public QAbstractItemModel @@ -86,13 +86,13 @@ Q_INVOKABLE QString userName(int row) const; Q_INVOKABLE bool setUserName(int row, const QString& value); -signals: +Q_SIGNALS: // new data is ready to be made available to the model with fetchMore() void newDataReady(const QModelIndex &parent) const; private: QHash, QVariant> m_headerData; void initHeaderData(); void updatePersistentIndexes(); -signals: +Q_SIGNALS: }; #endif // TEST_LIST_RUST_H diff --git a/tests/test_list_rust.cpp b/tests/test_list_rust.cpp --- a/tests/test_list_rust.cpp +++ b/tests/test_list_rust.cpp @@ -117,7 +117,7 @@ set = no_role_set_data_user_age(m_d, row, value); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -135,7 +135,7 @@ set = no_role_set_data_user_name(m_d, row, value.utf16(), value.length()); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -312,7 +312,7 @@ set = persons_set_data_user_name(m_d, row, value.utf16(), value.length()); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -407,14 +407,14 @@ QAbstractItemModel(parent), m_d(no_role_new(this, [](const NoRole* o) { - emit o->newDataReady(QModelIndex()); + Q_EMIT o->newDataReady(QModelIndex()); }, [](NoRole* o) { - emit o->layoutAboutToBeChanged(); + Q_EMIT o->layoutAboutToBeChanged(); }, [](NoRole* o) { o->updatePersistentIndexes(); - emit o->layoutChanged(); + Q_EMIT o->layoutChanged(); }, [](NoRole* o, quintptr first, quintptr last) { o->dataChanged(o->createIndex(first, 0, first), @@ -472,14 +472,14 @@ QAbstractItemModel(parent), m_d(persons_new(this, [](const Persons* o) { - emit o->newDataReady(QModelIndex()); + Q_EMIT o->newDataReady(QModelIndex()); }, [](Persons* o) { - emit o->layoutAboutToBeChanged(); + Q_EMIT o->layoutAboutToBeChanged(); }, [](Persons* o) { o->updatePersistentIndexes(); - emit o->layoutChanged(); + Q_EMIT o->layoutChanged(); }, [](Persons* o, quintptr first, quintptr last) { o->dataChanged(o->createIndex(first, 0, first), diff --git a/tests/test_list_types_rust.h b/tests/test_list_types_rust.h --- a/tests/test_list_types_rust.h +++ b/tests/test_list_types_rust.h @@ -70,13 +70,13 @@ Q_INVOKABLE quint8 u8(int row) const; Q_INVOKABLE bool setU8(int row, quint8 value); -signals: +Q_SIGNALS: // new data is ready to be made available to the model with fetchMore() void newDataReady(const QModelIndex &parent) const; private: QHash, QVariant> m_headerData; void initHeaderData(); void updatePersistentIndexes(); -signals: +Q_SIGNALS: }; #endif // TEST_LIST_TYPES_RUST_H diff --git a/tests/test_list_types_rust.cpp b/tests/test_list_types_rust.cpp --- a/tests/test_list_types_rust.cpp +++ b/tests/test_list_types_rust.cpp @@ -171,7 +171,7 @@ set = list_set_data_boolean(m_d, row, value); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -189,7 +189,7 @@ set = list_set_data_bytearray(m_d, row, value.data(), value.length()); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -205,7 +205,7 @@ set = list_set_data_f32(m_d, row, value); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -221,7 +221,7 @@ set = list_set_data_f64(m_d, row, value); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -237,7 +237,7 @@ set = list_set_data_i16(m_d, row, value); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -253,7 +253,7 @@ set = list_set_data_i32(m_d, row, value); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -269,7 +269,7 @@ set = list_set_data_i64(m_d, row, value); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -285,7 +285,7 @@ set = list_set_data_i8(m_d, row, value); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -310,7 +310,7 @@ } if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -332,7 +332,7 @@ } if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -354,7 +354,7 @@ } if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -372,7 +372,7 @@ set = list_set_data_string(m_d, row, value.utf16(), value.length()); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -388,7 +388,7 @@ set = list_set_data_u16(m_d, row, value); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -404,7 +404,7 @@ set = list_set_data_u32(m_d, row, value); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -420,7 +420,7 @@ set = list_set_data_u64(m_d, row, value); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -436,7 +436,7 @@ set = list_set_data_u8(m_d, row, value); if (set) { QModelIndex index = createIndex(row, 0, row); - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -649,14 +649,14 @@ QAbstractItemModel(parent), m_d(list_new(this, [](const List* o) { - emit o->newDataReady(QModelIndex()); + Q_EMIT o->newDataReady(QModelIndex()); }, [](List* o) { - emit o->layoutAboutToBeChanged(); + Q_EMIT o->layoutAboutToBeChanged(); }, [](List* o) { o->updatePersistentIndexes(); - emit o->layoutChanged(); + Q_EMIT o->layoutChanged(); }, [](List* o, quintptr first, quintptr last) { o->dataChanged(o->createIndex(first, 0, first), diff --git a/tests/test_object_rust.h b/tests/test_object_rust.h --- a/tests/test_object_rust.h +++ b/tests/test_object_rust.h @@ -22,7 +22,7 @@ ~Person(); QString userName() const; void setUserName(const QString& v); -signals: +Q_SIGNALS: void userNameChanged(); }; #endif // TEST_OBJECT_RUST_H diff --git a/tests/test_object_rust.cpp b/tests/test_object_rust.cpp --- a/tests/test_object_rust.cpp +++ b/tests/test_object_rust.cpp @@ -9,7 +9,7 @@ } inline void personUserNameChanged(Person* o) { - emit o->userNameChanged(); + Q_EMIT o->userNameChanged(); } } extern "C" { diff --git a/tests/test_object_types_rust.h b/tests/test_object_types_rust.h --- a/tests/test_object_types_rust.h +++ b/tests/test_object_types_rust.h @@ -73,7 +73,7 @@ void setU64(quint64 v); quint8 u8() const; void setU8(quint8 v); -signals: +Q_SIGNALS: void booleanChanged(); void bytearrayChanged(); void f32Changed(); diff --git a/tests/test_object_types_rust.cpp b/tests/test_object_types_rust.cpp --- a/tests/test_object_types_rust.cpp +++ b/tests/test_object_types_rust.cpp @@ -45,75 +45,75 @@ } inline void objectBooleanChanged(Object* o) { - emit o->booleanChanged(); + Q_EMIT o->booleanChanged(); } inline void objectBytearrayChanged(Object* o) { - emit o->bytearrayChanged(); + Q_EMIT o->bytearrayChanged(); } inline void objectF32Changed(Object* o) { - emit o->f32Changed(); + Q_EMIT o->f32Changed(); } inline void objectF64Changed(Object* o) { - emit o->f64Changed(); + Q_EMIT o->f64Changed(); } inline void objectI16Changed(Object* o) { - emit o->i16Changed(); + Q_EMIT o->i16Changed(); } inline void objectI32Changed(Object* o) { - emit o->i32Changed(); + Q_EMIT o->i32Changed(); } inline void objectI64Changed(Object* o) { - emit o->i64Changed(); + Q_EMIT o->i64Changed(); } inline void objectI8Changed(Object* o) { - emit o->i8Changed(); + Q_EMIT o->i8Changed(); } inline void objectOptionalBooleanChanged(Object* o) { - emit o->optionalBooleanChanged(); + Q_EMIT o->optionalBooleanChanged(); } inline void objectOptionalBytearrayChanged(Object* o) { - emit o->optionalBytearrayChanged(); + Q_EMIT o->optionalBytearrayChanged(); } inline void objectOptionalStringChanged(Object* o) { - emit o->optionalStringChanged(); + Q_EMIT o->optionalStringChanged(); } inline void objectOptionalU64Changed(Object* o) { - emit o->optionalU64Changed(); + Q_EMIT o->optionalU64Changed(); } inline void objectStringChanged(Object* o) { - emit o->stringChanged(); + Q_EMIT o->stringChanged(); } inline void objectStringByFunctionChanged(Object* o) { - emit o->stringByFunctionChanged(); + Q_EMIT o->stringByFunctionChanged(); } inline void objectU16Changed(Object* o) { - emit o->u16Changed(); + Q_EMIT o->u16Changed(); } inline void objectU32Changed(Object* o) { - emit o->u32Changed(); + Q_EMIT o->u32Changed(); } inline void objectU64Changed(Object* o) { - emit o->u64Changed(); + Q_EMIT o->u64Changed(); } inline void objectU8Changed(Object* o) { - emit o->u8Changed(); + Q_EMIT o->u8Changed(); } } extern "C" { diff --git a/tests/test_objects_rust.h b/tests/test_objects_rust.h --- a/tests/test_objects_rust.h +++ b/tests/test_objects_rust.h @@ -26,7 +26,7 @@ ~Group(); const Person* person() const; Person* person(); -signals: +Q_SIGNALS: void personChanged(); }; @@ -47,7 +47,7 @@ ~InnerObject(); QString description() const; void setDescription(const QString& v); -signals: +Q_SIGNALS: void descriptionChanged(); }; @@ -68,7 +68,7 @@ ~Person(); const InnerObject* object() const; InnerObject* object(); -signals: +Q_SIGNALS: void objectChanged(); }; #endif // TEST_OBJECTS_RUST_H diff --git a/tests/test_objects_rust.cpp b/tests/test_objects_rust.cpp --- a/tests/test_objects_rust.cpp +++ b/tests/test_objects_rust.cpp @@ -9,7 +9,7 @@ } inline void innerObjectDescriptionChanged(InnerObject* o) { - emit o->descriptionChanged(); + Q_EMIT o->descriptionChanged(); } } extern "C" { diff --git a/tests/test_tree_rust.h b/tests/test_tree_rust.h --- a/tests/test_tree_rust.h +++ b/tests/test_tree_rust.h @@ -40,13 +40,13 @@ Q_INVOKABLE QString userName(const QModelIndex& index) const; Q_INVOKABLE bool setUserName(const QModelIndex& index, const QString& value); -signals: +Q_SIGNALS: // new data is ready to be made available to the model with fetchMore() void newDataReady(const QModelIndex &parent) const; private: QHash, QVariant> m_headerData; void initHeaderData(); void updatePersistentIndexes(); -signals: +Q_SIGNALS: }; #endif // TEST_TREE_RUST_H diff --git a/tests/test_tree_rust.cpp b/tests/test_tree_rust.cpp --- a/tests/test_tree_rust.cpp +++ b/tests/test_tree_rust.cpp @@ -163,7 +163,7 @@ bool set = false; set = persons_set_data_user_name(m_d, index.internalId(), value.utf16(), value.length()); if (set) { - emit dataChanged(index, index); + Q_EMIT dataChanged(index, index); } return set; } @@ -260,17 +260,17 @@ [](const Persons* o, option_quintptr id) { if (id.some) { int row = persons_row(o->m_d, id.value); - emit o->newDataReady(o->createIndex(row, 0, id.value)); + Q_EMIT o->newDataReady(o->createIndex(row, 0, id.value)); } else { - emit o->newDataReady(QModelIndex()); + Q_EMIT o->newDataReady(QModelIndex()); } }, [](Persons* o) { - emit o->layoutAboutToBeChanged(); + Q_EMIT o->layoutAboutToBeChanged(); }, [](Persons* o) { o->updatePersistentIndexes(); - emit o->layoutChanged(); + Q_EMIT o->layoutChanged(); }, [](Persons* o, quintptr first, quintptr last) { quintptr frow = persons_row(o->m_d, first);