From 7e4cd9b3684b05b1a711e980bf43c0474267d21e Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Fri, 13 Dec 2019 22:22:00 +0100 Subject: [PATCH 01/14] FancyLineEdit: Fix camel case navigation with shift modifier Fixes: QTCREATORBUG-23370 Change-Id: Ie96f642f0b964499ded830ae6eabfc86ef31fabd Reviewed-by: David Schulz --- src/libs/utils/fancylineedit.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/libs/utils/fancylineedit.cpp b/src/libs/utils/fancylineedit.cpp index d67c3365440..928a612d438 100644 --- a/src/libs/utils/fancylineedit.cpp +++ b/src/libs/utils/fancylineedit.cpp @@ -370,15 +370,20 @@ void FancyLineEdit::onEditingFinished() void FancyLineEdit::keyPressEvent(QKeyEvent *event) { - const QTextCursor::MoveMode mode = (event->modifiers() & Qt::ShiftModifier) - ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor; - - if (camelCaseNavigation && event == QKeySequence::MoveToPreviousWord) - CamelCaseCursor::left(this, mode); - else if (camelCaseNavigation && event == QKeySequence::MoveToNextWord) - CamelCaseCursor::right(this, mode); - else + if (camelCaseNavigation) { + if (event == QKeySequence::MoveToPreviousWord) + CamelCaseCursor::left(this, QTextCursor::MoveAnchor); + else if (event == QKeySequence::SelectPreviousWord) + CamelCaseCursor::left(this, QTextCursor::KeepAnchor); + else if (event == QKeySequence::MoveToNextWord) + CamelCaseCursor::right(this, QTextCursor::MoveAnchor); + else if (event == QKeySequence::SelectNextWord) + CamelCaseCursor::right(this, QTextCursor::KeepAnchor); + else + QLineEdit::keyPressEvent(event); + } else { QLineEdit::keyPressEvent(event); + } } void FancyLineEdit::setCamelCaseNavigationEnabled(bool enabled) From e3338f2e8ac6cf48a6d75a463e04c0aa7a24511d Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 13 Dec 2019 13:51:00 +0100 Subject: [PATCH 02/14] Debugger: Avoid accessing nullptr If the context menu is spawned while stepping the user may be able to trigger some actions that try to access an item that had been present before, but after the stepping the items inside the tree view usually got completely re-created. Change-Id: I80029bc1272cfc8b78fe0ed5b1e0f36f29920631 Reviewed-by: hjk --- src/plugins/debugger/watchhandler.cpp | 31 ++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index a254036bf12..21656ec4fe0 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -1680,21 +1680,25 @@ bool WatchModel::contextMenuEvent(const ItemViewEvent &ev) addAction(menu, tr("Expand All Children"), item, - [this, item] { - m_expandedINames.insert(item->iname); - item->forFirstLevelChildren([this](WatchItem *child) { - m_expandedINames.insert(child->iname); - }); - m_engine->updateLocals(); + [this, name = item->iname] { + m_expandedINames.insert(name); + if (auto item = findItem(name)) { + item->forFirstLevelChildren([this](WatchItem *child) { + m_expandedINames.insert(child->iname); + }); + m_engine->updateLocals(); + } }); addAction(menu, tr("Collapse All Children"), item, - [this, item] { - item->forFirstLevelChildren([this](WatchItem *child) { - m_expandedINames.remove(child->iname); - }); - m_engine->updateLocals(); + [this, name = item->iname] { + if (auto item = findItem(name)) { + item->forFirstLevelChildren([this](WatchItem *child) { + m_expandedINames.remove(child->iname); + }); + m_engine->updateLocals(); + } }); addAction(menu, tr("Close Editor Tooltips"), @@ -1707,7 +1711,10 @@ bool WatchModel::contextMenuEvent(const ItemViewEvent &ev) addAction(menu, tr("Copy Current Value to Clipboard"), item, - [item] { copyToClipboard(item->value); }); + [this, name = item->iname] { + if (auto item = findItem(name)) + copyToClipboard(item->value); + }); // addAction(menu, tr("Copy Selected Rows to Clipboard"), // selectionModel()->hasSelection(), From 0cdea406061fe1bad0ab577adab0e0dc9b3b73dc Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 12 Dec 2019 11:39:52 +0100 Subject: [PATCH 03/14] Debugger: Fix std::string dumper for GCC 9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTCREATORBUG-22753 Fixes: QTCREATORBUG-22680 Change-Id: I75e2855d27bc2b83880379fee2364586b9d4a90e Reviewed-by: André Hartmann Reviewed-by: Christian Stenger --- share/qtcreator/debugger/stdtypes.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py index 2f51aa2ec1e..56890487b11 100644 --- a/share/qtcreator/debugger/stdtypes.py +++ b/share/qtcreator/debugger/stdtypes.py @@ -634,6 +634,15 @@ def qdumpHelper_std__string(d, value, charType, format): qdumpHelper__std__string__MSVC(d, value, charType, format) return + # GCC 9, QTCREATORBUG-22753 + try: + data = value["_M_dataplus"]["_M_p"].pointer() + size = int(value["_M_string_length"]) + d.putCharArrayHelper(data, size, charType, format) + return + except: + pass + data = value.extractPointer() # We can't lookup the std::string::_Rep type without crashing LLDB, # so hard-code assumption on member position From be9cad77d220715f50c1a76dc5be93f3bbaaa932 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Tue, 17 Dec 2019 10:26:32 +0100 Subject: [PATCH 04/14] Add another QDS doc image file path Task-number: QDS-1403 Change-Id: I104480405033838a565f5a596ab43404db5f40dc Reviewed-by: Tim Jenssen --- scripts/createDevPackage.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/createDevPackage.py b/scripts/createDevPackage.py index 66ddf40f346..3516b52e382 100755 --- a/scripts/createDevPackage.py +++ b/scripts/createDevPackage.py @@ -69,6 +69,7 @@ source_include_patterns = [ r"^.*\.h$", # .h files in all directories that are looked into r"^.*\.hpp$", # .hpp files in all directories that are looked into # qtdesignstudio docs are build against dev package, so we need to include some image directories + r"^share/qtcreator/qml/qmlpuppet/mockfiles/images/.*$", r"^share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/images/.*$", r"^src/libs/qmleditorwidgets/images/.*$", r"^src/libs/utils/images/.*$", From 77126dc4b8bcd462daa2642aac1565521fbcbe5a Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 10 Dec 2019 16:32:18 +0100 Subject: [PATCH 05/14] QmakeProjectManager: Extend Qt examples deployment hack E.g. for Qnx, QT_INSTALL_PREFIX is not a prefix of QT_INSTALL_EXAMPLES. Fixes: QTCREATORBUG-22592 Change-Id: I3092cd76af01519783e1162ab8e79caaf0836f00 Reviewed-by: hjk --- .../qmakeprojectmanager/qmakeparsernodes.cpp | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp index fc3be830c71..16410724b9e 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp @@ -1951,11 +1951,12 @@ InstallsList QmakeProFile::installsList(const QtSupport::ProFileReader *reader, if (itemList.isEmpty()) return result; - const QString installPrefix - = reader->propertyValue(QLatin1String("QT_INSTALL_PREFIX")); - const QString devInstallPrefix - = reader->propertyValue(QLatin1String("QT_INSTALL_PREFIX/dev")); - bool fixInstallPrefix = (installPrefix != devInstallPrefix); + const QStringList installPrefixVars{"QT_INSTALL_PREFIX", "QT_INSTALL_EXAMPLES"}; + QList> installPrefixValues; + for (const QString &installPrefix : installPrefixVars) { + installPrefixValues << qMakePair(reader->propertyValue(installPrefix), + reader->propertyValue(installPrefix + "/dev")); + } foreach (const QString &item, itemList) { const QStringList config = reader->values(item + ".CONFIG"); @@ -1974,13 +1975,18 @@ InstallsList QmakeProFile::installsList(const QtSupport::ProFileReader *reader, } QString itemPath = itemPaths.last(); - if (fixInstallPrefix && itemPath.startsWith(installPrefix)) { + for (const auto &prefixValuePair : qAsConst(installPrefixValues)) { + if (prefixValuePair.first == prefixValuePair.second + || !itemPath.startsWith(prefixValuePair.first)) { + continue; + } // This is a hack for projects which install into $$[QT_INSTALL_*], // in particular Qt itself, examples being most relevant. // Projects which implement their own install path policy must // parametrize their INSTALLS themselves depending on the intended // installation/deployment mode. - itemPath.replace(0, installPrefix.length(), devInstallPrefix); + itemPath.replace(0, prefixValuePair.first.length(), prefixValuePair.second); + break; } if (item == QLatin1String("target")) { if (active) From e5d4224fe447e1af538ca8a7fa83e621a7e62883 Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Mon, 16 Dec 2019 22:23:19 +0200 Subject: [PATCH 06/14] Prevent the Edit View 3D restart upon closing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also the 2D/3D action updates correctly according to Edit View 3D state. Task-number: QDS-1385 Change-Id: I95d0994e9c56df25a2988eb9d27994268dd1903d Reviewed-by: Henning Gründl Reviewed-by: Tim Jenssen --- .../qml/qmlpuppet/commands/commands.pri | 2 + .../commands/view3dclosedcommand.cpp | 47 +++++++++++++++++++ .../qmlpuppet/commands/view3dclosedcommand.h | 47 +++++++++++++++++++ .../instances/nodeinstanceclientproxy.cpp | 6 +++ .../instances/nodeinstanceclientproxy.h | 2 + .../interfaces/nodeinstanceclientinterface.h | 2 + .../nodeinstanceserverinterface.cpp | 6 ++- .../qt5informationnodeinstanceserver.cpp | 5 ++ src/plugins/qmldesigner/CMakeLists.txt | 1 + .../components/formeditor/formeditorview.cpp | 3 ++ .../designercore/include/nodeinstanceview.h | 1 + .../instances/nodeinstanceserverproxy.cpp | 4 ++ .../instances/nodeinstanceview.cpp | 7 +++ src/plugins/qmldesigner/qmldesignerplugin.qbs | 2 + src/tools/qml2puppet/CMakeLists.txt | 1 + src/tools/qml2puppet/qml2puppet.qbs | 2 + 16 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 share/qtcreator/qml/qmlpuppet/commands/view3dclosedcommand.cpp create mode 100644 share/qtcreator/qml/qmlpuppet/commands/view3dclosedcommand.h diff --git a/share/qtcreator/qml/qmlpuppet/commands/commands.pri b/share/qtcreator/qml/qmlpuppet/commands/commands.pri index 7985b259758..47ec4473eaf 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/commands.pri +++ b/share/qtcreator/qml/qmlpuppet/commands/commands.pri @@ -30,6 +30,7 @@ HEADERS += $$PWD/changeselectioncommand.h HEADERS += $$PWD/drop3dlibraryitemcommand.h HEADERS += $$PWD/update3dviewstatecommand.h HEADERS += $$PWD/enable3dviewcommand.h +HEADERS += $$PWD/view3dclosedcommand.h SOURCES += $$PWD/synchronizecommand.cpp SOURCES += $$PWD/debugoutputcommand.cpp @@ -61,3 +62,4 @@ SOURCES += $$PWD/changeselectioncommand.cpp SOURCES += $$PWD/drop3dlibraryitemcommand.cpp SOURCES += $$PWD/update3dviewstatecommand.cpp SOURCES += $$PWD/enable3dviewcommand.cpp +SOURCES += $$PWD/view3dclosedcommand.cpp diff --git a/share/qtcreator/qml/qmlpuppet/commands/view3dclosedcommand.cpp b/share/qtcreator/qml/qmlpuppet/commands/view3dclosedcommand.cpp new file mode 100644 index 00000000000..c7de7a99dee --- /dev/null +++ b/share/qtcreator/qml/qmlpuppet/commands/view3dclosedcommand.cpp @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#include "view3dclosedcommand.h" + +namespace QmlDesigner { + +View3DClosedCommand::View3DClosedCommand() = default; + +QDataStream &operator<<(QDataStream &out, const View3DClosedCommand &/*command*/) +{ + return out; +} + +QDataStream &operator>>(QDataStream &in, View3DClosedCommand &/*command*/) +{ + return in; +} + +QDebug operator<<(QDebug debug, const View3DClosedCommand &/*command*/) +{ + return debug.nospace() << "View3DClosedCommand()"; +} + +} // namespace QmlDesigner diff --git a/share/qtcreator/qml/qmlpuppet/commands/view3dclosedcommand.h b/share/qtcreator/qml/qmlpuppet/commands/view3dclosedcommand.h new file mode 100644 index 00000000000..132bb3c37bd --- /dev/null +++ b/share/qtcreator/qml/qmlpuppet/commands/view3dclosedcommand.h @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#pragma once + +#include +#include +#include + +namespace QmlDesigner { + +class View3DClosedCommand +{ +public: + View3DClosedCommand(); +}; + +QDataStream &operator<<(QDataStream &out, const View3DClosedCommand &command); +QDataStream &operator>>(QDataStream &in, View3DClosedCommand &command); + +QDebug operator<<(QDebug debug, const View3DClosedCommand &command); + +} // namespace QmlDesigner + +Q_DECLARE_METATYPE(QmlDesigner::View3DClosedCommand) diff --git a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp index d12cfe327fd..01d9cd18424 100644 --- a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp +++ b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp @@ -71,6 +71,7 @@ #include "puppetalivecommand.h" #include "changeselectioncommand.h" #include "drop3dlibraryitemcommand.h" +#include "view3dclosedcommand.h" namespace QmlDesigner { @@ -261,6 +262,11 @@ void NodeInstanceClientProxy::library3DItemDropped(const Drop3DLibraryItemComman writeCommand(QVariant::fromValue(command)); } +void NodeInstanceClientProxy::view3DClosed(const View3DClosedCommand &command) +{ + writeCommand(QVariant::fromValue(command)); +} + void NodeInstanceClientProxy::flush() { } diff --git a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h index 5a742947d2d..7c9724e1ff0 100644 --- a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h +++ b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h @@ -60,6 +60,7 @@ class ChangeNodeSourceCommand; class EndPuppetCommand; class ChangeSelectionCommand; class Drop3DLibraryItemCommand; +class View3DClosedCommand; class NodeInstanceClientProxy : public QObject, public NodeInstanceClientInterface { @@ -80,6 +81,7 @@ public: void puppetAlive(const PuppetAliveCommand &command); void selectionChanged(const ChangeSelectionCommand &command) override; void library3DItemDropped(const Drop3DLibraryItemCommand &command) override; + void view3DClosed(const View3DClosedCommand &command) override; void flush() override; void synchronizeWithClientProcess() override; diff --git a/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceclientinterface.h b/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceclientinterface.h index 10688cdd89f..b188d7edfdc 100644 --- a/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceclientinterface.h +++ b/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceclientinterface.h @@ -42,6 +42,7 @@ class DebugOutputCommand; class PuppetAliveCommand; class ChangeSelectionCommand; class Drop3DLibraryItemCommand; +class View3DClosedCommand; class NodeInstanceClientInterface { @@ -57,6 +58,7 @@ public: virtual void debugOutput(const DebugOutputCommand &command) = 0; virtual void selectionChanged(const ChangeSelectionCommand &command) = 0; virtual void library3DItemDropped(const Drop3DLibraryItemCommand &command) = 0; + virtual void view3DClosed(const View3DClosedCommand &command) = 0; virtual void flush() {} virtual void synchronizeWithClientProcess() {} diff --git a/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceserverinterface.cpp b/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceserverinterface.cpp index bbd73e63caf..f606bfacf2f 100644 --- a/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceserverinterface.cpp +++ b/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceserverinterface.cpp @@ -63,12 +63,13 @@ #include "endpuppetcommand.h" #include "debugoutputcommand.h" #include "puppetalivecommand.h" +#include "view3dclosedcommand.h" #include namespace QmlDesigner { -static bool isRegistered=false; +static bool isRegistered = false; NodeInstanceServerInterface::NodeInstanceServerInterface(QObject *parent) : QObject(parent) @@ -205,6 +206,9 @@ void NodeInstanceServerInterface::registerCommands() qRegisterMetaType("PuppetAliveCommand"); qRegisterMetaTypeStreamOperators("PuppetAliveCommand"); + + qRegisterMetaType("View3DClosedCommand"); + qRegisterMetaTypeStreamOperators("View3DClosedCommand"); } } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index e65b1b4b2da..db38985d90e 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -61,6 +61,7 @@ #include "removesharedmemorycommand.h" #include "objectnodeinstance.h" #include "drop3dlibraryitemcommand.h" +#include "view3dclosedcommand.h" #include "dummycontextobject.h" #include "../editor3d/generalhelper.h" @@ -97,6 +98,10 @@ bool Qt5InformationNodeInstanceServer::eventFilter(QObject *, QEvent *event) } break; + case QEvent::Close: { + nodeInstanceClient()->view3DClosed(View3DClosedCommand()); + } break; + default: break; } diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index 6d3bca379c0..0a758c135f1 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -142,6 +142,7 @@ extend_qtc_plugin(QmlDesigner drop3dlibraryitemcommand.cpp drop3dlibraryitemcommand.h update3dviewstatecommand.cpp update3dviewstatecommand.h enable3dviewcommand.cpp enable3dviewcommand.h + view3dclosedcommand.cpp view3dclosedcommand.h ) extend_qtc_plugin(QmlDesigner diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp index ee7b3f18a9a..baec3813168 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp @@ -462,6 +462,9 @@ void FormEditorView::auxiliaryDataChanged(const ModelNode &node, const PropertyN if (isInvisible) newNode.deselectNode(); } + } else if (name == "3d-view") { + bool is3DEnabled = data.isNull() || data.toBool(); + formEditorWidget()->option3DAction()->set3DEnabled(is3DEnabled); } } diff --git a/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h b/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h index f6b705acc3f..c55dae2d87a 100644 --- a/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h +++ b/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h @@ -138,6 +138,7 @@ public: void selectionChanged(const ChangeSelectionCommand &command) override; void library3DItemDropped(const Drop3DLibraryItemCommand &command) override; + void view3DClosed(const View3DClosedCommand &command) override; void selectedNodesChanged(const QList &selectedNodeList, const QList &lastSelectedNodeList) override; diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp index d979e3dd325..07e3216f377 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -285,6 +286,7 @@ void NodeInstanceServerProxy::dispatchCommand(const QVariant &command, PuppetStr static const int puppetAliveCommandType = QMetaType::type("PuppetAliveCommand"); static const int changeSelectionCommandType = QMetaType::type("ChangeSelectionCommand"); static const int drop3DLibraryItemCommandType = QMetaType::type("Drop3DLibraryItemCommand"); + static const int view3DClosedCommand = QMetaType::type("View3DClosedCommand"); if (m_destructing) return; @@ -312,6 +314,8 @@ void NodeInstanceServerProxy::dispatchCommand(const QVariant &command, PuppetStr nodeInstanceClient()->selectionChanged(command.value()); } else if (command.userType() == drop3DLibraryItemCommandType) { nodeInstanceClient()->library3DItemDropped(command.value()); + } else if (command.userType() == view3DClosedCommand) { + nodeInstanceClient()->view3DClosed(command.value()); } else if (command.userType() == puppetAliveCommandType) { puppetAlive(puppetStreamType); } else if (command.userType() == synchronizeCommandType) { diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp index 95283287540..a550a2e4b2d 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp @@ -1454,6 +1454,13 @@ void NodeInstanceView::library3DItemDropped(const Drop3DLibraryItemCommand &comm QmlVisualNode::createQmlVisualNode(this, itemLibraryEntry, {}); } +void NodeInstanceView::view3DClosed(const View3DClosedCommand &command) +{ + Q_UNUSED(command) + + rootModelNode().setAuxiliaryData("3d-view", false); +} + void NodeInstanceView::selectedNodesChanged(const QList &selectedNodeList, const QList & /*lastSelectedNodeList*/) { diff --git a/src/plugins/qmldesigner/qmldesignerplugin.qbs b/src/plugins/qmldesigner/qmldesignerplugin.qbs index 1ef8407d8e7..67783c7c157 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.qbs +++ b/src/plugins/qmldesigner/qmldesignerplugin.qbs @@ -175,6 +175,8 @@ Project { "commands/update3dviewstatecommand.h", "commands/enable3dviewcommand.cpp", "commands/enable3dviewcommand.h", + "commands/view3dclosedcommand.cpp", + "commands/view3dclosedcommand.h", "container/addimportcontainer.cpp", "container/addimportcontainer.h", "container/idcontainer.cpp", diff --git a/src/tools/qml2puppet/CMakeLists.txt b/src/tools/qml2puppet/CMakeLists.txt index eb9abeda162..39126452830 100644 --- a/src/tools/qml2puppet/CMakeLists.txt +++ b/src/tools/qml2puppet/CMakeLists.txt @@ -48,6 +48,7 @@ extend_qtc_executable(qml2puppet drop3dlibraryitemcommand.cpp drop3dlibraryitemcommand.h update3dviewstatecommand.cpp update3dviewstatecommand.h enable3dviewcommand.cpp enable3dviewcommand.h + view3dclosedcommand.cpp view3dclosedcommand.h valueschangedcommand.cpp ) diff --git a/src/tools/qml2puppet/qml2puppet.qbs b/src/tools/qml2puppet/qml2puppet.qbs index fb73413038f..645250c2d41 100644 --- a/src/tools/qml2puppet/qml2puppet.qbs +++ b/src/tools/qml2puppet/qml2puppet.qbs @@ -101,6 +101,8 @@ QtcTool { "commands/update3dviewstatecommand.h", "commands/enable3dviewcommand.cpp", "commands/enable3dviewcommand.h", + "commands/view3dclosedcommand.cpp", + "commands/view3dclosedcommand.h", "container/addimportcontainer.cpp", "container/addimportcontainer.h", "container/idcontainer.cpp", From 2f2787c4a8518fc31086a2cf7b317dccdb3a1624 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 16 Dec 2019 10:11:02 +0100 Subject: [PATCH 07/14] QmlDesigner: Add workaround for QVector3D For some reason the Qt meta system does not work reliable for QVector3D. It does work "rotation", but not for "pivot", despite the fact that both properties are defined in exactly the same way. This patch works around the main issue. There are still a few issues left, but at least the default is correct now. Task-number: QDS-1355 Change-Id: I75e2d3adff6967e89c6ce031d744baa12b5e8061 Reviewed-by: Mahmoud Badri Reviewed-by: Tim Jenssen --- .../instances/objectnodeinstance.cpp | 23 +++++++++++++++++-- .../qml2puppet/instances/objectnodeinstance.h | 1 + 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp index 83382fb198d..2d2edeee4a6 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp @@ -571,11 +571,30 @@ QVariant ObjectNodeInstance::property(const PropertyName &name) const return property.read(); } +void ObjectNodeInstance::ensureVector3DDotProperties(PropertyNameList &list) const +{ + const PropertyNameList properties = { "rotation", "scale", "pivot" }; + for (const auto &property : properties) { + if (list.contains(property) && instanceType(property) == "QVector3D") { + const PropertyNameList dotProperties = { "x", "y", "z" }; + for (const auto &dotProperty : dotProperties) { + const PropertyName dotPropertyName = property + "." + dotProperty; + if (!list.contains(dotPropertyName)) + list.append(dotPropertyName); + } + } + } +} + PropertyNameList ObjectNodeInstance::propertyNames() const { + PropertyNameList list; if (isValid()) - return QmlPrivateGate::allPropertyNames(object()); - return PropertyNameList(); + list = QmlPrivateGate::allPropertyNames(object()); + + ensureVector3DDotProperties(list); + + return list; } QString ObjectNodeInstance::instanceType(const PropertyName &name) const diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h index ced76dee58e..d716c4d755f 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h @@ -209,6 +209,7 @@ protected: static QVariant enumationValue(const Enumeration &enumeration); void initializePropertyWatcher(const ObjectNodeInstance::Pointer &objectNodeInstance); + void ensureVector3DDotProperties(PropertyNameList &list) const; private: QString m_id; From 166afd652166b42cc50ca0bee0aa0524201a9d28 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 17 Dec 2019 10:44:13 +0100 Subject: [PATCH 08/14] QmlDesigner: Increase the puppet timeout to 30s The puppet timeout creates issues with the 3D view. At the moment we do not know any case in which the puppet timeout is strictly required. Increasing the timeout to 30s should be safe. In the worst case users have to add the option to reduce the timeout again. Change-Id: I3a4b2b145f42b3fcabfdfaa97bc23ae10d6c1648 Reviewed-by: Mahmoud Badri Reviewed-by: Tim Jenssen --- src/plugins/qmldesigner/designersettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/designersettings.cpp b/src/plugins/qmldesigner/designersettings.cpp index f1afe3cf664..e08035389ff 100644 --- a/src/plugins/qmldesigner/designersettings.cpp +++ b/src/plugins/qmldesigner/designersettings.cpp @@ -67,7 +67,7 @@ void DesignerSettings::fromSettings(QSettings *settings) restoreValue(settings, DesignerSettingsKey::CONTROLS_STYLE); restoreValue(settings, DesignerSettingsKey::SHOW_PROPERTYEDITOR_WARNINGS, false); restoreValue(settings, DesignerSettingsKey::ENABLE_MODEL_EXCEPTION_OUTPUT, false); - restoreValue(settings, DesignerSettingsKey::PUPPET_KILL_TIMEOUT, 3000); // this has no ui at the moment + restoreValue(settings, DesignerSettingsKey::PUPPET_KILL_TIMEOUT, 30000); // this has no ui at the moment restoreValue(settings, DesignerSettingsKey::DEBUG_PUPPET, QString()); restoreValue(settings, DesignerSettingsKey::FORWARD_PUPPET_OUTPUT, QString()); restoreValue(settings, DesignerSettingsKey::REFORMAT_UI_QML_FILES, true); From 141d5e24126ef919ad624b04e8c959c664e9e410 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 17 Dec 2019 11:00:10 +0100 Subject: [PATCH 09/14] Fix build with namespaced Qt Fixes: QTCREATORBUG-23368 Change-Id: I3887b08587becd46bc203bb0bc4069521247498f Reviewed-by: hjk --- .../clangindexingprojectsettingswidget.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/plugins/clangpchmanager/clangindexingprojectsettingswidget.h b/src/plugins/clangpchmanager/clangindexingprojectsettingswidget.h index 2a3b4293b51..846e8bde23f 100644 --- a/src/plugins/clangpchmanager/clangindexingprojectsettingswidget.h +++ b/src/plugins/clangpchmanager/clangindexingprojectsettingswidget.h @@ -27,13 +27,11 @@ #include -namespace ProjectExplorer { -class Project; -} +namespace ProjectExplorer { class Project; } -namespace Ui { -class ClangIndexingProjectSettingsWidget; -} +QT_BEGIN_NAMESPACE +namespace Ui { class ClangIndexingProjectSettingsWidget; } +QT_END_NAMESPACE namespace ClangPchManager { From 17f47d6fa47dd213c3ce78059d2eef911e4bebe2 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 17 Dec 2019 11:07:23 +0100 Subject: [PATCH 10/14] UpdateInfo: Do not show multiple update notfications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove existing notification before showing a new one. Otherwise checking for updates multiple times results in multiple stacked notifications. Change-Id: I1af07c005e88b297fbaebec7f5358fa46c09a84c Reviewed-by: André Hartmann Reviewed-by: David Schulz --- src/plugins/updateinfo/updateinfoplugin.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/updateinfo/updateinfoplugin.cpp b/src/plugins/updateinfo/updateinfoplugin.cpp index c602136ef20..3c047e6723f 100644 --- a/src/plugins/updateinfo/updateinfoplugin.cpp +++ b/src/plugins/updateinfo/updateinfoplugin.cpp @@ -207,6 +207,7 @@ void UpdateInfoPlugin::checkForUpdatesFinished() label->setContentsMargins(0, 0, 0, 8); return label; }); + Core::ICore::infoBar()->removeInfo(InstallUpdates); // remove any existing notifications Core::ICore::infoBar()->unsuppressInfo(InstallUpdates); Core::ICore::infoBar()->addInfo(info); } else { From 6d0336f2231479951120c1128f9f95255612bd52 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Mon, 16 Dec 2019 19:05:52 +0100 Subject: [PATCH 11/14] CheckableMessageBox: Forbid focus for text and pixmap That allows changing between the buttons with the cursor Left and Right keys, without loosing focus from one of the buttons. Before, that was impossible without intermediate tab key pressing. E.g. when pressing Ctrl+W to close the git commit editor, the focus was outside the buttons. To select one of them, Tab had to be pressed first, but after some Key Right presses, the focus got away from the buttons again and the game had to be repeated. That behavior was different from QMessageBox, where one of the buttons always has focus. Change-Id: I9b12f794e8ba4aef1a68aaf249ba6dd6789cae4d Reviewed-by: Eike Ziller --- src/libs/utils/checkablemessagebox.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/utils/checkablemessagebox.cpp b/src/libs/utils/checkablemessagebox.cpp index 3ec411cfb32..ccf773cb99d 100644 --- a/src/libs/utils/checkablemessagebox.cpp +++ b/src/libs/utils/checkablemessagebox.cpp @@ -62,6 +62,7 @@ public: sizePolicy.setHeightForWidth(pixmapLabel->sizePolicy().hasHeightForWidth()); pixmapLabel->setSizePolicy(sizePolicy); pixmapLabel->setVisible(false); + pixmapLabel->setFocusPolicy(Qt::NoFocus); auto pixmapSpacer = new QSpacerItem(0, 5, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding); @@ -71,6 +72,7 @@ public: messageLabel->setWordWrap(true); messageLabel->setOpenExternalLinks(true); messageLabel->setTextInteractionFlags(Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse); + messageLabel->setFocusPolicy(Qt::NoFocus); auto checkBoxRightSpacer = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum); From ba7545f2ff33245ff72d576abd243bb2d786f191 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Tue, 17 Dec 2019 14:26:42 +0100 Subject: [PATCH 12/14] fix missing comma in source include patterns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QDS-1403 Change-Id: I907462f0978c1610ba2e7af10f386380f8ea18c7 Reviewed-by: Thomas Hartmann Reviewed-by: Henning Gründl --- scripts/createDevPackage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/createDevPackage.py b/scripts/createDevPackage.py index 3516b52e382..21f71eef5b5 100755 --- a/scripts/createDevPackage.py +++ b/scripts/createDevPackage.py @@ -80,10 +80,10 @@ source_include_patterns = [ r"^src/plugins/qmldesigner/components/componentcore/images/.*$", r"^src/plugins/qmldesigner/components/timelineeditor/images/.*$", r"^src/plugins/qmldesigner/qmlpreviewplugin/images/.*$", - r"^src/plugins/texteditor/images/.*$" + r"^src/plugins/texteditor/images/.*$", # also some single files r"^src/plugins/qmldesigner/components/formeditor/.*\.png$", - r"^src/plugins/qmldesigner/components/navigator/.*\.png$", + r"^src/plugins/qmldesigner/components/navigator/.*\.png$" ] build_include_patterns = [ From 6d4223c5d61fd42144cd1361e76c874c6384049b Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 17 Dec 2019 14:38:49 +0100 Subject: [PATCH 13/14] Do not show line ending option in read-only editors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids showing the option for example in git log or blame views. The user also should not be able to actually change the line ending style of read-only editors. Fixes: QTCREATORBUG-23276 Change-Id: Ifa5cc9f663539928b4d5422b020e348b439684fa Reviewed-by: Orgad Shaneh Reviewed-by: André Hartmann Reviewed-by: Marius Sincovici --- src/plugins/texteditor/texteditor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 2d349cecb70..ac84aca67c9 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -833,6 +833,10 @@ TextEditorWidgetPrivate::TextEditorWidgetPrivate(TextEditorWidget *parent) m_fileLineEnding->addItems(ExtraEncodingSettings::lineTerminationModeNames()); m_fileLineEnding->setContentsMargins(spacing, 0, spacing, 0); m_fileLineEndingAction = m_toolBar->addWidget(m_fileLineEnding); + m_fileLineEndingAction->setVisible(!q->isReadOnly()); + connect(q, &TextEditorWidget::readOnlyChanged, this, [this] { + m_fileLineEndingAction->setVisible(!q->isReadOnly()); + }); m_fileEncodingLabel = new FixedSizeClickLabel; m_fileEncodingLabel->setContentsMargins(spacing, 0, spacing, 0); From 546d4a3b1a7c0996fa9d730c9b0ccf59bea9d1cb Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 18 Dec 2019 07:40:05 +0100 Subject: [PATCH 14/14] WinRT: Move some device detection output into a logging category This hides the detection failing in the case when no winrtrunner.exe can be found, which is given as soon as you do not have a UWP Qt installed. So moving this output to logging category makes it still accessible, but it doesn't confuse non UWP developer. Change-Id: Ie1434f75086d435f8f033b58c010e35fe64658b0 Reviewed-by: Christian Stenger --- src/plugins/winrt/winrtdevice.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/winrt/winrtdevice.cpp b/src/plugins/winrt/winrtdevice.cpp index cf99e212b03..a8458ace905 100644 --- a/src/plugins/winrt/winrtdevice.cpp +++ b/src/plugins/winrt/winrtdevice.cpp @@ -137,10 +137,9 @@ WinRtDeviceFactory::WinRtDeviceFactory(Core::Id deviceType) void WinRtDeviceFactory::autoDetect() { qCDebug(winrtDeviceLog) << __FUNCTION__; - MessageManager::write(tr("Running Windows Runtime device detection.")); const QString runnerFilePath = findRunnerFilePath(); if (runnerFilePath.isEmpty()) { - MessageManager::write(tr("No winrtrunner.exe found.")); + qCDebug(winrtDeviceLog) << "No winrtrunner.exe found."; return; } @@ -155,7 +154,6 @@ void WinRtDeviceFactory::autoDetect() const CommandLine cmd{runnerFilePath, {"--list-devices"}}; m_process->setCommand(cmd); qCDebug(winrtDeviceLog) << __FUNCTION__ << "Starting process" << cmd.toUserOutput(); - MessageManager::write(cmd.toUserOutput()); m_process->start(); qCDebug(winrtDeviceLog) << __FUNCTION__ << "Process started"; } @@ -361,7 +359,7 @@ void WinRtDeviceFactory::parseRunnerOutput(const QByteArray &output) const message += QLatin1Char(' '); message += tr("%n of them are new.", nullptr, numNew); } - MessageManager::write(message); + qCDebug(winrtDeviceLog) << message; } } // Internal