Use functor based QMetaObject::invokeMethod

This commit is contained in:
Chocobo1 2019-06-19 15:35:29 +08:00
parent 183db3475a
commit e31c1ca780
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
3 changed files with 35 additions and 0 deletions

View file

@ -535,8 +535,13 @@ Parser::Parser(const QString lastBuildDate)
void Parser::parse(const QByteArray &feedData)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
QMetaObject::invokeMethod(this, [this, feedData]() { parse_impl(feedData); }
, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(this, "parse_impl", Qt::QueuedConnection
, Q_ARG(QByteArray, feedData));
#endif
}
// read and create items from a rss document