From 3fbb5ddba873e65855e8cf4d9b404170746fc511 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 16 Jul 2019 12:29:20 +0200 Subject: [PATCH 01/17] LanguageClient: Show outline after server start If the server was started by opening a document the outline factory and client was not properly initialized in the time the outline was requested. Update the outline after the client is fully initialized. Fixes: QTCREATORBUG-22695 Change-Id: I84dc56eead9774d80ed6baf7792daff930a7cb8e Reviewed-by: Eike Ziller --- src/plugins/languageclient/client.cpp | 5 +++++ src/plugins/texteditor/ioutlinewidget.h | 2 ++ src/plugins/texteditor/outlinefactory.cpp | 21 +++++++++++++++++++-- src/plugins/texteditor/outlinefactory.h | 6 +++++- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 3acea150800..dba6f93cc22 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -1139,6 +1140,10 @@ void Client::intializeCallback(const InitializeRequest::Response &initResponse) if (auto textEditor = qobject_cast(editor)) textEditor->editorWidget()->addHoverHandler(&m_hoverHandler); } + if (m_dynamicCapabilities.isRegistered(DocumentSymbolsRequest::methodName) + .value_or(capabilities().documentSymbolProvider().value_or(false))) { + TextEditor::IOutlineWidgetFactory::updateOutline(); + } emit initialized(m_serverCapabilities); } diff --git a/src/plugins/texteditor/ioutlinewidget.h b/src/plugins/texteditor/ioutlinewidget.h index 875181d8f07..ff0efa37b5e 100644 --- a/src/plugins/texteditor/ioutlinewidget.h +++ b/src/plugins/texteditor/ioutlinewidget.h @@ -56,6 +56,8 @@ public: virtual bool supportsEditor(Core::IEditor *editor) const = 0; virtual IOutlineWidget *createWidget(Core::IEditor *editor) = 0; + + static void updateOutline(); }; } // namespace TextEditor diff --git a/src/plugins/texteditor/outlinefactory.cpp b/src/plugins/texteditor/outlinefactory.cpp index 96011f4154a..038cd58cab4 100644 --- a/src/plugins/texteditor/outlinefactory.cpp +++ b/src/plugins/texteditor/outlinefactory.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -40,6 +41,7 @@ namespace TextEditor { static QList g_outlineWidgetFactories; +static QPointer g_outlineFactory; IOutlineWidgetFactory::IOutlineWidgetFactory() { @@ -51,6 +53,12 @@ IOutlineWidgetFactory::~IOutlineWidgetFactory() g_outlineWidgetFactories.removeOne(this); } +void IOutlineWidgetFactory::updateOutline() +{ + if (QTC_GUARD(!g_outlineFactory.isNull())) + emit g_outlineFactory->updateOutline(); +} + namespace Internal { OutlineWidgetStack::OutlineWidgetStack(OutlineFactory *factory) : @@ -88,8 +96,10 @@ OutlineWidgetStack::OutlineWidgetStack(OutlineFactory *factory) : m_filterButton->setMenu(m_filterMenu); connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged, + this, &OutlineWidgetStack::updateEditor); + connect(factory, &OutlineFactory::updateOutline, this, &OutlineWidgetStack::updateCurrentEditor); - updateCurrentEditor(Core::EditorManager::currentEditor()); + updateCurrentEditor(); } OutlineWidgetStack::~OutlineWidgetStack() = default; @@ -159,7 +169,12 @@ void OutlineWidgetStack::updateFilterMenu() m_filterButton->setVisible(!m_filterMenu->actions().isEmpty()); } -void OutlineWidgetStack::updateCurrentEditor(Core::IEditor *editor) +void OutlineWidgetStack::updateCurrentEditor() +{ + updateEditor(Core::EditorManager::currentEditor()); +} + +void OutlineWidgetStack::updateEditor(Core::IEditor *editor) { IOutlineWidget *newWidget = nullptr; @@ -195,6 +210,8 @@ void OutlineWidgetStack::updateCurrentEditor(Core::IEditor *editor) OutlineFactory::OutlineFactory() { + QTC_CHECK(g_outlineFactory.isNull()); + g_outlineFactory = this; setDisplayName(tr("Outline")); setId("Outline"); setPriority(600); diff --git a/src/plugins/texteditor/outlinefactory.h b/src/plugins/texteditor/outlinefactory.h index 00a5732c83f..375caf02ac5 100644 --- a/src/plugins/texteditor/outlinefactory.h +++ b/src/plugins/texteditor/outlinefactory.h @@ -55,7 +55,8 @@ private: QWidget *dummyWidget() const; void updateFilterMenu(); void toggleCursorSynchronization(); - void updateCurrentEditor(Core::IEditor *editor); + void updateEditor(Core::IEditor *editor); + void updateCurrentEditor(); QStackedWidget *m_widgetStack; OutlineFactory *m_factory; @@ -76,6 +77,9 @@ public: Core::NavigationView createWidget() override; void saveSettings(QSettings *settings, int position, QWidget *widget) override; void restoreSettings(QSettings *settings, int position, QWidget *widget) override; + +signals: + void updateOutline(); }; } // namespace Internal From 32ac159ce663bf978216e661881690e9041f8556 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 17 Jul 2019 14:55:39 +0200 Subject: [PATCH 02/17] File search: Avoid symlink loops and duplicate directories Looks like this was always broken, but got more prominent by the introduction of automatic directory locator filters for all open projects. Task-number: QTCREATORBUG-22662 Change-Id: I248fb611bb1a6226b27901ea6ab310fc640def7a Reviewed-by: Christian Kandeler Reviewed-by: David Schulz --- src/libs/utils/filesearch.cpp | 44 ++++++++++++++++++++++------------- src/libs/utils/filesearch.h | 1 + 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp index 0bdf3991c5e..03aa1cf9b20 100644 --- a/src/libs/utils/filesearch.cpp +++ b/src/libs/utils/filesearch.cpp @@ -651,11 +651,16 @@ SubDirFileIterator::SubDirFileIterator(const QStringList &directories, const QSt { m_encoding = (encoding == nullptr ? QTextCodec::codecForLocale() : encoding); qreal maxPer = qreal(MAX_PROGRESS) / directories.count(); - foreach (const QString &directoryEntry, directories) { + for (const QString &directoryEntry : directories) { if (!directoryEntry.isEmpty()) { - m_dirs.push(QDir(directoryEntry)); - m_progressValues.push(maxPer); - m_processedValues.push(false); + const QDir dir(directoryEntry); + const QString canonicalPath = dir.canonicalPath(); + if (!canonicalPath.isEmpty() && dir.exists()) { + m_dirs.push(dir); + m_knownDirs.insert(canonicalPath); + m_progressValues.push(maxPer); + m_processedValues.push(false); + } } } } @@ -676,10 +681,18 @@ void SubDirFileIterator::update(int index) const bool processed = m_processedValues.pop(); if (dir.exists()) { const QString dirPath = dir.path(); - QStringList subDirs; - if (!processed) - subDirs = dir.entryList(QDir::Dirs|QDir::Hidden|QDir::NoDotAndDotDot); - if (subDirs.isEmpty()) { + using Dir = QString; + using CanonicalDir = QString; + std::vector> subDirs; + if (!processed) { + for (const QFileInfo &info : + dir.entryInfoList(QDir::Dirs | QDir::Hidden | QDir::NoDotAndDotDot)) { + const QString canonicalDir = info.canonicalFilePath(); + if (!m_knownDirs.contains(canonicalDir)) + subDirs.emplace_back(info.filePath(), canonicalDir); + } + } + if (subDirs.empty()) { const QStringList allFileEntries = dir.entryList(QDir::Files|QDir::Hidden); const QStringList allFilePaths = Utils::transform(allFileEntries, [&dirPath](const QString &entry) { @@ -696,14 +709,13 @@ void SubDirFileIterator::update(int index) m_dirs.push(dir); m_progressValues.push(subProgress); m_processedValues.push(true); - QStringListIterator it(subDirs); - it.toBack(); - while (it.hasPrevious()) { - const QString &directory = it.previous(); - m_dirs.push(QDir(dirPath + QLatin1Char('/') + directory)); - m_progressValues.push(subProgress); - m_processedValues.push(false); - } + Utils::reverseForeach(subDirs, + [this, subProgress](const std::pair &dir) { + m_dirs.push(QDir(dir.first)); + m_knownDirs.insert(dir.second); + m_progressValues.push(subProgress); + m_processedValues.push(false); + }); } } else { m_progress += dirProgressMax; diff --git a/src/libs/utils/filesearch.h b/src/libs/utils/filesearch.h index cddb637184f..546a7334cc9 100644 --- a/src/libs/utils/filesearch.h +++ b/src/libs/utils/filesearch.h @@ -159,6 +159,7 @@ private: std::function m_filterFiles; QTextCodec *m_encoding; QStack m_dirs; + QSet m_knownDirs; QStack m_progressValues; QStack m_processedValues; qreal m_progress; From 20ef53a3464ece40319c4affff1b96fc22fe38ea Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 17 Jul 2019 14:56:34 +0200 Subject: [PATCH 03/17] ProjectExplorer: Fix missing KitManager::kitUpdated() emission Amends a503c00fd4. Fixes: QTCREATORBUG-22722 Change-Id: I17cca6d2c5c0ef4af2b4c77db6c926dc6ae8fd61 Reviewed-by: Christian Stenger --- src/plugins/projectexplorer/kitmanager.h | 4 ++-- src/plugins/projectexplorer/kitmanagerconfigwidget.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index 4cc80230c6d..b3185446475 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -55,7 +55,7 @@ class KitAspectWidget; class KitManager; namespace Internal { -class KitModel; +class KitManagerConfigWidget; } // namespace Internal /** @@ -220,7 +220,7 @@ private: friend class ProjectExplorerPlugin; // for constructor friend class Kit; - friend class Internal::KitModel; + friend class Internal::KitManagerConfigWidget; friend class KitAspect; // for notifyAboutUpdate and self-registration }; diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp index cdd508b0785..f49c61824fc 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp @@ -172,6 +172,7 @@ void KitManagerConfigWidget::apply() const auto copyIntoKit = [this](Kit *k) { k->copyFrom(m_modifiedKit.get()); }; if (m_kit) { copyIntoKit(m_kit); + KitManager::notifyAboutUpdate(m_kit); } else { m_isRegistering = true; m_kit = KitManager::registerKit(copyIntoKit); From 5ce028c499e4ca1b8b701850957acc6f8d043d3c Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Wed, 17 Jul 2019 16:46:24 +0200 Subject: [PATCH 04/17] Fix capitalization of "qmake" Shall be consistent with other wizards Change-Id: I810cf55abf519f5b67155063ce515c4442fc6637 Reviewed-by: Leena Miettinen Reviewed-by: Eike Ziller --- .../qtcreator/templates/wizards/projects/cpplibrary/wizard.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json b/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json index af209105bfd..e61048a4b64 100644 --- a/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json +++ b/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json @@ -59,7 +59,7 @@ "items": [ { - "trKey": "Qmake", + "trKey": "qmake", "value": "qmake", "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" }, From 83f83e0b5408ef4f83b9da1356563648f703a979 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 17 Jul 2019 13:28:26 +0200 Subject: [PATCH 05/17] Doc: Update info on LLDB support LLDB is no longer considered experimental on Linux. Change-Id: I56947461564ca5778ead6abdbf0bc70a80bfb9de Reviewed-by: Christian Stenger --- .../creator-only/creator-debugger-setup.qdoc | 36 +++---------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/doc/src/debugger/creator-only/creator-debugger-setup.qdoc b/doc/src/debugger/creator-only/creator-debugger-setup.qdoc index bf956faa48c..379e821eb5a 100644 --- a/doc/src/debugger/creator-only/creator-debugger-setup.qdoc +++ b/doc/src/debugger/creator-only/creator-debugger-setup.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -77,10 +77,9 @@ \QC supports native debuggers when working with compiled code. On most supported platforms, the GNU Symbolic Debugger GDB can be used. On - Microsoft Windows, when using the Microsoft tool chain the Microsoft Console - Debugger CDB, is needed. On \macos, the LLDB debugger can be used. Basic - support for LLDB is also available on Linux, but it is restricted by LLDB's - capabilities there, and considered experimental. + Microsoft Windows, when using the Microsoft tool chain, the Microsoft + Console Debugger CDB is needed. On \macos and Linux, the LLDB debugger + can be used. The following table summarizes the support for debugging C++ code: @@ -92,7 +91,7 @@ \row \li Linux \li GCC, ICC - \li GDB, LLDB (experimental) + \li GDB, LLDB \row \li Unix \li GCC, ICC @@ -340,29 +339,4 @@ of the project. \endlist - - \section1 Setting Up Experimental LLDB Support - - To use the experimental interface to LLDB, you must set up a kit that uses - the LLDB engine and select the kit for your project: - - \list 1 - - \li Select \uicontrol Tools > \uicontrol Options > - \uicontrol Kits. - - \li Select an automatically created kit in the list, and then select - \uicontrol Clone to create a copy of the kit. - - \li In the \uicontrol Debugger field, select an LLDB Engine. If an LLDB - Engine is not listed, select \uicontrol Manage to add it in - \uicontrol Tools > \uicontrol Options > \uicontrol Kits > - \uicontrol Debuggers. For more information, see - \l {Adding Debuggers}. - - \li To use the debugger, add the kit in the \uicontrol {Build Settings} - of the project. - - \endlist - */ From 56337478e7e435e4ff9a301a848ba19f2a86cab6 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 18 Jul 2019 10:43:09 +0200 Subject: [PATCH 06/17] Clang: Tests: Fix flaky testCompleteProjectDependingCodeAfterChangingProject After changing the project, ensure that the project part is updated and thus the backend is notified about it, otherwise we run into a race condition. Change-Id: Iea1ff16156350d10982cfd7fac3e8e5220eb4726 Reviewed-by: Christian Stenger --- src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp index 8d3f1b54a08..cb8105a33a1 100644 --- a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp +++ b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp @@ -655,6 +655,7 @@ void ClangCodeCompletionTest::testCompleteProjectDependingCodeAfterChangingProje // Check completion with project configuration 2 QVERIFY(projectLoader.updateProject({{"PROJECT_CONFIGURATION_2"}})); + openEditor.waitUntilBackendIsNotified(); proposal = completionResults(openEditor.editor()); QVERIFY(!hasItem(proposal, "projectConfiguration1")); From bfb971920a66730f7f3d4f859be35e6852570150 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 28 Jun 2019 11:24:09 +0200 Subject: [PATCH 07/17] Debugger: Fix CharArrays dumper test Change-Id: I041700a2a6ddac7f3a07b0e0d5dd876a9d542f5b Reviewed-by: Christian Stenger --- tests/auto/debugger/tst_dumpers.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index d8dfac056f9..f6b3cd8b56d 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -5344,11 +5344,11 @@ void tst_Dumpers::dumper_data() + CheckType("t", "char [5]") % CdbEngine + Check("t.0", "[0]", "97", "char") + CheckType("w", "wchar_t [4]") - + Check("ch.0", "[0]", "97", "CHAR") + + Check("ch.0", "[0]", "97", TypeDef("char", "CHAR")) + CheckType("ch", "CHAR [5]") % NoCdbEngine - + CheckType("ch", "CHAR [4]") % CdbEngine - + Check("wch.0", "[0]", "97", "WCHAR") - + CheckType("wch", "WCHAR [4]"); + + CheckType("ch", "char [4]") % CdbEngine + + Check("wch.0", "[0]", "97", TypeDef("wchar_t", "WCHAR")) + + CheckType("wch", TypeDef("wchar_t[4]", "WCHAR [4]")); QTest::newRow("CharPointers") From c8e656c506e22d62968ae2a5adf09c96f49efe12 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 18 Jul 2019 12:55:43 +0200 Subject: [PATCH 08/17] Add qbs support to library wizard Change-Id: Id78bc547cf42dec8948d7ebca56eacfcbbd2f055 Reviewed-by: Christian Stenger --- .../wizards/projects/cpplibrary/project.qbs | 59 +++++++++++++++++++ .../wizards/projects/cpplibrary/wizard.json | 17 +++++- 2 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 share/qtcreator/templates/wizards/projects/cpplibrary/project.qbs diff --git a/share/qtcreator/templates/wizards/projects/cpplibrary/project.qbs b/share/qtcreator/templates/wizards/projects/cpplibrary/project.qbs new file mode 100644 index 00000000000..0e5df73e84f --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/cpplibrary/project.qbs @@ -0,0 +1,59 @@ +import qbs.FileInfo + +@if %{IsStatic} +StaticLibrary { +@else +DynamicLibrary { +@endif +@if '%{QtModule}' === 'none' + Depends { name: "cpp" } +@else + Depends { name: "Qt.%{QtModule}" } +@endif + + cpp.cxxLanguageVersion: "c++11" + cpp.defines: [ +@if %{IsShared} + "%{LibraryDefine}", +@endif +@if %{IsQtPlugin} + "QT_PLUGIN", +@endif + + // The following define makes your compiler emit warnings if you use + // any Qt feature that has been marked deprecated (the exact warnings + // depend on your compiler). Please consult the documentation of the + // deprecated API in order to know how to port your code away from it. + "QT_DEPRECATED_WARNINGS", + + // You can also make your code fail to compile if it uses deprecated APIs. + // In order to do so, uncomment the following line. + // You can also select to disable deprecated APIs only up to a certain version of Qt. + // "QT_DISABLE_DEPRECATED_BEFORE=0x060000", // disables all the APIs deprecated before Qt 6.0.0 + ] + + files: [ + "%{SrcFileName}", +@if %{IsShared} + "%{GlobalHdrFileName}", +@endif + "%{HdrFileName}", +@if %{IsQtPlugin} + "%{PluginJsonFile}", +@endif + ] + +@if '%{TargetInstallPath}' != '' + // Default rules for deployment. + qbs.installPrefix: "" + Properties { + condition: qbs.targetOS.contains("unix") + install: true +@if %{IsQtPlugin} + installDir: FileInfo.joinPaths(Qt.core.pluginPath, "%{PluginTargetPath}") +@else + installDir: "%{TargetInstallPath}" +@endif + } +@endif +} diff --git a/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json b/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json index e61048a4b64..8f4c264499c 100644 --- a/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json +++ b/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json @@ -1,6 +1,6 @@ { "version": 1, - "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qt4ProjectManager.Qt4Project" ], + "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ], "id": "H.CppLibrary", "category": "G.Library", "trDescription": "Creates a C++ library. This can be used to create:
  • a shared C++ library for use with QPluginLoader and runtime (Plugins)
  • a shared or static C++ library for use with another project at linktime
", @@ -11,8 +11,8 @@ "options": [ - { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'qmake' ? value('ProFile') : value('CMakeFile')}" }, - { "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" }, + { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'cmake' ? value('CMakeFile') : value('ProFile')}" }, + { "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), value('BuildSystem') === 'qmake' ? 'pro' : 'qbs')}" }, { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, { "key": "PluginJsonFile", "value": "%{JS: Util.fileName(value('ProjectName'), 'json')}" }, { "key": "IsShared", "value": "%{JS: value('Type') === 'shared'}" }, @@ -67,6 +67,11 @@ "trKey": "CMake", "value": "cmake", "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" + }, + { + "trKey": "Qbs", + "value": "qbs", + "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}" } ] } @@ -291,6 +296,12 @@ "openAsProject": true, "condition": "%{JS: value('BuildSystem') === 'qmake'}" }, + { + "source": "project.qbs", + "target": "%{ProFile}", + "openAsProject": true, + "condition": "%{JS: value('BuildSystem') === 'qbs'}" + }, { "source": "CMakeLists.txt", "openAsProject": true, From 7b4cde9d65ab7a2001e60efffd80329fe1cb21ac Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 16 Jul 2019 13:56:40 +0200 Subject: [PATCH 09/17] RemoteLinux: Add "make install" step to pre-4.10 deploy configurations ... if applicable. Fixes: QTCREATORBUG-22689 Change-Id: If3cec90bed4d84f8bf82eb0cc1d831143ee2e298 Reviewed-by: Christian Stenger --- .../projectexplorer/deployconfiguration.cpp | 3 ++ .../projectexplorer/deployconfiguration.h | 5 +++ .../projectexplorer/userfileaccessor.cpp | 40 +++++++++++++++++++ .../remotelinuxdeployconfiguration.cpp | 10 ++++- 4 files changed, 57 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/deployconfiguration.cpp b/src/plugins/projectexplorer/deployconfiguration.cpp index 4d16599a12f..fcc0c886bf9 100644 --- a/src/plugins/projectexplorer/deployconfiguration.cpp +++ b/src/plugins/projectexplorer/deployconfiguration.cpp @@ -223,7 +223,10 @@ DeployConfiguration *DeployConfigurationFactory::restore(Target *parent, const Q if (!dc->fromMap(map)) { delete dc; dc = nullptr; + } else if (factory->postRestore()) { + factory->postRestore()(dc, map); } + return dc; } diff --git a/src/plugins/projectexplorer/deployconfiguration.h b/src/plugins/projectexplorer/deployconfiguration.h index 1d9ff883383..66d387291c9 100644 --- a/src/plugins/projectexplorer/deployconfiguration.h +++ b/src/plugins/projectexplorer/deployconfiguration.h @@ -97,6 +97,10 @@ public: void setConfigWidgetCreator(const std::function &configWidgetCreator); void setUseDeploymentDataView(); + using PostRestore = std::function; + void setPostRestore(const PostRestore &postRestore) { m_postRestore = postRestore; } + PostRestore postRestore() const { return m_postRestore; } + protected: using DeployConfigurationCreator = std::function; void setConfigBaseId(Core::Id deployConfigBaseId); @@ -109,6 +113,7 @@ private: QList m_initialSteps; QString m_defaultDisplayName; std::function m_configWidgetCreator; + PostRestore m_postRestore; }; class DefaultDeployConfigurationFactory : public DeployConfigurationFactory diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp index 838507e544d..f166425a1de 100644 --- a/src/plugins/projectexplorer/userfileaccessor.cpp +++ b/src/plugins/projectexplorer/userfileaccessor.cpp @@ -155,6 +155,18 @@ public: static QVariant process(const QVariant &entry); }; +// Version 21 adds a "make install" step to an existing RemoteLinux deploy configuration +// if and only if such a step would be added when creating a new one. +// See QTCREATORBUG-22689. +class UserFileVersion21Upgrader : public VersionUpgrader +{ +public: + UserFileVersion21Upgrader() : VersionUpgrader(21, "4.10-pre1") { } + QVariantMap upgrade(const QVariantMap &map) final; + + static QVariant process(const QVariant &entry); +}; + } // namespace // @@ -315,6 +327,7 @@ UserFileAccessor::UserFileAccessor(Project *project) : addVersionUpgrader(std::make_unique()); addVersionUpgrader(std::make_unique()); addVersionUpgrader(std::make_unique()); + addVersionUpgrader(std::make_unique()); } Project *UserFileAccessor::project() const @@ -855,6 +868,33 @@ QVariant UserFileVersion20Upgrader::process(const QVariant &entry) } } +QVariantMap UserFileVersion21Upgrader::upgrade(const QVariantMap &map) +{ + return process(map).toMap(); +} + +QVariant UserFileVersion21Upgrader::process(const QVariant &entry) +{ + switch (entry.type()) { + case QVariant::List: + return Utils::transform(entry.toList(), &UserFileVersion21Upgrader::process); + case QVariant::Map: { + QVariantMap entryMap = entry.toMap(); + if (entryMap.value("ProjectExplorer.ProjectConfiguration.Id").toString() + == "DeployToGenericLinux") { + entryMap.insert("_checkMakeInstall", true); + return entryMap; + } + return Utils::transform( + entryMap.toStdMap(), [](const std::pair &item) { + return qMakePair(item.first, UserFileVersion21Upgrader::process(item.second)); + }); + } + default: + return entry; + } +} + #if defined(WITH_TESTS) #include diff --git a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp b/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp index 88cd76f66d4..6bdef06dab9 100644 --- a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp @@ -61,11 +61,19 @@ RemoteLinuxDeployConfigurationFactory::RemoteLinuxDeployConfigurationFactory() "Deploy to Remote Linux Host")); setUseDeploymentDataView(); - addInitialStep(MakeInstallStep::stepId(), [](Target *target) { + const auto needsMakeInstall = [](Target *target) + { const Project * const prj = target->project(); return prj->deploymentKnowledge() == DeploymentKnowledge::Bad && prj->hasMakeInstallEquivalent(); + }; + setPostRestore([needsMakeInstall](DeployConfiguration *dc, const QVariantMap &map) { + // 4.9 -> 4.10. See QTCREATORBUG-22689. + if (map.value("_checkMakeInstall").toBool() && needsMakeInstall(dc->target())) + dc->stepList()->insertStep(0, new MakeInstallStep(dc->stepList())); }); + + addInitialStep(MakeInstallStep::stepId(), needsMakeInstall); addInitialStep(RemoteLinuxCheckForFreeDiskSpaceStep::stepId()); addInitialStep(RemoteLinuxKillAppStep::stepId()); addInitialStep(RsyncDeployStep::stepId(), [](Target *target) { From 4c6c3de53b658c8957db228834beb19f02f57751 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 18 Jul 2019 09:28:34 +0200 Subject: [PATCH 10/17] GenericProjectManager: Do not crash on removing all files When removing all files from a generic project QC crashed on trying to access the first item of the empty file list. Change-Id: I85045bf126f4e12575305466f0f4a6c4191176d3 Reviewed-by: Christian Kandeler --- .../genericprojectmanager/genericproject.cpp | 13 ++++++++----- src/plugins/genericprojectmanager/genericproject.h | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 89051f2a4a0..c15b9d85fb9 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -382,10 +382,13 @@ void GenericProject::parseProject(RefreshOptions options) } } -QString GenericProject::findCommonSourceRoot(const QStringList &list) +FilePath GenericProject::findCommonSourceRoot() { - QString root = list.front(); - for (const QString &item : list) { + if (m_files.isEmpty()) + return FilePath::fromFileInfo(QFileInfo(m_filesFileName).absolutePath()); + + QString root = m_files.front(); + for (const QString &item : m_files) { if (root.length() > item.length()) root.truncate(item.length()); @@ -396,7 +399,7 @@ QString GenericProject::findCommonSourceRoot(const QStringList &list) } } } - return QFileInfo(root).absolutePath(); + return FilePath::fromString(QFileInfo(root).absolutePath()); } void GenericProject::refresh(RefreshOptions options) @@ -408,7 +411,7 @@ void GenericProject::refresh(RefreshOptions options) auto newRoot = std::make_unique(this); // find the common base directory of all source files - Utils::FilePath baseDir = FilePath::fromFileInfo(QFileInfo(findCommonSourceRoot(m_files))); + Utils::FilePath baseDir = findCommonSourceRoot(); for (const QString &f : m_files) { FileType fileType = FileType::Source; // ### FIXME diff --git a/src/plugins/genericprojectmanager/genericproject.h b/src/plugins/genericprojectmanager/genericproject.h index d914ddc1495..9f742f322f5 100644 --- a/src/plugins/genericprojectmanager/genericproject.h +++ b/src/plugins/genericprojectmanager/genericproject.h @@ -66,7 +66,7 @@ private: QStringList processEntries(const QStringList &paths, QHash *map = nullptr) const; - static QString findCommonSourceRoot(const QStringList &list); + Utils::FilePath findCommonSourceRoot(); void refreshCppCodeModel(); void updateDeploymentData(); void activeTargetWasChanged(); From 53ca9752e25ec60f7f9a5da2958c776efa9696d9 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 18 Jul 2019 10:43:05 +0200 Subject: [PATCH 11/17] ProjectManagers: Avoid deletion of special files Do not allow deletion or rename of files that are used to define or manage projects. This fixes issues of being able to remove or rename pri and pro files of qmake based projects as well as special files used by the GenericProjectManager. Change-Id: Ib173abf04368f0625a9e481bb7290aa11933e62f Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/projectexplorer.cpp | 9 +++++---- src/plugins/qbsprojectmanager/qbsnodes.cpp | 13 ++----------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index c200fd0e547..3abb4b69516 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -3264,20 +3264,21 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions() m_addExistingFilesAction->setEnabled(supports(AddExistingFile)); m_addExistingDirectoryAction->setEnabled(supports(AddExistingDirectory)); m_renameFileAction->setEnabled(supports(Rename)); - } else if (currentNode->asFileNode()) { + } else if (auto fileNode = currentNode->asFileNode()) { // Enable and show remove / delete in magic ways: // If both are disabled show Remove // If both are enabled show both (can't happen atm) // If only removeFile is enabled only show it // If only deleteFile is enable only show it - bool enableRemove = supports(RemoveFile); + bool isTypeProject = fileNode->fileType() == FileType::Project; + bool enableRemove = !isTypeProject && supports(RemoveFile); m_removeFileAction->setEnabled(enableRemove); - bool enableDelete = supports(EraseFile); + bool enableDelete = !isTypeProject && supports(EraseFile); m_deleteFileAction->setEnabled(enableDelete); m_deleteFileAction->setVisible(enableDelete); m_removeFileAction->setVisible(!enableDelete || enableRemove); - m_renameFileAction->setEnabled(supports(Rename)); + m_renameFileAction->setEnabled(!isTypeProject && supports(Rename)); const bool currentNodeIsTextFile = isTextFile( currentNode->filePath().toString()); m_diffFileAction->setEnabled(DiffService::instance() diff --git a/src/plugins/qbsprojectmanager/qbsnodes.cpp b/src/plugins/qbsprojectmanager/qbsnodes.cpp index cbc6e597401..62762069b2a 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.cpp +++ b/src/plugins/qbsprojectmanager/qbsnodes.cpp @@ -217,17 +217,8 @@ static bool supportsNodeAction(ProjectAction action, const Node *node) const QbsProject * const project = parentQbsProjectNode(node)->project(); if (!project->isProjectEditable()) return false; - - auto equalsNodeFilePath = [node](const QString &str) - { - return str == node->filePath().toString(); - }; - - if (action == RemoveFile || action == Rename) { - if (node->asFileNode()) - return !Utils::contains(project->qbsProject().buildSystemFiles(), equalsNodeFilePath); - } - + if (action == RemoveFile || action == Rename) + return node->asFileNode(); return false; } From c65e480cbd9511b0641d9fdc46c86694767b3a87 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 18 Jul 2019 10:52:27 +0200 Subject: [PATCH 12/17] LanguageClient: include the range length in document updates The did change notification parameter has an arguable redundant range length field, but it seems that there are language server out there which rely on the presence of this field. Change-Id: Id29132fb6586a2886b8ba6d9a13df52a64f31161 Fixes: QTCREATORBUG-22694 Reviewed-by: Eike Ziller --- src/plugins/languageclient/client.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index dba6f93cc22..f53d4dd9dc9 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -469,6 +469,7 @@ void Client::documentContentsChanged(TextEditor::TextDocument *document, cursor.setPosition(position + charsRemoved); cursor.setPosition(position, QTextCursor::KeepAnchor); change.setRange(Range(cursor)); + change.setRangeLength(cursor.selectionEnd() - cursor.selectionStart()); change.setText(document->textAt(position, charsAdded)); params.setContentChanges({change}); } else { From 524cdf54bc8996ba2d7bbae1c61acb3e0b86f77a Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 18 Jul 2019 16:09:54 +0200 Subject: [PATCH 13/17] QtSupport: Fix handling of not yet saved *.ui files Since commit fb3e18bd4ba7c08346290cf498f28bf82a7162d9 Fix missing header guards in UI files the uic input comes from a file (on disk) and thus the source contents from the edited and not yet saved *.ui file (Designer mode) was ignored. Revert the relevant part. This should not introduce a regression as commit 47312b04c0878e0c308794cde08e92c03d4be29e QtSupport: Fix header guard for ui files basically superseded the first change, handling the proper inclusion of the generated header file. Fixes: QTCREATORBUG-22740 Change-Id: Iec6550817941eea99f823c377680b9a6fa5564e8 Reviewed-by: Christian Kandeler --- src/plugins/qtsupport/uicgenerator.cpp | 8 +++++++- src/plugins/qtsupport/uicgenerator.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/qtsupport/uicgenerator.cpp b/src/plugins/qtsupport/uicgenerator.cpp index abf8790016f..19248f3b366 100644 --- a/src/plugins/qtsupport/uicgenerator.cpp +++ b/src/plugins/qtsupport/uicgenerator.cpp @@ -67,7 +67,7 @@ Utils::FilePath UicGenerator::command() const QStringList UicGenerator::arguments() const { - return {"-p", source().toString()}; + return {"-p"}; } FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process) @@ -87,6 +87,12 @@ FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process) return result; } +void UicGenerator::handleProcessStarted(QProcess *process, const QByteArray &sourceContents) +{ + process->write(sourceContents); + process->closeWriteChannel(); +} + FileType UicGeneratorFactory::sourceType() const { return FileType::Form; diff --git a/src/plugins/qtsupport/uicgenerator.h b/src/plugins/qtsupport/uicgenerator.h index 1253e8f1abe..e1c7f013d04 100644 --- a/src/plugins/qtsupport/uicgenerator.h +++ b/src/plugins/qtsupport/uicgenerator.h @@ -43,6 +43,7 @@ protected: Utils::FilePath command() const override; QStringList arguments() const override; ProjectExplorer::FileNameToContentsHash handleProcessFinished(QProcess *process) override; + void handleProcessStarted(QProcess *process, const QByteArray &sourceContents) override; }; class UicGeneratorFactory : public ProjectExplorer::ExtraCompilerFactory From 636209fa92f95e82dbeb1b04dd2f9d56e71cebe0 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 18 Jul 2019 13:03:27 +0200 Subject: [PATCH 14/17] LSP: Add RenameOptions to the protocol implementation Task-number: QTCREATORBUG-22691 Change-Id: I7eb13079a174cc6da8580e11e06cef09ebcc7b99 Reviewed-by: Christian Stenger --- src/libs/languageserverprotocol/jsonkeys.h | 1 + .../servercapabilities.cpp | 21 ++++++++++++++++++- .../servercapabilities.h | 18 ++++++++++++++-- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/libs/languageserverprotocol/jsonkeys.h b/src/libs/languageserverprotocol/jsonkeys.h index e3673085ebb..7e1ea3720b7 100644 --- a/src/libs/languageserverprotocol/jsonkeys.h +++ b/src/libs/languageserverprotocol/jsonkeys.h @@ -144,6 +144,7 @@ constexpr char optionsKey[] = "options"; constexpr char parametersKey[] = "params"; constexpr char patternKey[] = "pattern"; constexpr char positionKey[] = "position"; +constexpr char prepareProviderKey[] = "prepareProvider"; constexpr char processIdKey[] = "processId"; constexpr char queryKey[] = "query"; constexpr char rangeFormattingKey[] = "rangeFormatting"; diff --git a/src/libs/languageserverprotocol/servercapabilities.cpp b/src/libs/languageserverprotocol/servercapabilities.cpp index 6ebf4f431fa..3d2721f4a69 100644 --- a/src/libs/languageserverprotocol/servercapabilities.cpp +++ b/src/libs/languageserverprotocol/servercapabilities.cpp @@ -111,6 +111,25 @@ Utils::optional> ServerCapabilities::cod return Utils::nullopt; } +Utils::optional> ServerCapabilities::renameProvider() const +{ + using RetType = Utils::variant; + const QJsonValue &localValue = value(renameProviderKey); + if (localValue.isBool()) + return RetType(localValue.toBool()); + if (localValue.isObject()) + return RetType(RenameOptions(localValue.toObject())); + return Utils::nullopt; +} + +void ServerCapabilities::setRenameProvider(Utils::variant renameProvider) +{ + if (Utils::holds_alternative(renameProvider)) + insert(renameProviderKey, Utils::get(renameProvider)); + else if (Utils::holds_alternative(renameProvider)) + insert(renameProviderKey, Utils::get(renameProvider)); +} + bool ServerCapabilities::isValid(QStringList *error) const { return checkOptional(error, textDocumentSyncKey) @@ -128,7 +147,7 @@ bool ServerCapabilities::isValid(QStringList *error) const && checkOptional(error, codeLensProviderKey) && checkOptional(error, documentFormattingProviderKey) && checkOptional(error, documentRangeFormattingProviderKey) - && checkOptional(error, renameProviderKey) + && checkOptional(error, renameProviderKey) && checkOptional(error, documentLinkProviderKey) && checkOptional(error, colorProviderKey) && checkOptional(error, executeCommandProviderKey) diff --git a/src/libs/languageserverprotocol/servercapabilities.h b/src/libs/languageserverprotocol/servercapabilities.h index 71d3e4a4965..0cbc7facf87 100644 --- a/src/libs/languageserverprotocol/servercapabilities.h +++ b/src/libs/languageserverprotocol/servercapabilities.h @@ -346,9 +346,23 @@ public: { insert(documentRangeFormattingProviderKey, documentRangeFormattingProvider); } void clearDocumentRangeFormattingProvider() { remove(documentRangeFormattingProviderKey); } + class RenameOptions : public JsonObject + { + public: + using JsonObject::JsonObject; + + // Renames should be checked and tested before being executed. + Utils::optional prepareProvider() const { return optionalValue(prepareProviderKey); } + void setPrepareProvider(bool prepareProvider) { insert(prepareProviderKey, prepareProvider); } + void clearPrepareProvider() { remove(prepareProviderKey); } + + bool isValid(QStringList * error) const override + { return checkOptional(error, prepareProviderKey); } + }; + // The server provides rename support. - Utils::optional renameProvider() const { return optionalValue(renameProviderKey); } - void setRenameProvider(bool renameProvider) { insert(renameProviderKey, renameProvider); } + Utils::optional> renameProvider() const; + void setRenameProvider(Utils::variant renameProvider); void clearRenameProvider() { remove(renameProviderKey); } // The server provides document link support. From 71fa2d950c938bcda279a5e5d8d0c64635030906 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 18 Jul 2019 13:26:34 +0200 Subject: [PATCH 15/17] LSP: update colorProvider entry of ServerCapabilities Since version 3.8.0 of the lsp the server can provide the information whether it supports colors also via an boolean value. The newly added ColorProviderOptions are currently completely empty, so we ignore them. Fixes: QTCREATORBUG-22691 Change-Id: I76232d160f4abed7b07574dc1b5413cead26b9f0 Reviewed-by: Christian Stenger --- .../servercapabilities.cpp | 21 ++++++++++++++++++- .../servercapabilities.h | 6 ++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/libs/languageserverprotocol/servercapabilities.cpp b/src/libs/languageserverprotocol/servercapabilities.cpp index 3d2721f4a69..1b2c0bd9cc0 100644 --- a/src/libs/languageserverprotocol/servercapabilities.cpp +++ b/src/libs/languageserverprotocol/servercapabilities.cpp @@ -130,6 +130,25 @@ void ServerCapabilities::setRenameProvider(Utils::variant(renameProvider)); } +Utils::optional> ServerCapabilities::colorProvider() const +{ + using RetType = Utils::variant; + const QJsonValue &localValue = value(colorProviderKey); + if (localValue.isBool()) + return RetType(localValue.toBool()); + if (localValue.isObject()) + return RetType(JsonObject(localValue.toObject())); + return Utils::nullopt; +} + +void ServerCapabilities::setColorProvider(Utils::variant colorProvider) +{ + if (Utils::holds_alternative(colorProvider)) + insert(renameProviderKey, Utils::get(colorProvider)); + else if (Utils::holds_alternative(colorProvider)) + insert(renameProviderKey, Utils::get(colorProvider)); +} + bool ServerCapabilities::isValid(QStringList *error) const { return checkOptional(error, textDocumentSyncKey) @@ -149,7 +168,7 @@ bool ServerCapabilities::isValid(QStringList *error) const && checkOptional(error, documentRangeFormattingProviderKey) && checkOptional(error, renameProviderKey) && checkOptional(error, documentLinkProviderKey) - && checkOptional(error, colorProviderKey) + && checkOptional(error, colorProviderKey) && checkOptional(error, executeCommandProviderKey) && checkOptional(error, workspaceKey); } diff --git a/src/libs/languageserverprotocol/servercapabilities.h b/src/libs/languageserverprotocol/servercapabilities.h index 0cbc7facf87..4c8011378f4 100644 --- a/src/libs/languageserverprotocol/servercapabilities.h +++ b/src/libs/languageserverprotocol/servercapabilities.h @@ -373,10 +373,8 @@ public: void clearDocumentLinkProvider() { remove(documentLinkProviderKey); } // The server provides color provider support. - Utils::optional colorProvider() const - { return optionalValue(colorProviderKey); } - void setColorProvider(TextDocumentRegistrationOptions colorProvider) - { insert(colorProviderKey, colorProvider); } + Utils::optional> colorProvider() const; + void setColorProvider(Utils::variant colorProvider); void clearColorProvider() { remove(colorProviderKey); } // The server provides execute command support. From 18e6962fca5e7103c50e9ee21419f176e8f0ce59 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 18 Jul 2019 15:09:43 +0200 Subject: [PATCH 16/17] LanguageClient: reverse error list for initialize errors like it's done in Client::handleMethod. Change-Id: I78c8c43f93ebde20b662fa3d1b6032d83ccac0fd Reviewed-by: Christian Stenger --- src/plugins/languageclient/client.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index f53d4dd9dc9..6e5d294bb7c 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -1123,8 +1123,10 @@ void Client::intializeCallback(const InitializeRequest::Response &initResponse) } else { const InitializeResult &result = _result.value(); QStringList error; - if (!result.isValid(&error)) // continue on ill formed result + if (!result.isValid(&error)) { // continue on ill formed result + std::reverse(error.begin(), error.end()); log(tr("Initialize result is not valid: ") + error.join("->")); + } m_serverCapabilities = result.capabilities().value_or(ServerCapabilities()); } From 4c77521a6fe1a491907084fed293b7d42a8dbc63 Mon Sep 17 00:00:00 2001 From: Aleksei German Date: Fri, 19 Jul 2019 15:03:38 +0200 Subject: [PATCH 17/17] QmlDesigner Icon for Gradient List button Change-Id: I875f15e06b39362247f9ee3c020acf125358c506 Reviewed-by: Tim Jenssen --- .../imports/HelperWidgets/ColorEditor.qml | 28 ++++++++---------- .../images/icon-gradient-list.png | Bin 0 -> 2124 bytes 2 files changed, 13 insertions(+), 15 deletions(-) create mode 100644 share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/images/icon-gradient-list.png diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml index 39fb95fce14..878d26c15e3 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml @@ -518,8 +518,8 @@ Column { height: 20 visible: colorEditor.supportGradient - color: "white" - border.color: "white" + color: Theme.qmlDesignerButtonColor() + border.color: Theme.qmlDesignerBorderColor() border.width: 1 ToolTipArea { @@ -566,20 +566,18 @@ Column { } } - Rectangle { - width: 18 - height: 18 + Image { + id: image + width: 16 + height: 16 + smooth: false anchors.centerIn: parent - color: "steelblue" - - border.color: "black" - border.width: 1 - - MouseArea { - anchors.fill: parent - onClicked: { - presetList.open() - } + source: "images/icon-gradient-list.png" + } + MouseArea { + anchors.fill: parent + onClicked: { + presetList.open() } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/images/icon-gradient-list.png b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/images/icon-gradient-list.png new file mode 100644 index 0000000000000000000000000000000000000000..ee53d07898354271f51385b34e95667f2eaf62b7 GIT binary patch literal 2124 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!toH&um1lmsP~D-;yvr)B1( zDwI?fq$;FVWTr7NRNQ(S9zE@i8qc5WTANr@6y;7IJT_;tY|2kfgED`68}oTjl;yY2 zG~A@Z5;8T@Jh%Su%@_PNM^-B58@9?c9X_5uf9U~_y#H@(t?k!+J|=r?^89lR2bR7l z-OqdbjQ)q)$qrvG@3;A_xo)%Htk%9$n-_eW$$IRJ_vQ(w-aW7Muk6$Qce?CZ{i)=0 zb{YJ8@BHR4Sha8-*U4pT_`>fCi)de1!&-YpbX!S(yROu+Q2S)} zW05C^d^q$aeC=t+S$Tf4eIx-w?83=gMU5!%mNwG|Ekw zqV%&iJkF5RP3+c|Se;Pp7~N^ieIf77&Z39MZodeR+vuV{+vSVW>K7kWdnct{oy%mB zC*YI?nn$5L+PWD5?e7VnS=NJ^Hrf@BmNInw1*#F%8Et>yG{=)cw&p+NvV#$;{7BzPUFi&t+v0 zd}gN8Cd#wpK$gr6*NG>1WQ2ccM(kWMot0<9%#dYlc_GXvJTE;zHsgeHxKEjRpO`>m zg^SXPgUl?O_L#p=|HZ;98vHpW?cgHS(_u|)@;WU7&i0GFuDn=$R3O>M@c1N?pDCJ4 zW(1vDnR2pA`ApG?iAAR@r#E?Wdx`hxozO^~=qkSdhS0PfOH}n!TWiAh-;%nvW0~pt zrCwLNj_+@iTDfdi_RWgsDQ5d`if!AmR5yRAW47rB(S#CO%# zDmGn{{H&~R7tw5eY%$CC$49Kv6MSr%Ki-gRSg^GCnNYR<+@0rUp0-$Yg=Njg(ju+$ zV+R)8k682ZESfdo}Nod%khuhVT#aN$TIM-3%UeZLXP7cCNPP zj7FFq!->peFTzh-ns3>2;)(Yfrs`cGH+&l}mVTIb;6+fPIjh@ruHBjj5W%H~^0<2R zM9YE`N>*-|&9vCN^{$A-UHe0J&K~7`8{Sv_THa}|)iPgZ?W1txzr3@m_E$KYg-S3m zFt8yhz literal 0 HcmV?d00001