Merge pull request #12396 from ElderOrb/double-connection-fix

fix 4x 'fromQml' slots execution
This commit is contained in:
John Conklin II 2018-02-21 09:01:47 -08:00 committed by GitHub
commit 92249a2bee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View file

@ -331,9 +331,9 @@ void OffscreenSurface::finishQmlLoad(QQmlComponent* qmlComponent,
qmlComponent->deleteLater();
onItemCreated(qmlContext, newItem);
connect(newItem, SIGNAL(sendToScript(QVariant)), this, SIGNAL(fromQml(QVariant)));
if (!rootCreated) {
connect(newItem, SIGNAL(sendToScript(QVariant)), this, SIGNAL(fromQml(QVariant)));
onRootCreated();
emit rootItemCreated(newItem);
// Call this callback after rootitem is set, otherwise VrMenu wont work

View file

@ -305,7 +305,6 @@ void OffscreenQmlSurface::onItemCreated(QQmlContext* qmlContext, QQuickItem* new
qmlContext->setContextProperty("eventBridgeWrapper", new EventBridgeWrapper(eventBridge, qmlContext));
}
connect(newItem, SIGNAL(sendToScript(QVariant)), this, SIGNAL(fromQml(QVariant)));
}
void OffscreenQmlSurface::onRootCreated() {