From ad11e08f7288a156d76cf3f8aa0c931c67824efc Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Mon, 2 Jul 2018 15:29:15 +0200 Subject: [PATCH 01/22] ProjectExplorer: Search for clang-cl compiler in path Currently we only check if it's in the registry which is not the case when you have a custom build. Change-Id: I20ec25378d16996f790726ed14238861bc220004 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/msvctoolchain.cpp | 59 ++++++++++++------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index aead49aa6ce..24491e15982 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -1008,6 +1008,32 @@ static const ToolChain *selectMsvcToolChain(const QString &clangClPath, return toolChain; } +static void detectClangClToolChainInPath(const QString &clangClPath, QList *list) +{ + const unsigned char wordWidth = Utils::is64BitWindowsBinary(clangClPath) ? 64 : 32; + const ToolChain *toolChain = selectMsvcToolChain(clangClPath, *list, wordWidth); + + QDir path = QFileInfo(clangClPath).absoluteDir(); // bin folder + path.cdUp(); // cd to LLVM root + const QString rootPath = path.canonicalPath(); + + if (!toolChain) { + qWarning("Unable to find a suitable MSVC version for \"%s\".", + qPrintable(QDir::toNativeSeparators(rootPath))); + return; + } + const MsvcToolChain *msvcToolChain = static_cast(toolChain); + const Abi targetAbi = msvcToolChain->targetAbi(); + const QString name = QStringLiteral("LLVM ") + QString::number(wordWidth) + + QStringLiteral("bit based on ") + + Abi::toString(targetAbi.osFlavor()).toUpper(); + for (auto language: {Constants::C_LANGUAGE_ID, Constants::CXX_LANGUAGE_ID}) { + list->append(new ClangClToolChain(name, rootPath, targetAbi, + msvcToolChain->varsBat(), msvcToolChain->varsBatArg(), + language, ToolChain::AutoDetection)); + } +} + // Detect Clang-cl on top of MSVC2017, MSVC2015 or MSVC2013. static void detectClangClToolChain(QList *list) { @@ -1018,28 +1044,19 @@ static void detectClangClToolChain(QList *list) #endif const QSettings registry(QLatin1String(registryNode), QSettings::NativeFormat); - if (registry.status() != QSettings::NoError) - return; - const QString path = QDir::cleanPath(registry.value(QStringLiteral(".")).toString()); - if (path.isEmpty()) - return; - const QString clangClPath = compilerFromPath(path); - const unsigned char wordWidth = Utils::is64BitWindowsBinary(clangClPath) ? 64 : 32; - const ToolChain *toolChain = selectMsvcToolChain(clangClPath, *list, wordWidth); - if (!toolChain) { - qWarning("Unable to find a suitable MSVC version for \"%s\".", qPrintable(QDir::toNativeSeparators(path))); - return; - } - const MsvcToolChain *msvcToolChain = static_cast(toolChain); - const Abi targetAbi = msvcToolChain->targetAbi(); - const QString name = QStringLiteral("LLVM ") + QString::number(wordWidth) - + QStringLiteral("bit based on ") - + Abi::toString(targetAbi.osFlavor()).toUpper(); - for (auto language: {Constants::C_LANGUAGE_ID, Constants::CXX_LANGUAGE_ID}) { - list->append(new ClangClToolChain(name, path, targetAbi, - msvcToolChain->varsBat(), msvcToolChain->varsBatArg(), - language, ToolChain::AutoDetection)); + if (registry.status() == QSettings::NoError) { + const QString path = QDir::cleanPath(registry.value(QStringLiteral(".")).toString()); + const QString clangClPath = compilerFromPath(path); + if (!path.isEmpty()) { + detectClangClToolChainInPath(path, list); + return; + } } + + const Utils::Environment systemEnvironment = Utils::Environment::systemEnvironment(); + const Utils::FileName clangClPath = systemEnvironment.searchInPath("clang-cl"); + if (!clangClPath.isEmpty()) + detectClangClToolChainInPath(clangClPath.toString(), list); } QList MsvcToolChainFactory::autoDetect(const QList &alreadyKnown) From d9bcf78270b51ee8ca2355c603519fc18c52515d Mon Sep 17 00:00:00 2001 From: Vikas Pachdha Date: Thu, 5 Jul 2018 08:13:08 +0200 Subject: [PATCH 02/22] Android: Use ipv4 host to connect to app in android IPv6 enabled systems can have IPv4 and an IPv6 entry for localhost and macos seems to prefer IPv6 for localhost and IPv6 is not supported by adbd Task-number: QTCREATORBUG-20730 Change-Id: Ia0823fa04581afc6297e5e8d57a8034ba1b5749c Reviewed-by: hjk Reviewed-by: Ulf Hermann --- src/plugins/android/androiddebugsupport.cpp | 6 +++++- src/plugins/android/androidrunner.cpp | 2 ++ src/plugins/android/androidrunnerworker.cpp | 3 +-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp index 11fabdccfdb..84ed1bf52db 100644 --- a/src/plugins/android/androiddebugsupport.cpp +++ b/src/plugins/android/androiddebugsupport.cpp @@ -44,6 +44,7 @@ #include #include +#include using namespace Debugger; using namespace ProjectExplorer; @@ -131,7 +132,10 @@ void AndroidDebugSupport::start() + "/app_process"); setSkipExecutableValidation(true); setUseExtendedRemote(true); - setRemoteChannel(":" + m_runner->gdbServerPort().toString()); + QUrl gdbServer; + gdbServer.setHost(QHostAddress(QHostAddress::LocalHost).toString()); + gdbServer.setPort(m_runner->gdbServerPort().number()); + setRemoteChannel(gdbServer); setSysRoot(AndroidConfigurations::currentConfig().ndkLocation().appendPath("platforms") .appendPath(QString("android-%1").arg(AndroidManager::minimumSDK(target))) .appendPath(toNdkArch(AndroidManager::targetArch(target))).toString()); diff --git a/src/plugins/android/androidrunner.cpp b/src/plugins/android/androidrunner.cpp index 4ea111aeb3b..06475a3118e 100644 --- a/src/plugins/android/androidrunner.cpp +++ b/src/plugins/android/androidrunner.cpp @@ -34,6 +34,7 @@ #include "androidavdmanager.h" #include "androidrunnerworker.h" +#include #include #include #include @@ -197,6 +198,7 @@ void AndroidRunner::qmlServerPortReady(Port port) // device side. It only happens to work since we redirect // host port n to target port n via adb. QUrl serverUrl; + serverUrl.setHost(QHostAddress(QHostAddress::LocalHost).toString()); serverUrl.setPort(port.number()); serverUrl.setScheme(urlTcpScheme()); emit qmlServerReady(serverUrl); diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index d4bb5cc899c..39239bf6424 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -166,8 +166,7 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa QTC_CHECK(m_localGdbServerPort.isValid()); if (m_qmlDebugServices != QmlDebug::NoQmlDebugServices) { QTcpServer server; - QTC_ASSERT(server.listen(QHostAddress::LocalHost) - || server.listen(QHostAddress::LocalHostIPv6), + QTC_ASSERT(server.listen(QHostAddress::LocalHost), qDebug() << tr("No free ports available on host for QML debugging.")); m_qmlServer.setScheme(Utils::urlTcpScheme()); m_qmlServer.setHost(server.serverAddress().toString()); From 2cf84b84119e927522c022d7350ff39d8d66d19d Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 27 Jun 2018 17:20:46 +0200 Subject: [PATCH 03/22] Doc: Pull information about C++ sidebar views into separate file To make docs more modular. Change-Id: I58095b2b4e9e216808cc4d37b3494480cbf1787c Reviewed-by: Eike Ziller --- doc/src/cpp/creator-sidebar-cpp-views.qdocinc | 78 +++++++++++++++++++ doc/src/howto/creator-ui.qdoc | 40 ++-------- 2 files changed, 85 insertions(+), 33 deletions(-) create mode 100644 doc/src/cpp/creator-sidebar-cpp-views.qdocinc diff --git a/doc/src/cpp/creator-sidebar-cpp-views.qdocinc b/doc/src/cpp/creator-sidebar-cpp-views.qdocinc new file mode 100644 index 00000000000..5acefba93eb --- /dev/null +++ b/doc/src/cpp/creator-sidebar-cpp-views.qdocinc @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Creator documentation. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** +****************************************************************************/ + +/*! +//! [cpp sidebar views] + +The following views display additional information about C++ code: + + \list + \li \uicontrol {Class View} shows the class hierarchy of the currently + open projects. + \li \uicontrol Tests lists autotests and Qt Quick tests in the project. + For more information, see \l {Running Autotests}. + \li \uicontrol {Type Hierarchy} shows the base classes of a class. + \li \uicontrol {Include Hierarchy} shows which files are included in + the current file and which files include the current file. + \endlist + +//! [cpp sidebar views] + + +//! [class view] + + \section2 Viewing the Class Hierarchy + + The \uicontrol {Class View} shows the class hierarchy of the currently + open projects. To organize the view by subprojects, click + \inlineimage qtcreator-show-subprojects.png + (\uicontrol {Show Subprojects}). + + To visit all parts of a namespace, double-click on the namespace item + multiple times. + +//! [class view] + + +//! [type hierarchy view] + + \section2 Viewing Type Hierarchy + + To view the base classes of a class, right-click the class and select + \uicontrol {Open Type Hierarchy} or press \key {Ctrl+Shift+T}. + +//! [type hierarchy view] + + +//! [include hierarchy view] + + \section2 Viewing Include Hierarchy + + To view which files are included in the current file and which files include + the current file, right-click in the editor and select + \uicontrol {Open Include Hierarchy} or press \key {Ctrl+Shift+I}. + +//! [include hierarchy view] +*/ diff --git a/doc/src/howto/creator-ui.qdoc b/doc/src/howto/creator-ui.qdoc index 5cb7a65a8fa..f753e9054a2 100644 --- a/doc/src/howto/creator-ui.qdoc +++ b/doc/src/howto/creator-ui.qdoc @@ -136,22 +136,13 @@ \li \uicontrol{File System} shows all files in the currently selected directory. - \li \uicontrol {Class View} shows the class hierarchy of the currently - open projects. - - \li \uicontrol Outline shows the symbol hierarchy of a C++ file and the type - hierarchy of a QML file. - - \li \uicontrol Tests lists autotests and Qt Quick tests in the project. - For more information, see \l {Running Autotests}. - - \li \uicontrol {Type Hierarchy} shows the base classes of a class. - - \li \uicontrol {Include Hierarchy} shows which files are included in the current file - and which files include the current file. + \li \uicontrol Outline shows an overview of defined types and other + symbols, as well as their properties and hierarchy in a source file. \endlist + \include creator-sidebar-cpp-views.qdocinc cpp sidebar views + For more information about the sidebar views that are only available when editing QML files in the Design mode, see \l{Editing QML Files in Design Mode}. @@ -326,16 +317,6 @@ \endlist - \section2 Viewing the Class Hierarchy - - The \uicontrol {Class View} shows the class hierarchy of the currently - open projects. To organize the view by subprojects, click - \inlineimage qtcreator-show-subprojects.png - (\uicontrol {Show Subprojects}). - - To visit all parts of a namespace, double-click on the namespace item - multiple times. - \section2 Viewing QML Types The \uicontrol Outline view shows the type hierarchy in a QML file. @@ -350,16 +331,9 @@ \endlist - \section2 Viewing Type Hierarchy - - To view the base classes of a class, right-click the class and select - \uicontrol {Open Type Hierarchy} or press \key {Ctrl+Shift+T}. - - \section2 Viewing Include Hierarchy - - To view which files are included in the current file and which files include - the current file, right-click in the editor and select \uicontrol {Open Include Hierarchy} - or press \key {Ctrl+Shift+I}. + \include creator-sidebar-cpp-views.qdocinc class view + \include creator-sidebar-cpp-views.qdocinc type hierarchy view + \include creator-sidebar-cpp-views.qdocinc include hierarchy view \section1 Viewing Output From b620727bb84988628a09cba60963838323774cf1 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 6 Jul 2018 10:15:26 +0200 Subject: [PATCH 04/22] Update qbs submodule To HEAD of 1.12 branch. Change-Id: I06fb4bfcf1b7affd6cb1ca6fbf0c39e886e4d27c Reviewed-by: Joerg Bornemann --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 872e4b883d7..73d0d3a2471 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 872e4b883d7732c46e1e5d32b60ce698862e5da6 +Subproject commit 73d0d3a247162b91d6b2c78f5a490e006168a2e4 From a7fba990f4ecd592f479340d10fe60c2e34ba187 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 5 Jul 2018 15:58:35 +0200 Subject: [PATCH 05/22] Debugger: Fix Qt namespace detection for gdb8 Task-number: QTCREATORBUG-19620 Change-Id: Ieb7a8bc8cfeb8ba4331436ef6652437c0971c356 Reviewed-by: hjk --- share/qtcreator/debugger/gdbbridge.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 117f5fcfdd8..618c4113ee8 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -1002,7 +1002,12 @@ class Dumper(DumperBase): try: symbols = gdb.execute(cmd, to_string = True) except: - pass + # command syntax depends on gdb version - below is gdb 8+ + cmd = 'maint print msymbols -objfile "%s" -- %s' % (objfile.filename, tmppath) + try: + symbols = gdb.execute(cmd, to_string = True) + except: + pass ns = '' with open(tmppath) as f: for line in f: From 21ac38aca9ccd246051992c5266aa2f4021c3c20 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 6 Jul 2018 12:30:27 +0200 Subject: [PATCH 06/22] Version bump to 4.7.0 Change-Id: I339097aa2a0deeeea4bd81a9a8b74c6732bb217d Reviewed-by: Eike Ziller --- qbs/modules/qtc/qtc.qbs | 10 +++++----- qtcreator.pri | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index fd2cd3f2da8..3c673abf01b 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -4,16 +4,16 @@ import qbs.FileInfo import "qtc.js" as HelperFunctions Module { - property string qtcreator_display_version: '4.7.0-rc1' + property string qtcreator_display_version: '4.7.0' property string ide_version_major: '4' - property string ide_version_minor: '6' - property string ide_version_release: '84' + property string ide_version_minor: '7' + property string ide_version_release: '0' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release property string ide_compat_version_major: '4' - property string ide_compat_version_minor: '6' - property string ide_compat_version_release: '84' + property string ide_compat_version_minor: '7' + property string ide_compat_version_release: '0' property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release diff --git a/qtcreator.pri b/qtcreator.pri index b79249c045f..cf24edeb91d 100644 --- a/qtcreator.pri +++ b/qtcreator.pri @@ -1,10 +1,10 @@ !isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included") QTCREATOR_PRI_INCLUDED = 1 -QTCREATOR_VERSION = 4.6.84 -QTCREATOR_COMPAT_VERSION = 4.6.84 +QTCREATOR_VERSION = 4.7.0 +QTCREATOR_COMPAT_VERSION = 4.7.0 VERSION = $$QTCREATOR_VERSION -QTCREATOR_DISPLAY_VERSION = 4.7.0-rc1 +QTCREATOR_DISPLAY_VERSION = 4.7.0 QTCREATOR_COPYRIGHT_YEAR = 2018 BINARY_ARTIFACTS_BRANCH = 4.7 From 887cdfa7e996156ace831109836bca4f91284da8 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 6 Jul 2018 11:30:53 +0200 Subject: [PATCH 07/22] More changelog for 4.7 Change-Id: Iec38a288aba9971b1d779a1bc4ff2eee31f46030 Reviewed-by: Leena Miettinen --- dist/changes-4.7.0.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dist/changes-4.7.0.md b/dist/changes-4.7.0.md index 84014306a2b..4967dd3472b 100644 --- a/dist/changes-4.7.0.md +++ b/dist/changes-4.7.0.md @@ -29,6 +29,7 @@ Editing * Added `Context Help` to editor context menu (QTCREATORBUG-55) * Added previous and next buttons to bookmarks view, and polished their behavior (QTCREATORBUG-9859, QTCREATORBUG-20061) +* Added support for `WordDetect` in Kate highlighting files * Fixed that extra editor windows were not restored when opening session (QTCREATORBUG-13840) * Fixed that editor could stay busy repainting annotations (QTCREATORBUG-20422) @@ -76,6 +77,7 @@ C++ Support (category `Clang Code Model`) * Added highlighting style for overloaded operators (QTCREATORBUG-19659) * Added option to use `.clang-tidy` configuration file or checks string + * Added default configurations for Clang-Tidy and Clazy checks * Added link to the documentation in tooltip for Clang-Tidy and Clazy diagnostics * Improved reparse performance and memory usage @@ -92,6 +94,7 @@ QML Support * Fixed that reformatting incorrectly removed quotes (QTCREATORBUG-17455) * Fixed that `.pragma` and `.import` were removed when reformatting (QTCREATORBUG-13038) +* Fixed that import completion did not offer `QtWebEngine` (QTCREATORBUG-20723) Python Support @@ -99,8 +102,16 @@ Python Support Debugging +* Fixed updating of memory view * QML * Added support for nested properties (QTBUG-68474) + * Fixed issue with different endianness (QTBUG-68721) + +Qt Quick Designer + +* Fixed crash when adding quotes to text (QTCREATORBUG-20684) +* Fixed that meta data could move in source code even when no changes occurred + (QTCREATORBUG-20686) Clang Static Analyzer @@ -119,6 +130,7 @@ Version Control Systems * Added `-git-show ` command line parameter * Gerrit * Added warning when pushing to wrong branch (QTCREATORBUG-20062) + * Fixed updating after settings change (QTCREATORBUG-20536) Image Viewer @@ -134,6 +146,7 @@ Test Integration (QTCREATORBUG-18725) * Qt Quick * Fixed parsing issue with non-ASCII characters (QTCREATORBUG-20105) + * Fixed detection of test name (QTCREATORBUG-20642) Platform Specific @@ -141,11 +154,15 @@ Windows * Improved parsing of MSVC error messages (QTCREATORBUG-20297) * Fixed that querying MSVC tool chains at startup could block Qt Creator +* Fixed issue with writing to network drives (QTCREATORBUG-20560) * Fixed issue with Clang and Qt 5.8 and later (QTCREATORBUG-20021) +* Fixed handling of Windows debug stream which could lead to freezes + (QTCREATORBUG-20640) Android * Improved behavior when emulator cannot be started (QTCREATORBUG-20160) +* Fixed QML debugger connection issue from macOS client (QTCREATORBUG-20730) Credits for these changes go to: Aaron Barany @@ -172,9 +189,11 @@ Jaroslaw Kobus Jay Gupta José Tomás Tocino Jörg Bornemann +Kai Köhne Kari Oikarinen Kimmo Linnavuo Leena Miettinen +Lorenz Haas Marco Benelli Marco Bubke Mitch Curtis @@ -187,6 +206,7 @@ Przemyslaw Gorszkowski Razi Alavizadeh Robert Löhning Rune Espeseth +Sergey Belyashov Sergey Morozov Tasuku Suzuki Thiago Macieira From cb572773c0f6e6d577e29702c7484ce3f252cdff Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 6 Jul 2018 13:28:31 +0200 Subject: [PATCH 08/22] Debugger: Robustify MainWindow state saving Save the state before child widgets are affected. Task-number: QTCREATORBUG-20721 Change-Id: I1d0d1ca610b0a8e8904585953ecbb42dddee4827 Reviewed-by: Ulf Hermann --- src/plugins/debugger/debuggermainwindow.h | 2 ++ src/plugins/debugger/debuggerplugin.cpp | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/debuggermainwindow.h b/src/plugins/debugger/debuggermainwindow.h index cc93e7a00fc..08970aaeadc 100644 --- a/src/plugins/debugger/debuggermainwindow.h +++ b/src/plugins/debugger/debuggermainwindow.h @@ -140,6 +140,8 @@ public: void setPerspectiveEnabled(const QByteArray &perspectiveId, bool enabled); private: + void closeEvent(QCloseEvent *) final { saveCurrentPerspective(); } + QDockWidget *registerDockWidget(const QByteArray &dockId, QWidget *widget); void loadPerspectiveHelper(const QByteArray &perspectiveId, bool fromStoredSettings = true); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 0857b63ba6b..cf0ce7d5b29 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -2799,7 +2799,6 @@ void DebuggerPluginPrivate::aboutToShutdown() disconnect(SessionManager::instance(), &SessionManager::startupProjectChanged, this, nullptr); - m_mainWindow->saveCurrentPerspective(); m_shutdownTimer.setInterval(0); m_shutdownTimer.setSingleShot(true); connect(&m_shutdownTimer, &QTimer::timeout, this, &DebuggerPluginPrivate::doShutdown); From 299da013325be20ff731b91e7ead47b20242b1cd Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 6 Jul 2018 09:11:05 +0200 Subject: [PATCH 09/22] QmlDesigner: Fix crash when opening qmlproject while Design mode is open Fix the order of signal handling, which was changed in a5935cb27a0609764586302bf109796d74060f3d but leads to this crash. The connection to the DesignMode instance still needs to be delayed to after it has been created in Core plugin's extensionsInitialized, so do the final initialization as a reaction to ICore::coreAboutToOpen. Task-number: QTCREATORBUG-20495 Change-Id: I92d9a4ff689d2f191d2fd368966ca582bf8af2f7 Reviewed-by: Thomas Hartmann --- src/plugins/qmldesigner/qmldesignerplugin.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp index c5710957da1..1aadaa081ae 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.cpp +++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp @@ -198,15 +198,15 @@ bool QmlDesignerPlugin::delayedInitialize() d->viewManager.registerFormEditorToolTakingOwnership(new QmlDesigner::TextTool); d->viewManager.registerFormEditorToolTakingOwnership(new QmlDesigner::PathTool); - connect(Core::DesignMode::instance(), &Core::DesignMode::actionsUpdated, - &d->shortCutManager, &ShortCutManager::updateActions); - return true; } void QmlDesignerPlugin::extensionsInitialized() { - integrateIntoQtCreator(&d->mainWidget); + // delay after Core plugin's extensionsInitialized, so the DesignMode is availabe + connect(Core::ICore::instance(), &Core::ICore::coreAboutToOpen, this, [this] { + integrateIntoQtCreator(&d->mainWidget); + }); } static QStringList allUiQmlFilesforCurrentProject(const Utils::FileName &fileName) @@ -255,6 +255,9 @@ void QmlDesignerPlugin::integrateIntoQtCreator(QWidget *modeWidget) Core::DesignMode::registerDesignWidget(modeWidget, mimeTypes, d->context->context()); + connect(Core::DesignMode::instance(), &Core::DesignMode::actionsUpdated, + &d->shortCutManager, &ShortCutManager::updateActions); + connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged, [this] (Core::IEditor *editor) { if (d && checkIfEditorIsQtQuick(editor) && isInDesignerMode()) changeEditor(); From f19a6e8ac2c76e323875e4dc02b53c58aa887afe Mon Sep 17 00:00:00 2001 From: Vikas Pachdha Date: Tue, 3 Jul 2018 11:51:28 +0200 Subject: [PATCH 10/22] Android: Add API's to run Android SDK tools Task-number: QDS-16 Change-Id: Ifea5aa17330833cd130555778134fb8f90e2d990 Reviewed-by: Ulf Hermann --- src/plugins/android/androidmanager.cpp | 51 +++++++++++++++++--------- src/plugins/android/androidmanager.h | 3 ++ 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index de927adc41c..c52bd5f8eeb 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -67,6 +68,20 @@ namespace { const QLatin1String AndroidDeviceSn("AndroidDeviceSerialNumber"); const QLatin1String ApiLevelKey("AndroidVersion.ApiLevel"); + Q_LOGGING_CATEGORY(androidManagerLog, "qtc.android.androidManager") + + bool runCommand(const QString &executable, const QStringList &args, + QString *output = nullptr, int timeoutS = 30) + { + Utils::SynchronousProcess cmdProc; + cmdProc.setTimeoutS(timeoutS); + qCDebug(androidManagerLog) << executable << args.join(' '); + Utils::SynchronousProcessResponse response = cmdProc.runBlocking(executable, args); + if (output) + *output = response.allOutput(); + return response.result == Utils::SynchronousProcessResponse::Finished; + } + } // anonymous namespace namespace Android { @@ -364,16 +379,9 @@ void AndroidManager::cleanLibsOnDevice(ProjectExplorer::Target *target) Core::MessageManager::write(tr("Starting Android virtual device failed.")); } - QProcess *process = new QProcess(); QStringList arguments = AndroidDeviceInfo::adbSelector(deviceSerialNumber); arguments << QLatin1String("shell") << QLatin1String("rm") << QLatin1String("-r") << QLatin1String("/data/local/tmp/qt"); - QObject::connect(process, static_cast(&QProcess::finished), - process, &QObject::deleteLater); - const QString adb = AndroidConfigurations::currentConfig().adbToolPath().toString(); - Core::MessageManager::write(adb + QLatin1Char(' ') + arguments.join(QLatin1Char(' '))); - process->start(adb, arguments); - if (!process->waitForStarted(500)) - delete process; + runAdbCommandDetached(arguments); } void AndroidManager::installQASIPackage(ProjectExplorer::Target *target, const QString &packagePath) @@ -393,17 +401,9 @@ void AndroidManager::installQASIPackage(ProjectExplorer::Target *target, const Q Core::MessageManager::write(tr("Starting Android virtual device failed.")); } - QProcess *process = new QProcess(); QStringList arguments = AndroidDeviceInfo::adbSelector(deviceSerialNumber); arguments << QLatin1String("install") << QLatin1String("-r ") << packagePath; - - connect(process, static_cast(&QProcess::finished), - process, &QObject::deleteLater); - const QString adb = AndroidConfigurations::currentConfig().adbToolPath().toString(); - Core::MessageManager::write(adb + QLatin1Char(' ') + arguments.join(QLatin1Char(' '))); - process->start(adb, arguments); - if (!process->waitForStarted(500) && process->state() != QProcess::Running) - delete process; + runAdbCommandDetached(arguments); } bool AndroidManager::checkKeystorePassword(const QString &keystorePath, const QString &keystorePasswd) @@ -596,4 +596,21 @@ int AndroidManager::findApiLevel(const Utils::FileName &platformPath) return apiLevel; } +void AndroidManager::runAdbCommandDetached(const QStringList &args) +{ + QProcess *process = new QProcess(); + connect(process, static_cast(&QProcess::finished), + process, &QObject::deleteLater); + const QString adb = AndroidConfigurations::currentConfig().adbToolPath().toString(); + qCDebug(androidManagerLog) << adb << args.join(' '); + process->start(adb, args); + if (!process->waitForStarted(500) && process->state() != QProcess::Running) + delete process; +} + +bool AndroidManager::runAdbCommand(const QStringList &args, QString *output) +{ + return runCommand(AndroidConfigurations::currentConfig().adbToolPath().toString(), + args, output); +} } // namespace Android diff --git a/src/plugins/android/androidmanager.h b/src/plugins/android/androidmanager.h index b1ce3321317..1c79a236311 100644 --- a/src/plugins/android/androidmanager.h +++ b/src/plugins/android/androidmanager.h @@ -87,6 +87,9 @@ public: static AndroidQtSupport *androidQtSupport(ProjectExplorer::Target *target); static bool updateGradleProperties(ProjectExplorer::Target *target); static int findApiLevel(const Utils::FileName &platformPath); + + static void runAdbCommandDetached(const QStringList &args); + static bool runAdbCommand(const QStringList &args, QString *output = nullptr); }; } // namespace Android From 42754374b00f9101a82029c56bd5bf3e6d03f292 Mon Sep 17 00:00:00 2001 From: Vikas Pachdha Date: Tue, 3 Jul 2018 11:53:25 +0200 Subject: [PATCH 11/22] Android: Parse APK to find package name and other information Task-number: QDS-16 Change-Id: I228af0711fb2dd64ff96dcb5fc9bc634b556ffd9 Reviewed-by: Ulf Hermann --- src/plugins/android/androidconfigurations.cpp | 11 +++ src/plugins/android/androidconfigurations.h | 1 + src/plugins/android/androidmanager.cpp | 69 +++++++++++++++++++ src/plugins/android/androidmanager.h | 9 ++- 4 files changed, 89 insertions(+), 1 deletion(-) diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index c281f25dda7..ed76035c27e 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -416,6 +416,17 @@ FileName AndroidConfig::avdManagerToolPath() const return avdManagerPath; } +FileName AndroidConfig::aaptToolPath() const +{ + Utils::FileName aaptToolPath = m_sdkLocation; + aaptToolPath.appendPath("build-tools"); + QString toolPath = QString("%1/aapt").arg(buildToolsVersion().toString()); + if (HostOsInfo::isWindowsHost()) + toolPath += ANDROID_BAT_SUFFIX; + aaptToolPath.appendPath(toolPath); + return aaptToolPath; +} + FileName AndroidConfig::gccPath(const Abi &abi, Core::Id lang, const QString &ndkToolChainVersion) const { diff --git a/src/plugins/android/androidconfigurations.h b/src/plugins/android/androidconfigurations.h index 58dde7479ba..0a7fa4c3b72 100644 --- a/src/plugins/android/androidconfigurations.h +++ b/src/plugins/android/androidconfigurations.h @@ -132,6 +132,7 @@ public: Utils::FileName emulatorToolPath() const; Utils::FileName sdkManagerToolPath() const; Utils::FileName avdManagerToolPath() const; + Utils::FileName aaptToolPath() const; Utils::FileName gccPath(const ProjectExplorer::Abi &abi, Core::Id lang, const QString &ndkToolChainVersion) const; diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index c52bd5f8eeb..c6f5a42e036 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -61,12 +61,19 @@ #include #include #include +#include namespace { const QLatin1String AndroidManifestName("AndroidManifest.xml"); const QLatin1String AndroidDefaultPropertiesName("project.properties"); const QLatin1String AndroidDeviceSn("AndroidDeviceSerialNumber"); const QLatin1String ApiLevelKey("AndroidVersion.ApiLevel"); + const QString packageNameRegEx("(package: name=)\\'(([a-z]{1}[a-z\\d_]*\\." + ")*[a-z][a-z\\d_]*)\\'"); + const QString activityRegEx("(launchable-activity: name=)\\'" + "(([a-z]{1}[a-z\\d_]*\\.)*[a-z][a-z\\d_]*)\\'"); + const QString apkVersionRegEx("package: name=([\\=a-z\\d_\\.\\'\\s]*)" + "\\sversionName='([\\d\\.]*)'"); Q_LOGGING_CATEGORY(androidManagerLog, "qtc.android.androidManager") @@ -82,6 +89,15 @@ namespace { return response.result == Utils::SynchronousProcessResponse::Finished; } + QString parseAaptOutput(const QString &output, const QString ®Ex) { + const QRegularExpression regRx(regEx, + QRegularExpression::CaseInsensitiveOption | + QRegularExpression::MultilineOption); + QRegularExpressionMatch match = regRx.match(output); + if (match.hasMatch()) + return match.captured(2); + return QString(); + }; } // anonymous namespace namespace Android { @@ -134,6 +150,53 @@ QString AndroidManager::packageName(const Utils::FileName &manifestFile) return manifestElem.attribute(QLatin1String("package")); } +bool AndroidManager::packageInstalled(const QString &deviceSerial, + const QString &packageName) +{ + if (deviceSerial.isEmpty() || packageName.isEmpty()) + return false; + QStringList args = AndroidDeviceInfo::adbSelector(deviceSerial); + args << "shell" << "pm" << "list" << "packages"; + QString output; + runAdbCommand(args, &output); + QStringList lines = output.split(QRegularExpression("[\\n\\r]"), + QString::SkipEmptyParts); + for (const QString &line : lines) { + // Don't want to confuse com.abc.xyz with com.abc.xyz.def so check with + // endsWith + if (line.endsWith(packageName)) + return true; + } + return false; +} + +void AndroidManager::apkInfo(const Utils::FileName &apkPath, + QString *packageName, + QVersionNumber *version, + QString *activityPath) +{ + QString output; + runAaptCommand({"dump", "badging", apkPath.toString()}, &output); + + QString packageStr; + if (activityPath) { + packageStr = parseAaptOutput(output, packageNameRegEx); + QString path = parseAaptOutput(output, activityRegEx); + if (!packageStr.isEmpty() && !path.isEmpty()) + *activityPath = packageStr + '/' + path; + } + + if (packageName) { + *packageName = activityPath ? packageStr : + parseAaptOutput(output, packageNameRegEx); + } + + if (version) { + QString versionStr = parseAaptOutput(output, apkVersionRegEx); + *version = QVersionNumber::fromString(versionStr); + } +} + QString AndroidManager::intentName(ProjectExplorer::Target *target) { return packageName(target) + QLatin1Char('/') + activityName(target); @@ -613,4 +676,10 @@ bool AndroidManager::runAdbCommand(const QStringList &args, QString *output) return runCommand(AndroidConfigurations::currentConfig().adbToolPath().toString(), args, output); } + +bool AndroidManager::runAaptCommand(const QStringList &args, QString *output) +{ + return runCommand(AndroidConfigurations::currentConfig().aaptToolPath().toString(), + args, output); +} } // namespace Android diff --git a/src/plugins/android/androidmanager.h b/src/plugins/android/androidmanager.h index 1c79a236311..fcda5e46d42 100644 --- a/src/plugins/android/androidmanager.h +++ b/src/plugins/android/androidmanager.h @@ -29,6 +29,7 @@ #include #include +#include namespace ProjectExplorer { class Kit; @@ -48,7 +49,12 @@ class ANDROID_EXPORT AndroidManager : public QObject public: static QString packageName(ProjectExplorer::Target *target); static QString packageName(const Utils::FileName &manifestFile); - + static bool packageInstalled(const QString &deviceSerial, + const QString &packageName); + static void apkInfo(const Utils::FileName &apkPath, + QString *packageName = nullptr, + QVersionNumber *version = nullptr, + QString *activityPath = nullptr); static QString intentName(ProjectExplorer::Target *target); static QString activityName(ProjectExplorer::Target *target); @@ -90,6 +96,7 @@ public: static void runAdbCommandDetached(const QStringList &args); static bool runAdbCommand(const QStringList &args, QString *output = nullptr); + static bool runAaptCommand(const QStringList &args, QString *output = nullptr); }; } // namespace Android From 91cbbd39ac97bd32b699a76e19a7f316855d2f4b Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Fri, 6 Jul 2018 11:38:55 +0200 Subject: [PATCH 12/22] Clang: Don't show template type parameters in Class View and Current Document filter They do not bring any value. Task-number: QTCREATORBUG-20716 Change-Id: I2876f0e1e3918cb33d133b4a65ccaefd9bd30ac8 Reviewed-by: David Schulz --- src/libs/clangsupport/clangsupport_global.h | 4 +++- src/libs/clangsupport/tokeninfocontainer.cpp | 2 ++ src/libs/clangsupport/tokeninfocontainer.h | 7 +++++++ .../clangcodemodel/clanghighlightingresultreporter.cpp | 2 ++ src/tools/clangbackend/source/tokeninfo.cpp | 6 +++++- 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/libs/clangsupport/clangsupport_global.h b/src/libs/clangsupport/clangsupport_global.h index def7cea41c0..01e9e2c7f40 100644 --- a/src/libs/clangsupport/clangsupport_global.h +++ b/src/libs/clangsupport/clangsupport_global.h @@ -104,7 +104,9 @@ enum class HighlightingType : quint8 ObjectiveCInterface, ObjectiveCImplementation, ObjectiveCProperty, - ObjectiveCMethod + ObjectiveCMethod, + TemplateTypeParameter, + TemplateTemplateParameter }; enum class StorageClass : quint8 diff --git a/src/libs/clangsupport/tokeninfocontainer.cpp b/src/libs/clangsupport/tokeninfocontainer.cpp index 157f93746c7..2744200c60e 100644 --- a/src/libs/clangsupport/tokeninfocontainer.cpp +++ b/src/libs/clangsupport/tokeninfocontainer.cpp @@ -70,6 +70,8 @@ static const char *highlightingTypeToCStringLiteral(HighlightingType type) RETURN_TEXT_FOR_CASE(ObjectiveCMethod); RETURN_TEXT_FOR_CASE(PrimitiveType); RETURN_TEXT_FOR_CASE(Declaration); + RETURN_TEXT_FOR_CASE(TemplateTypeParameter); + RETURN_TEXT_FOR_CASE(TemplateTemplateParameter); default: return "UnhandledHighlightingType"; } } diff --git a/src/libs/clangsupport/tokeninfocontainer.h b/src/libs/clangsupport/tokeninfocontainer.h index 8bd57b9f954..d01d0f92eb0 100644 --- a/src/libs/clangsupport/tokeninfocontainer.h +++ b/src/libs/clangsupport/tokeninfocontainer.h @@ -129,6 +129,13 @@ public: bool isGlobalDeclaration() const { + if (types.mixinHighlightingTypes.contains( + ClangBackEnd::HighlightingType::TemplateTypeParameter) + || types.mixinHighlightingTypes.contains( + ClangBackEnd::HighlightingType::TemplateTemplateParameter)) { + return false; + } + return extraInfo.declaration && types.mainHighlightingType != HighlightingType::LocalVariable && ((types.mainHighlightingType == HighlightingType::Operator) diff --git a/src/plugins/clangcodemodel/clanghighlightingresultreporter.cpp b/src/plugins/clangcodemodel/clanghighlightingresultreporter.cpp index ef1b905a8d8..795941f6ec9 100644 --- a/src/plugins/clangcodemodel/clanghighlightingresultreporter.cpp +++ b/src/plugins/clangcodemodel/clanghighlightingresultreporter.cpp @@ -108,6 +108,8 @@ bool ignore(ClangBackEnd::HighlightingType type) case HighlightingType::ObjectiveCImplementation: case HighlightingType::ObjectiveCProperty: case HighlightingType::ObjectiveCMethod: + case HighlightingType::TemplateTypeParameter: + case HighlightingType::TemplateTemplateParameter: return true; } diff --git a/src/tools/clangbackend/source/tokeninfo.cpp b/src/tools/clangbackend/source/tokeninfo.cpp index a5a2220adad..68877e4032a 100644 --- a/src/tools/clangbackend/source/tokeninfo.cpp +++ b/src/tools/clangbackend/source/tokeninfo.cpp @@ -341,9 +341,13 @@ void TokenInfo::typeKind(const Cursor &cursor) case CXCursor_ObjCCategoryImplDecl: m_types.mixinHighlightingTypes.push_back(HighlightingType::ObjectiveCCategory); return; - case CXCursor_ObjCSuperClassRef: case CXCursor_TemplateTypeParameter: + m_types.mixinHighlightingTypes.push_back(HighlightingType::TemplateTypeParameter); + return; case CXCursor_TemplateTemplateParameter: + m_types.mixinHighlightingTypes.push_back(HighlightingType::TemplateTemplateParameter); + return; + case CXCursor_ObjCSuperClassRef: case CXCursor_CXXStaticCastExpr: case CXCursor_CXXReinterpretCastExpr: break; From 534aa02163f7782a792334aa14071fa041f1ff33 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Thu, 21 Jun 2018 08:28:50 +0200 Subject: [PATCH 13/22] Clang: For definitions show their parent class qualification Append methods and class members with the scope they belong to extracting the parent name. It was like that in old code model. Example: namespace Foo { void Bar::function() {} } Old result: Foo function() -> void New result: Foo Bar::function() -> void Change-Id: I9dad86a6738baafb1a210c5e1146d8de33828c44 Reviewed-by: David Schulz --- .../clangcodemodel/clangoverviewmodel.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/plugins/clangcodemodel/clangoverviewmodel.cpp b/src/plugins/clangcodemodel/clangoverviewmodel.cpp index fc6dce919a8..e663eec27a3 100644 --- a/src/plugins/clangcodemodel/clangoverviewmodel.cpp +++ b/src/plugins/clangcodemodel/clangoverviewmodel.cpp @@ -96,6 +96,20 @@ static QString addType(const QString &name, const ClangBackEnd::ExtraInfo &extra return name + QLatin1String(" -> ", 4) + extraInfo.typeSpelling.toString(); } +static QString fullName(const ClangBackEnd::ExtraInfo &extraInfo, TokenTreeItem *parent) +{ + const QString parentType = parent->token.extraInfo.typeSpelling.toString(); + if (extraInfo.semanticParentTypeSpelling.startsWith(parentType)) { + const QString parentQualification = parentType.isEmpty() + ? extraInfo.semanticParentTypeSpelling + : extraInfo.semanticParentTypeSpelling.mid(parentType.length() + 2); + if (!parentQualification.isEmpty()) + return parentQualification + "::" + extraInfo.token.toString(); + } + + return extraInfo.token.toString(); +} + QVariant TokenTreeItem::data(int column, int role) const { Q_UNUSED(column) @@ -109,7 +123,8 @@ QVariant TokenTreeItem::data(int column, int role) const switch (role) { case Qt::DisplayRole: { - QString name = token.extraInfo.token.toString(); + QString name = fullName(token.extraInfo, static_cast(parent())); + ClangBackEnd::HighlightingType mainType = token.types.mainHighlightingType; if (mainType == ClangBackEnd::HighlightingType::VirtualFunction From 943f499fe40970ecb76be8615ec990a35800668e Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 4 Jul 2018 22:23:54 +0300 Subject: [PATCH 14/22] Git: Silence managesFile When adding existing untracked files to a project, and choosing to add them to Git, error messages appeared in the output pane. Change-Id: Iba639a678d2ca424fb32b34b218fca1c4b99971d Reviewed-by: Tobias Hunger --- src/plugins/git/gitclient.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 08e1cdb88dd..e2fa7fe8d53 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -795,7 +795,8 @@ QString GitClient::findGitDirForRepository(const QString &repositoryDir) const bool GitClient::managesFile(const QString &workingDirectory, const QString &fileName) const { - return vcsFullySynchronousExec(workingDirectory, {"ls-files", "--error-unmatch", fileName}).result + return vcsFullySynchronousExec(workingDirectory, {"ls-files", "--error-unmatch", fileName}, + Core::ShellCommand::NoOutput).result == SynchronousProcessResponse::Finished; } From e152b1c46882ca352b96dd5e854041d67b84f4c6 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 9 Jul 2018 09:52:09 +0200 Subject: [PATCH 15/22] Fix crash when filtering out warnings from issues pane Do not send endRemoveRows if we never sent beginRemoveRows. Fix up of 702d6a69148091b23023aeafdb697919dff1a1d6 Task-number: QTCREATORBUG-20741 Change-Id: If22a18e6426c8b4041924a170d5927ab9d11ccdf Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/taskmodel.cpp | 7 ++++++- src/plugins/projectexplorer/taskmodel.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/taskmodel.cpp b/src/plugins/projectexplorer/taskmodel.cpp index 981f85651d3..0b3381fadc2 100644 --- a/src/plugins/projectexplorer/taskmodel.cpp +++ b/src/plugins/projectexplorer/taskmodel.cpp @@ -337,7 +337,10 @@ TaskFilterModel::TaskFilterModel(TaskModel *sourceModel, QObject *parent) : QAbs connect(m_sourceModel, &QAbstractItemModel::rowsRemoved, this, [this](const QModelIndex &parent, int, int) { QTC_ASSERT(!parent.isValid(), return); - endRemoveRows(); + if (m_beginRemoveRowsSent) { + m_beginRemoveRowsSent = false; + endRemoveRows(); + } }); connect(m_sourceModel, &QAbstractItemModel::modelReset, @@ -430,6 +433,7 @@ void TaskFilterModel::handleNewRows(const QModelIndex &index, int first, int las void TaskFilterModel::handleRowsAboutToBeRemoved(const QModelIndex &index, int first, int last) { + m_beginRemoveRowsSent = false; QTC_ASSERT(!index.isValid(), return); const QPair range = findFilteredRange(first, last, m_mapping); @@ -437,6 +441,7 @@ void TaskFilterModel::handleRowsAboutToBeRemoved(const QModelIndex &index, int f return; beginRemoveRows(QModelIndex(), range.first, range.second); + m_beginRemoveRowsSent = true; m_mapping.erase(m_mapping.begin() + range.first, m_mapping.begin() + range.second + 1); const int sourceRemovedCount = (last - first) + 1; for (int i = range.first; i < m_mapping.count(); ++i) diff --git a/src/plugins/projectexplorer/taskmodel.h b/src/plugins/projectexplorer/taskmodel.h index b2b1c933e2b..4b2757c2891 100644 --- a/src/plugins/projectexplorer/taskmodel.h +++ b/src/plugins/projectexplorer/taskmodel.h @@ -165,6 +165,7 @@ private: void updateMapping() const; bool filterAcceptsTask(const Task &task) const; + bool m_beginRemoveRowsSent = false; bool m_includeUnknowns; bool m_includeWarnings; bool m_includeErrors; From b85692e9203d5dd28acce545802c86fd2a491c5a Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Wed, 4 Jul 2018 16:38:40 +0200 Subject: [PATCH 16/22] Remove wrong quotes from German translation %1 contains line breaks and bullets. Having quotes around it is pointless. Change-Id: Iced4bd6efcf60b1005fcd560ea773e208a0df997 Reviewed-by: Oswald Buddenhagen Reviewed-by: Christian Stenger --- share/qtcreator/translations/qtcreator_de.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 2d4f46b0601..717dd81d3b1 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -16812,7 +16812,7 @@ Soll es noch einmal versucht werden? No compiler can produce code for this Qt version. Please define one or more compilers for: %1 - Kein Compiler kann für diese Qt-Version Code erzeugen. Bitte richten Sie einen oder mehrere für "%1" geeignete Compiler ein. + Kein Compiler kann für diese Qt-Version Code erzeugen. Bitte richten Sie einen oder mehrere Compiler ein, geeignet für: %1 The following ABIs are currently not supported: %1 From 6a42d8bd747fce93fa9e7af28aec8c01d609f6b4 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Fri, 6 Jul 2018 16:58:38 +0200 Subject: [PATCH 17/22] Squish: Give code model more time to list refactorings Change-Id: I944dfa306954cd16fdb24334db6e869702da282f Reviewed-by: Christian Stenger --- tests/system/suite_APTW/tst_APTW03/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/suite_APTW/tst_APTW03/test.py b/tests/system/suite_APTW/tst_APTW03/test.py index 2ceef47b708..905dea914e4 100644 --- a/tests/system/suite_APTW/tst_APTW03/test.py +++ b/tests/system/suite_APTW/tst_APTW03/test.py @@ -100,7 +100,7 @@ def main(): editor = getEditorForFileSuffix("%s.h" % className.lower()) oldContent = str(editor.plainText) placeCursorToLine(editor, "class %s.*" % className, True) - snooze(1) # avoid timing issue with the parser + snooze(4) # avoid timing issue with the parser invokeContextMenuItem(editor, "Refactor", "Insert Virtual Functions of Base Classes") handleInsertVirtualFunctions(["keys() const = 0 : QStringList", "create(const QString &, const QString &) = 0 : QObject *"]) From 3bf887c2ad0e9a20c35356d992dedfed52602b47 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Fri, 6 Jul 2018 17:33:51 +0200 Subject: [PATCH 18/22] Squish: Update tst_CSUP01 The built-in code model also proposes "void_t". Change-Id: I2462e47d5b1a69065f998244fc8372011e37a0c8 Reviewed-by: Christian Stenger --- tests/system/suite_CSUP/tst_CSUP01/test.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/system/suite_CSUP/tst_CSUP01/test.py b/tests/system/suite_CSUP/tst_CSUP01/test.py index 3512630ea45..51c9208797b 100644 --- a/tests/system/suite_CSUP/tst_CSUP01/test.py +++ b/tests/system/suite_CSUP/tst_CSUP01/test.py @@ -77,12 +77,14 @@ def main(): "possible to select one of the suggestions.") # Step 4: Insert text "voi" to new line and press Tab. resetLine(editorWidget) - type(editorWidget, "voi") + type(editorWidget, "unsi") try: - waitForObjectItem(":popupFrame_Proposal_QListView", "void") - type(waitForObject(":popupFrame_Proposal_QListView"), "") - test.compare(str(lineUnderCursor(editorWidget)).strip(), "void", - "Step 4: Verifying if: Word 'void' is completed because only one option is available.") + proposalListView = waitForObject(":popupFrame_Proposal_QListView") + waitForObjectItem(proposalListView, "unsigned") + test.compare(proposalListView.model().rowCount(), 1, 'Only one proposal for "unsi"?') + type(proposalListView, "") + test.compare(str(lineUnderCursor(editorWidget)).strip(), "unsigned", + "Step 4: Verifying if: Word 'unsigned' is completed because only one option is available.") except: test.fail("The expected completion popup was not shown.") # Step 4.5: Insert text "2." to new line and verify that code completion is not triggered (QTCREATORBUG-16188) From 7442790934c66e776f30a60a51048338c055928a Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 9 Jul 2018 11:05:16 +0200 Subject: [PATCH 19/22] Show examples page in welcome mode on first start This change might help first-time users getting started. Task-number: QTCREATORBUG-20674 Change-Id: If55402160bf6b1515142bb64f281654fe4c68134 Reviewed-by: hjk Reviewed-by: Alessandro Portale --- src/plugins/welcome/welcomeplugin.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index b3c70ed984d..aa804bbe6d8 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -357,8 +357,12 @@ void WelcomeMode::initPlugins() addPage(page); if (!m_activePage.isValid() && !m_pageButtons.isEmpty()) { - m_activePage = m_pluginList.at(0)->id(); - m_pageButtons.at(0)->click(); + const int welcomeIndex = Utils::indexOf(m_pluginList, + Utils::equal(&IWelcomePage::id, + Core::Id("Examples"))); + const int defaultIndex = welcomeIndex >= 0 ? welcomeIndex : 0; + m_activePage = m_pluginList.at(defaultIndex)->id(); + m_pageButtons.at(defaultIndex)->click(); } } From 126030d079b7309a9487cd4138e40da49e617341 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 9 Jul 2018 12:42:54 +0200 Subject: [PATCH 20/22] QML Debugger: Make sure to re-fetch expanded properties on update If an expanded object is updated we typically just get the ref for it. If we leave the tree item at "wantsChildren", the debugger will think that the update fails and "adjust" the "child expectation" to none. Fetching the children right away takes care of this. Task-number: QTCREATORBUG-20736 Change-Id: I1b3725e7106a563198962915cbcab8f68ef741a6 Reviewed-by: hjk Reviewed-by: Eike Ziller --- src/plugins/debugger/qml/qmlengine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index b489de57541..9f5a30315fa 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -2247,7 +2247,10 @@ void QmlEnginePrivate::handleScope(const QVariantMap &response) item->setHasChildren(localData.hasChildren()); if (localData.value.isValid() || item->wantsChildren || localData.expectedProperties == 0) { - engine->watchHandler()->insertItem(item.release()); + WatchHandler *watchHander = engine->watchHandler(); + if (watchHander->isExpandedIName(item->iname)) + itemsToLookup.insert(int(item->id), {item->iname, item->name, item->exp}); + watchHander->insertItem(item.release()); } else { itemsToLookup.insert(int(item->id), {item->iname, item->name, item->exp}); } From 8eef50e576daf95e21a8fe0dd5f5bf68e3b354b3 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 9 Jul 2018 14:58:44 +0200 Subject: [PATCH 21/22] Qml Debugger: Disallow editing of items with children The debugger will treat any value you put in there as string, and then fail to update the item because it doesn't expect the type to change. Proper editing of JavaScript objects requires quite a bit more UI than this, so disallow it for now. Task-number: QTCREATORBUG-20736 Change-Id: I7bf6e7a3747cde3c6682b66aaa810291f753e85d Reviewed-by: hjk --- src/plugins/debugger/qml/qmlengine.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 9f5a30315fa..2e0f655abd5 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -138,6 +138,12 @@ struct LookupData typedef QHash LookupItems; // id -> (iname, exp) +static void setWatchItemHasChildren(WatchItem *item, bool hasChildren) +{ + item->setHasChildren(hasChildren); + item->valueEditable = !hasChildren; +} + class QmlEnginePrivate : public QmlDebugClient { public: @@ -1311,7 +1317,7 @@ void QmlEnginePrivate::handleEvaluateExpression(const QVariantMap &response, if (success) { item->type = body.type; item->value = body.value.toString(); - item->setHasChildren(body.hasChildren()); + setWatchItemHasChildren(item, body.hasChildren()); } else { //Do not set type since it is unknown item->setError(body.value.toString()); @@ -2156,11 +2162,11 @@ void QmlEnginePrivate::handleFrame(const QVariantMap &response) item->id = objectData.handle; item->type = objectData.type; item->value = objectData.value.toString(); - item->setHasChildren(objectData.hasChildren()); + setWatchItemHasChildren(item, objectData.hasChildren()); // In case of global object, we do not get children // Set children nevertheless and query later. if (item->value == "global") { - item->setHasChildren(true); + setWatchItemHasChildren(item, true); item->id = 0; } watchHandler->insertItem(item); @@ -2244,7 +2250,7 @@ void QmlEnginePrivate::handleScope(const QVariantMap &response) item->id = localData.handle; item->type = localData.type; item->value = localData.value.toString(); - item->setHasChildren(localData.hasChildren()); + setWatchItemHasChildren(item.get(), localData.hasChildren()); if (localData.value.isValid() || item->wantsChildren || localData.expectedProperties == 0) { WatchHandler *watchHander = engine->watchHandler(); @@ -2390,7 +2396,7 @@ void QmlEnginePrivate::insertSubItems(WatchItem *parent, const QVariantList &pro item->value = propertyData.value.toString(); if (item->type.isEmpty() || expandedINames.contains(item->iname)) itemsToLookup.insert(propertyData.handle, {item->iname, item->name, item->exp}); - item->setHasChildren(propertyData.hasChildren()); + setWatchItemHasChildren(item.get(), propertyData.hasChildren()); parent->appendChild(item.release()); } @@ -2446,7 +2452,7 @@ void QmlEnginePrivate::handleLookup(const QVariantMap &response) item->type = bodyObjectData.type; item->value = bodyObjectData.value.toString(); - item->setHasChildren(bodyObjectData.hasChildren()); + setWatchItemHasChildren(item, bodyObjectData.hasChildren()); insertSubItems(item, bodyObjectData.properties); engine->watchHandler()->insertItem(item); From 3300182d405bffe062a0f2be900f35822a9e20b0 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 5 Jul 2018 12:36:53 +0200 Subject: [PATCH 22/22] Wizards: Make it easier to debug cmake based quick applications Change-Id: I09a09fb14b3cf8d5486e84413f9f3238c72e2d0f Reviewed-by: Christian Stenger Reviewed-by: Tobias Hunger --- .../wizards/projects/qtquickapplication/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt index 07c1f586086..f28d772a1a4 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt @@ -11,5 +11,5 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt5 COMPONENTS Core Quick REQUIRED) add_executable(${PROJECT_NAME} "%{MainCppFileName}" "qml.qrc") - -target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Quick) +target_compile_definitions(${PROJECT_NAME} PRIVATE $<$,$>:QT_QML_DEBUG>) +target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Quick)