Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 5611728e authored by Laurent Montel's avatar Laurent Montel 😁

We can use QMetaObject::invokeMethod + lambda in qt5.10

parent 2d87527c
......@@ -166,7 +166,11 @@ void ContactGroupExpandJob::start()
d->searchResult(job);
});
} else {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, [this]() { d->resolveGroup(); }, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "resolveGroup", Qt::QueuedConnection);
#endif
}
}
......
......@@ -244,7 +244,12 @@ void DisplayNameEditWidget::updateView()
mView->setItemText(5, mContact.formattedName());
// delay the state change here, since we might have been called from mView via a signal
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod(this, [this]() { setComboBoxEditable(mDisplayType == CustomName); }, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "setComboBoxEditable", Qt::QueuedConnection, Q_ARG(bool, mDisplayType == CustomName));
#endif
mView->setCurrentIndex((int)mDisplayType);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment