fix 4x 'fromQml' slots execution

note: per discussion with Austion & Seth, TabletRoot should be the only entity sending 'sendToScript' signals to C++
This commit is contained in:
Alexander Ivash 2018-02-15 21:45:35 +03:00
parent 040710807d
commit beb595266d
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() {