From a7c05e5e113e9b10e09d395cfc0686ded9356453 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 6 Mar 2020 10:15:26 +0100 Subject: [PATCH 01/25] Debugger: Invalidate disassembler cache index after using it Not before. Amends b3812bf94f. Change-Id: I3f8dd9f23adbbd56bb0d5d76a80a90fd9b7030b5 Reviewed-by: Christian Stenger --- src/plugins/debugger/disassembleragent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/disassembleragent.cpp b/src/plugins/debugger/disassembleragent.cpp index d8a083b8d53..ff958b5d7af 100644 --- a/src/plugins/debugger/disassembleragent.cpp +++ b/src/plugins/debugger/disassembleragent.cpp @@ -238,8 +238,8 @@ void DisassemblerAgent::setLocation(const Location &loc) // Refresh when not displaying a function and there is not sufficient // context left past the address. if (d->cache.at(index).first.endAddress - loc.address() < 24) { - index = -1; d->cache.removeAt(index); + index = -1; } } if (index != -1) { From df2efd7df69f4bbacd77be746a10d0ffc18c55d8 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 3 Mar 2020 11:11:50 +0100 Subject: [PATCH 02/25] Dumper: raise exception in gdbbridge callHelper on Windows Gdb from MinGW 7.3.0 and 5.3.0 crashes on Windows when we try to evaluate expressions that result in a function call. At least prevent evaluating such expressions from within the dumper. Task-number: QTCREATORBUG-23477 Change-Id: Ic14148a43b95aa1b52c1d4488958fa66eccdc0b5 Reviewed-by: Christian Stenger --- share/qtcreator/debugger/gdbbridge.py | 2 ++ share/qtcreator/debugger/qttypes.py | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 4d2e9680cce..bcaf8ed314c 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -744,6 +744,8 @@ class Dumper(DumperBase): return None def callHelper(self, rettype, value, function, args): + if self.isWindowsTarget(): + raise Exception("gdb crashes when calling functions on Windows") # args is a tuple. arg = '' for i in range(len(args)): diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index f28abcd8edb..8a33e3306e7 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -494,7 +494,10 @@ def qdump__QDir(d, value): with Children(d): if not d.isMsvcTarget(): ns = d.qtNamespace() - d.call('int', value, 'count') # Fill cache. + try: + d.call('int', value, 'count') # Fill cache. + except: + pass #d.putCallItem('absolutePath', '@QString', value, 'absolutePath') #d.putCallItem('canonicalPath', '@QString', value, 'canonicalPath') with SubItem(d, 'absolutePath'): @@ -1083,9 +1086,6 @@ qqLocalesCount = None def qdump__QLocale(d, value): - if d.isMsvcTarget(): # as long as this dumper relies on calling functions skip it for cdb - return - # Check for uninitialized 'index' variable. Retrieve size of # QLocale data array from variable in qlocale.cpp. # Default is 368 in Qt 4.8, 438 in Qt 5.0.1, the last one @@ -1119,7 +1119,10 @@ def qdump__QLocale(d, value): = d.split('2s{short}2s' + '{QChar}{QChar}{short}{QChar}{QChar}' + '{QChar}{QChar}{QChar}', data) - d.putStringValue(d.call('const char *', value, 'name')) + try: + d.putStringValue(d.call('const char *', value, 'name')) + except: + pass d.putNumChild(1) if d.isExpanded(): with Children(d): From 4f6ef7b698a4a4b57d912262f71119a35c3c4d71 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Fri, 6 Mar 2020 10:57:43 +0100 Subject: [PATCH 03/25] ADS: Disable workspace menu if not in design mode Task-number: QDS-1741 Change-Id: I8ab9f9f130d74c1dd426077d1b8b9500534b380f Reviewed-by: Thomas Hartmann --- src/plugins/qmldesigner/designmodewidget.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/plugins/qmldesigner/designmodewidget.cpp b/src/plugins/qmldesigner/designmodewidget.cpp index a434d5d866c..29bb90f51fe 100644 --- a/src/plugins/qmldesigner/designmodewidget.cpp +++ b/src/plugins/qmldesigner/designmodewidget.cpp @@ -244,16 +244,23 @@ void DesignModeWidget::setup() // Setup Actions and Menus Core::ActionContainer *mwindow = Core::ActionManager::actionContainer(Core::Constants::M_WINDOW); // Window > Views - Core::ActionContainer *mviews = Core::ActionManager::createMenu(Core::Constants::M_WINDOW_VIEWS); + Core::ActionContainer *mviews = Core::ActionManager::actionContainer(Core::Constants::M_WINDOW_VIEWS); mviews->menu()->addSeparator(); // Window > Workspaces Core::ActionContainer *mworkspaces = Core::ActionManager::createMenu(QmlDesigner::Constants::M_WINDOW_WORKSPACES); mwindow->addMenu(mworkspaces, Core::Constants::G_WINDOW_VIEWS); mworkspaces->menu()->setTitle(tr("&Workspaces")); - mworkspaces->setOnAllDisabledBehavior(Core::ActionContainer::Show); // TODO what does it exactly do?! - - // Connect opening of the 'window' menu with creation of the workspaces menu - connect(mwindow->menu(), &QMenu::aboutToShow, this, &DesignModeWidget::aboutToShowWorkspaces); + mworkspaces->setOnAllDisabledBehavior(Core::ActionContainer::Show); + // Connect opening of the 'workspaces' menu with creation of the workspaces menu + connect(mworkspaces->menu(), &QMenu::aboutToShow, this, &DesignModeWidget::aboutToShowWorkspaces); + // Disable workspace menu when context is different to C_DESIGN_MODE + connect(Core::ICore::instance(), &Core::ICore::contextChanged, + this, [mworkspaces](const Core::Context &context){ + if (context.contains(Core::Constants::C_DESIGN_MODE)) + mworkspaces->menu()->setEnabled(true); + else + mworkspaces->menu()->setEnabled(false); + }); // Create a DockWidget for each QWidget and add them to the DockManager const Core::Context designContext(Core::Constants::C_DESIGN_MODE); From ce3103194f3f08c0482e47ce599234db04f93a14 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 6 Mar 2020 16:38:24 +0100 Subject: [PATCH 04/25] CppTools: Fix code model with clang and precompiled headers Amends a1d22fd2f7. Fixes: QTCREATORBUG-22897 Change-Id: Iaadf72d78e11279c8dd553860e00be9d29135752 Reviewed-by: Cristian Adam --- src/plugins/cpptools/compileroptionsbuilder.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index fcce3d6cc5c..e559a8400cf 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -341,19 +341,17 @@ void CompilerOptionsBuilder::addHeaderPathOptions() void CompilerOptionsBuilder::addPrecompiledHeaderOptions(UsePrecompiledHeaders usePrecompiledHeaders) { for (const QString &pchFile : m_projectPart.precompiledHeaders) { - // Bail if build system precomiple header artifacts exists + // Bail if build system precompiled header artifacts exists. // Clang cannot handle foreign PCH files. - if (QFile::exists(pchFile + ".gch") || QFile::exists(pchFile + ".pch")) { + if (QFile::exists(pchFile + ".gch") || QFile::exists(pchFile + ".pch")) usePrecompiledHeaders = UsePrecompiledHeaders::No; - // In case of Clang compilers, remove the pch-inclusion arguments - remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".gch"}); - remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".pch"}); - } - if (usePrecompiledHeaders == UsePrecompiledHeaders::No) { // CMake PCH will already have force included the header file in // command line options, remove it if exists. + // In case of Clang compilers, also remove the pch-inclusion arguments. + remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".gch"}); + remove({"-Xclang", "-include-pch", "-Xclang", pchFile + ".pch"}); remove({isClStyle() ? QLatin1String(includeFileOptionCl) : QLatin1String(includeFileOptionGcc), pchFile}); } else if (QFile::exists(pchFile)) { From dc2abffe6023dfa99a6d9725e129eeeabaa3b5ab Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Fri, 6 Mar 2020 16:38:47 +0100 Subject: [PATCH 05/25] QmlDesigner: Fix crash on shutdown Task-number: QDS-1749 Change-Id: I0ddfcc98080de0bdf2f620fdad387b3a4a582c4e Reviewed-by: Thomas Hartmann --- .../components/timelineeditor/timelinetoolbar.cpp | 8 ++++---- .../components/timelineeditor/timelinetoolbar.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp index 4c4e1e38f08..ea065e49a15 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp @@ -104,10 +104,10 @@ QAction *createAction(const Core::Id &id, TimelineToolBar::TimelineToolBar(QWidget *parent) : QToolBar(parent) , m_grp() - , m_dialog(Core::ICore::dialogParent()) + , m_dialog(new AnimationCurveDialog(Core::ICore::dialogParent())) , m_curveModel(new AnimationCurveEditorModel(0., 500.)) { - m_dialog.setModel(m_curveModel); + m_dialog->setModel(m_curveModel); connect(m_curveModel, &AnimationCurveEditorModel::currentFrameChanged, this, @@ -232,9 +232,9 @@ void TimelineToolBar::openAnimationCurveEditor() timeline = tlv->timelineForState(tlv->currentState()); } - m_dialog.refresh(); + m_dialog->refresh(); m_curveModel->setTimeline(timeline); - m_dialog.show(); + m_dialog->show(); } void TimelineToolBar::updateCurve(DesignTools::PropertyTreeItem *item) diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.h b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.h index a95af873daf..6f275484b4a 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.h +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.h @@ -105,7 +105,7 @@ private: QList m_grp; - AnimationCurveDialog m_dialog; + AnimationCurveDialog *m_dialog = nullptr; AnimationCurveEditorModel *m_curveModel = nullptr; From 6de4e496466d6eecdfd3191f36bd6fba20347fdb Mon Sep 17 00:00:00 2001 From: Aleksei German Date: Fri, 6 Mar 2020 14:12:00 +0100 Subject: [PATCH 06/25] QmlDesigner: Fix Add State Button spacing Task: QDS-300 Change-Id: I3c69e9b3871a8879137d25c92cbef3c1a4ae9e8b Reviewed-by: Thomas Hartmann --- .../qtcreator/qmldesigner/statesEditorQmlSources/StatesList.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesList.qml b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesList.qml index f15d5e186d7..a1fce752bdd 100644 --- a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesList.qml +++ b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesList.qml @@ -88,7 +88,7 @@ FocusScope { Item { id: addStateItem - property int buttonLeftSpacing: 0 + property int buttonLeftSpacing: 8 * (expanded ? 1 : 2) anchors.right: parent.right width: delegateHeight / 2 + buttonLeftSpacing From 73aaa2a38119b48c187fff2e9170ec900a77f91a Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Mon, 9 Mar 2020 08:30:17 +0100 Subject: [PATCH 07/25] ADS: Hide detached window if not in design mode Task-number: QDS-1672 Change-Id: Ia20113cb9025c19194d87920cf060d2b9791e52a Reviewed-by: Thomas Hartmann --- src/libs/advanceddockingsystem/dockmanager.cpp | 14 ++++++++++++++ src/libs/advanceddockingsystem/dockmanager.h | 3 +++ src/plugins/qmldesigner/designmodewidget.cpp | 18 ++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/src/libs/advanceddockingsystem/dockmanager.cpp b/src/libs/advanceddockingsystem/dockmanager.cpp index 80e45881256..39b7062c098 100644 --- a/src/libs/advanceddockingsystem/dockmanager.cpp +++ b/src/libs/advanceddockingsystem/dockmanager.cpp @@ -98,6 +98,7 @@ namespace ADS bool m_autorestoreLastWorkspace; // This option is set in the Workspace Manager! QSettings *m_settings = nullptr; QString m_workspacePresetsPath; + bool m_modeChangeState; /** * Private data constructor @@ -576,6 +577,9 @@ namespace ADS bool DockManager::save() { + if (isModeChangeState()) + return false; + emit aboutToSaveWorkspace(); bool result = write(activeWorkspace(), saveState(), parentWidget()); @@ -836,6 +840,16 @@ namespace ADS return result; } + void DockManager::setModeChangeState(bool value) + { + d->m_modeChangeState = value; + } + + bool DockManager::isModeChangeState() const + { + return d->m_modeChangeState; + } + bool DockManager::write(const QString &workspace, const QByteArray &data, QString *errorString) const { Utils::FilePath filename = workspaceNameToFileName(workspace); diff --git a/src/libs/advanceddockingsystem/dockmanager.h b/src/libs/advanceddockingsystem/dockmanager.h index e52646437f9..a987a1977b3 100644 --- a/src/libs/advanceddockingsystem/dockmanager.h +++ b/src/libs/advanceddockingsystem/dockmanager.h @@ -473,6 +473,9 @@ public: bool isWorkspacePreset(const QString &workspace) const; + void setModeChangeState(bool value); + bool isModeChangeState() const; + signals: void aboutToUnloadWorkspace(QString workspaceName); void aboutToLoadWorkspace(QString workspaceName); diff --git a/src/plugins/qmldesigner/designmodewidget.cpp b/src/plugins/qmldesigner/designmodewidget.cpp index 29bb90f51fe..d92bf6f6b3c 100644 --- a/src/plugins/qmldesigner/designmodewidget.cpp +++ b/src/plugins/qmldesigner/designmodewidget.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -381,6 +382,23 @@ void DesignModeWidget::setup() setupNavigatorHistory(currentDesignDocument()->textEditor()); m_dockManager->initialize(); + + connect(Core::ModeManager::instance(), &Core::ModeManager::currentModeChanged, + this, [this](Core::Id mode, Core::Id oldMode) { + if (mode == Core::Constants::MODE_DESIGN) { + m_dockManager->reloadActiveWorkspace(); + m_dockManager->setModeChangeState(false); + } + + if (oldMode == Core::Constants::MODE_DESIGN + && mode != Core::Constants::MODE_DESIGN) { + m_dockManager->save(); + m_dockManager->setModeChangeState(true); + for (auto floatingWidget : m_dockManager->floatingWidgets()) + floatingWidget->hide(); + } + }); + viewManager().enableWidgets(); readSettings(); show(); From 9abd96e38f37af805ae8e3fd17140f473c8bc0e3 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 9 Mar 2020 13:35:53 +0200 Subject: [PATCH 08/25] QmlDesigner: Fix edit 3D view tool state initialization Edit 3D view tool state is now always initialized to a stored "no scene" state if one exists to ensure further scene changes properly inherit the tool state in all cases. Change-Id: Ifee5fe58255b51d9dbed57abb2020ea00d94af2c Fixes: QDS-1750 Reviewed-by: Mahmoud Badri --- .../qml/qmlpuppet/mockfiles/EditView3D.qml | 38 +++++++++++-------- .../qml/qmlpuppet/mockfiles/SceneView3D.qml | 2 +- .../qt5informationnodeinstanceserver.cpp | 8 ++++ 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml index 4710f3b87bc..3c2742c409d 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml @@ -65,15 +65,8 @@ Item { onGlobalOrientationChanged: _generalHelper.storeToolState(sceneId, "globalOrientation", globalOrientation) onActiveSceneChanged: updateActiveScene() - function updateActiveScene() + function createEditView() { - if (editView) { - // Destroy is async, so make sure we don't get any more updates for the old editView - _generalHelper.enableItemUpdate(editView, false); - editView.destroy(); - } - - // importScene cannot be updated after initial set, so we need to reconstruct entire View3D var component = Qt.createComponent("SceneView3D.qml"); if (component.status === Component.Ready) { editView = component.createObject(viewRect, @@ -87,7 +80,21 @@ Item { editView.cameraZoomFactor = Qt.binding(function() {return cameraControl._zoomFactor;}); selectionBoxes.length = 0; + return true; + } + return false; + } + function updateActiveScene() + { + if (editView) { + // Destroy is async, so make sure we don't get any more updates for the old editView + _generalHelper.enableItemUpdate(editView, false); + editView.destroy(); + } + + // importScene cannot be updated after initial set, so we need to reconstruct entire View3D + if (createEditView()) { if (activeScene) { var toolStates = _generalHelper.getToolStates(sceneId); if (Object.keys(toolStates).length > 0) @@ -381,10 +388,11 @@ Item { } } - // Work-around the fact that the projection matrix for the camera is not calculated until - // the first frame is rendered, so any initial calls to mapFrom3DScene() will fail. Component.onCompleted: { + createEditView(); selectObjects([]); + // Work-around the fact that the projection matrix for the camera is not calculated until + // the first frame is rendered, so any initial calls to mapFrom3DScene() will fail. _generalHelper.requestOverlayUpdate(); } @@ -396,10 +404,10 @@ Item { PerspectiveCamera { id: overlayPerspectiveCamera - clipFar: viewRoot.editView ? viewRoot.editView.perpectiveCamera.clipFar : 1000 - clipNear: viewRoot.editView ? viewRoot.editView.perpectiveCamera.clipNear : 1 - position: viewRoot.editView ? viewRoot.editView.perpectiveCamera.position : Qt.vector3d(0, 0, 0) - rotation: viewRoot.editView ? viewRoot.editView.perpectiveCamera.rotation : Qt.quaternion(1, 0, 0, 0) + clipFar: viewRoot.editView ? viewRoot.editView.perspectiveCamera.clipFar : 1000 + clipNear: viewRoot.editView ? viewRoot.editView.perspectiveCamera.clipNear : 1 + position: viewRoot.editView ? viewRoot.editView.perspectiveCamera.position : Qt.vector3d(0, 0, 0) + rotation: viewRoot.editView ? viewRoot.editView.perspectiveCamera.rotation : Qt.quaternion(1, 0, 0, 0) } OrthographicCamera { @@ -538,7 +546,7 @@ Item { View3D { id: overlayView anchors.fill: parent - camera: usePerspective ? overlayPerspectiveCamera : overlayOrthoCamera + camera: viewRoot.usePerspective ? overlayPerspectiveCamera : overlayOrthoCamera importScene: overlayScene z: 2 } diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/SceneView3D.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/SceneView3D.qml index e44e9d95128..72608d20b8f 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/SceneView3D.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/SceneView3D.qml @@ -33,7 +33,7 @@ View3D { property bool usePerspective: false property bool showSceneLight: false property alias sceneHelpers: sceneHelpers - property alias perpectiveCamera: scenePerspectiveCamera + property alias perspectiveCamera: scenePerspectiveCamera property alias orthoCamera: sceneOrthoCamera property double cameraZoomFactor: .55; diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index eaea9911dbf..83fd85202af 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -818,6 +818,14 @@ void Qt5InformationNodeInstanceServer::setup3DEditView(const QList Date: Thu, 5 Mar 2020 09:47:02 +0100 Subject: [PATCH 09/25] AutoTest: Fix enabled state of framework root Do not evaluate the invisible root as it is not a real test tree item. Change-Id: I944c1ac2f8ed3ff47cd8036ebf8fd8319e05e1ab Reviewed-by: David Schulz --- src/plugins/autotest/boost/boosttesttreeitem.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/autotest/boost/boosttesttreeitem.cpp b/src/plugins/autotest/boost/boosttesttreeitem.cpp index f82ff942bba..995331f625a 100644 --- a/src/plugins/autotest/boost/boosttesttreeitem.cpp +++ b/src/plugins/autotest/boost/boosttesttreeitem.cpp @@ -337,6 +337,9 @@ bool BoostTestTreeItem::enabled() const if (m_state & Disabled) return false; + if (type() == Root) + return true; + const TestTreeItem *parent = parentItem(); if (parent && parent->type() == TestSuite) // take test suites into account return static_cast(parent)->enabled(); From aaa9a5151198fefb63fdcfe9c56cbed5ea51e0cc Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Mon, 9 Mar 2020 08:46:05 +0100 Subject: [PATCH 10/25] ADS: Fix QHash unite warning for 5.15 Change-Id: I384f810bd15ec0c0b191dcdd0654f089de9e8ecb Reviewed-by: Thomas Hartmann --- src/libs/advanceddockingsystem/workspacemodel.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libs/advanceddockingsystem/workspacemodel.cpp b/src/libs/advanceddockingsystem/workspacemodel.cpp index 08d12966734..04ff7b4c757 100644 --- a/src/libs/advanceddockingsystem/workspacemodel.cpp +++ b/src/libs/advanceddockingsystem/workspacemodel.cpp @@ -166,7 +166,14 @@ QHash WorkspaceModel::roleNames() const {PresetWorkspaceRole, "presetWorkspace"}, {LastWorkspaceRole, "activeWorkspace"}, {ActiveWorkspaceRole, "lastWorkspace"}}; + +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + auto defaultRoles = QAbstractTableModel::roleNames(); + defaultRoles.insert(extraRoles); + return defaultRoles; +#else return QAbstractTableModel::roleNames().unite(extraRoles); +#endif } void WorkspaceModel::sort(int column, Qt::SortOrder order) From 7f1c1baf8c5c88cd4c40cffd35299bde3c915c72 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 9 Mar 2020 12:46:15 +0100 Subject: [PATCH 11/25] ProjectExplorer: Register the "QtKeywordsEnabled" macro in time It was used in the header template before we made it known to the wizard. Fixes: QTCREATORBUG-23603 Change-Id: I4b0f77c199aa22cc1b9853657695cdb10b96faad Reviewed-by: Eike Ziller --- src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp index e750dd59ea5..ab99fa4de97 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp @@ -49,6 +49,7 @@ static char KEY_SELECTED_PROJECT[] = "SelectedProject"; static char KEY_SELECTED_NODE[] = "SelectedFolderNode"; static char KEY_IS_SUBPROJECT[] = "IsSubproject"; static char KEY_VERSIONCONTROL[] = "VersionControl"; +static char KEY_QT_KEYWORDS_ENABLED[] = "QtKeywordsEnabled"; namespace ProjectExplorer { @@ -105,6 +106,7 @@ void JsonSummaryPage::initializePage() m_wizard->setValue(QLatin1String(KEY_SELECTED_NODE), QVariant()); m_wizard->setValue(QLatin1String(KEY_IS_SUBPROJECT), false); m_wizard->setValue(QLatin1String(KEY_VERSIONCONTROL), QString()); + m_wizard->setValue(QLatin1String(KEY_QT_KEYWORDS_ENABLED), false); connect(m_wizard, &JsonWizard::filesReady, this, &JsonSummaryPage::triggerCommit); connect(m_wizard, &JsonWizard::filesReady, this, &JsonSummaryPage::addToProject); @@ -270,7 +272,7 @@ void JsonSummaryPage::updateProjectData(FolderNode *node) projectNode = projectNode->parentProjectNode(); } } - m_wizard->setValue("QtKeywordsEnabled", qtKeyWordsEnabled); + m_wizard->setValue(QLatin1String(KEY_QT_KEYWORDS_ENABLED), qtKeyWordsEnabled); updateFileList(); } From 74eaa8f8832692cbd80e60754ecd85436e957cdd Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Mon, 9 Mar 2020 08:25:03 +0100 Subject: [PATCH 12/25] ADS: Integrate newest base repository commits f3c5d5138024acfb0991fa1794da70a19240c820 fe10b570d3c17eaaf7c4c67e4cf7d56550e6e9e4 4cb1931acec0ce21e0ebc38742b3d4f1c066e368 59c783831ad23238e41205a5da854a9eb39ce777 - Fix reception of escape key press events - Fix display of container dock overlay - Fix comments Change-Id: I34387046335b3d57434decd5714da7ae307bcc05 Reviewed-by: Thomas Hartmann --- src/libs/advanceddockingsystem/dockmanager.h | 8 +++++--- .../floatingdragpreview.cpp | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/libs/advanceddockingsystem/dockmanager.h b/src/libs/advanceddockingsystem/dockmanager.h index a987a1977b3..506335714e0 100644 --- a/src/libs/advanceddockingsystem/dockmanager.h +++ b/src/libs/advanceddockingsystem/dockmanager.h @@ -151,8 +151,8 @@ public: using Super = DockContainerWidget; /** - * These global configuration flags configure some global dock manager - * settings. + * These global configuration flags configure some global dock manager settings. + * Set the dock manager flags, before you create the dock manager instance. */ enum eConfigFlag { ActiveTabHasCloseButton @@ -238,12 +238,14 @@ public: /** * Sets the global configuration flags for the whole docking system. - * Call this function before you create your first dock widget. + * Call this function before you create the dock manager and before + * your create the first dock widget. */ static void setConfigFlags(const ConfigFlags flags); /** * Set a certain config flag + * \see setConfigFlags() */ static void setConfigFlag(eConfigFlag flag, bool on = true); diff --git a/src/libs/advanceddockingsystem/floatingdragpreview.cpp b/src/libs/advanceddockingsystem/floatingdragpreview.cpp index 33e0a5ac346..5732ae408e3 100644 --- a/src/libs/advanceddockingsystem/floatingdragpreview.cpp +++ b/src/libs/advanceddockingsystem/floatingdragpreview.cpp @@ -68,6 +68,7 @@ namespace ADS DockContainerWidget *m_dropContainer = nullptr; bool m_hidden = false; QPixmap m_contentPreviewPixmap; + bool m_canceled = false; /** * Private data constructor @@ -86,6 +87,7 @@ namespace ADS */ void cancelDragging() { + m_canceled = true; emit q->draggingCanceled(); m_dockManager->containerOverlay()->hideOverlay(); m_dockManager->dockAreaOverlay()->hideOverlay(); @@ -149,6 +151,12 @@ namespace ADS } } else { dockAreaOverlay->hideOverlay(); + // If there is only one single visible dock area in a container, then + // it does not make sense to show a dock overlay because the dock area + // would be removed and inserted at the same position + if (visibleDockAreas <= 1) + containerOverlay->hide(); + if (dockArea == m_contentSourceArea && InvalidDockWidgetArea == containerDropArea) m_dropContainer = nullptr; } @@ -195,9 +203,9 @@ namespace ADS &QApplication::applicationStateChanged, this, &FloatingDragPreview::onApplicationStateChanged); - // The focused object will receive key press events and therefore we install - // the event filter on it to receive escape key press for drag canceling - QApplication::focusObject()->installEventFilter(this); + // The only safe way to receive escape key presses is to install an event + // filter for the application object + QApplication::instance()->installEventFilter(this); } FloatingDragPreview::FloatingDragPreview(DockWidget *content) @@ -329,7 +337,7 @@ namespace ADS bool FloatingDragPreview::eventFilter(QObject *watched, QEvent *event) { - if (event->type() == QEvent::KeyPress) { + if (!d->m_canceled && event->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast(event); if (keyEvent->key() == Qt::Key_Escape) { watched->removeEventFilter(this); From 9d4a6092d2632ac672c36f717afaea06c259d4df Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Mon, 9 Mar 2020 15:05:13 +0100 Subject: [PATCH 13/25] ADS: Fix Preset sync failure if directory missing Change-Id: I23ed2a12753058b36a708c9aff64291782b73809 Reviewed-by: Thomas Hartmann --- src/libs/advanceddockingsystem/dockmanager.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/libs/advanceddockingsystem/dockmanager.cpp b/src/libs/advanceddockingsystem/dockmanager.cpp index 39b7062c098..6adce0111ad 100644 --- a/src/libs/advanceddockingsystem/dockmanager.cpp +++ b/src/libs/advanceddockingsystem/dockmanager.cpp @@ -909,7 +909,13 @@ namespace ADS // Copy all missing workspace presets over to the local workspace folder QDir presetsDir(d->m_workspacePresetsPath); - QDir workspaceDir(QFileInfo(d->m_settings->fileName()).path() + QLatin1String("/workspaces")); + QDir workspaceDir(QFileInfo(d->m_settings->fileName()).path() + QLatin1Char('/') + m_dirName); + // Try do create the 'workspaces' directory if it doesn't exist already + workspaceDir.mkpath(workspaceDir.absolutePath()); + if (!workspaceDir.exists()) { + qCInfo(adsLog) << QString("Could not make directory '%1')").arg(workspaceDir.absolutePath()); + return; + } for (const auto &preset : presets) { QString filename = preset; @@ -920,7 +926,10 @@ namespace ADS QFile file(filePath); if (file.exists()) { - file.copy(workspaceDir.filePath(filename)); + if (!file.copy(workspaceDir.filePath(filename))) { + qCInfo(adsLog) << QString("Could not copy '%1' to '%2' error: %3").arg( + filePath, workspaceDir.filePath(filename), file.errorString()); + } d->m_workspaceListDirty = true; } } From 8652188ac9beb65ac78999c679d945a698a70c85 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 4 Mar 2020 19:59:50 +0100 Subject: [PATCH 14/25] McuSupport: Restructure UI to reflect the data hierarchy 1) User selects the Qt for MCUs sdk dir 2) User chooses which board to configure 3) User provides paths for dependencies 4) User creates Kit Change-Id: Ia30ca7e245e2500c7650d12ea6768ab6e60d99c7 Reviewed-by: Alessandro Portale --- src/plugins/mcusupport/mcusupportoptions.cpp | 20 +++-- .../mcusupport/mcusupportoptionspage.cpp | 76 ++++++++++++------- 2 files changed, 61 insertions(+), 35 deletions(-) diff --git a/src/plugins/mcusupport/mcusupportoptions.cpp b/src/plugins/mcusupport/mcusupportoptions.cpp index d13e2e018d8..a9839965416 100644 --- a/src/plugins/mcusupport/mcusupportoptions.cpp +++ b/src/plugins/mcusupport/mcusupportoptions.cpp @@ -462,11 +462,10 @@ McuSupportOptions::McuSupportOptions(QObject *parent) McuPackage* seggerJLinkPackage = createSeggerJLinkPackage(); QVector stmEvalPackages = { - armGccPackage, stm32CubeProgrammerPackage, qtForMCUsSdkPackage}; + armGccPackage, stm32CubeProgrammerPackage}; QVector nxpEvalPackages = { - armGccPackage, seggerJLinkPackage, qtForMCUsSdkPackage}; - QVector desktopPackages = { - qtForMCUsSdkPackage}; + armGccPackage, seggerJLinkPackage}; + QVector desktopPackages = {}; packages = { armGccPackage, stm32CubeFwF7SdkPackage, stm32CubeProgrammerPackage, evkbImxrt1050SdkPackage, seggerJLinkPackage, qtForMCUsSdkPackage}; @@ -564,13 +563,20 @@ static void setKitDevice(ProjectExplorer::Kit *k) ProjectExplorer::DeviceTypeKitAspect::setDeviceTypeId(k, Constants::DEVICE_TYPE); } -static void setKitEnvironment(ProjectExplorer::Kit *k, const McuTarget* mcuTarget) +static void setKitEnvironment(ProjectExplorer::Kit *k, const McuTarget* mcuTarget, + McuPackage *qtForMCUsSdkPackage) { using namespace ProjectExplorer; Utils::EnvironmentItems changes; QStringList pathAdditions; - for (auto package : mcuTarget->packages()) { + + QVector packagesIncludingSdk; + packagesIncludingSdk.reserve(mcuTarget->packages().size() + 1); + packagesIncludingSdk.append(mcuTarget->packages()); + packagesIncludingSdk.append(qtForMCUsSdkPackage); + + for (auto package : packagesIncludingSdk) { if (package->addToPath()) pathAdditions.append(QDir::toNativeSeparators(package->path())); if (!package->environmentVariableName().isEmpty()) @@ -646,7 +652,7 @@ ProjectExplorer::Kit *McuSupportOptions::newKit(const McuTarget *mcuTarget) setKitDebugger(k, mcuTarget->toolChainPackage()); setKitDevice(k); } - setKitEnvironment(k, mcuTarget); + setKitEnvironment(k, mcuTarget, qtForMCUsSdkPackage); setKitCMakeOptions(k, mcuTarget, qtForMCUsSdkPackage->path()); k->setup(); diff --git a/src/plugins/mcusupport/mcusupportoptionspage.cpp b/src/plugins/mcusupport/mcusupportoptionspage.cpp index 5d72fd819df..18356fec399 100644 --- a/src/plugins/mcusupport/mcusupportoptionspage.cpp +++ b/src/plugins/mcusupport/mcusupportoptionspage.cpp @@ -74,48 +74,62 @@ private: QMap m_packageWidgets; QMap m_mcuTargetPacketWidgets; QFormLayout *m_packagesLayout = nullptr; - Utils::InfoLabel *m_infoLabel = nullptr; - QComboBox *m_mcuTargetComboBox = nullptr; + QGroupBox *m_qtForMCUsSdkGroupBox = nullptr; + QGroupBox *m_packagesGroupBox = nullptr; + QGroupBox *m_mcuTargetsGroupBox = nullptr; + QComboBox *m_mcuTargetsComboBox = nullptr; + QGroupBox *m_kitCreationGroupBox = nullptr; + Utils::InfoLabel *m_kitCreationInfoLabel = nullptr; }; McuSupportOptionsWidget::McuSupportOptionsWidget() { auto mainLayout = new QVBoxLayout(this); - auto mcuTargetChooserlayout = new QHBoxLayout; - auto mcuTargetChooserLabel = new QLabel(tr("Target:")); - mcuTargetChooserlayout->addWidget(mcuTargetChooserLabel); - m_mcuTargetComboBox = new QComboBox; - mcuTargetChooserLabel->setBuddy(m_mcuTargetComboBox); - mcuTargetChooserLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); - m_mcuTargetComboBox->addItems( + m_qtForMCUsSdkGroupBox = new QGroupBox(m_options.qtForMCUsSdkPackage->label()); + m_qtForMCUsSdkGroupBox->setFlat(true); + auto qtForMCUsSdkGroupBoxLayout = new QVBoxLayout(m_qtForMCUsSdkGroupBox); + qtForMCUsSdkGroupBoxLayout->addWidget(m_options.qtForMCUsSdkPackage->widget()); + mainLayout->addWidget(m_qtForMCUsSdkGroupBox); + + m_mcuTargetsGroupBox = new QGroupBox(tr("Targets supported by the %1") + .arg(m_qtForMCUsSdkGroupBox->title())); + m_mcuTargetsGroupBox->setFlat(true); + mainLayout->addWidget(m_mcuTargetsGroupBox); + auto qtForMCUsTargetsGroupBoxLayout = new QVBoxLayout(m_mcuTargetsGroupBox); + m_mcuTargetsComboBox = new QComboBox; + m_mcuTargetsComboBox->addItems( Utils::transform(m_options.mcuTargets, [this](McuTarget *t){ return m_options.kitName(t); })); - mcuTargetChooserlayout->addWidget(m_mcuTargetComboBox); - mainLayout->addLayout(mcuTargetChooserlayout); + qtForMCUsTargetsGroupBoxLayout->addWidget(m_mcuTargetsComboBox); - auto m_packagesGroupBox = new QGroupBox(tr("Packages")); + m_packagesGroupBox = new QGroupBox(tr("Requirements")); + m_packagesGroupBox->setFlat(true); mainLayout->addWidget(m_packagesGroupBox); m_packagesLayout = new QFormLayout; m_packagesGroupBox->setLayout(m_packagesLayout); + m_kitCreationGroupBox = new QGroupBox(tr("Create a Kit")); + m_kitCreationGroupBox->setFlat(true); + mainLayout->addWidget(m_kitCreationGroupBox); + auto kitCreationGroupBoxLayout = new QVBoxLayout(m_kitCreationGroupBox); + m_kitCreationInfoLabel = new Utils::InfoLabel; + m_kitCreationInfoLabel->setOpenExternalLinks(false); + m_kitCreationInfoLabel->setElideMode(Qt::ElideNone); + m_kitCreationInfoLabel->setWordWrap(true); + kitCreationGroupBoxLayout->addWidget(m_kitCreationInfoLabel); + mainLayout->addStretch(); - m_infoLabel = new Utils::InfoLabel; - m_infoLabel->setOpenExternalLinks(false); - m_infoLabel->setElideMode(Qt::ElideNone); - m_infoLabel->setWordWrap(true); - mainLayout->addWidget(m_infoLabel); - connect(&m_options, &McuSupportOptions::changed, this, &McuSupportOptionsWidget::updateStatus); - connect(m_mcuTargetComboBox, &QComboBox::currentTextChanged, + connect(m_mcuTargetsComboBox, &QComboBox::currentTextChanged, this, &McuSupportOptionsWidget::showMcuTargetPackages); - connect(m_infoLabel, &QLabel::linkActivated, this, []{ - Core::ICore::showOptionsDialog( - CMakeProjectManager::Constants::CMAKE_SETTINGSPAGE_ID, - Core::ICore::mainWindow()); - }); + connect(m_kitCreationInfoLabel, &QLabel::linkActivated, this, []{ + Core::ICore::showOptionsDialog( + CMakeProjectManager::Constants::CMAKE_SETTINGSPAGE_ID, + Core::ICore::mainWindow()); + }); showMcuTargetPackages(); } @@ -126,8 +140,13 @@ void McuSupportOptionsWidget::updateStatus() if (!mcuTarget) return; - m_infoLabel->setType(cMakeAvailable() && mcuTarget->isValid() - ? Utils::InfoLabel::Ok : Utils::InfoLabel::NotOk); + m_kitCreationInfoLabel->setType(cMakeAvailable() && mcuTarget->isValid() + ? Utils::InfoLabel::Ok : Utils::InfoLabel::NotOk); + + const bool sdkValid = m_options.qtForMCUsSdkPackage->status() == McuPackage::ValidPackage; + m_mcuTargetsGroupBox->setVisible(sdkValid); + m_packagesGroupBox->setVisible(sdkValid && !mcuTarget->packages().isEmpty()); + m_kitCreationGroupBox->setVisible(sdkValid); QStringList errorStrings; if (!mcuTarget->isValid()) @@ -136,7 +155,8 @@ void McuSupportOptionsWidget::updateStatus() errorStrings << "No CMake tool was detected. Add a CMake tool in the " "CMake options and press Apply."; - m_infoLabel->setText(errorStrings.isEmpty() + m_kitCreationInfoLabel->setText( + errorStrings.isEmpty() ? QString::fromLatin1("A kit %1 for the selected target can be generated. " "Press Apply to generate it.").arg(m_options.kitName( mcuTarget)) @@ -168,7 +188,7 @@ void McuSupportOptionsWidget::showMcuTargetPackages() McuTarget *McuSupportOptionsWidget::currentMcuTarget() const { - const int mcuTargetIndex = m_mcuTargetComboBox->currentIndex(); + const int mcuTargetIndex = m_mcuTargetsComboBox->currentIndex(); return m_options.mcuTargets.isEmpty() ? nullptr : m_options.mcuTargets.at(mcuTargetIndex); } From 233c438a2d9e273703104a5319a9f83db73a0f57 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 9 Mar 2020 16:44:13 +0100 Subject: [PATCH 15/25] QbsProjectManager: Consider cpp.platformDefines for the code model Fixes: QTCREATORBUG-19537 Change-Id: Ia51441491913da0f7b31c2ff02e2552ff58147f3 Reviewed-by: Christian Stenger --- src/plugins/qbsprojectmanager/qbsproject.cpp | 4 +++- src/plugins/qbsprojectmanager/qbssession.cpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index f0de5fe9522..08e65445cb4 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -888,7 +888,9 @@ static RawProjectParts generateProjectParts( rpp.setFlagsForC({cToolChain.get(), cFlags}); rpp.setFlagsForCxx({cxxToolChain.get(), cxxFlags}); - rpp.setMacros(transform(arrayToStringList(props.value("cpp.defines")), + const QStringList defines = arrayToStringList(props.value("cpp.defines")) + + arrayToStringList(props.value("cpp.platformDefines")); + rpp.setMacros(transform(defines, [](const QString &s) { return Macro::fromKeyValue(s); })); ProjectExplorer::HeaderPaths grpHeaderPaths; diff --git a/src/plugins/qbsprojectmanager/qbssession.cpp b/src/plugins/qbsprojectmanager/qbssession.cpp index 5ba4b84c5a8..14cdea8095f 100644 --- a/src/plugins/qbsprojectmanager/qbssession.cpp +++ b/src/plugins/qbsprojectmanager/qbssession.cpp @@ -392,6 +392,7 @@ void QbsSession::insertRequestedModuleProperties(QJsonObject &request) "cpp.minimumDarwinVersionCompilerFlag", "cpp.platformCommonCompilerFlags", "cpp.platformDriverFlags", + "cpp.platformDefines", "cpp.positionIndependentCode", "cpp.systemFrameworkPaths", "cpp.systemIncludePaths", From 7c7c5d5a4fb5011aa1328508943b7d2d50874b07 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 9 Mar 2020 16:12:49 +0100 Subject: [PATCH 16/25] Add changes file for 4.11.2 Change-Id: I6bd6bc3e682c13ca562bcf33f458444e8f74b353 Reviewed-by: Leena Miettinen --- dist/changes-4.11.2.md | 54 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 dist/changes-4.11.2.md diff --git a/dist/changes-4.11.2.md b/dist/changes-4.11.2.md new file mode 100644 index 00000000000..0e0ba506a42 --- /dev/null +++ b/dist/changes-4.11.2.md @@ -0,0 +1,54 @@ +Qt Creator 4.11.2 +================= + +Qt Creator version 4.11.2 contains bug fixes. + +The most important changes are listed in this document. For a complete +list of changes, see the Git log for the Qt Creator sources that +you can check out from the public Git repository. For example: + + git clone git://code.qt.io/qt-creator/qt-creator.git + git log --cherry-pick --pretty=oneline origin/v4.11.1..v4.11.2 + +Editing +------- + +* Improved performance of highlighting (QTCREATORBUG-23281) +* Fixed that `Rewrap Paragraph` split on non-breaking space (QTCREATORBUG-23643) +* Fixed freeze with block selection (QTCREATORBUG-23622) +* Fixed high CPU usage after scrolling horizontally (QTCREATORBUG-23647) +* Fixed scroll position after splitting if text cursor is not visible +* Fixed position of markers in scrollbar for long documents (QTCREATORBUG-23660) + +### Python + +* Fixed warnings in files generated by Python file wizard + +### Language Client + +* Fixed issue with server restart after server crash (QTCREATORBUG-23648) + +Projects +-------- + +* Fixed wrong default project for adding files via wizards (QTCREATORBUG-23603) + +Platforms +--------- + +### macOS + +* Fixed issues with notarization of binary package + +Credits for these changes go to: +-------------------------------- + +André Pönitz +Andy Shaw +Christian Kandeler +David Schulz +Eike Ziller +Leena Miettinen +Orgad Shaneh +Richard Weickelt +Tobias Hunger From 8914d8565e2638a09d183ce9a6d33853f6ee2919 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 10 Mar 2020 10:54:33 +0100 Subject: [PATCH 17/25] ProjectExplorer: Fix memory leak in "New File" dialog Change-Id: I729392c04d2bb9e02f882d62e371e5fbc286afc4 Reviewed-by: Eike Ziller --- src/plugins/coreplugin/dialogs/newdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/dialogs/newdialog.cpp b/src/plugins/coreplugin/dialogs/newdialog.cpp index 8cb8f1770e8..eed2fd91e21 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.cpp +++ b/src/plugins/coreplugin/dialogs/newdialog.cpp @@ -198,7 +198,7 @@ NewDialog::NewDialog(QWidget *parent) : m_ui->templateCategoryView->setModel(m_filterProxyModel); m_ui->templateCategoryView->setEditTriggers(QAbstractItemView::NoEditTriggers); - m_ui->templateCategoryView->setItemDelegate(new FancyTopLevelDelegate); + m_ui->templateCategoryView->setItemDelegate(new FancyTopLevelDelegate(this)); m_ui->templatesView->setModel(m_filterProxyModel); m_ui->templatesView->setIconSize(QSize(ICON_SIZE, ICON_SIZE)); From 4a119759563adccb0e737fc569e42f90d2742e4f Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Tue, 10 Mar 2020 15:57:41 +0200 Subject: [PATCH 18/25] QmlDesigner: Update cullingMode API to QtQuick3D 5.15 specs Change-Id: Ic4fc6bbd4d2bb7e9968c337eb5775a04c1a6f59c Reviewed-by: Miikka Heikkinen --- share/qtcreator/qml/qmlpuppet/mockfiles/CameraFrustum.qml | 2 +- share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml | 2 +- share/qtcreator/qml/qmlpuppet/mockfiles/HelperGrid.qml | 8 ++++---- share/qtcreator/qml/qmlpuppet/mockfiles/Line3D.qml | 2 +- .../qtcreator/qml/qmlpuppet/mockfiles/PlanarDraggable.qml | 2 +- share/qtcreator/qml/qmlpuppet/mockfiles/SelectionBox.qml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/CameraFrustum.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/CameraFrustum.qml index f038b9b74d3..0ba02e362b9 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/CameraFrustum.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/CameraFrustum.qml @@ -50,7 +50,7 @@ Model { id: defaultMaterial emissiveColor: cameraFrustum.selected ? "#FF0000" : "#555555" lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } ] diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml index 3c2742c409d..8fab6ff0e42 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/EditView3D.qml @@ -503,7 +503,7 @@ Item { DefaultMaterial { id: lineMat lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling emissiveColor: pivotLine.color } ] diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/HelperGrid.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/HelperGrid.qml index 38ea65034b6..70e6e82ee32 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/HelperGrid.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/HelperGrid.qml @@ -49,7 +49,7 @@ Node { id: mainGridMaterial emissiveColor: "#aaaaaa" lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } ] } @@ -67,7 +67,7 @@ Node { id: subGridMaterial emissiveColor: mainGridMaterial.emissiveColor lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } ] } @@ -84,7 +84,7 @@ Node { id: vCenterLineMaterial emissiveColor: "#00a1d2" lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } ] } @@ -101,7 +101,7 @@ Node { id: hCenterLineMaterial emissiveColor: "#cb211a" lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } ] } diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/Line3D.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/Line3D.qml index b4b911a51de..79718d042f2 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/Line3D.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/Line3D.qml @@ -43,7 +43,7 @@ Node { DefaultMaterial { id: lineMat lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } ] } diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/PlanarDraggable.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/PlanarDraggable.qml index 6dce8e52086..9015a127d95 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/PlanarDraggable.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/PlanarDraggable.qml @@ -54,7 +54,7 @@ Model { id: gizmoMaterial emissiveColor: "white" lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } materials: gizmoMaterial diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/SelectionBox.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/SelectionBox.qml index 256cefa97b3..739c7a6d34b 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/SelectionBox.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/SelectionBox.qml @@ -58,7 +58,7 @@ Node { DefaultMaterial { emissiveColor: "#fff600" lighting: DefaultMaterial.NoLighting - cullingMode: Material.DisableCulling + cullMode: Material.NoCulling } ] } From 0702f65a52f05dee38ec70f2ff558752554e2467 Mon Sep 17 00:00:00 2001 From: Aleksei German Date: Fri, 6 Mar 2020 15:48:45 +0100 Subject: [PATCH 19/25] QmlDesigner: Add Default State button Added functionality to change default state from UI TASK: QDS-1747 Change-Id: I78c0a5e8f5abfc18b4dbce9e283ceb1307a537ae Reviewed-by: Thomas Hartmann --- .../statesEditorQmlSources/StatesDelegate.qml | 26 ++++++++--- .../stateseditor/stateseditormodel.cpp | 30 ++++++++++++- .../stateseditor/stateseditormodel.h | 7 ++- .../stateseditor/stateseditorview.cpp | 44 +++++++++++++++++++ .../stateseditor/stateseditorview.h | 3 ++ .../designercore/include/qmlstate.h | 3 ++ .../designercore/model/qmlstate.cpp | 18 ++++++++ 7 files changed, 123 insertions(+), 8 deletions(-) diff --git a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml index 9f525f2fc5a..135740c01de 100644 --- a/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml +++ b/share/qtcreator/qmldesigner/statesEditorQmlSources/StatesDelegate.qml @@ -39,8 +39,9 @@ Rectangle { property int delegateStateImageSize property bool delegateHasWhenCondition property string delegateWhenConditionString + readonly property bool isDefaultState: isDefault - color: baseColor + color: (isDefaultState || (isBaseState && !modelHasDefaultState)) ? Qt.lighter(baseColor, 1.5) : baseColor border.color: Theme.qmlDesignerBorderColor() function autoComplete(text, pos, explicitComplete, filter) { @@ -85,7 +86,7 @@ Rectangle { Image { id: whenButton - visible: !isBaseState && expanded + visible: !isBaseState || (isBaseState && modelHasDefaultState) width: 14 height: 14 x: 4 @@ -108,6 +109,7 @@ Rectangle { id: contextMenu MenuItem { + visible: !isBaseState text: qsTr("Set when Condition") onTriggered: { var x = whenButton.mapToGlobal(0,0).x + 4 @@ -116,20 +118,32 @@ Rectangle { bindingEditor.text = delegateWhenConditionString bindingEditor.prepareBindings() } - } MenuItem { - visible: delegateHasWhenCondition + visible: !isBaseState && delegateHasWhenCondition text: qsTr("Reset when Condition") onTriggered: { statesEditorModel.resetWhenCondition(internalNodeId) } + } + MenuItem { + visible: !isBaseState && !isDefaultState + text: qsTr("Set as Default") + onTriggered: { + statesEditorModel.setStateAsDefault(internalNodeId) + } + } + + MenuItem { + visible: (!isBaseState && isDefaultState) || (isBaseState && modelHasDefaultState) + text: qsTr("Reset Default") + onTriggered: { + statesEditorModel.resetDefaultState() + } } } - - } TextField { diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp index d5e21ebe945..f2a83d05182 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp @@ -130,6 +130,17 @@ QVariant StatesEditorModel::data(const QModelIndex &index, int role) const return QString(); } + case IsDefault: { + QmlModelState modelState(stateNode); + if (modelState.isValid()) + return modelState.isDefault(); + return false; + } + + case ModelHasDefaultState: { + return hasDefaultState(); + } + } return QVariant(); @@ -142,7 +153,9 @@ QHash StatesEditorModel::roleNames() const {StateImageSourceRole, "stateImageSource"}, {InternalNodeId, "internalNodeId"}, {HasWhenCondition, "hasWhenCondition"}, - {WhenConditionString, "whenConditionString"} + {WhenConditionString, "whenConditionString"}, + {IsDefault, "isDefault"}, + {ModelHasDefaultState, "modelHasDefaultState"} }; return roleNames; } @@ -221,4 +234,19 @@ QVariant StatesEditorModel::stateModelNode() return QVariant::fromValue(m_statesEditorView->currentStateNode()); } +void StatesEditorModel::setStateAsDefault(int internalNodeId) +{ + m_statesEditorView->setStateAsDefault(internalNodeId); +} + +void StatesEditorModel::resetDefaultState() +{ + m_statesEditorView->resetDefaultState(); +} + +bool StatesEditorModel::hasDefaultState() const +{ + return m_statesEditorView->hasDefaultState(); +} + } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h index 40cad6efefc..97c4c6a9ec5 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h @@ -42,7 +42,9 @@ class StatesEditorModel : public QAbstractListModel StateImageSourceRole = Qt::UserRole, InternalNodeId, HasWhenCondition, - WhenConditionString + WhenConditionString, + IsDefault, + ModelHasDefaultState }; public: @@ -62,6 +64,9 @@ public: Q_INVOKABLE void resetWhenCondition(int internalNodeId); Q_INVOKABLE QStringList autoComplete(const QString &text, int pos, bool explicitComplete); Q_INVOKABLE QVariant stateModelNode(); + Q_INVOKABLE void setStateAsDefault(int internalNodeId); + Q_INVOKABLE void resetDefaultState(); + Q_INVOKABLE bool hasDefaultState() const; void reset(); diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp index 001a5a902c5..37693158f17 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp @@ -304,6 +304,50 @@ void StatesEditorView::resetWhenCondition(int internalNodeId) m_block = false; } +void StatesEditorView::setStateAsDefault(int internalNodeId) +{ + if (m_block) + return; + + m_block = true; + + if (hasModelNodeForInternalId(internalNodeId)) { + QmlModelState state(modelNodeForInternalId(internalNodeId)); + try { + if (state.isValid()) + state.setAsDefault(); + + } catch (const RewritingException &e) { + e.showException(); + } + } + + m_block = false; +} + +void StatesEditorView::resetDefaultState() +{ + if (m_block) + return; + + m_block = true; + + try { + if (rootModelNode().hasProperty("state")) + rootModelNode().removeProperty("state"); + + } catch (const RewritingException &e) { + e.showException(); + } + + m_block = false; +} + +bool StatesEditorView::hasDefaultState() const +{ + return rootModelNode().hasProperty("state"); +} + void StatesEditorView::modelAttached(Model *model) { if (model == AbstractView::model()) diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h index 572b4548921..66ab998e041 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h @@ -44,6 +44,9 @@ public: void renameState(int internalNodeId,const QString &newName); void setWhenCondition(int internalNodeId, const QString &condition); void resetWhenCondition(int internalNodeId); + void setStateAsDefault(int internalNodeId); + void resetDefaultState(); + bool hasDefaultState() const; bool validStateName(const QString &name) const; QString currentStateName() const; void setCurrentState(const QmlModelState &state); diff --git a/src/plugins/qmldesigner/designercore/include/qmlstate.h b/src/plugins/qmldesigner/designercore/include/qmlstate.h index 23213428492..156e441615f 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlstate.h +++ b/src/plugins/qmldesigner/designercore/include/qmlstate.h @@ -69,6 +69,9 @@ public: static ModelNode createQmlState(AbstractView *view, const PropertyListType &propertyList); + void setAsDefault(); + bool isDefault() const; + protected: void addChangeSetIfNotExists(const ModelNode &node); static QmlModelState createBaseState(const AbstractView *view); diff --git a/src/plugins/qmldesigner/designercore/model/qmlstate.cpp b/src/plugins/qmldesigner/designercore/model/qmlstate.cpp index 2961951ef88..e23a87b3ef3 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlstate.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlstate.cpp @@ -289,6 +289,24 @@ ModelNode QmlModelState::createQmlState(AbstractView *view, const PropertyListTy return view->createModelNode("QtQuick.State", 1, 0, propertyList); } +void QmlModelState::setAsDefault() +{ + if ((!isBaseState()) && (modelNode().isValid())) { + view()->rootModelNode().variantProperty("state").setValue(name()); + } +} + +bool QmlModelState::isDefault() const +{ + if ((!isBaseState()) && (modelNode().isValid())) { + if (view()->rootModelNode().hasProperty("state")) { + return (view()->rootModelNode().variantProperty("state").value() == name()); + } + } + + return false; +} + QmlModelState QmlModelState::createBaseState(const AbstractView *view) { QmlModelState qmlModelState(view->rootModelNode()); From 4e4b8965a9358143a6e75afe4dc1b4a949491df1 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 10 Mar 2020 06:58:37 +0100 Subject: [PATCH 20/25] McuSupport: Introduce a separate status label The status label will notify about missing CMake, etc. The Kit Creation info label should only inform about the kit options for the currently selected target. Change-Id: I8786fe287f5fa28b46bb0e6d2d88517ec2593e05 Reviewed-by: Alessandro Portale --- .../mcusupport/mcusupportoptionspage.cpp | 146 ++++++++++-------- 1 file changed, 85 insertions(+), 61 deletions(-) diff --git a/src/plugins/mcusupport/mcusupportoptionspage.cpp b/src/plugins/mcusupport/mcusupportoptionspage.cpp index 18356fec399..a991af60ece 100644 --- a/src/plugins/mcusupport/mcusupportoptionspage.cpp +++ b/src/plugins/mcusupport/mcusupportoptionspage.cpp @@ -48,11 +48,6 @@ namespace McuSupport { namespace Internal { -static bool cMakeAvailable() -{ - return !CMakeProjectManager::CMakeToolManager::cmakeTools().isEmpty(); -} - class McuSupportOptionsWidget : public Core::IOptionsPageWidget { Q_DECLARE_TR_FUNCTIONS(McuSupport::Internal::McuSupportOptionsWidget) @@ -80,56 +75,71 @@ private: QComboBox *m_mcuTargetsComboBox = nullptr; QGroupBox *m_kitCreationGroupBox = nullptr; Utils::InfoLabel *m_kitCreationInfoLabel = nullptr; + Utils::InfoLabel *m_statusInfoLabel = nullptr; }; McuSupportOptionsWidget::McuSupportOptionsWidget() { auto mainLayout = new QVBoxLayout(this); - m_qtForMCUsSdkGroupBox = new QGroupBox(m_options.qtForMCUsSdkPackage->label()); - m_qtForMCUsSdkGroupBox->setFlat(true); - auto qtForMCUsSdkGroupBoxLayout = new QVBoxLayout(m_qtForMCUsSdkGroupBox); - qtForMCUsSdkGroupBoxLayout->addWidget(m_options.qtForMCUsSdkPackage->widget()); - mainLayout->addWidget(m_qtForMCUsSdkGroupBox); + { + m_statusInfoLabel = new Utils::InfoLabel; + m_statusInfoLabel->setElideMode(Qt::ElideNone); + m_statusInfoLabel->setOpenExternalLinks(false); + mainLayout->addWidget(m_statusInfoLabel); + connect(m_statusInfoLabel, &QLabel::linkActivated, this, []{ + Core::ICore::showOptionsDialog( + CMakeProjectManager::Constants::CMAKE_SETTINGSPAGE_ID, + Core::ICore::mainWindow()); + }); + } - m_mcuTargetsGroupBox = new QGroupBox(tr("Targets supported by the %1") - .arg(m_qtForMCUsSdkGroupBox->title())); - m_mcuTargetsGroupBox->setFlat(true); - mainLayout->addWidget(m_mcuTargetsGroupBox); - auto qtForMCUsTargetsGroupBoxLayout = new QVBoxLayout(m_mcuTargetsGroupBox); - m_mcuTargetsComboBox = new QComboBox; - m_mcuTargetsComboBox->addItems( - Utils::transform(m_options.mcuTargets, [this](McuTarget *t){ - return m_options.kitName(t); - })); - qtForMCUsTargetsGroupBoxLayout->addWidget(m_mcuTargetsComboBox); + { + m_qtForMCUsSdkGroupBox = new QGroupBox(m_options.qtForMCUsSdkPackage->label()); + m_qtForMCUsSdkGroupBox->setFlat(true); + auto layout = new QVBoxLayout(m_qtForMCUsSdkGroupBox); + layout->addWidget(m_options.qtForMCUsSdkPackage->widget()); + mainLayout->addWidget(m_qtForMCUsSdkGroupBox); + } - m_packagesGroupBox = new QGroupBox(tr("Requirements")); - m_packagesGroupBox->setFlat(true); - mainLayout->addWidget(m_packagesGroupBox); - m_packagesLayout = new QFormLayout; - m_packagesGroupBox->setLayout(m_packagesLayout); + { + m_mcuTargetsGroupBox = new QGroupBox(tr("Targets supported by the %1") + .arg(m_qtForMCUsSdkGroupBox->title())); + m_mcuTargetsGroupBox->setFlat(true); + mainLayout->addWidget(m_mcuTargetsGroupBox); + m_mcuTargetsComboBox = new QComboBox; + m_mcuTargetsComboBox->addItems( + Utils::transform(m_options.mcuTargets, [this](McuTarget *t){ + return m_options.kitName(t); + })); + auto layout = new QVBoxLayout(m_mcuTargetsGroupBox); + layout->addWidget(m_mcuTargetsComboBox); + connect(m_mcuTargetsComboBox, &QComboBox::currentTextChanged, + this, &McuSupportOptionsWidget::showMcuTargetPackages); + } - m_kitCreationGroupBox = new QGroupBox(tr("Create a Kit")); - m_kitCreationGroupBox->setFlat(true); - mainLayout->addWidget(m_kitCreationGroupBox); - auto kitCreationGroupBoxLayout = new QVBoxLayout(m_kitCreationGroupBox); - m_kitCreationInfoLabel = new Utils::InfoLabel; - m_kitCreationInfoLabel->setOpenExternalLinks(false); - m_kitCreationInfoLabel->setElideMode(Qt::ElideNone); - m_kitCreationInfoLabel->setWordWrap(true); - kitCreationGroupBoxLayout->addWidget(m_kitCreationInfoLabel); + { + m_packagesGroupBox = new QGroupBox(tr("Requirements")); + m_packagesGroupBox->setFlat(true); + mainLayout->addWidget(m_packagesGroupBox); + m_packagesLayout = new QFormLayout; + m_packagesGroupBox->setLayout(m_packagesLayout); + } + + { + m_kitCreationGroupBox = new QGroupBox(tr("Create a Kit")); + m_kitCreationGroupBox->setFlat(true); + mainLayout->addWidget(m_kitCreationGroupBox); + m_kitCreationInfoLabel = new Utils::InfoLabel; + m_kitCreationInfoLabel->setElideMode(Qt::ElideNone); + m_kitCreationInfoLabel->setWordWrap(true); + auto layout = new QVBoxLayout(m_kitCreationGroupBox); + layout->addWidget(m_kitCreationInfoLabel); + } mainLayout->addStretch(); connect(&m_options, &McuSupportOptions::changed, this, &McuSupportOptionsWidget::updateStatus); - connect(m_mcuTargetsComboBox, &QComboBox::currentTextChanged, - this, &McuSupportOptionsWidget::showMcuTargetPackages); - connect(m_kitCreationInfoLabel, &QLabel::linkActivated, this, []{ - Core::ICore::showOptionsDialog( - CMakeProjectManager::Constants::CMAKE_SETTINGSPAGE_ID, - Core::ICore::mainWindow()); - }); showMcuTargetPackages(); } @@ -140,27 +150,41 @@ void McuSupportOptionsWidget::updateStatus() if (!mcuTarget) return; - m_kitCreationInfoLabel->setType(cMakeAvailable() && mcuTarget->isValid() - ? Utils::InfoLabel::Ok : Utils::InfoLabel::NotOk); + const bool cMakeAvailable = !CMakeProjectManager::CMakeToolManager::cmakeTools().isEmpty(); - const bool sdkValid = m_options.qtForMCUsSdkPackage->status() == McuPackage::ValidPackage; - m_mcuTargetsGroupBox->setVisible(sdkValid); - m_packagesGroupBox->setVisible(sdkValid && !mcuTarget->packages().isEmpty()); - m_kitCreationGroupBox->setVisible(sdkValid); + // Page elements + { + m_qtForMCUsSdkGroupBox->setVisible(cMakeAvailable); + const bool ready = cMakeAvailable && + m_options.qtForMCUsSdkPackage->status() == McuPackage::ValidPackage; + m_mcuTargetsGroupBox->setVisible(ready); + m_packagesGroupBox->setVisible(ready && !mcuTarget->packages().isEmpty()); + m_kitCreationGroupBox->setVisible(ready); + } - QStringList errorStrings; - if (!mcuTarget->isValid()) - errorStrings << "Provide the package paths in order to create a kit for your target."; - if (!cMakeAvailable()) - errorStrings << "No CMake tool was detected. Add a CMake tool in the " - "CMake options and press Apply."; + // Kit creation status + { + const bool mcuTargetValid = mcuTarget->isValid(); + m_kitCreationInfoLabel->setType(mcuTargetValid ? Utils::InfoLabel::Ok + : Utils::InfoLabel::NotOk); + m_kitCreationInfoLabel->setText( + mcuTargetValid ? QString::fromLatin1( + "A kit %1 for the selected target can be " + "generated. Press Apply to generate it.") + .arg(m_options.kitName(mcuTarget)) + : "Provide the package paths in order to create a kit " + "for your target."); + } - m_kitCreationInfoLabel->setText( - errorStrings.isEmpty() - ? QString::fromLatin1("A kit %1 for the selected target can be generated. " - "Press Apply to generate it.").arg(m_options.kitName( - mcuTarget)) - : errorStrings.join("
")); + // Status label in the bottom + { + m_statusInfoLabel->setVisible(!cMakeAvailable); + if (m_statusInfoLabel->isVisible()) { + m_statusInfoLabel->setType(Utils::InfoLabel::NotOk); + m_statusInfoLabel->setText("No CMake tool was detected. Add a CMake tool in the " + "CMake options and press Apply."); + } + } } void McuSupportOptionsWidget::showMcuTargetPackages() @@ -205,7 +229,7 @@ void McuSupportOptionsWidget::apply() QTC_ASSERT(m_options.qtForMCUsSdkPackage, return); - if (!isVisible() || !cMakeAvailable()) + if (!isVisible()) return; const McuTarget *mcuTarget = currentMcuTarget(); From aac77eecb97d49b91bf063a6da324107ffc71aaa Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 6 Feb 2020 21:05:01 +0100 Subject: [PATCH 21/25] Squish: Replace Qt version 5.6.1 with 5.14.1 Task-number: QTCREATORBUG-22111 Change-Id: Iaae052e73a264252e399bd0992be4b420e2799ae Reviewed-by: Robert Loehning Reviewed-by: Christian Stenger --- tests/system/README | 8 ++-- .../mac/QtProject/qtcreator/profiles.xml | 2 +- .../mac/QtProject/qtcreator/qtversion.xml | 2 +- .../unix/QtProject/qtcreator/profiles.xml | 2 +- .../unix/QtProject/qtcreator/qtversion.xml | 2 +- .../windows/QtProject/qtcreator/profiles.xml | 6 +-- .../windows/QtProject/qtcreator/qtversion.xml | 4 +- .../QtProject/qtcreator/toolchains.xml | 42 +++++++++++++++---- tests/system/shared/classes.py | 12 +++--- tests/system/shared/project.py | 13 +++--- tests/system/suite_APTW/tst_APTW03/test.py | 2 +- tests/system/suite_CCOM/tst_CCOM01/test.py | 3 +- tests/system/suite_CCOM/tst_CCOM02/test.py | 2 +- tests/system/suite_CSUP/tst_CSUP04/test.py | 2 +- tests/system/suite_CSUP/tst_CSUP05/test.py | 2 +- tests/system/suite_CSUP/tst_CSUP06/test.py | 2 +- tests/system/suite_QMLS/tst_QMLS03/test.py | 22 +++++----- tests/system/suite_WELP/tst_WELP02/test.py | 2 +- .../suite_debugger/tst_qml_js_console/test.py | 2 + .../suite_debugger/tst_qml_locals/test.py | 2 + .../suite_debugger/tst_simple_analyze/test.py | 5 +-- .../testdata/events_qt5.6.1.tsv | 9 ---- .../suite_editors/tst_memberoperator/test.py | 3 +- .../suite_editors/tst_qml_editor/test.py | 2 +- .../tst_create_proj_wizard/test.py | 2 +- .../suite_general/tst_rename_file/test.py | 2 +- .../tst_session_handling/test.py | 6 +-- .../suite_qtquick/tst_qml_outline/test.py | 4 +- .../tst_qtquick_creation/test.py | 4 +- .../tst_qtquick_creation3/test.py | 8 ++-- .../tst_qtquick_creation4/test.py | 2 +- 31 files changed, 100 insertions(+), 81 deletions(-) delete mode 100644 tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt5.6.1.tsv diff --git a/tests/system/README b/tests/system/README index 57816f235bf..05fe472d5ad 100644 --- a/tests/system/README +++ b/tests/system/README @@ -30,24 +30,24 @@ locations. On Linux/macOS this is ~/Qt5.x.1 and on Windows this is C:\Qt\Qt5.x.1 use installations of the official opensource Qt packages. Just install the Qt version for the respective toolchain with the components (if available): - (Desktop) , e.g. Desktop gcc 64-bit -- Qt Quick Controls +- Qt Quick Controls (if available) - Qt Script The exact versions and toolchains are: Linux: Qt 5.4.1 (gcc) -Qt 5.6.1-1 (gcc) Qt 5.10.1 (gcc) +Qt 5.14.1 (gcc) macOS: -Qt 5.6.1-1 (clang) Qt 5.10.1 (clang) +Qt 5.14.1 (clang) Windows: Qt 5.4.1 (gcc) -Qt 5.6.1-1 (MSVC2013, 32 bit) Qt 5.10.1 (MSVC2015, 32 bit) +Qt 5.14.1 (MSVC2017, 64 bit) Fourth - you'll have to provide some additional repositories. These additional repositories are located inside ~/squish-data or C:\Users\\squish-data (depending on the OS you're on). diff --git a/tests/system/settings/mac/QtProject/qtcreator/profiles.xml b/tests/system/settings/mac/QtProject/qtcreator/profiles.xml index f64b5ba0550..cf36fa263fc 100644 --- a/tests/system/settings/mac/QtProject/qtcreator/profiles.xml +++ b/tests/system/settings/mac/QtProject/qtcreator/profiles.xml @@ -49,7 +49,7 @@ :///DESKTOP/// {fc5f34fd-e703-4f4c-85ce-ea5bf5869e6a} - Desktop 5.6.1 default + Desktop 5.14.1 default false diff --git a/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml b/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml index f9a0babe523..6521f404a1a 100644 --- a/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml +++ b/tests/system/settings/mac/QtProject/qtcreator/qtversion.xml @@ -17,7 +17,7 @@ 9 Qt %{Qt:Version} (SQUISH_DEFAULT_COMPILER) - ~/Qt5.6.1/5.6/SQUISH_DEFAULT_COMPILER/bin/qmake + ~/Qt5.14.1/5.14.1/SQUISH_DEFAULT_COMPILER/bin/qmake Qt4ProjectManager.QtVersion.Desktop false diff --git a/tests/system/settings/unix/QtProject/qtcreator/profiles.xml b/tests/system/settings/unix/QtProject/qtcreator/profiles.xml index 627451db8b3..81f328703d3 100644 --- a/tests/system/settings/unix/QtProject/qtcreator/profiles.xml +++ b/tests/system/settings/unix/QtProject/qtcreator/profiles.xml @@ -91,7 +91,7 @@ :///DESKTOP/// {542217c7-ce0f-48f7-843b-d4fad339688d} - Desktop 5.6.1 default + Desktop 5.14.1 default false diff --git a/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml b/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml index 90e86a4f6a8..cb208914864 100644 --- a/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml +++ b/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml @@ -27,7 +27,7 @@ 15 Qt %{Qt:Version} (SQUISH_DEFAULT_COMPILER) - ~/Qt5.6.1/5.6/SQUISH_DEFAULT_COMPILER/bin/qmake + ~/Qt5.14.1/5.14.1/SQUISH_DEFAULT_COMPILER/bin/qmake Qt4ProjectManager.QtVersion.Desktop false diff --git a/tests/system/settings/windows/QtProject/qtcreator/profiles.xml b/tests/system/settings/windows/QtProject/qtcreator/profiles.xml index ac1911748fb..fab39649776 100644 --- a/tests/system/settings/windows/QtProject/qtcreator/profiles.xml +++ b/tests/system/settings/windows/QtProject/qtcreator/profiles.xml @@ -72,8 +72,8 @@ {7ca0887f-a9a5-4251-aba6-560a15595d20} - {d35e7a1a-5ab8-4fd6-8a2c-634846c669bb} - {7ca0887f-a9a5-4251-aba6-560a15595d20} + {ce3a8004-e9ae-46f2-b62d-d7daf69435ca} + {3df7c776-a480-4a04-9099-6c75adac2dca} 24 @@ -81,7 +81,7 @@ :///DESKTOP/// {f9c7858c-d167-4b78-847a-91943bd0af07} - Desktop 5.6.1 default + Desktop 5.14.1 default false diff --git a/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml b/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml index e9c384e6343..2939316b75f 100644 --- a/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml +++ b/tests/system/settings/windows/QtProject/qtcreator/qtversion.xml @@ -26,8 +26,8 @@ QtVersion.2 24 - Qt %{Qt:Version} (msvc2013) - C:/Qt/Qt5.6.1/5.6/msvc2013/bin/qmake.exe + Qt %{Qt:Version} (msvc2017_64) + C:/Qt/Qt5.14.1/5.14.1/msvc2017_64/bin/qmake.exe Qt4ProjectManager.QtVersion.Desktop false diff --git a/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml b/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml index 1dea56573ee..49518d2d28b 100644 --- a/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml +++ b/tests/system/settings/windows/QtProject/qtcreator/toolchains.xml @@ -49,18 +49,31 @@ ToolChain.3 - x86-windows-msvc2015-pe-32bit - C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat - x86 - true - Microsoft Visual C++ Compiler 14.0 (x86) - ProjectExplorer.ToolChain.Msvc:{c96cfaf3-fb8a-472b-b3c7-e94e8c490f17} + x86-windows-msvc2017-pe-64bit + C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat + amd64 + false + MSVC2017 (amd64) + ProjectExplorer.ToolChain.Msvc:{ce3a8004-e9ae-46f2-b62d-d7daf69435ca} 1 C ToolChain.4 + + x86-windows-msvc2015-pe-32bit + C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat + x86 + true + Microsoft Visual C++ Compiler 14.0 (x86) + ProjectExplorer.ToolChain.Msvc:{c96cfaf3-fb8a-472b-b3c7-e94e8c490f17} + 1 + C + + + + ToolChain.5 x86-windows-msvc2015-pe-32bit C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat @@ -73,7 +86,7 @@ - ToolChain.5 + ToolChain.6 x86-windows-msvc2013-pe-32bit C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/vcvarsall.bat @@ -83,9 +96,22 @@ ProjectExplorer.ToolChain.Msvc:{7ca0887f-a9a5-4251-aba6-560a15595d20} + + ToolChain.7 + + x86-windows-msvc2017-pe-64bit + C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat + amd64 + false + MSVC2017 (amd64) + ProjectExplorer.ToolChain.Msvc:{3df7c776-a480-4a04-9099-6c75adac2dca} + 2 + Cxx + + ToolChain.Count - 6 + 8 Version diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py index 90bbe4d7967..3a675c61e5e 100644 --- a/tests/system/shared/classes.py +++ b/tests/system/shared/classes.py @@ -32,15 +32,15 @@ class Targets: (DESKTOP_4_8_7_DEFAULT, EMBEDDED_LINUX, DESKTOP_5_4_1_GCC, - DESKTOP_5_6_1_DEFAULT, - DESKTOP_5_10_1_DEFAULT) = ALL_TARGETS + DESKTOP_5_10_1_DEFAULT, + DESKTOP_5_14_1_DEFAULT) = ALL_TARGETS __TARGET_NAME_DICT__ = dict(zip(ALL_TARGETS, ["Desktop 4.8.7 default", "Embedded Linux", "Desktop 5.4.1 GCC", - "Desktop 5.6.1 default", - "Desktop 5.10.1 default"])) + "Desktop 5.10.1 default", + "Desktop 5.14.1 default"])) @staticmethod def availableTargetClasses(): @@ -71,7 +71,7 @@ class Targets: @staticmethod def getDefaultKit(): - return Targets.DESKTOP_5_6_1_DEFAULT + return Targets.DESKTOP_5_14_1_DEFAULT # this class holds some constants for easier usage inside the Projects view class ProjectSettings: @@ -106,7 +106,7 @@ class Qt5Path: @staticmethod def getPaths(pathSpec): - qt5targets = [Targets.DESKTOP_5_6_1_DEFAULT, Targets.DESKTOP_5_10_1_DEFAULT] + qt5targets = [Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT] if platform.system() != 'Darwin': qt5targets.append(Targets.DESKTOP_5_4_1_GCC) if pathSpec == Qt5Path.DOCS: diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 39cdda43518..96b79a5c4ad 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -278,7 +278,7 @@ def createProject_Qt_Console(path, projectName, checks = True, buildSystem = Non __verifyFileCreation__(path, expectedFiles) def createNewQtQuickApplication(workingDir, projectName=None, - targets=Targets.desktopTargetClasses(), minimumQtVersion="5.6", + targets=Targets.desktopTargetClasses(), minimumQtVersion="5.10", template="Qt Quick Application - Empty", fromWelcome=False, buildSystem=None): available = __createProjectOrFileSelectType__(" Application (Qt Quick)", template, fromWelcome) @@ -298,7 +298,7 @@ def createNewQtQuickApplication(workingDir, projectName=None, return checkedTargets, projectName -def createNewQtQuickUI(workingDir, qtVersion = "5.6"): +def createNewQtQuickUI(workingDir, qtVersion = "5.10"): available = __createProjectOrFileSelectType__(" Other Project", 'Qt Quick UI Prototype') if workingDir == None: workingDir = tempDir() @@ -316,7 +316,7 @@ def createNewQtQuickUI(workingDir, qtVersion = "5.6"): return checkedTargets, projectName -def createNewQmlExtension(workingDir, targets=[Targets.DESKTOP_5_6_1_DEFAULT]): +def createNewQmlExtension(workingDir, targets=[Targets.DESKTOP_5_14_1_DEFAULT]): available = __createProjectOrFileSelectType__(" Library", "Qt Quick 2 Extension Plugin") if workingDir == None: workingDir = tempDir() @@ -505,10 +505,7 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False): else: version = None if templateName.startswith("Qt Quick Application - "): - if templateName == "Qt Quick Application - Empty": - result = set([Targets.DESKTOP_5_6_1_DEFAULT, Targets.DESKTOP_5_10_1_DEFAULT]) - else: - result = set([Targets.DESKTOP_5_10_1_DEFAULT]) + result = set([Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT]) elif 'Supported Platforms' in text: supports = text[text.find('Supported Platforms'):].split(":")[1].strip().split(" ") result = set() @@ -517,7 +514,7 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False): result.add(Targets.DESKTOP_4_8_7_DEFAULT) if platform.system() in ("Linux", "Darwin"): result.add(Targets.EMBEDDED_LINUX) - result = result.union(set([Targets.DESKTOP_5_6_1_DEFAULT, Targets.DESKTOP_5_10_1_DEFAULT])) + result = result.union(set([Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT])) if platform.system() != 'Darwin': result.add(Targets.DESKTOP_5_4_1_GCC) elif 'Platform independent' in text: diff --git a/tests/system/suite_APTW/tst_APTW03/test.py b/tests/system/suite_APTW/tst_APTW03/test.py index fb04c53fa8b..e08901fb6dc 100644 --- a/tests/system/suite_APTW/tst_APTW03/test.py +++ b/tests/system/suite_APTW/tst_APTW03/test.py @@ -86,7 +86,7 @@ def main(): checkSimpleCppLib("SampleApp1", False) checkSimpleCppLib("SampleApp2", True) - pluginTargets = (Targets.DESKTOP_5_6_1_DEFAULT, Targets.DESKTOP_5_10_1_DEFAULT) + pluginTargets = (Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT) projectName, className = createNewQtPlugin(tempDir(), "SampleApp3", "MyPlugin", pluginTargets) virtualFunctionsAdded = False for kit, config in iterateBuildConfigs("Debug"): diff --git a/tests/system/suite_CCOM/tst_CCOM01/test.py b/tests/system/suite_CCOM/tst_CCOM01/test.py index 6c9101c3813..20dd368a80e 100755 --- a/tests/system/suite_CCOM/tst_CCOM01/test.py +++ b/tests/system/suite_CCOM/tst_CCOM01/test.py @@ -28,7 +28,7 @@ source("../../shared/qtcreator.py") # entry of test def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "animation") proFile = "animation.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): @@ -42,6 +42,7 @@ def main(): # open example project, supports only Qt 5 targets = Targets.desktopTargetClasses() targets.discard(Targets.DESKTOP_4_8_7_DEFAULT) + targets.discard(Targets.DESKTOP_5_4_1_GCC) openQmakeProject(examplePath, targets) # build and wait until finished - on all build configurations availableConfigs = iterateBuildConfigs() diff --git a/tests/system/suite_CCOM/tst_CCOM02/test.py b/tests/system/suite_CCOM/tst_CCOM02/test.py index b49594ddfb3..f44d68ffd0e 100755 --- a/tests/system/suite_CCOM/tst_CCOM02/test.py +++ b/tests/system/suite_CCOM/tst_CCOM02/test.py @@ -29,7 +29,7 @@ source("../../shared/qtcreator.py") # entry of test def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "animation") proFile = "animation.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): diff --git a/tests/system/suite_CSUP/tst_CSUP04/test.py b/tests/system/suite_CSUP/tst_CSUP04/test.py index 143e3fe8126..99ec6ae8db3 100644 --- a/tests/system/suite_CSUP/tst_CSUP04/test.py +++ b/tests/system/suite_CSUP/tst_CSUP04/test.py @@ -28,7 +28,7 @@ source("../../shared/qtcreator.py") # entry of test def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "gui", "openglwindow") proFile = "openglwindow.pro" diff --git a/tests/system/suite_CSUP/tst_CSUP05/test.py b/tests/system/suite_CSUP/tst_CSUP05/test.py index 3e686b0509a..2bd3dd846c7 100644 --- a/tests/system/suite_CSUP/tst_CSUP05/test.py +++ b/tests/system/suite_CSUP/tst_CSUP05/test.py @@ -28,7 +28,7 @@ source("../../shared/qtcreator.py") # entry of test def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "gui", "openglwindow") proFile = "openglwindow.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): diff --git a/tests/system/suite_CSUP/tst_CSUP06/test.py b/tests/system/suite_CSUP/tst_CSUP06/test.py index 3626a959510..c28c8bb198f 100644 --- a/tests/system/suite_CSUP/tst_CSUP06/test.py +++ b/tests/system/suite_CSUP/tst_CSUP06/test.py @@ -168,7 +168,7 @@ def main(): with TestSection(getCodeModelString(useClang)): if not startCreatorVerifyingClang(useClang): continue - openQmakeProject(examplePath, [Targets.DESKTOP_5_6_1_DEFAULT]) + openQmakeProject(examplePath, [Targets.DESKTOP_5_14_1_DEFAULT]) checkCodeModelSettings(useClang) if not openDocument("cplusplus-tools.Sources.main\\.cpp"): earlyExit("Failed to open main.cpp.") diff --git a/tests/system/suite_QMLS/tst_QMLS03/test.py b/tests/system/suite_QMLS/tst_QMLS03/test.py index c82568a6bce..a1f742eee3c 100644 --- a/tests/system/suite_QMLS/tst_QMLS03/test.py +++ b/tests/system/suite_QMLS/tst_QMLS03/test.py @@ -67,7 +67,7 @@ def checkUsages(resultsView, expectedResults, directory): def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "animation") proFile = "animation.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): @@ -80,7 +80,7 @@ def main(): if not startedWithoutPluginError(): return # open example project - openQmakeProject(examplePath, [Targets.DESKTOP_5_6_1_DEFAULT]) + openQmakeProject(examplePath, [Targets.DESKTOP_5_14_1_DEFAULT]) # open qml file openDocument("animation.Resources.animation\\.qrc./animation.basics.color-animation\\.qml") # get editor @@ -94,10 +94,10 @@ def main(): type(editorArea, "") invokeContextMenuItem(editorArea, "Find References to Symbol Under Cursor") # check if usage was properly found - expectedResults = [ExpectedResult("color-animation.qml", 49, "Rectangle {"), - ExpectedResult("color-animation.qml", 109, "Rectangle {"), - ExpectedResult("property-animation.qml", 48, "Rectangle {"), - ExpectedResult("property-animation.qml", 57, "Rectangle {")] + expectedResults = [ExpectedResult("color-animation.qml", 59, "Rectangle {"), + ExpectedResult("color-animation.qml", 119, "Rectangle {"), + ExpectedResult("property-animation.qml", 58, "Rectangle {"), + ExpectedResult("property-animation.qml", 67, "Rectangle {")] resultsView = waitForObject(":Qt Creator_Find::Internal::SearchResultTreeView") test.verify(checkUsages(resultsView, expectedResults, templateDir), "Verifying if usages were properly found using context menu.") @@ -113,10 +113,10 @@ def main(): type(editorArea, "") invokeMenuItem("Tools", "QML/JS", "Find References to Symbol Under Cursor") # check if usage was properly found - expectedResults = [ExpectedResult("color-animation.qml", 50, "anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }"), - ExpectedResult("color-animation.qml", 110, "anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }"), - ExpectedResult("property-animation.qml", 49, "anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }"), - ExpectedResult("property-animation.qml", 58, "anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }")] + expectedResults = [ExpectedResult("color-animation.qml", 60, "anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }"), + ExpectedResult("color-animation.qml", 120, "anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }"), + ExpectedResult("property-animation.qml", 59, "anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }"), + ExpectedResult("property-animation.qml", 68, "anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }")] resultsView = waitForObject(":Qt Creator_Find::Internal::SearchResultTreeView") test.verify(checkUsages(resultsView, expectedResults, templateDir), "Verifying if usages were properly found using main menu.") @@ -132,7 +132,7 @@ def main(): type(editorArea, "") type(editorArea, "") # check if usage was properly found - expectedResults = [ExpectedResult("color-animation.qml", 93, "SequentialAnimation on opacity {")] + expectedResults = [ExpectedResult("color-animation.qml", 103, "SequentialAnimation on opacity {")] resultsView = waitForObject(":Qt Creator_Find::Internal::SearchResultTreeView") test.verify(checkUsages(resultsView, expectedResults, templateDir), "Verifying if usages were properly found using shortcut.") diff --git a/tests/system/suite_WELP/tst_WELP02/test.py b/tests/system/suite_WELP/tst_WELP02/test.py index b44f0382dce..d2650081f8d 100644 --- a/tests/system/suite_WELP/tst_WELP02/test.py +++ b/tests/system/suite_WELP/tst_WELP02/test.py @@ -65,7 +65,7 @@ def checkTypeAndProperties(typePropertiesDetails): def main(): # prepare example project - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "animation") if not neededFilePresent(sourceExample): return diff --git a/tests/system/suite_debugger/tst_qml_js_console/test.py b/tests/system/suite_debugger/tst_qml_js_console/test.py index b94303bfb1b..c7d9df09f25 100644 --- a/tests/system/suite_debugger/tst_qml_js_console/test.py +++ b/tests/system/suite_debugger/tst_qml_js_console/test.py @@ -114,6 +114,8 @@ def testLoggingFeatures(): clickButton(":*Qt Creator.Clear_QToolButton") def main(): + test.xfail("Skipping test. This will not work correctly with Qt <= 5.15 (QTBUG-82150).") + return projName = "simpleQuickUI2.qmlproject" projFolder = os.path.dirname(findFile("testdata", "simpleQuickUI2/%s" % projName)) if not neededFilePresent(os.path.join(projFolder, projName)): diff --git a/tests/system/suite_debugger/tst_qml_locals/test.py b/tests/system/suite_debugger/tst_qml_locals/test.py index f85a2d3b23d..63516e89518 100644 --- a/tests/system/suite_debugger/tst_qml_locals/test.py +++ b/tests/system/suite_debugger/tst_qml_locals/test.py @@ -27,6 +27,8 @@ source("../../shared/qtcreator.py") source("Tree.py") def main(): + test.xfail("Skipping test. This must be rewritten for current kits.") + return if os.getenv("SYSTEST_OPENGL_MISSING") == "1": test.xfail("This test needs OpenGL - skipping...") return diff --git a/tests/system/suite_debugger/tst_simple_analyze/test.py b/tests/system/suite_debugger/tst_simple_analyze/test.py index 6c694f063ef..69ee40d5b65 100644 --- a/tests/system/suite_debugger/tst_simple_analyze/test.py +++ b/tests/system/suite_debugger/tst_simple_analyze/test.py @@ -66,8 +66,7 @@ def performTest(workingDir, projectName, availableConfigs): # because of differences between MSVC's and MinGW's Makefile (so clean before changing kit) invokeMenuItem('Build', 'Clean Project "%s"' % projectName) verifyBuildConfig(kit, config, True, True, True) - qtVersion = "5.6.1" if kit == Targets.DESKTOP_5_6_1_DEFAULT else "5.10.1" - test.log("Selected kit using Qt %s" % qtVersion) + test.log("Selected kit '%s'" % Targets.getStringForTarget(kit)) # explicitly build before start debugging for adding the executable as allowed program to WinFW invokeMenuItem("Build", "Rebuild All Projects") waitForCompile() @@ -100,7 +99,7 @@ def performTest(workingDir, projectName, availableConfigs): colMean, colMedian, colLongest, colShortest) = range(2, 11) model = waitForObject(":Events.QmlProfilerEventsTable_QmlProfiler::" "Internal::QmlProfilerStatisticsMainView").model() - compareEventsTab(model, "events_qt%s.tsv" % qtVersion) + compareEventsTab(model, "events_qt5.10.1.tsv") test.compare(dumpItems(model, column=colPercent)[0], '100 %') # cannot run following test on colShortest (unstable) for i in [colMean, colMedian, colLongest]: diff --git a/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt5.6.1.tsv b/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt5.6.1.tsv deleted file mode 100644 index a5228fad419..00000000000 --- a/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt5.6.1.tsv +++ /dev/null @@ -1,9 +0,0 @@ -"0" "1" "6" "11" -"" "" "1" "Main program" -"main.qml:15" "Handling Signal" "2" "onTriggered: { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }" -"main.qml:15" "JavaScript" "2" "onTriggered" -"main.qml:4" "Creating" "2" "QtQuick.Window/Window" -"main.qml:1" "Compiling" "1" "main.qml" -"main.qml:10" "Creating" "2" "QtQuick/Timer" -"main.qml:14" "Binding" "3" "running: runCount < 2" -"main.qml:14" "JavaScript" "3" "expression for running" diff --git a/tests/system/suite_editors/tst_memberoperator/test.py b/tests/system/suite_editors/tst_memberoperator/test.py index 99e511049a3..f7e7ed67375 100644 --- a/tests/system/suite_editors/tst_memberoperator/test.py +++ b/tests/system/suite_editors/tst_memberoperator/test.py @@ -47,7 +47,8 @@ def main(): if not startCreatorVerifyingClang(useClang): continue createProject_Qt_Console(tempDir(), "SquishProject") - selectBuildConfig(Targets.DESKTOP_5_6_1_DEFAULT, "Debug") # do not use the default Qt4 + # by default Qt4 is selected, use a Qt5 kit instead + selectBuildConfig(Targets.DESKTOP_5_10_1_DEFAULT, "Debug") checkCodeModelSettings(useClang) selectFromLocator("main.cpp") cppwindow = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") diff --git a/tests/system/suite_editors/tst_qml_editor/test.py b/tests/system/suite_editors/tst_qml_editor/test.py index 56179134cbd..ecd9ab008e6 100644 --- a/tests/system/suite_editors/tst_qml_editor/test.py +++ b/tests/system/suite_editors/tst_qml_editor/test.py @@ -28,7 +28,7 @@ source("../../shared/qtcreator.py") focusDocumentPath = "keyinteraction.Resources.keyinteraction\.qrc./keyinteraction.focus.%s" def main(): - target = Targets.DESKTOP_5_6_1_DEFAULT + target = Targets.DESKTOP_5_14_1_DEFAULT sourceExample = os.path.join(Qt5Path.examplesPath(target), "quick/keyinteraction") proFile = "keyinteraction.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): diff --git a/tests/system/suite_general/tst_create_proj_wizard/test.py b/tests/system/suite_general/tst_create_proj_wizard/test.py index ab984d52257..4669c47b846 100644 --- a/tests/system/suite_general/tst_create_proj_wizard/test.py +++ b/tests/system/suite_general/tst_create_proj_wizard/test.py @@ -71,7 +71,7 @@ def main(): with TestSection("Testing project template %s -> %s" % (category, template)): displayedPlatforms = __createProject__(category, template) if template.startswith("Qt Quick Application - "): - qtVersionsForQuick = ["5.6", "5.10"] if template == "Qt Quick Application - Empty" else ["5.10"] + qtVersionsForQuick = ["5.10", "5.14"] for counter, qtVersion in enumerate(qtVersionsForQuick): def additionalFunc(displayedPlatforms, qtVersion): requiredQtVersion = __createProjectHandleQtQuickSelection__(qtVersion) diff --git a/tests/system/suite_general/tst_rename_file/test.py b/tests/system/suite_general/tst_rename_file/test.py index 5c296973b02..c39bdda57a2 100644 --- a/tests/system/suite_general/tst_rename_file/test.py +++ b/tests/system/suite_general/tst_rename_file/test.py @@ -28,7 +28,7 @@ source("../../shared/qtcreator.py") def main(): # prepare example project projectName = "adding" - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "qml", "referenceexamples", "adding") proFile = projectName + ".pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): diff --git a/tests/system/suite_general/tst_session_handling/test.py b/tests/system/suite_general/tst_session_handling/test.py index 96a3f33dd9d..f33cdab833f 100644 --- a/tests/system/suite_general/tst_session_handling/test.py +++ b/tests/system/suite_general/tst_session_handling/test.py @@ -39,7 +39,7 @@ def main(): "Verifying window title contains created session name.") checkWelcomePage(sessionName, True) for project in projects: - openQmakeProject(project, [Targets.DESKTOP_5_6_1_DEFAULT]) + openQmakeProject(project, [Targets.DESKTOP_5_14_1_DEFAULT]) waitForProjectParsing() checkNavigator(52, "Verifying whether all projects have been opened.") openDocument("animation.Resources.animation\\.qrc./animation.basics.animators\\.qml") @@ -67,9 +67,9 @@ def main(): invokeMenuItem("File", "Exit") def prepareTestExamples(): - examples = [os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + examples = [os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "animation", "animation.pro"), - os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "keyinteraction", "keyinteraction.pro") ] projects = [] diff --git a/tests/system/suite_qtquick/tst_qml_outline/test.py b/tests/system/suite_qtquick/tst_qml_outline/test.py index 4c0c5e8a037..b0cd8df3165 100644 --- a/tests/system/suite_qtquick/tst_qml_outline/test.py +++ b/tests/system/suite_qtquick/tst_qml_outline/test.py @@ -30,7 +30,7 @@ outline = ":Qt Creator_QmlJSEditor::Internal::QmlJSOutlineTreeView" treebase = "keyinteraction.Resources.keyinteraction\\.qrc./keyinteraction.focus." def main(): - sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT), + sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_14_1_DEFAULT), "quick", "keyinteraction") proFile = "keyinteraction.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): @@ -39,7 +39,7 @@ def main(): startQC() if not startedWithoutPluginError(): return - openQmakeProject(os.path.join(templateDir, proFile), [Targets.DESKTOP_5_6_1_DEFAULT]) + openQmakeProject(os.path.join(templateDir, proFile), [Targets.DESKTOP_5_14_1_DEFAULT]) qmlFiles = [treebase + "focus\\.qml", treebase + "Core.ListMenu\\.qml"] checkOutlineFor(qmlFiles) testModify() diff --git a/tests/system/suite_qtquick/tst_qtquick_creation/test.py b/tests/system/suite_qtquick/tst_qtquick_creation/test.py index d27b7fa9c0a..d8a5cc8ee29 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation/test.py @@ -30,8 +30,8 @@ def main(): if not startedWithoutPluginError(): return - available = [("5.6", "Qt Quick Application - Empty", Targets.DESKTOP_5_6_1_DEFAULT), - ("5.10", "Qt Quick Application - Swipe", Targets.DESKTOP_5_10_1_DEFAULT)] + available = [("5.10", "Qt Quick Application - Empty", Targets.DESKTOP_5_10_1_DEFAULT), + ("5.14", "Qt Quick Application - Swipe", Targets.DESKTOP_5_14_1_DEFAULT)] for qtVersion, appTemplate, targ in available: # using a temporary directory won't mess up a potentially existing diff --git a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py index adf7c4f62f8..1b2613cda83 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py @@ -36,7 +36,7 @@ def main(): startQC() if not startedWithoutPluginError(): return - available = ["5.6", "5.10"] + available = ["5.10", "5.14"] for qtVersion in available: # using a temporary directory won't mess up a potentially existing @@ -45,9 +45,9 @@ def main(): checkedKitNames = Targets.getTargetsAsStrings(checkedKits) test.verify(_exactlyOne_(map(lambda name: qtVersion in name, checkedKitNames)), "The requested kit should have been checked") - if qtVersion == "5.10": - test.verify(not any(map(lambda name: "5.6" in name, checkedKitNames)), - "The 5.6 kit should not have been checked when 5.10 is required") + if qtVersion == "5.14": + test.verify(not any(map(lambda name: "5.10" in name, checkedKitNames)), + "The 5.10 kit should not have been checked when 5.14 is required") clickButton(waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")) if not waitForProcessRunning(): test.fatal("Couldn't start application - leaving test") diff --git a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py index 630cb35bae8..82d04ef8d3d 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py @@ -29,7 +29,7 @@ def main(): startQC() if not startedWithoutPluginError(): return - for target in [Targets.DESKTOP_5_6_1_DEFAULT, Targets.DESKTOP_5_10_1_DEFAULT]: + for target in [Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT]: # using a temporary directory won't mess up a potentially existing createNewQmlExtension(tempDir(), [target]) # wait for parsing to complete From af8e1530771c439876c3c9b5924d00a04b7fc1cb Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 9 Mar 2020 18:36:28 +0100 Subject: [PATCH 22/25] QmlDesigner: Create NavigatorWidget lazily Change-Id: I12ebee0867de01af77c37ff97ad9bd4772f06b05 Reviewed-by: Aleksei German Reviewed-by: Thomas Hartmann --- .../components/navigator/navigatorview.cpp | 107 ++++++++++-------- .../components/navigator/navigatorview.h | 1 + 2 files changed, 59 insertions(+), 49 deletions(-) diff --git a/src/plugins/qmldesigner/components/navigator/navigatorview.cpp b/src/plugins/qmldesigner/components/navigator/navigatorview.cpp index 8da3cc9bba0..7401e5e3704 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorview.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatorview.cpp @@ -72,57 +72,9 @@ namespace QmlDesigner { NavigatorView::NavigatorView(QObject* parent) : AbstractView(parent), - m_blockSelectionChangedSignal(false), - m_widget(new NavigatorWidget(this)), - m_treeModel(new NavigatorTreeModel(this)) + m_blockSelectionChangedSignal(false) { -#ifndef QMLDESIGNER_TEST - auto navigatorContext = new Internal::NavigatorContext(m_widget.data()); - Core::ICore::addContextObject(navigatorContext); -#endif - m_treeModel->setView(this); - m_widget->setTreeModel(m_treeModel.data()); - m_currentModelInterface = m_treeModel; - - connect(treeWidget()->selectionModel(), &QItemSelectionModel::selectionChanged, this, &NavigatorView::changeSelection); - - connect(m_widget.data(), &NavigatorWidget::leftButtonClicked, this, &NavigatorView::leftButtonClicked); - connect(m_widget.data(), &NavigatorWidget::rightButtonClicked, this, &NavigatorView::rightButtonClicked); - connect(m_widget.data(), &NavigatorWidget::downButtonClicked, this, &NavigatorView::downButtonClicked); - connect(m_widget.data(), &NavigatorWidget::upButtonClicked, this, &NavigatorView::upButtonClicked); - connect(m_widget.data(), &NavigatorWidget::filterToggled, this, &NavigatorView::filterToggled); - -#ifndef QMLDESIGNER_TEST - auto idDelegate = new NameItemDelegate(this); - IconCheckboxItemDelegate *showDelegate = - new IconCheckboxItemDelegate(this, - Utils::Icons::EYE_OPEN_TOOLBAR.icon(), - Utils::Icons::EYE_CLOSED_TOOLBAR.icon()); - - IconCheckboxItemDelegate *exportDelegate = - new IconCheckboxItemDelegate(this, - Icons::EXPORT_CHECKED.icon(), - Icons::EXPORT_UNCHECKED.icon()); - -#ifdef _LOCK_ITEMS_ - IconCheckboxItemDelegate *lockDelegate = - new IconCheckboxItemDelegate(this, - Utils::Icons::LOCKED_TOOLBAR.icon(), - Utils::Icons::UNLOCKED_TOOLBAR.icon()); -#endif - - - treeWidget()->setItemDelegateForColumn(0, idDelegate); -#ifdef _LOCK_ITEMS_ - treeWidget()->setItemDelegateForColumn(1,lockDelegate); - treeWidget()->setItemDelegateForColumn(2,showDelegate); -#else - treeWidget()->setItemDelegateForColumn(1, exportDelegate); - treeWidget()->setItemDelegateForColumn(2, showDelegate); -#endif - -#endif //QMLDESIGNER_TEST } NavigatorView::~NavigatorView() @@ -138,6 +90,9 @@ bool NavigatorView::hasWidget() const WidgetInfo NavigatorView::widgetInfo() { + if (!m_widget) + setupWidget(); + return createWidgetInfo(m_widget.data(), new WidgetInfo::ToolBarWidgetDefaultFactory(m_widget.data()), QStringLiteral("Navigator"), @@ -519,4 +474,58 @@ void NavigatorView::reparentAndCatch(NodeAbstractProperty property, const ModelN } } +void NavigatorView::setupWidget() +{ + m_widget = new NavigatorWidget(this); + m_treeModel = new NavigatorTreeModel(this); + +#ifndef QMLDESIGNER_TEST + auto navigatorContext = new Internal::NavigatorContext(m_widget.data()); + Core::ICore::addContextObject(navigatorContext); +#endif + + m_treeModel->setView(this); + m_widget->setTreeModel(m_treeModel.data()); + m_currentModelInterface = m_treeModel; + + connect(treeWidget()->selectionModel(), &QItemSelectionModel::selectionChanged, this, &NavigatorView::changeSelection); + + connect(m_widget.data(), &NavigatorWidget::leftButtonClicked, this, &NavigatorView::leftButtonClicked); + connect(m_widget.data(), &NavigatorWidget::rightButtonClicked, this, &NavigatorView::rightButtonClicked); + connect(m_widget.data(), &NavigatorWidget::downButtonClicked, this, &NavigatorView::downButtonClicked); + connect(m_widget.data(), &NavigatorWidget::upButtonClicked, this, &NavigatorView::upButtonClicked); + connect(m_widget.data(), &NavigatorWidget::filterToggled, this, &NavigatorView::filterToggled); + +#ifndef QMLDESIGNER_TEST + auto idDelegate = new NameItemDelegate(this); + IconCheckboxItemDelegate *showDelegate = + new IconCheckboxItemDelegate(this, + Utils::Icons::EYE_OPEN_TOOLBAR.icon(), + Utils::Icons::EYE_CLOSED_TOOLBAR.icon()); + + IconCheckboxItemDelegate *exportDelegate = + new IconCheckboxItemDelegate(this, + Icons::EXPORT_CHECKED.icon(), + Icons::EXPORT_UNCHECKED.icon()); + +#ifdef _LOCK_ITEMS_ + IconCheckboxItemDelegate *lockDelegate = + new IconCheckboxItemDelegate(this, + Utils::Icons::LOCKED_TOOLBAR.icon(), + Utils::Icons::UNLOCKED_TOOLBAR.icon()); +#endif + + + treeWidget()->setItemDelegateForColumn(0, idDelegate); +#ifdef _LOCK_ITEMS_ + treeWidget()->setItemDelegateForColumn(1,lockDelegate); + treeWidget()->setItemDelegateForColumn(2,showDelegate); +#else + treeWidget()->setItemDelegateForColumn(1, exportDelegate); + treeWidget()->setItemDelegateForColumn(2, showDelegate); +#endif + +#endif //QMLDESIGNER_TEST +} + } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/navigator/navigatorview.h b/src/plugins/qmldesigner/components/navigator/navigatorview.h index 057e83a74de..852dddc70fc 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorview.h +++ b/src/plugins/qmldesigner/components/navigator/navigatorview.h @@ -110,6 +110,7 @@ protected: //functions bool blockSelectionChangedSignal(bool block); void expandRecursively(const QModelIndex &index); void reparentAndCatch(NodeAbstractProperty property, const ModelNode &modelNode); + void setupWidget(); private: bool m_blockSelectionChangedSignal; From 97112f3e4dd683c45711e1420942a1cc81553a0e Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 9 Mar 2020 18:37:17 +0100 Subject: [PATCH 23/25] QmlDesigner: Add back toolbar to NavigatorView Change-Id: I9e8c0372a85ec40b795f8d8fc68bb22959f73513 Reviewed-by: Aleksei German Reviewed-by: Thomas Hartmann --- .../components/navigator/navigatorwidget.cpp | 22 +++++++++++++++++-- .../components/navigator/navigatorwidget.h | 2 ++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp b/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp index 0d2417e3944..5c326f65faf 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp @@ -61,6 +61,11 @@ NavigatorWidget::NavigatorWidget(NavigatorView *view) layout->setSpacing(0); layout->setContentsMargins(0, 0, 0, 0); + QWidget *toolBar = createToolBar(); + + toolBar->setParent(this); + layout->addWidget(toolBar); + layout->addWidget(m_treeView); setLayout(layout); @@ -124,8 +129,10 @@ QList NavigatorWidget::createToolBarWidgets() auto filterMenu = new QMenu(filter); auto objectAction = new QAction(tr("Show only visible items."), nullptr); objectAction->setCheckable(true); - objectAction->setChecked( - DesignerSettings::getValue(DesignerSettingsKey::NAVIGATOR_SHOW_ONLY_VISIBLE_ITEMS).toBool()); + + bool filterFlag = DesignerSettings::getValue(DesignerSettingsKey::NAVIGATOR_SHOW_ONLY_VISIBLE_ITEMS).toBool(); + objectAction->setChecked(filterFlag); + connect(objectAction, &QAction::toggled, this, &NavigatorWidget::filterToggled); filterMenu->addAction(objectAction); filter->setMenu(filterMenu); @@ -134,6 +141,17 @@ QList NavigatorWidget::createToolBarWidgets() return buttons; } +QToolBar *NavigatorWidget::createToolBar() +{ + const QList buttons = createToolBarWidgets(); + + auto toolBar = new QToolBar(); + for (auto toolButton : buttons) + toolBar->addWidget(toolButton); + + return toolBar; +} + void NavigatorWidget::contextHelp(const Core::IContext::HelpCallback &callback) const { if (navigatorView()) diff --git a/src/plugins/qmldesigner/components/navigator/navigatorwidget.h b/src/plugins/qmldesigner/components/navigator/navigatorwidget.h index f02f0b52807..b6240aa3bb9 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorwidget.h +++ b/src/plugins/qmldesigner/components/navigator/navigatorwidget.h @@ -32,6 +32,7 @@ #include "navigatortreeview.h" +QT_FORWARD_DECLARE_CLASS(QToolBar) QT_FORWARD_DECLARE_CLASS(QToolButton) QT_FORWARD_DECLARE_CLASS(QAbstractItemModel) @@ -48,6 +49,7 @@ public: void setTreeModel(QAbstractItemModel *model); QTreeView *treeView() const; QList createToolBarWidgets(); + QToolBar *createToolBar(); void contextHelp(const Core::IContext::HelpCallback &callback) const; void disableNavigator(); From 4ce49bbfdedc889521799f97952653a423fdd6f8 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 9 Mar 2020 19:09:13 +0100 Subject: [PATCH 24/25] QmlDesigner: Add toolbar back to ConnectionView Setting the fusion style only on the stack widget to keep the toolbar style. Change-Id: I33b8256f894fa417a8729b8cdebb19a3128f1fde Reviewed-by: Aleksei German Reviewed-by: Thomas Hartmann --- .../connectioneditor/connectionviewwidget.cpp | 7 ++++++- .../connectioneditor/connectionviewwidget.ui | 12 ++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp b/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp index 30aaf2b0045..ae4532f1f13 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp +++ b/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp @@ -85,7 +85,7 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) : ui->setupUi(this); QStyle *style = QStyleFactory::create("fusion"); - setStyle(style); + ui->stackedWidget->setStyle(style); //ui->tabWidget->tabBar()->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); @@ -96,6 +96,11 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) : ui->tabBar->addTab(tr("Bindings", "Title of connection view")); ui->tabBar->addTab(tr("Properties", "Title of dynamic properties view")); + const QList buttons = createToolBarWidgets(); + + for (auto toolButton : buttons) + ui->toolBar->addWidget(toolButton); + auto settings = QmlDesignerPlugin::instance()->settings(); if (!settings.value(DesignerSettingsKey::STANDALONE_MODE).toBool()) diff --git a/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.ui b/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.ui index 18df078ec6b..1828811abf4 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.ui +++ b/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.ui @@ -29,6 +29,9 @@ 0 + + + @@ -51,10 +54,7 @@ - - - - + 3 @@ -255,10 +255,14 @@ + + + stackedWidget tabBar widgetSpacer + toolBar From 3992e3c113155055540a6b1d30d82822a08c4b64 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 10 Mar 2020 13:25:50 +0100 Subject: [PATCH 25/25] macOS: Fix label color in tool buttons For example the "Ignore Whitespace" button in the diff viewer Change-Id: I9882b9d2f3e22635bfbb047904ef284dd515db9f Reviewed-by: Alessandro Portale --- src/plugins/coreplugin/manhattanstyle.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index aa60cf34570..b55b885615d 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -857,7 +857,11 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt } } break; - + case CE_ToolButtonLabel: + // Directly use QCommonStyle to circumvent funny painting in QMacStyle + // which ignores the palette and adds an alpha + QCommonStyle::drawControl(element, option, painter, widget); + break; default: QProxyStyle::drawControl(element, option, painter, widget); break;