diff options
author | Dominik Holland <dominik.holland@qt.io> | 2020-01-20 10:43:43 +0100 |
---|---|---|
committer | Dominik Holland <dominik.holland@qt.io> | 2020-01-20 17:46:20 +0100 |
commit | 9ca588c7711e43212e40931ff4a0072bbd1deb28 (patch) | |
tree | 4d1af06aeeb494f31be01d4445978fcf616e80b6 /src/ivicore | |
parent | 9fd63dd467506c35a541fa09dd63d16fb7ebf9bd (diff) | |
download | qtivi-9ca588c7711e43212e40931ff4a0072bbd1deb28.tar.gz |
Fix registering the QIviPendingReplies at startup
Using a singleShot timer is not the right way as it doesn't make
sure the call is really executed in the next event loop run.
Instead use QMetaObject::invokeMethod().
Also reorder the qivipendingreply autotest to make sure the QML
test is done first, which needs the types to be registered...
Change-Id: Id4f8dd1577e653c99fd82e8ab8f93a848f9b1b79
Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Diffstat (limited to 'src/ivicore')
-rw-r--r-- | src/ivicore/qivipendingreply.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ivicore/qivipendingreply.cpp b/src/ivicore/qivipendingreply.cpp index 0229d39..b0c6edd 100644 --- a/src/ivicore/qivipendingreply.cpp +++ b/src/ivicore/qivipendingreply.cpp @@ -81,7 +81,7 @@ void qiviRegisterPendingReplyBasicTypes() { // rest of the library is initialized (e.g. the QMetaObject of QIviPendingReplyBase). // The singleshot timer makes sure the registration is done in the next event // loop run, when everything is ready. - QTimer::singleShot(0, []() { + QMetaObject::invokeMethod(qApp, []() { qRegisterMetaType<QIviPendingReplyBase>("QIviPendingReplyBase"); QT_FOR_EACH_STATIC_PRIMITIVE_TYPE(QTIVI_ADD_STATIC_METATYPE) QT_FOR_EACH_STATIC_PRIMITIVE_POINTER(QTIVI_ADD_STATIC_METATYPE) |