QTextDocument::loadResource(): invoke parent via direct connection
If QTextDocument::loadResource() gets called from a different thread
than the thread that the QTD object (and *necessarily* its parent, if it
has one) live in, we would get the warning "Unable to invoke methods
with return values in queued connections". Rather, ensure that it's
invoked only via a direct connection.
Amends ac300a166f
Pick-to: 6.4
Task-number: QTBUG-35688
Change-Id: I35644f7cd54b1f40362d3d45c2a120883f7a2e61
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
bb10
parent
cb9d76169a
commit
963f3c678c
|
|
@ -2235,7 +2235,8 @@ QVariant QTextDocument::loadResource(int type, const QUrl &name)
|
|||
int index = me->indexOfMethod("loadResource(int,QUrl)");
|
||||
if (index >= 0) {
|
||||
QMetaMethod loader = me->method(index);
|
||||
loader.invoke(p, Q_RETURN_ARG(QVariant, r), Q_ARG(int, type), Q_ARG(QUrl, name));
|
||||
// don't invoke() via a queued connection: this function needs to return a value
|
||||
loader.invoke(p, Qt::DirectConnection, Q_RETURN_ARG(QVariant, r), Q_ARG(int, type), Q_ARG(QUrl, name));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue