From 849d65f95f2e1fbd4bde1e3fdfda29988ae5f35e Mon Sep 17 00:00:00 2001 From: Vladyslav Stelmakhovskyi Date: Fri, 31 Mar 2017 15:01:19 +0200 Subject: [PATCH 01/10] Fixed warning: Tablet.qml:205: TypeError: Cannot read property of null (cherry picked from commit b1dc14b355bc6053a0e264a057a799a4d446e347) --- interface/resources/qml/hifi/tablet/Tablet.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/tablet/Tablet.qml b/interface/resources/qml/hifi/tablet/Tablet.qml index 3fb70f9cca..8ad6339d88 100644 --- a/interface/resources/qml/hifi/tablet/Tablet.qml +++ b/interface/resources/qml/hifi/tablet/Tablet.qml @@ -202,7 +202,7 @@ Item { RalewaySemiBold { id: usernameText - text: tablet.parent.parent.username + text: tabletRoot.username anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right anchors.rightMargin: 20 From 6b7f3f7125994ed6a8f2c77a5ca6e4ce3f793c71 Mon Sep 17 00:00:00 2001 From: Vladyslav Stelmakhovskyi Date: Fri, 31 Mar 2017 15:09:39 +0200 Subject: [PATCH 02/10] Fixed warning: TabletAddressDialog.qml:282:13: QML ListView: Cannot specify top, bottom, and verticalCenter anchors at the same time. (cherry picked from commit b11e245cb1b19149ff00f16b718ff4088b856f3e) --- interface/resources/qml/hifi/tablet/TabletAddressDialog.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml index a58177640d..e99332368e 100644 --- a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml +++ b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml @@ -291,8 +291,6 @@ StackView { left: parent.left right: parent.right leftMargin: 10 - verticalCenter: parent.verticalCenter; - horizontalCenter: parent.horizontalCenter; } model: suggestions orientation: ListView.Vertical From 9e96888534b703a67026bf16ed95b71c9bf0c600 Mon Sep 17 00:00:00 2001 From: Vladyslav Stelmakhovskyi Date: Fri, 31 Mar 2017 15:18:02 +0200 Subject: [PATCH 03/10] Fixed warning: TabletAddressDialog.qml:546: Error: Cannot assign to non-existent property 'shown' (cherry picked from commit e70c2cdcc74f9fd43273dca268433cdefd9ecf40) --- interface/resources/qml/hifi/tablet/TabletAddressDialog.qml | 6 +++--- interface/resources/qml/hifi/tablet/TabletRoot.qml | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml index e99332368e..b3d56f02f2 100644 --- a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml +++ b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml @@ -107,7 +107,7 @@ StackView { imageURL: "../../../images/home.svg" onClicked: { addressBarDialog.loadHome(); - root.shown = false; + tabletRoot.shown = false; } anchors { left: parent.left @@ -541,14 +541,14 @@ StackView { if (addressLine.text !== "") { addressBarDialog.loadAddress(addressLine.text, fromSuggestions) } - root.shown = false; + tabletRoot.shown = false; } Keys.onPressed: { switch (event.key) { case Qt.Key_Escape: case Qt.Key_Back: - root.shown = false + tabletRoot.shown = false clearAddressLineTimer.start(); event.accepted = true break diff --git a/interface/resources/qml/hifi/tablet/TabletRoot.qml b/interface/resources/qml/hifi/tablet/TabletRoot.qml index 8037c1280e..f5144e698f 100644 --- a/interface/resources/qml/hifi/tablet/TabletRoot.qml +++ b/interface/resources/qml/hifi/tablet/TabletRoot.qml @@ -13,6 +13,7 @@ Item { property var openMessage: null; property string subMenu: "" signal showDesktop(); + property bool shown: true function setOption(value) { option = value; From 156166ce4a0b8dac8a40fb08b76835eca676eaa7 Mon Sep 17 00:00:00 2001 From: Vladyslav Stelmakhovskyi Date: Fri, 31 Mar 2017 15:25:53 +0200 Subject: [PATCH 04/10] Fixed another warning in TabletAddressDialog.qml (cherry picked from commit 73c923bb522ad711380a2fcdaa9babe9f01a639a) --- interface/resources/qml/hifi/tablet/TabletAddressDialog.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml index b3d56f02f2..4699bfd66b 100644 --- a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml +++ b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml @@ -25,8 +25,8 @@ StackView { HifiConstants { id: hifi } HifiStyles.HifiConstants { id: hifiStyleConstants } initialItem: addressBarDialog - width: parent.width - height: parent.height + width: parent !== null ? parent.width : undefined + height: parent !== null ? parent.height : undefined property var eventBridge; property var allStories: []; property int cardWidth: 460; @@ -142,7 +142,9 @@ StackView { anchors { top: navBar.bottom right: parent.right + rightMargin: 16 left: parent.left + leftMargin: 16 } property int inputAreaHeight: 70 From 7318ec468b7d1e5880a3f24910ad5afea239d0c6 Mon Sep 17 00:00:00 2001 From: Vladyslav Stelmakhovskyi Date: Fri, 31 Mar 2017 16:01:43 +0200 Subject: [PATCH 05/10] Fixed warning QObject::connect: No such signal Desktop_QMLTYPE_217::sendToScript(QVariant) (cherry picked from commit ef4bea2cd4811364e65baec2c48ce2205a0e2cb3) --- libraries/gl/src/gl/OffscreenGLCanvas.cpp | 3 ++- libraries/gl/src/gl/OffscreenQmlSurface.cpp | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/gl/src/gl/OffscreenGLCanvas.cpp b/libraries/gl/src/gl/OffscreenGLCanvas.cpp index e54846196b..fcb3195741 100644 --- a/libraries/gl/src/gl/OffscreenGLCanvas.cpp +++ b/libraries/gl/src/gl/OffscreenGLCanvas.cpp @@ -59,7 +59,8 @@ bool OffscreenGLCanvas::create(QOpenGLContext* sharedContext) { bool OffscreenGLCanvas::makeCurrent() { bool result = _context->makeCurrent(_offscreenSurface); - Q_ASSERT(result); + //Q_ASSERT(result); + std::call_once(_reportOnce, [this]{ qCDebug(glLogging) << "GL Version: " << QString((const char*) glGetString(GL_VERSION)); qCDebug(glLogging) << "GL Shader Language Version: " << QString((const char*) glGetString(GL_SHADING_LANGUAGE_VERSION)); diff --git a/libraries/gl/src/gl/OffscreenQmlSurface.cpp b/libraries/gl/src/gl/OffscreenQmlSurface.cpp index de0caf56a9..4842faa3ef 100644 --- a/libraries/gl/src/gl/OffscreenQmlSurface.cpp +++ b/libraries/gl/src/gl/OffscreenQmlSurface.cpp @@ -607,7 +607,11 @@ QObject* OffscreenQmlSurface::finishQmlLoad(std::functionmetaObject()->indexOfSignal("sendToScript"); + if (sendToScriptIndex != -1) { + connect(newItem, SIGNAL(sendToScript(QVariant)), this, SIGNAL(fromQml(QVariant))); + } // The root item is ready. Associate it with the window. _rootItem = newItem; From 990e1379e3cc66e04e36c2f372b57713c65fb2a4 Mon Sep 17 00:00:00 2001 From: Vladyslav Stelmakhovskyi Date: Sat, 1 Apr 2017 20:33:46 +0200 Subject: [PATCH 06/10] Fix warning in Audio page. Revert commented out assert in OffscreenGLCanvas: move to separate task (cherry picked from commit d966979c2368b159cf5b96c5fd535411cda019b8) --- interface/resources/qml/hifi/Audio.qml | 4 ++-- libraries/gl/src/gl/OffscreenGLCanvas.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/resources/qml/hifi/Audio.qml b/interface/resources/qml/hifi/Audio.qml index deb44b9bd5..d0c3122100 100644 --- a/interface/resources/qml/hifi/Audio.qml +++ b/interface/resources/qml/hifi/Audio.qml @@ -127,7 +127,7 @@ Rectangle { text: hifi.glyphs.mic color: hifi.colors.primaryHighlight anchors.verticalCenter: parent.verticalCenter - font.pointSize: 27 + size: 32 } RalewayRegular { anchors.verticalCenter: parent.verticalCenter @@ -182,7 +182,7 @@ Rectangle { text: hifi.glyphs.unmuted color: hifi.colors.primaryHighlight anchors.verticalCenter: parent.verticalCenter - font.pointSize: 27 + size: 32 } RalewayRegular { anchors.verticalCenter: parent.verticalCenter diff --git a/libraries/gl/src/gl/OffscreenGLCanvas.cpp b/libraries/gl/src/gl/OffscreenGLCanvas.cpp index fcb3195741..e5c630d97e 100644 --- a/libraries/gl/src/gl/OffscreenGLCanvas.cpp +++ b/libraries/gl/src/gl/OffscreenGLCanvas.cpp @@ -59,7 +59,7 @@ bool OffscreenGLCanvas::create(QOpenGLContext* sharedContext) { bool OffscreenGLCanvas::makeCurrent() { bool result = _context->makeCurrent(_offscreenSurface); - //Q_ASSERT(result); + Q_ASSERT(result); std::call_once(_reportOnce, [this]{ qCDebug(glLogging) << "GL Version: " << QString((const char*) glGetString(GL_VERSION)); From 072e024d9ad29723f384dcb811b56bd59e9f55f1 Mon Sep 17 00:00:00 2001 From: Vladyslav Stelmakhovskyi Date: Tue, 4 Apr 2017 16:10:37 +0200 Subject: [PATCH 07/10] Fixed warning in JSConsole --- interface/src/ui/JSConsole.cpp | 14 ++++++++------ interface/src/ui/JSConsole.h | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/interface/src/ui/JSConsole.cpp b/interface/src/ui/JSConsole.cpp index 5d197f5ddc..7700874d9a 100644 --- a/interface/src/ui/JSConsole.cpp +++ b/interface/src/ui/JSConsole.cpp @@ -76,8 +76,8 @@ void JSConsole::setScriptEngine(ScriptEngine* scriptEngine) { return; } if (_scriptEngine != NULL) { - disconnect(_scriptEngine, SIGNAL(printedMessage(const QString&)), this, SLOT(handlePrint(const QString&))); - disconnect(_scriptEngine, SIGNAL(errorMessage(const QString&)), this, SLOT(handleError(const QString&))); + disconnect(_scriptEngine, &ScriptEngine::printedMessage, this, &JSConsole::handlePrint); + disconnect(_scriptEngine, &ScriptEngine::errorMessage, this, &JSConsole::handleError); if (_ownScriptEngine) { _scriptEngine->deleteLater(); } @@ -87,8 +87,8 @@ void JSConsole::setScriptEngine(ScriptEngine* scriptEngine) { _ownScriptEngine = scriptEngine == NULL; _scriptEngine = _ownScriptEngine ? DependencyManager::get()->loadScript(QString(), false) : scriptEngine; - connect(_scriptEngine, SIGNAL(printedMessage(const QString&)), this, SLOT(handlePrint(const QString&))); - connect(_scriptEngine, SIGNAL(errorMessage(const QString&)), this, SLOT(handleError(const QString&))); + connect(_scriptEngine, &ScriptEngine::printedMessage, this, &JSConsole::handlePrint); + connect(_scriptEngine, &ScriptEngine::errorMessage, this, &JSConsole::handleError); } void JSConsole::executeCommand(const QString& command) { @@ -134,11 +134,13 @@ void JSConsole::commandFinished() { resetCurrentCommandHistory(); } -void JSConsole::handleError(const QString& message) { +void JSConsole::handleError(const QString& scriptName, const QString& message) { + Q_UNUSED(scriptName); appendMessage(GUTTER_ERROR, "" + message.toHtmlEscaped() + ""); } -void JSConsole::handlePrint(const QString& message) { +void JSConsole::handlePrint(const QString& scriptName, const QString& message) { + Q_UNUSED(scriptName); appendMessage("", message); } diff --git a/interface/src/ui/JSConsole.h b/interface/src/ui/JSConsole.h index 47878fea99..d5f5aff301 100644 --- a/interface/src/ui/JSConsole.h +++ b/interface/src/ui/JSConsole.h @@ -47,8 +47,8 @@ protected: protected slots: void scrollToBottom(); void resizeTextInput(); - void handlePrint(const QString& message); - void handleError(const QString& message); + void handlePrint(const QString& scriptName, const QString& message); + void handleError(const QString& scriptName, const QString& message); void commandFinished(); private: From 332f9bb28354f6f6bf509939c72813769f5d3bc2 Mon Sep 17 00:00:00 2001 From: Vladyslav Stelmakhovskyi Date: Tue, 4 Apr 2017 16:22:40 +0200 Subject: [PATCH 08/10] Fixed TabletMenuStack.qml:56: Error: Cannot assign [undefined] to QString. Fixed keyboardRaised undefined error --- interface/resources/qml/hifi/dialogs/TabletAssetServer.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/dialogs/TabletAssetServer.qml b/interface/resources/qml/hifi/dialogs/TabletAssetServer.qml index 2460fc39d5..85f8a2f59e 100644 --- a/interface/resources/qml/hifi/dialogs/TabletAssetServer.qml +++ b/interface/resources/qml/hifi/dialogs/TabletAssetServer.qml @@ -21,6 +21,9 @@ Rectangle { id: root objectName: "AssetServer" + property string title: "Asset Browser" + property bool keyboardRaised: false + property var eventBridge; signal sendToScript(var message); property bool isHMD: false @@ -415,7 +418,6 @@ Rectangle { Column { width: parent.width - y: hifi.dimensions.tabletMenuHeader //-bgNavBar spacing: 10 HifiControls.TabletContentSection { From 367555acdbdbe184ebd6945cef1876057fe55508 Mon Sep 17 00:00:00 2001 From: Vladyslav Stelmakhovskyi Date: Tue, 4 Apr 2017 16:35:21 +0200 Subject: [PATCH 09/10] Fixed BasicTableView.qml:610:17: QML Item: Binding loop detected for property width. width must be explicitly set --- .../resources/qml/hifi/dialogs/TabletRunningScripts.qml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml index dee0d0e21f..d826b40ad1 100644 --- a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml @@ -20,7 +20,7 @@ import "../../windows" Rectangle { id: root objectName: "RunningScripts" - property var title: "Running Scripts" + property string title: "Running Scripts" HifiConstants { id: hifi } signal sendToScript(var message); property var eventBridge; @@ -81,9 +81,9 @@ Rectangle { Flickable { id: flickable - width: parent.width + width: tabletRoot.width height: parent.height - (keyboard.raised ? keyboard.raisedHeight : 0) - contentWidth: parent.width + contentWidth: column.width contentHeight: column.childrenRect.height clip: true @@ -121,9 +121,8 @@ Rectangle { model: runningScriptsModel id: table height: 185 + width: parent.width colorScheme: hifi.colorSchemes.dark - anchors.left: parent.left - anchors.right: parent.right expandSelectedRow: true itemDelegate: Item { From aa487faad17d10b222e84b83011ffe43390f0088 Mon Sep 17 00:00:00 2001 From: Vladyslav Stelmakhovskyi Date: Tue, 4 Apr 2017 16:59:09 +0200 Subject: [PATCH 10/10] Fixed No such signal QmlWindow_QMLTYPE_490::resized(QSizeF) and No such signal QmlWindow_QMLTYPE_490::moved(QVector2D) warnings --- libraries/ui/src/QmlWindowClass.cpp | 7 +++++-- scripts/developer/debugging/debugWindow.qml | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libraries/ui/src/QmlWindowClass.cpp b/libraries/ui/src/QmlWindowClass.cpp index c60e4fa698..c0e94058ae 100644 --- a/libraries/ui/src/QmlWindowClass.cpp +++ b/libraries/ui/src/QmlWindowClass.cpp @@ -122,12 +122,15 @@ void QmlWindowClass::initQml(QVariantMap properties) { object->setProperty(OFFSCREEN_VISIBILITY_PROPERTY, visible); object->setProperty(SOURCE_PROPERTY, _source); + const QMetaObject *metaObject = _qmlWindow->metaObject(); // Forward messages received from QML on to the script connect(_qmlWindow, SIGNAL(sendToScript(QVariant)), this, SLOT(qmlToScript(const QVariant&)), Qt::QueuedConnection); connect(_qmlWindow, SIGNAL(visibleChanged()), this, SIGNAL(visibleChanged()), Qt::QueuedConnection); - connect(_qmlWindow, SIGNAL(resized(QSizeF)), this, SIGNAL(resized(QSizeF)), Qt::QueuedConnection); - connect(_qmlWindow, SIGNAL(moved(QVector2D)), this, SLOT(hasMoved(QVector2D)), Qt::QueuedConnection); + if (metaObject->indexOfSignal("resized") >= 0) + connect(_qmlWindow, SIGNAL(resized(QSizeF)), this, SIGNAL(resized(QSizeF)), Qt::QueuedConnection); + if (metaObject->indexOfSignal("moved") >= 0) + connect(_qmlWindow, SIGNAL(moved(QVector2D)), this, SLOT(hasMoved(QVector2D)), Qt::QueuedConnection); connect(_qmlWindow, SIGNAL(windowClosed()), this, SLOT(hasClosed()), Qt::QueuedConnection); }); } diff --git a/scripts/developer/debugging/debugWindow.qml b/scripts/developer/debugging/debugWindow.qml index f046a949ef..20fa24358d 100644 --- a/scripts/developer/debugging/debugWindow.qml +++ b/scripts/developer/debugging/debugWindow.qml @@ -18,6 +18,9 @@ Rectangle { width: parent ? parent.width : 100 height: parent ? parent.height : 100 + signal moved(vector2d position); + signal resized(size size); + property var channel; TextArea {