diff --git a/dist/changes-4.5.1.md b/dist/changes-4.5.1.md new file mode 100644 index 00000000000..648d53054c8 --- /dev/null +++ b/dist/changes-4.5.1.md @@ -0,0 +1,85 @@ +Qt Creator version 4.5.1 contains bug fixes. + +The most important changes are listed in this document. For a complete +list of changes, see the Git log for the Qt Creator sources that +you can check out from the public Git repository. For example: + + git clone git://code.qt.io/qt-creator/qt-creator.git + git log --cherry-pick --pretty=oneline v4.5.0..v4.5.1 + +Help + +* Fixed that mouse cursor got stuck in waiting state when jumping to + anchor within open help page (QTCREATORBUG-19649) + +All Projects + +* Fixed predefined macro setting for custom toolchains (QTCREATORBUG-19714) + +QMake Projects + +* Fixed crash when importing build (QTCREATORBUG-19391) +* Fixed crash when switching file while project is parsing (QTCREATORBUG-19428) + +Qbs Projects + +* Fixed issue with toolchain setup (QTCREATORBUG-19467) +* Fixed reparsing after switching build configuration + +Qt Quick Designer + +* Fixed painting artifacts while resizing + +Nim Support + +* Fixed debugging (QTCREATORBUG-19414) + +Debugging + +* CDB + * Improved performance when stepping (QTCREATORBUG-18613) + +QML Profiler + +* Fixed `Analyze Current Range` (QTCREATORBUG-19456) +* Fixed attaching to running application (QTCREATORBUG-19496) + +Version Control Systems + +* Gerrit + * Fixed that dialog could use wrong repository (QTCREATORBUG-19562) + +Platform Specific + +Windows + +* Fixed issue with `PATH` when running QMake project +* Fixed issue with `PATH` when debugging with GDB +* Fixed multiple registration of MSVC 2015 Build Tools + +Universal Windows Platform + +* Fixed that changes to deployment steps did not persist + +Credits for these changes go to: +Alessandro Portale +Alexandru Croitor +André Pönitz +Christian Kandeler +Christian Stenger +David Schulz +Eike Ziller +Friedemann Kleint +Ivan Donchevskii +Jaroslaw Kobus +Leena Miettinen +Nikolai Kosjar +Orgad Shaneh +Oswald Buddenhagen +Robert Löhning +Samuel Gaist +Sergey Belyashov +Thomas Hartmann +Tim Jenssen +Tobias Hunger +Ulf Hermann diff --git a/doc/images/qtcreator-modeleditor-classes.png b/doc/images/qtcreator-modeleditor-classes.png index 32aff713ef8..c5747416db2 100644 Binary files a/doc/images/qtcreator-modeleditor-classes.png and b/doc/images/qtcreator-modeleditor-classes.png differ diff --git a/doc/images/qtcreator-modeleditor-packages.png b/doc/images/qtcreator-modeleditor-packages.png index 07b31e8552b..3884886e19f 100644 Binary files a/doc/images/qtcreator-modeleditor-packages.png and b/doc/images/qtcreator-modeleditor-packages.png differ diff --git a/doc/images/qtcreator-modeleditor.png b/doc/images/qtcreator-modeleditor.png index 447c210c2e9..9f46b26ac62 100644 Binary files a/doc/images/qtcreator-modeleditor.png and b/doc/images/qtcreator-modeleditor.png differ diff --git a/doc/src/editors/creator-coding.qdoc b/doc/src/editors/creator-coding.qdoc index 73ca7751cea..3b6bddfb9f5 100644 --- a/doc/src/editors/creator-coding.qdoc +++ b/doc/src/editors/creator-coding.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -88,9 +88,9 @@ \li \l{Modeling} - You can use the experimental model editor to create Universal - Modeling Language (UML) style models with structured diagrams and - store them in XML format. + You can use the model editor to create Universal Modeling Language + (UML) style models with structured and behavioral diagrams that + provide different views of your system and store them in XML format. \li \l{Editing State Charts} diff --git a/doc/src/editors/creator-modeling.qdoc b/doc/src/editors/creator-modeling.qdoc index 0de481668ea..e4a3caf0966 100644 --- a/doc/src/editors/creator-modeling.qdoc +++ b/doc/src/editors/creator-modeling.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -37,21 +37,46 @@ \title Modeling - You can use the experimental model editor to create Universal Modeling - Language (UML) style models with structured diagrams. However, the editor - uses a variant of UML and only a subset of properties are provided for - specifying the appearance of model elements. + You can use the model editor to create Universal Modeling Language (UML) + style models with structured and behavioral diagrams that provide different + views of your system. However, the editor uses a variant of UML and only a + subset of properties are provided for specifying the appearance of model + elements. - You can create the following types of diagrams: + Structural diagrams represent the static aspect of the system and are + therefore stable, whereas behavioral diagrams have both static and dynamic + aspects. + + You can create the following types of structural diagrams: \list - \li Package - \li Class - \li Component - \li Use case - \li Activity + \li Package diagrams, which consist of packages and their relationships, + and visualize how the system is packaged. + \li Class diagrams, which consists of classes, dependencies, + inheritance, associations, aggregation, and composition, and + provide an object-oriented view of a system. + \li Component diagrams, which represent a set of components and their + relationships, and provide an implementation view of a system. + \li Deployment diagrams, which represent a set of software and hardware + components and their relationships, and visualize the deployment + of a system. \endlist + You can create the following types of behavioral diagrams: + + \list + \li Use case diagrams, which consists of actors, use cases, and their + relationships, and represent a particular functionality of a system. + \li Activity diagrams, which visualize the flow from one activity to + another. + \li Sequence diagrams, which consist of instances and specify where the + instances are activated and destroyed and where their lifeline ends. + \endlist + + \section1 Using the Model Editor + + You can create models that contain several different structural or + behavioral diagrams. You can add elements to the diagrams and specify properties for them. You can either use standard model elements or add your own elements with custom icons. @@ -66,13 +91,14 @@ \li Select tool bar buttons (3) to add elements to the element tree (4). \li Drag elements from the element tree to the editor to add them and all their relations to the diagram. - \li Drag and drop source files from \uicontrol Projects to the editor - to add C++ classes or components to a class or component diagram. + \li Drag and drop source files from the sidebar views to the editor + to add C++ classes or components to diagrams. + \endlist You can group elements by surrounding them with a boundary. When you move - the boundary, all elements within it are moved together. Similary drag - a swimlane to the diagram. When you move the swimlane all elements right + the boundary, all elements within it are moved together. Similary, drag + a swimlane to the diagram. When you move the swimlane, all elements right to the swimlane (for vertical swimlanes) or below it (for horizontal swimlanes) will be moved together. A vertical swimlane is created when you drop the swimlane icon on the top border of the diagram and a horizontal swimlane @@ -82,6 +108,11 @@ You can move individual elements and modify their properties (5) by selecting them. You can also use \e multiselection to group elements temporarily. + To align elements in the editor, select several elements and right-click to + open a context menu. Select actions in the \uicontrol {Align Objects} menu + to align elements horizontally or vertically or to adjust their width and + height. + Drag the mouse over elements to select them and apply actions such as changing their \e stereotype or color. A stereotype is a classifier for elements, such as \e entity, \e control, \e interface, or \e boundary. An @@ -89,6 +120,9 @@ a custom icon is defined. You can assign several comma-separated stereotypes to one element. + To add related elements to a diagram, select an element in the editor, and + then select \uicontrol {Add Related Elements} in the context menu. + By default, when you select an element in a diagram, it is highlighted also in the \uicontrol Structure view. To change this behavior so that selecting an element in the \uicontrol Structure makes it highlighted also in the @@ -97,13 +131,11 @@ To keep the selections in the diagram and the \uicontrol Structure view synchronized, select \uicontrol {Keep Synchronized}. - To zoom into diagrams, select \uicontrol Tools > \uicontrol {Model Editor} > - \uicontrol {Zoom In}, press \key Ctrl++, or press \key Ctrl and roll the - mouse wheel up. To zoom out of diagrams, select \uicontrol Tools > - \uicontrol {Model Editor} > \uicontrol {Zoom Out}, press \key Ctrl+-, or - press \key Ctrl and roll the mouse wheel down. To reset the diagram size to - 100%, select \uicontrol Tools > \uicontrol {Model Editor} > \uicontrol - {Reset Zoom} or press \key Ctrl+0. + To zoom into diagrams, select the \uicontrol {Zoom In} toolbar button, + press \key Ctrl++, or press \key Ctrl and roll the mouse wheel up. To zoom + out of diagrams, select \uicontrol {Zoom Out}, press \key Ctrl+-, or press + \key Ctrl and roll the mouse wheel down. To reset the diagram size to 100%, + select \uicontrol {Reset Zoom} or press \key Ctrl+0. To print diagrams, press \key Ctrl+C when no elements are selected in the editor to copy all elements to the clipboard by using 300 dpi. Then @@ -112,22 +144,26 @@ If you copy a selection of elements in the editor, only those elements and their relations will be copied to the clipboard as an image. - To save diagrams as images, select \uicontrol Tools > - \uicontrol {Model Editor} > \uicontrol {Export Diagram}. + To save diagrams as images, select \uicontrol File > + \uicontrol {Export Diagram}. To save only the selected parts of a diagram, + select \uicontrol {Export Selected Elements}. \section1 Creating Models + You can use wizards to create models and \e {scratch models}. A scratch + model can be used to quickly put a temporary diagram together. The wizard + creates the model file in a temporary folder without any input from you. + Therefore, you can assign a \l{Keyboard Shortcuts}{keyboard shortcut} to the + wizard and use it to create and open models with empty diagrams. + To create models: \list 1 - \li Select \uicontrol Help > \uicontrol {About Plugins} > - \uicontrol Modeling > \uicontrol ModelEditor and restart \QC to - enable the plugin. - \li Select \uicontrol File > \uicontrol {New File or Project} > - \uicontrol Modeling > \uicontrol Model > \uicontrol Choose to - create a model. + \uicontrol Modeling > \uicontrol Model > or + \uicontrol {Scratch Model} > \uicontrol Choose to create a model + or a scratch model. \li Drag and drop model elements to the editor and select them to specify properties for them: @@ -148,8 +184,9 @@ element. \li In the \uicontrol Role field, select a \e role to make the model - element color lighter, darker, or softer or to remove color and - draw the element outline. + element color lighter, darker, or softer. You can also remove + color and draw the element outline or flatten the element by + removing gradients. \li Select the \uicontrol Emphasized check box to draw the model element with a thicker line. @@ -234,6 +271,13 @@ \image qtcreator-modeleditor-packages.png + Right-click a package to open a context menu, where you can select + \uicontrol {Create Diagram} to create a new package diagram within the + model. You can drag and drop items from the element tree to the diagram. + + To update the include dependencies of the package, select + \uicontrol {Update Include Dependencies}. + \section1 Creating Class Diagrams \image qtcreator-modeleditor-classes.png diff --git a/qbs/imports/QtcLibrary.qbs b/qbs/imports/QtcLibrary.qbs index faa3900a995..8ea8a6d2dff 100644 --- a/qbs/imports/QtcLibrary.qbs +++ b/qbs/imports/QtcLibrary.qbs @@ -13,7 +13,7 @@ QtcProduct { } targetName: QtcFunctions.qtLibraryName(qbs, name) - destinationDirectory: FileInfo.joinPaths(buildDirectory, qtc.ide_library_path) + destinationDirectory: FileInfo.joinPaths(project.buildDirectory, qtc.ide_library_path) cpp.linkerFlags: { var flags = base; diff --git a/qbs/imports/QtcPlugin.qbs b/qbs/imports/QtcPlugin.qbs index 95198a62ef4..7606b02504e 100644 --- a/qbs/imports/QtcPlugin.qbs +++ b/qbs/imports/QtcPlugin.qbs @@ -13,7 +13,7 @@ QtcProduct { property var pluginTestDepends: [] targetName: QtcFunctions.qtLibraryName(qbs, name) - destinationDirectory: FileInfo.joinPaths(buildDirectory, qtc.ide_plugin_path) + destinationDirectory: FileInfo.joinPaths(project.buildDirectory, qtc.ide_plugin_path) Depends { name: "ExtensionSystem" } Depends { name: "pluginjson" } diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 5a8290b3d20..f7b9d8a0ef7 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -908,7 +908,10 @@ class Dumper(DumperBase): elif self.startMode_ == AttachCore: coreFile = args.get('coreFile', ''); self.process = self.target.LoadCore(coreFile) - self.reportState('enginerunokandinferiorunrunnable') + if self.process.IsValid(): + self.reportState('enginerunokandinferiorunrunnable') + else: + self.reportState('enginerunfailed') else: launchInfo = lldb.SBLaunchInfo(self.processArgs_) launchInfo.SetWorkingDirectory(self.workingDirectory_) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml index 602d442be18..10d562da158 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml @@ -232,7 +232,7 @@ Section { text: qsTr("Kerning") Layout.fillWidth: true backendValue: (backendValues.font_kerning === undefined) ? dummyBackendValue : backendValues.font_kerning - tooltip: qsTr("Enables or disables the kerning OpenType feature when shaping the text. This may " + + tooltip: qsTr("Enables or disables the kerning OpenType feature when shaping the text. Disabling this may " + "improve performance when creating or changing the text, at the expense of some cosmetic features. The default value is true.") } @@ -241,7 +241,7 @@ Section { Layout.fillWidth: true backendValue: (backendValues.font_preferShaping === undefined) ? dummyBackendValue : backendValues.font_preferShaping tooltip: qsTr("Sometimes, a font will apply complex rules to a set of characters in order to display them correctly.\n" + - "In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, whereas in" + + "In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, whereas in " + "Latin script,\n it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features\nwhen they are not required, which will improve performance in most cases.") } } diff --git a/src/libs/clangsupport/connectionclient.cpp b/src/libs/clangsupport/connectionclient.cpp index 2d7a3ee4526..2a3ec8af30e 100644 --- a/src/libs/clangsupport/connectionclient.cpp +++ b/src/libs/clangsupport/connectionclient.cpp @@ -103,20 +103,6 @@ void ConnectionClient::setProcessAliveTimerInterval(int processTimerInterval) m_processAliveTimer.setInterval(processTimerInterval); } -QProcessEnvironment ConnectionClient::processEnvironment() const -{ - auto processEnvironment = QProcessEnvironment::systemEnvironment(); - - if (temporaryDirectory().isValid()) { - const QString temporaryDirectoryPath = temporaryDirectory().path(); - processEnvironment.insert(QStringLiteral("TMPDIR"), temporaryDirectoryPath); - processEnvironment.insert(QStringLiteral("TMP"), temporaryDirectoryPath); - processEnvironment.insert(QStringLiteral("TEMP"), temporaryDirectoryPath); - } - - return processEnvironment; -} - const QTemporaryDir &ConnectionClient::temporaryDirectory() const { return m_processCreator.temporaryDirectory(); diff --git a/src/libs/clangsupport/connectionclient.h b/src/libs/clangsupport/connectionclient.h index 327275e0502..45797bd8922 100644 --- a/src/libs/clangsupport/connectionclient.h +++ b/src/libs/clangsupport/connectionclient.h @@ -31,7 +31,6 @@ #include #include -#include #include #include @@ -124,8 +123,6 @@ private: void ensureMessageIsWritten(); - QProcessEnvironment processEnvironment() const; - protected: ProcessCreator m_processCreator; diff --git a/src/libs/utils/utilsicons.cpp b/src/libs/utils/utilsicons.cpp index 35dfe17f9f1..2a602705384 100644 --- a/src/libs/utils/utilsicons.cpp +++ b/src/libs/utils/utilsicons.cpp @@ -87,6 +87,8 @@ const Icon NEWFILE({ {QLatin1String(":/utils/images/filenew.png"), Theme::PanelTextColorMid}}, Icon::Tint); const Icon OPENFILE({ {QLatin1String(":/utils/images/fileopen.png"), Theme::PanelTextColorMid}}, Icon::Tint); +const Icon OPENFILE_TOOLBAR({ + {QLatin1String(":/utils/images/fileopen.png"), Theme::IconsBaseColor}}); const Icon SAVEFILE({ {QLatin1String(":/utils/images/filesave.png"), Theme::PanelTextColorMid}}, Icon::Tint); const Icon SAVEFILE_TOOLBAR({ diff --git a/src/libs/utils/utilsicons.h b/src/libs/utils/utilsicons.h index 4b341ea784e..c836cd3bc35 100644 --- a/src/libs/utils/utilsicons.h +++ b/src/libs/utils/utilsicons.h @@ -58,6 +58,7 @@ QTCREATOR_UTILS_EXPORT extern const Icon SNAPSHOT_TOOLBAR; QTCREATOR_UTILS_EXPORT extern const Icon NEWFILE; QTCREATOR_UTILS_EXPORT extern const Icon OPENFILE; +QTCREATOR_UTILS_EXPORT extern const Icon OPENFILE_TOOLBAR; QTCREATOR_UTILS_EXPORT extern const Icon SAVEFILE; QTCREATOR_UTILS_EXPORT extern const Icon SAVEFILE_TOOLBAR; QTCREATOR_UTILS_EXPORT extern const Icon UNDO; diff --git a/src/libs/utils/winutils.cpp b/src/libs/utils/winutils.cpp index 140d94977d6..f9d04a5d77e 100644 --- a/src/libs/utils/winutils.cpp +++ b/src/libs/utils/winutils.cpp @@ -181,6 +181,8 @@ QTCREATOR_UTILS_EXPORT QString imageName(quint32 processId) if (QueryFullProcessImageName(handle, 0, path, &pathLen)) result = QString::fromUtf16(reinterpret_cast(path)); CloseHandle(handle); +#else + Q_UNUSED(processId); #endif return result; } diff --git a/src/plugins/android/androidgdbserverkitinformation.cpp b/src/plugins/android/androidgdbserverkitinformation.cpp index cb0ad4d4014..d4a7e17d85f 100644 --- a/src/plugins/android/androidgdbserverkitinformation.cpp +++ b/src/plugins/android/androidgdbserverkitinformation.cpp @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -73,6 +74,7 @@ KitInformation::ItemList AndroidGdbServerKitInformation::toUserOutput(const Kit KitConfigWidget *AndroidGdbServerKitInformation::createConfigWidget(Kit *kit) const { + QTC_ASSERT(kit, return nullptr); return new AndroidGdbServerKitInformationWidget(kit, this); } @@ -94,11 +96,13 @@ bool AndroidGdbServerKitInformation::isAndroidKit(const Kit *kit) FileName AndroidGdbServerKitInformation::gdbServer(const Kit *kit) { + QTC_ASSERT(kit, return FileName()); return FileName::fromString(kit->value(AndroidGdbServerKitInformation::id()).toString()); } void AndroidGdbServerKitInformation::setGdbSever(Kit *kit, const FileName &gdbServerCommand) { + QTC_ASSERT(kit, return); kit->setValue(AndroidGdbServerKitInformation::id(), gdbServerCommand.toString()); } diff --git a/src/plugins/android/androidpackageinstallationstep.cpp b/src/plugins/android/androidpackageinstallationstep.cpp index c5d3d69f531..fa69951e820 100644 --- a/src/plugins/android/androidpackageinstallationstep.cpp +++ b/src/plugins/android/androidpackageinstallationstep.cpp @@ -132,7 +132,7 @@ AndroidPackageInstallationStepWidget::AndroidPackageInstallationStepWidget(Andro QString AndroidPackageInstallationStepWidget::summaryText() const { - return tr("Make install"); + return "" + tr("Make install") + ""; } QString AndroidPackageInstallationStepWidget::displayName() const diff --git a/src/plugins/autotest/testsettingspage.cpp b/src/plugins/autotest/testsettingspage.cpp index 852db0bdee4..f0fc60c09fc 100644 --- a/src/plugins/autotest/testsettingspage.cpp +++ b/src/plugins/autotest/testsettingspage.cpp @@ -237,8 +237,8 @@ void TestSettingsWidget::onAddFilterClicked() { TestFilterDialog dialog; dialog.setWindowTitle(tr("Add Filter")); - dialog.setDetailsText(tr("

Specify a filter expression to be added to the list of filters." - "
Wildcards are not supported.

")); + dialog.setDetailsText("

" + tr("Specify a filter expression to be added to the list of filters." + "
Wildcards are not supported.") + "

"); if (dialog.exec() == QDialog::Accepted) { const QString &filter = dialog.filterPath(); if (!filter.isEmpty()) @@ -254,8 +254,8 @@ void TestSettingsWidget::onEditFilterClicked() TestFilterDialog dialog; dialog.setWindowTitle(tr("Edit Filter")); - dialog.setDetailsText(tr("

Specify a filter expression that will replace \"%1\"." - "
Wildcards are not supported.

").arg(oldFilter)); + dialog.setDetailsText("

" + tr("Specify a filter expression that will replace \"%1\"." + "
Wildcards are not supported.").arg(oldFilter) + "

"); dialog.setDefaultFilterPath(oldFilter); if (dialog.exec() == QDialog::Accepted) { const QString &edited = dialog.filterPath(); diff --git a/src/plugins/clangcodemodel/clanghoverhandler.cpp b/src/plugins/clangcodemodel/clanghoverhandler.cpp index 1c387562612..158bb9db64f 100644 --- a/src/plugins/clangcodemodel/clanghoverhandler.cpp +++ b/src/plugins/clangcodemodel/clanghoverhandler.cpp @@ -196,7 +196,7 @@ void ClangHoverHandler::processToolTipInfo(const CppTools::ToolTipInfo &info) } if (!info.sizeInBytes.isEmpty()) - text.append(tr("\n\n%1 bytes").arg(info.sizeInBytes)); + text.append("\n\n" + tr("%1 bytes").arg(info.sizeInBytes)); setToolTip(text); m_reportPriority(priority()); diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index b59fb5e2353..7a8d22ac284 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -86,7 +86,7 @@ Core::Id CMakeKitInformation::id() CMakeTool *CMakeKitInformation::cmakeTool(const Kit *k) { if (!k) - return 0; + return nullptr; const QVariant id = k->value(TOOL_ID); return CMakeToolManager::findById(Core::Id::fromSetting(id)); @@ -142,11 +142,13 @@ KitInformation::ItemList CMakeKitInformation::toUserOutput(const Kit *k) const KitConfigWidget *CMakeKitInformation::createConfigWidget(Kit *k) const { + QTC_ASSERT(k, return nullptr); return new Internal::CMakeKitConfigWidget(k, this); } void CMakeKitInformation::addToMacroExpander(Kit *k, Utils::MacroExpander *expander) const { + QTC_ASSERT(k, return); expander->registerFileVariables("CMake:Executable", tr("Path to the cmake executable"), [k]() -> QString { CMakeTool *tool = CMakeKitInformation::cmakeTool(k); @@ -304,6 +306,8 @@ QStringList CMakeGeneratorKitInformation::generatorArguments(const Kit *k) QVariant CMakeGeneratorKitInformation::defaultValue(const Kit *k) const { + QTC_ASSERT(k, return QVariant()); + CMakeTool *tool = CMakeKitInformation::cmakeTool(k); if (!tool) return QVariant(); @@ -426,6 +430,8 @@ void CMakeGeneratorKitInformation::fix(Kit *k) void CMakeGeneratorKitInformation::upgrade(Kit *k) { + QTC_ASSERT(k, return); + const QVariant value = k->value(GENERATOR_ID); if (value.type() != QVariant::Map) { GeneratorInfo info; @@ -545,6 +551,8 @@ QVariant CMakeConfigurationKitInformation::defaultValue(const Kit *k) const QList CMakeConfigurationKitInformation::validate(const Kit *k) const { + QTC_ASSERT(k, return QList()); + const QtSupport::BaseQtVersion *const version = QtSupport::QtKitInformation::qtVersion(k); const ToolChain *const tcC = ToolChainKitInformation::toolChain(k, ProjectExplorer::Constants::C_LANGUAGE_ID); const ToolChain *const tcCxx = ToolChainKitInformation::toolChain(k, ProjectExplorer::Constants::CXX_LANGUAGE_ID); @@ -659,7 +667,7 @@ KitInformation::ItemList CMakeConfigurationKitInformation::toUserOutput(const Ki KitConfigWidget *CMakeConfigurationKitInformation::createConfigWidget(Kit *k) const { if (!k) - return 0; + return nullptr; return new Internal::CMakeConfigurationKitConfigWidget(k, this); } diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp index ac8350e8279..96ca235225e 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp @@ -146,9 +146,6 @@ bool CMakeRunConfiguration::fromMap(const QVariantMap &map) extraAspect()->setDefaultWorkingDirectory(ct.workingDirectory); } - setDisplayName(defaultDisplayName()); - setDefaultDisplayName(defaultDisplayName()); - return true; } diff --git a/src/plugins/coreplugin/dialogs/newdialog.cpp b/src/plugins/coreplugin/dialogs/newdialog.cpp index 43c2b2efe69..0bc113a42fb 100644 --- a/src/plugins/coreplugin/dialogs/newdialog.cpp +++ b/src/plugins/coreplugin/dialogs/newdialog.cpp @@ -52,6 +52,10 @@ const char LAST_CATEGORY_KEY[] = "Core/NewDialog/LastCategory"; const char LAST_PLATFORM_KEY[] = "Core/NewDialog/LastPlatform"; const char ALLOW_ALL_TEMPLATES[] = "Core/NewDialog/AllowAllTemplates"; const char SHOW_PLATOFORM_FILTER[] = "Core/NewDialog/ShowPlatformFilter"; +const char BLACKLISTED_CATEGORIES_KEY[] = "Core/NewDialog/BlacklistedCategories"; + +using namespace Core; +using namespace Core::Internal; class WizardFactoryContainer { @@ -73,7 +77,11 @@ class PlatformFilterProxyModel : public QSortFilterProxyModel { // Q_OBJECT public: - PlatformFilterProxyModel(QObject *parent = nullptr): QSortFilterProxyModel(parent) {} + PlatformFilterProxyModel(QObject *parent = nullptr): QSortFilterProxyModel(parent) + { + m_blacklistedCategories = + Id::fromStringList(ICore::settings()->value(BLACKLISTED_CATEGORIES_KEY).toStringList()); + } void setPlatform(Core::Id platform) { @@ -103,13 +111,18 @@ public: QModelIndex sourceIndex = sourceModel()->index(sourceRow, 0, sourceParent); Core::IWizardFactory *wizard = factoryOfItem(qobject_cast(sourceModel())->itemFromIndex(sourceIndex)); - if (wizard) + + if (wizard) { + if (m_blacklistedCategories.contains(Core::Id::fromString(wizard->category()))) + return false; return wizard->isAvailable(m_platform); + } return true; } private: Core::Id m_platform; + QSet m_blacklistedCategories; }; #define ROW_HEIGHT 24 diff --git a/src/plugins/cpptools/clangbasechecks.ui b/src/plugins/cpptools/clangbasechecks.ui new file mode 100644 index 00000000000..470f3531b67 --- /dev/null +++ b/src/plugins/cpptools/clangbasechecks.ui @@ -0,0 +1,41 @@ + + + CppTools::ClangBaseChecks + + + + 0 + 0 + 665 + 300 + + + + Form + + + + + + For appropriate options, consult the GCC or Clang manual pages or the <a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html">GCC online documentation</a>. + + + true + + + + + + + + + + + CppTools::WrappableLineEdit + QLineEdit +
cpptools/wrappablelineedit.h
+
+
+ + +
diff --git a/src/plugins/cpptools/clangdiagnosticconfigswidget.cpp b/src/plugins/cpptools/clangdiagnosticconfigswidget.cpp index 1cc623e3536..fe66ed5c7df 100644 --- a/src/plugins/cpptools/clangdiagnosticconfigswidget.cpp +++ b/src/plugins/cpptools/clangdiagnosticconfigswidget.cpp @@ -25,6 +25,7 @@ #include "clangdiagnosticconfigswidget.h" #include "ui_clangdiagnosticconfigswidget.h" +#include "ui_clangbasechecks.h" #include "ui_clazychecks.h" #include "ui_tidychecks.h" @@ -47,7 +48,7 @@ ClangDiagnosticConfigsWidget::ClangDiagnosticConfigsWidget( , m_diagnosticConfigsModel(diagnosticConfigsModel) { m_ui->setupUi(this); - setupPluginsWidgets(); + setupTabs(); connectConfigChooserCurrentIndex(); connect(m_ui->copyButton, &QPushButton::clicked, @@ -99,7 +100,7 @@ void ClangDiagnosticConfigsWidget::onCopyButtonClicked() emit customConfigsChanged(customConfigs()); syncConfigChooserToModel(customConfig.id()); - m_ui->diagnosticOptionsTextEdit->setFocus(); + m_clangBaseChecks->diagnosticOptionsTextEdit->setFocus(); } } @@ -123,6 +124,28 @@ void ClangDiagnosticConfigsWidget::onClangTidyItemChanged(QListWidgetItem *item) updateConfig(config); } +void ClangDiagnosticConfigsWidget::onClazyRadioButtonChanged(bool checked) +{ + if (!checked) + return; + + QString checks; + if (m_clazyChecks->clazyRadioDisabled->isChecked()) + checks = QString(); + else if (m_clazyChecks->clazyRadioLevel0->isChecked()) + checks = "level0"; + else if (m_clazyChecks->clazyRadioLevel1->isChecked()) + checks = "level1"; + else if (m_clazyChecks->clazyRadioLevel2->isChecked()) + checks = "level2"; + else if (m_clazyChecks->clazyRadioLevel3->isChecked()) + checks = "level3"; + + ClangDiagnosticConfig config = currentConfig(); + config.setClazyChecks(checks); + updateConfig(config); +} + static bool isAcceptedWarningOption(const QString &option) { return option == "-w" @@ -162,7 +185,8 @@ static QStringList normalizeDiagnosticInputOptions(const QString &options) void ClangDiagnosticConfigsWidget::onDiagnosticOptionsEdited() { // Clean up input - const QString diagnosticOptions = m_ui->diagnosticOptionsTextEdit->document()->toPlainText(); + const QString diagnosticOptions = m_clangBaseChecks->diagnosticOptionsTextEdit->document() + ->toPlainText(); const QStringList normalizedOptions = normalizeDiagnosticInputOptions(diagnosticOptions); // Validate @@ -231,7 +255,7 @@ void ClangDiagnosticConfigsWidget::syncOtherWidgetsToComboBox() ? m_notAcceptedOptions.value(config.id()) : config.clangOptions().join(QLatin1Char(' ')); setDiagnosticOptions(options); - m_ui->diagnosticOptionsTextEdit->setReadOnly(config.isReadOnly()); + m_clangBaseChecks->diagnosticOptionsTextEdit->setReadOnly(config.isReadOnly()); syncClangTidyWidgets(config); syncClazyWidgets(config); @@ -265,31 +289,23 @@ void ClangDiagnosticConfigsWidget::syncClangTidyWidgets(const ClangDiagnosticCon void ClangDiagnosticConfigsWidget::syncClazyWidgets(const ClangDiagnosticConfig &config) { const QString clazyChecks = config.clazyChecks(); + + QRadioButton *button = m_clazyChecks->clazyRadioDisabled; if (clazyChecks.isEmpty()) - m_clazyChecks->clazyLevel->setCurrentIndex(0); - else - m_clazyChecks->clazyLevel->setCurrentText(clazyChecks); + button = m_clazyChecks->clazyRadioDisabled; + else if (clazyChecks == "level0") + button = m_clazyChecks->clazyRadioLevel0; + else if (clazyChecks == "level1") + button = m_clazyChecks->clazyRadioLevel1; + else if (clazyChecks == "level2") + button = m_clazyChecks->clazyRadioLevel2; + else if (clazyChecks == "level3") + button = m_clazyChecks->clazyRadioLevel3; + + button->setChecked(true); m_clazyChecksWidget->setEnabled(!config.isReadOnly()); } -void ClangDiagnosticConfigsWidget::setClazyLevelDescription(int index) -{ - // Levels descriptions are taken from https://github.com/KDE/clazy - static const QString levelDescriptions[] { - QString(), - tr("Very stable checks, 99.99% safe, no false-positives."), - tr("Similar to level 0, but sometimes (rarely) there might be\n" - "some false-positives."), - tr("Sometimes has false-positives (20-30%)."), - tr("Not always correct, possibly very noisy, might require\n" - "a knowledgeable developer to review, might have a very big\n" - "rate of false-positives, might have bugs.") - }; - - QTC_ASSERT(m_clazyChecks, return); - m_clazyChecks->levelDescription->setText(levelDescriptions[static_cast(index)]); -} - void ClangDiagnosticConfigsWidget::updateConfig(const ClangDiagnosticConfig &config) { m_diagnosticConfigsModel.appendOrUpdate(config); @@ -308,10 +324,10 @@ const ClangDiagnosticConfig &ClangDiagnosticConfigsWidget::currentConfig() const void ClangDiagnosticConfigsWidget::setDiagnosticOptions(const QString &options) { - if (options != m_ui->diagnosticOptionsTextEdit->document()->toPlainText()) { + if (options != m_clangBaseChecks->diagnosticOptionsTextEdit->document()->toPlainText()) { disconnectDiagnosticOptionsChanged(); - m_ui->diagnosticOptionsTextEdit->document()->setPlainText(options); + m_clangBaseChecks->diagnosticOptionsTextEdit->document()->setPlainText(options); const QString errorMessage = validateDiagnosticOptions(normalizeDiagnosticInputOptions(options)); updateValidityWidgets(errorMessage); @@ -351,6 +367,14 @@ void ClangDiagnosticConfigsWidget::disconnectClangTidyItemChanged() this, &ClangDiagnosticConfigsWidget::onClangTidyItemChanged); } +void ClangDiagnosticConfigsWidget::connectClazyRadioButtonClicked(QRadioButton *button) +{ + connect(button, + &QRadioButton::clicked, + this, + &ClangDiagnosticConfigsWidget::onClazyRadioButtonChanged); +} + void ClangDiagnosticConfigsWidget::connectConfigChooserCurrentIndex() { connect(m_ui->configChooserComboBox, @@ -369,14 +393,18 @@ void ClangDiagnosticConfigsWidget::disconnectConfigChooserCurrentIndex() void ClangDiagnosticConfigsWidget::connectDiagnosticOptionsChanged() { - connect(m_ui->diagnosticOptionsTextEdit->document(), &QTextDocument::contentsChanged, - this, &ClangDiagnosticConfigsWidget::onDiagnosticOptionsEdited); + connect(m_clangBaseChecks->diagnosticOptionsTextEdit->document(), + &QTextDocument::contentsChanged, + this, + &ClangDiagnosticConfigsWidget::onDiagnosticOptionsEdited); } void ClangDiagnosticConfigsWidget::disconnectDiagnosticOptionsChanged() { - disconnect(m_ui->diagnosticOptionsTextEdit->document(), &QTextDocument::contentsChanged, - this, &ClangDiagnosticConfigsWidget::onDiagnosticOptionsEdited); + disconnect(m_clangBaseChecks->diagnosticOptionsTextEdit->document(), + &QTextDocument::contentsChanged, + this, + &ClangDiagnosticConfigsWidget::onDiagnosticOptionsEdited); } Core::Id ClangDiagnosticConfigsWidget::currentConfigId() const @@ -401,31 +429,31 @@ void ClangDiagnosticConfigsWidget::refresh( syncWidgetsToModel(configToSelect); } -void ClangDiagnosticConfigsWidget::setupPluginsWidgets() +void ClangDiagnosticConfigsWidget::setupTabs() { + m_clangBaseChecks.reset(new CppTools::Ui::ClangBaseChecks); + m_clangBaseChecksWidget = new QWidget(); + m_clangBaseChecks->setupUi(m_clangBaseChecksWidget); + m_clazyChecks.reset(new CppTools::Ui::ClazyChecks); m_clazyChecksWidget = new QWidget(); m_clazyChecks->setupUi(m_clazyChecksWidget); - connect(m_clazyChecks->clazyLevel, - static_cast(&QComboBox::currentIndexChanged), - [this](int index) { - setClazyLevelDescription(index); - ClangDiagnosticConfig config = currentConfig(); - if (index == 0) - config.setClazyChecks(QString()); - else - config.setClazyChecks(m_clazyChecks->clazyLevel->itemText(index)); - updateConfig(config); - }); + + connectClazyRadioButtonClicked(m_clazyChecks->clazyRadioDisabled); + connectClazyRadioButtonClicked(m_clazyChecks->clazyRadioLevel0); + connectClazyRadioButtonClicked(m_clazyChecks->clazyRadioLevel1); + connectClazyRadioButtonClicked(m_clazyChecks->clazyRadioLevel2); + connectClazyRadioButtonClicked(m_clazyChecks->clazyRadioLevel3); m_tidyChecks.reset(new CppTools::Ui::TidyChecks); m_tidyChecksWidget = new QWidget(); m_tidyChecks->setupUi(m_tidyChecksWidget); connectClangTidyItemChanged(); - m_ui->pluginChecksTabs->addTab(m_tidyChecksWidget, tr("Clang-Tidy")); - m_ui->pluginChecksTabs->addTab(m_clazyChecksWidget, tr("Clazy")); - m_ui->pluginChecksTabs->setCurrentIndex(0); + m_ui->tabWidget->addTab(m_clangBaseChecksWidget, tr("Clang")); + m_ui->tabWidget->addTab(m_tidyChecksWidget, tr("Clang-Tidy")); + m_ui->tabWidget->addTab(m_clazyChecksWidget, tr("Clazy")); + m_ui->tabWidget->setCurrentIndex(0); } } // CppTools namespace diff --git a/src/plugins/cpptools/clangdiagnosticconfigswidget.h b/src/plugins/cpptools/clangdiagnosticconfigswidget.h index 40d574b9442..1d57797a561 100644 --- a/src/plugins/cpptools/clangdiagnosticconfigswidget.h +++ b/src/plugins/cpptools/clangdiagnosticconfigswidget.h @@ -35,12 +35,16 @@ #include -QT_FORWARD_DECLARE_CLASS(QListWidgetItem) +QT_BEGIN_NAMESPACE +class QListWidgetItem; +class QRadioButton; +QT_END_NAMESPACE namespace CppTools { namespace Ui { class ClangDiagnosticConfigsWidget; +class ClangBaseChecks; class ClazyChecks; class TidyChecks; } @@ -67,12 +71,13 @@ signals: void customConfigsChanged(const CppTools::ClangDiagnosticConfigs &customConfigs); private: - void setupPluginsWidgets(); + void setupTabs(); void onCurrentConfigChanged(int); void onCopyButtonClicked(); void onRemoveButtonClicked(); void onClangTidyItemChanged(QListWidgetItem *item); + void onClazyRadioButtonChanged(bool checked); void onDiagnosticOptionsEdited(); @@ -82,7 +87,6 @@ private: void syncClangTidyWidgets(const ClangDiagnosticConfig &config); void syncClazyWidgets(const ClangDiagnosticConfig &config); - void setClazyLevelDescription(int index); void updateConfig(const CppTools::ClangDiagnosticConfig &config); bool isConfigChooserEmpty() const; @@ -94,6 +98,8 @@ private: void connectClangTidyItemChanged(); void disconnectClangTidyItemChanged(); + void connectClazyRadioButtonClicked(QRadioButton *button); + void connectConfigChooserCurrentIndex(); void disconnectConfigChooserCurrentIndex(); void connectDiagnosticOptionsChanged(); @@ -104,6 +110,9 @@ private: ClangDiagnosticConfigsModel m_diagnosticConfigsModel; QHash m_notAcceptedOptions; + std::unique_ptr m_clangBaseChecks; + QWidget *m_clangBaseChecksWidget = nullptr; + std::unique_ptr m_clazyChecks; QWidget *m_clazyChecksWidget = nullptr; diff --git a/src/plugins/cpptools/clangdiagnosticconfigswidget.ui b/src/plugins/cpptools/clangdiagnosticconfigswidget.ui index 201a6f67ccf..fdb0d072623 100644 --- a/src/plugins/cpptools/clangdiagnosticconfigswidget.ui +++ b/src/plugins/cpptools/clangdiagnosticconfigswidget.ui @@ -13,16 +13,9 @@ Form - + - - - - Configuration to use: - - - @@ -50,66 +43,49 @@ - + - - - ValidationIcon - - + + + + + ValidationIcon + + + + + + + ValidationText + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - - - ValidationText - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - + - - - - - - - For appropriate options, consult the GCC or Clang manual pages or the <a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html">GCC online documentation</a>. - - - true - - - - - - - - - CppTools::WrappableLineEdit - QLineEdit -
cpptools/wrappablelineedit.h
-
-
configChooserComboBox copyButton removeButton - diagnosticOptionsTextEdit diff --git a/src/plugins/cpptools/clazychecks.ui b/src/plugins/cpptools/clazychecks.ui index 86a3e049abf..6917cebbfa4 100644 --- a/src/plugins/cpptools/clazychecks.ui +++ b/src/plugins/cpptools/clazychecks.ui @@ -6,8 +6,8 @@ 0 0 - 503 - 73 + 609 + 220 @@ -19,92 +19,73 @@ Form - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - + - - - - 0 - 0 - + + + Each level adds checks to the previous level. For more information, see <a href="https://github.com/KDE/clazy">clazy's homepage</a>. - - 0 + + true - - - Disable - - - - - level0 - - - - - level1 - - - - - level2 - - - - - level3 - - - - - 10 + + + Disabled - - - - - 0 - 0 - - - - - - - - + - - - Qt::Horizontal + + + - - QSizePolicy::Expanding + + Level 0: No false positives + + + + + + + + + + Level 1: Very few false positives + + + + + + + + + + Level 2: More false positives + + + + + + + Not always correct, possibly very noisy, might require a knowledgeable developer to review, might have a very big rate of false-positives, might have bugs. + + + Level 3: Experimental checks + + + + + + + Qt::Vertical - 10 - 20 + 20 + 34 diff --git a/src/plugins/cpptools/cppcodemodelsettingspage.ui b/src/plugins/cpptools/cppcodemodelsettingspage.ui index 61351787f07..3a0b1501d1a 100644 --- a/src/plugins/cpptools/cppcodemodelsettingspage.ui +++ b/src/plugins/cpptools/cppcodemodelsettingspage.ui @@ -106,7 +106,7 @@ - Clang Code Model Warnings + Clang Diagnostics false @@ -114,19 +114,6 @@ - - - - Qt::Vertical - - - - 20 - 151 - - - - diff --git a/src/plugins/cpptools/cpptools.pro b/src/plugins/cpptools/cpptools.pro index a1413bc5bf9..cb57c97cfc3 100644 --- a/src/plugins/cpptools/cpptools.pro +++ b/src/plugins/cpptools/cpptools.pro @@ -191,6 +191,7 @@ FORMS += \ cppcodemodelsettingspage.ui \ cppcodestylesettingspage.ui \ cppfilesettingspage.ui \ + clangbasechecks.ui \ clazychecks.ui \ tidychecks.ui diff --git a/src/plugins/cpptools/cpptools.qbs b/src/plugins/cpptools/cpptools.qbs index 04abfc88c9c..72cc6737b2a 100644 --- a/src/plugins/cpptools/cpptools.qbs +++ b/src/plugins/cpptools/cpptools.qbs @@ -43,6 +43,7 @@ Project { "builtinindexingsupport.h", "builtincursorinfo.cpp", "builtincursorinfo.h", + "clangbasechecks.ui", "clangdiagnosticconfig.cpp", "clangdiagnosticconfig.h", "clangdiagnosticconfigsmodel.cpp", diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp index d1a4e84b10a..5bdd0272d45 100644 --- a/src/plugins/debugger/debuggerkitinformation.cpp +++ b/src/plugins/debugger/debuggerkitinformation.cpp @@ -77,6 +77,8 @@ QVariant DebuggerKitInformation::defaultValue(const Kit *k) const void DebuggerKitInformation::setup(Kit *k) { + QTC_ASSERT(k, return); + // This can be anything (Id, binary path, "auto") // With 3.0 we have: // {75ecf347-f221-44c3-b613-ea1d29929cd4} @@ -158,6 +160,8 @@ void DebuggerKitInformation::setup(Kit *k) // This handles the upgrade path from 2.8 to 3.0 void DebuggerKitInformation::fix(Kit *k) { + QTC_ASSERT(k, return); + // This can be Id, binary path, but not "auto" anymore. const QVariant rawId = k->value(DebuggerKitInformation::id()); @@ -238,7 +242,7 @@ DebuggerKitInformation::ConfigurationErrors DebuggerKitInformation::configuratio const DebuggerItem *DebuggerKitInformation::debugger(const Kit *kit) { - QTC_ASSERT(kit, return 0); + QTC_ASSERT(kit, return nullptr); const QVariant id = kit->value(DebuggerKitInformation::id()); return DebuggerItemManager::findById(id); } @@ -299,6 +303,7 @@ KitConfigWidget *DebuggerKitInformation::createConfigWidget(Kit *k) const void DebuggerKitInformation::addToMacroExpander(Kit *kit, MacroExpander *expander) const { + QTC_ASSERT(kit, return); expander->registerVariable("Debugger:Name", tr("Name of Debugger"), [kit]() -> QString { const DebuggerItem *item = debugger(kit); @@ -353,6 +358,7 @@ void DebuggerKitInformation::setDebugger(Kit *k, const QVariant &id) { // Only register reasonably complete debuggers. QTC_ASSERT(DebuggerItemManager::findById(id), return); + QTC_ASSERT(k, return); k->setValue(DebuggerKitInformation::id(), id); } diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index cab0cda7e78..992d4d15041 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1331,6 +1331,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data) // be handled in the result handler. // -- or -- // *stopped arriving earlier than ^done response to an -exec-step + notifyInferiorRunOk(); notifyInferiorSpontaneousStop(); } else if (state() == InferiorStopOk) { // That's expected. diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 6e26ff3e6e8..80f2fd411c5 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -157,6 +157,15 @@ void LldbEngine::debugLastCommand() runCommand(m_lastDebuggableCommand); } +void LldbEngine::handleAttachedToCore() +{ + QTC_ASSERT(state() == InferiorUnrunnable, qDebug() << state();return); + showMessage("Attached to core."); + reloadFullStack(); + reloadModules(); + updateLocals(); +} + void LldbEngine::shutdownInferior() { QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state()); @@ -851,9 +860,11 @@ void LldbEngine::handleStateNotification(const GdbMi &reportedState) } else if (newState == "enginerunandinferiorstopok") { notifyEngineRunAndInferiorStopOk(); continueInferior(); - } else if (newState == "enginerunokandinferiorunrunnable") + } else if (newState == "enginerunokandinferiorunrunnable") { notifyEngineRunOkAndInferiorUnrunnable(); - else if (newState == "inferiorshutdownfinished") + if (runParameters().startMode == AttachCore) + handleAttachedToCore(); + } else if (newState == "inferiorshutdownfinished") notifyInferiorShutdownFinished(); else if (newState == "engineshutdownfinished") notifyEngineShutdownFinished(); diff --git a/src/plugins/debugger/lldb/lldbengine.h b/src/plugins/debugger/lldb/lldbengine.h index 46a4b745785..f52cf3dd99d 100644 --- a/src/plugins/debugger/lldb/lldbengine.h +++ b/src/plugins/debugger/lldb/lldbengine.h @@ -136,6 +136,7 @@ private: void runCommand(const DebuggerCommand &cmd) override; void debugLastCommand() override; + void handleAttachedToCore(); private: DebuggerCommand m_lastDebuggableCommand; diff --git a/src/plugins/debugger/qml/qmlcppengine.cpp b/src/plugins/debugger/qml/qmlcppengine.cpp index d90799a42ac..bf3a51e43f5 100644 --- a/src/plugins/debugger/qml/qmlcppengine.cpp +++ b/src/plugins/debugger/qml/qmlcppengine.cpp @@ -481,12 +481,16 @@ void QmlCppEngine::slaveEngineStateChanged break; } case InferiorRunOk: { - if (state() == EngineRunRequested) + if (state() == EngineRunRequested) { notifyEngineRunAndInferiorRunOk(); - else if (state() == InferiorRunRequested) + } else if (state() == InferiorRunRequested) { notifyInferiorRunOk(); - else + } else if (state() == InferiorStopOk) { + notifyInferiorRunRequested(); + notifyInferiorRunOk(); + } else { QTC_ASSERT(false, qDebug() << state()); + } if (m_qmlEngine->state() == InferiorStopOk) { // track qml engine again diff --git a/src/plugins/git/gerrit/gerritpushdialog.ui b/src/plugins/git/gerrit/gerritpushdialog.ui index ff06a8da0f7..5b34b1c7763 100644 --- a/src/plugins/git/gerrit/gerritpushdialog.ui +++ b/src/plugins/git/gerrit/gerritpushdialog.ui @@ -77,9 +77,9 @@ - Checked - Mark change as private -Unchecked - Unmark change as private -Semi-checked - Do not change current state + Checked - Mark change as private. +Unchecked - Remove mark. +Partially checked - Do not change current state. &Draft/private diff --git a/src/plugins/help/webenginehelpviewer.cpp b/src/plugins/help/webenginehelpviewer.cpp index 9ff0b1965ab..18c4d865d41 100644 --- a/src/plugins/help/webenginehelpviewer.cpp +++ b/src/plugins/help/webenginehelpviewer.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #include @@ -89,7 +90,20 @@ WebEngineHelpViewer::WebEngineHelpViewer(QWidget *parent) : setPalette(p); connect(m_widget, &QWebEngineView::urlChanged, this, &WebEngineHelpViewer::sourceChanged); - connect(m_widget, &QWebEngineView::loadStarted, this, &WebEngineHelpViewer::slotLoadStarted); + connect(m_widget, &QWebEngineView::loadStarted, this, [this] { + slotLoadStarted(); + // Work around QTBUG-65223: if only anchor changed, we never get a loadFinished signal + // If a link is clicked in a page, it can happen that the new URL has not yet been set, + // so we need to delay a bit... + QTimer::singleShot(/*magic timeout=*/150, this, [this] { + QUrl urlWithoutFragment = source(); + urlWithoutFragment.setFragment(QString()); + qDebug() << urlWithoutFragment << m_previousUrlWithoutFragment; + if (urlWithoutFragment == m_previousUrlWithoutFragment) + slotLoadFinished(); + m_previousUrlWithoutFragment = urlWithoutFragment; + }); + }); connect(m_widget, &QWebEngineView::loadFinished, this, &WebEngineHelpViewer::slotLoadFinished); connect(m_widget, &QWebEngineView::titleChanged, this, &WebEngineHelpViewer::titleChanged); connect(m_widget->page(), &QWebEnginePage::linkHovered, this, &WebEngineHelpViewer::setToolTip); diff --git a/src/plugins/help/webenginehelpviewer.h b/src/plugins/help/webenginehelpviewer.h index d5835c4d6a0..390e90ea654 100644 --- a/src/plugins/help/webenginehelpviewer.h +++ b/src/plugins/help/webenginehelpviewer.h @@ -97,6 +97,7 @@ public: private: WebView *m_widget; + QUrl m_previousUrlWithoutFragment; }; } // namespace Internal diff --git a/src/plugins/modeleditor/ModelEditor.json.in b/src/plugins/modeleditor/ModelEditor.json.in index 42da88171aa..ea4aa9d92f6 100644 --- a/src/plugins/modeleditor/ModelEditor.json.in +++ b/src/plugins/modeleditor/ModelEditor.json.in @@ -15,7 +15,6 @@ \"Category\" : \"Modeling\", \"Description\" : \"Graphical modeling with structured diagrams.\", \"Url\" : \"http://www.qt.io\", - \"Experimental\" : true, $$dependencyList, \"Mimetypes\" : [ diff --git a/src/plugins/modeleditor/actionhandler.cpp b/src/plugins/modeleditor/actionhandler.cpp index 1e3d5563a46..34417d64f22 100644 --- a/src/plugins/modeleditor/actionhandler.cpp +++ b/src/plugins/modeleditor/actionhandler.cpp @@ -187,7 +187,7 @@ void ActionHandler::createActions() d->synchronizeBrowserAction = registerCommand( Constants::ACTION_SYNC_BROWSER, nullptr, Core::Context(), tr("Synchronize Browser and Diagram") + "
" - + tr("Press && Hold for options") + "", QKeySequence(), + + tr("Press && Hold for Options") + "", QKeySequence(), Utils::Icons::LINK.icon())->action(); d->synchronizeBrowserAction->setCheckable(true); diff --git a/src/plugins/projectexplorer/buildsteplist.cpp b/src/plugins/projectexplorer/buildsteplist.cpp index d5979a97a6e..6ae0cd63196 100644 --- a/src/plugins/projectexplorer/buildsteplist.cpp +++ b/src/plugins/projectexplorer/buildsteplist.cpp @@ -47,10 +47,10 @@ BuildStepList::BuildStepList(QObject *parent, Core::Id id) : ProjectConfiguration(parent, id) { if (id == Constants::BUILDSTEPS_BUILD) { - //: Display name of the clean build step list. Used as part of the labels in the project window. + //: Display name of the build build step list. Used as part of the labels in the project window. setDefaultDisplayName(tr("Build")); } else if (id == Constants::BUILDSTEPS_CLEAN) { - //: Display name of the build build step list. Used as part of the labels in the project window. + //: Display name of the clean build step list. Used as part of the labels in the project window. setDefaultDisplayName(tr("Clean")); } } @@ -130,7 +130,7 @@ bool BuildStepList::fromMap(const QVariantMap &map) } } } - QTC_CHECK(handled); + QTC_ASSERT(handled, qDebug() << "No factory for build step" << stepId.toString() << "found."); } return true; } diff --git a/src/plugins/projectexplorer/customtoolchain.cpp b/src/plugins/projectexplorer/customtoolchain.cpp index be829531826..c24a2dda6af 100644 --- a/src/plugins/projectexplorer/customtoolchain.cpp +++ b/src/plugins/projectexplorer/customtoolchain.cpp @@ -649,13 +649,21 @@ void CustomToolChainConfigWidget::applyImpl() tc->setCompilerCommand(m_compilerCommand->fileName()); tc->setMakeCommand(m_makeCommand->fileName()); tc->setTargetAbi(m_abiWidget->currentAbi()); - tc->setPredefinedMacros(Macro::toMacros(m_predefinedDetails->text().toUtf8())); + Macros macros = Utils::transform( + m_predefinedDetails->text().split('\n', QString::SkipEmptyParts), + [](const QString &m) { + return Macro::fromKeyValue(m); + }); + tc->setPredefinedMacros(macros); tc->setHeaderPaths(m_headerDetails->entries()); tc->setCxx11Flags(m_cxx11Flags->text().split(QLatin1Char(','))); tc->setMkspecs(m_mkspecs->text()); tc->setDisplayName(displayName); // reset display name tc->setOutputParserId(Core::Id::fromSetting(m_errorParserComboBox->currentData())); tc->setCustomParserSettings(m_customParserSettings); + + setFromToolchain(); // Refresh with actual data from the toolchain. This shows what e.g. the + // macro parser did with the input. } void CustomToolChainConfigWidget::setFromToolchain() @@ -666,7 +674,10 @@ void CustomToolChainConfigWidget::setFromToolchain() m_compilerCommand->setFileName(tc->compilerCommand()); m_makeCommand->setFileName(FileName::fromString(tc->makeCommand(Environment()))); m_abiWidget->setAbis(QList(), tc->targetAbi()); - m_predefinedMacros->setPlainText(QString::fromUtf8(Macro::toByteArray(tc->rawPredefinedMacros()))); + const QStringList macroLines = Utils::transform(tc->rawPredefinedMacros(), [](const Macro &m) { + return QString::fromUtf8(m.toKeyValue(QByteArray())); + }); + m_predefinedMacros->setPlainText(macroLines.join('\n')); m_headerPaths->setPlainText(tc->headerPathsList().join('\n')); m_cxx11Flags->setText(tc->cxx11Flags().join(QLatin1Char(','))); m_mkspecs->setText(tc->mkspecs()); diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index 9265e9f02a9..8d8015fa4f4 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -78,6 +78,10 @@ const int SORT_ROLE = Qt::UserRole + 2; const char PROJECTSDIRECTORYROOT_ID[] = "A.Projects"; const char C_FOLDERNAVIGATIONWIDGET[] = "ProjectExplorer.FolderNavigationWidget"; +const char kSettingsBase[] = "FolderNavigationWidget."; +const char kHiddenFilesKey[] = ".HiddenFilesFilter"; +const char kSyncKey[] = ".SyncWithEditor"; + namespace ProjectExplorer { namespace Internal { @@ -732,18 +736,18 @@ void FolderNavigationWidgetFactory::saveSettings(QSettings *settings, int positi { auto fnw = qobject_cast(widget); QTC_ASSERT(fnw, return); - const QString baseKey = QLatin1String("FolderNavigationWidget.") + QString::number(position); - settings->setValue(baseKey + QLatin1String(".HiddenFilesFilter"), fnw->hiddenFilesFilter()); - settings->setValue(baseKey + QLatin1String(".SyncWithEditor"), fnw->autoSynchronization()); + const QString base = kSettingsBase + QString::number(position); + settings->setValue(base + kHiddenFilesKey, fnw->hiddenFilesFilter()); + settings->setValue(base + kSyncKey, fnw->autoSynchronization()); } void FolderNavigationWidgetFactory::restoreSettings(QSettings *settings, int position, QWidget *widget) { auto fnw = qobject_cast(widget); QTC_ASSERT(fnw, return); - const QString baseKey = QLatin1String("FolderNavigationWidget.") + QString::number(position); - fnw->setHiddenFilesFilter(settings->value(baseKey + QLatin1String(".HiddenFilesFilter"), false).toBool()); - fnw->setAutoSynchronization(settings->value(baseKey + QLatin1String(".SyncWithEditor"), true).toBool()); + const QString base = kSettingsBase + QString::number(position); + fnw->setHiddenFilesFilter(settings->value(base + kHiddenFilesKey, false).toBool()); + fnw->setAutoSynchronization(settings->value(base + kSyncKey, true).toBool()); } void FolderNavigationWidgetFactory::insertRootDirectory(const RootDirectory &directory) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp index 293714ccb6f..96a9d1a5544 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp @@ -83,7 +83,7 @@ void warnAboutUnsupportedKeys(const QVariantMap &map, const QString &name, const QString typeAndName = name; if (!type.isEmpty() && !name.isEmpty()) - typeAndName = QString("%1(\"%2\")").arg(type, name); + typeAndName = QString("%1 (\"%2\")").arg(type, name); qWarning().noquote() << QString("Field %1 has unsupported keys: %2").arg(typeAndName, map.keys().join(", ")); } @@ -362,7 +362,7 @@ bool LabelField::parseData(const QVariant &data, QString *errorMessage) { if (data.type() != QVariant::Map) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", - "Label(\"%1\") data is not an object.") + "Label (\"%1\") data is not an object.") .arg(name()); return false; } @@ -374,7 +374,7 @@ bool LabelField::parseData(const QVariant &data, QString *errorMessage) if (m_text.isEmpty()) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", - "Label(\"%1\") has no trText.") + "Label (\"%1\") has no trText.") .arg(name()); return false; } @@ -403,7 +403,7 @@ bool SpacerField::parseData(const QVariant &data, QString *errorMessage) if (data.type() != QVariant::Map) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", - "Spacer(\"%1\") data is not an object.") + "Spacer (\"%1\") data is not an object.") .arg(name()); return false; } @@ -415,7 +415,7 @@ bool SpacerField::parseData(const QVariant &data, QString *errorMessage) if (!ok) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", - "Spacer(\"%1\") property \"factor\" is no integer value.") + "Spacer (\"%1\") property \"factor\" is no integer value.") .arg(name()); return false; } @@ -448,7 +448,7 @@ bool LineEditField::parseData(const QVariant &data, QString *errorMessage) if (data.type() != QVariant::Map) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", - "LineEdit(\"%1\") data is not an object.") + "LineEdit (\"%1\") data is not an object.") .arg(name()); return false; } @@ -466,7 +466,7 @@ bool LineEditField::parseData(const QVariant &data, QString *errorMessage) m_validatorRegExp = QRegularExpression(pattern); if (!m_validatorRegExp.isValid()) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", - "LineEdit(\"%1\") has an invalid regular expression \"%1\" in \"validator\".") + "LineEdit (\"%1\") has an invalid regular expression \"%2\" in \"validator\".") .arg(name(), pattern); m_validatorRegExp = QRegularExpression(); return false; @@ -563,7 +563,7 @@ bool TextEditField::parseData(const QVariant &data, QString *errorMessage) if (data.type() != QVariant::Map) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", - "TextEdit(\"%1\") data is not an object.") + "TextEdit (\"%1\") data is not an object.") .arg(name()); return false; } @@ -731,7 +731,7 @@ bool CheckBoxField::parseData(const QVariant &data, QString *errorMessage) if (data.type() != QVariant::Map) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", - "CheckBox(\"%1\") data is not an object.") + "CheckBox (\"%1\") data is not an object.") .arg(name()); return false; } @@ -742,7 +742,7 @@ bool CheckBoxField::parseData(const QVariant &data, QString *errorMessage) m_uncheckedValue = consumeValue(tmp, "uncheckedValue", false).toString(); if (m_checkedValue == m_uncheckedValue) { *errorMessage= QCoreApplication::translate("ProjectExplorer::JsonFieldPage", - "CheckBox(\"%1\") values for checked and unchecked state are identical.") + "CheckBox (\"%1\") values for checked and unchecked state are identical.") .arg(name()); return false; } @@ -840,7 +840,7 @@ bool ListField::parseData(const QVariant &data, QString *errorMessage) { if (data.type() != QVariant::Map) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", - "%1(\"%2\") data is not an object.") + "%1 (\"%2\") data is not an object.") .arg(type(), name()); return false; } @@ -851,14 +851,14 @@ bool ListField::parseData(const QVariant &data, QString *errorMessage) m_index = consumeValue(tmp, "index", 0).toInt(&ok); if (!ok) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", - "%1(\"%2\") \"index\" is not an integer value.") + "%1 (\"%2\") \"index\" is not an integer value.") .arg(type(), name()); return false; } m_disabledIndex = consumeValue(tmp, "disabledIndex", -1).toInt(&ok); if (!ok) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", - "%1(\"%2\") \"disabledIndex\" is not an integer value.") + "%1 (\"%2\") \"disabledIndex\" is not an integer value.") .arg(type(), name()); return false; } @@ -866,13 +866,13 @@ bool ListField::parseData(const QVariant &data, QString *errorMessage) const QVariant value = consumeValue(tmp, "items"); if (value.isNull()) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", - "%1(\"%2\") \"items\" missing.") + "%1 (\"%2\") \"items\" missing.") .arg(type(), name()); return false; } if (value.type() != QVariant::List) { *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage", - "%1(\"%2\") \"items\" is not a JSON list.") + "%1 (\"%2\") \"items\" is not a JSON list.") .arg(type(), name()); return false; } @@ -935,7 +935,7 @@ void ListField::initializeData(MacroExpander *expander) qWarning().noquote() << QString("Icon file \"%1\" not found.").arg(QDir::toNativeSeparators(iconPath)); } } else { - qWarning().noquote() << QString("%1(\"%2\") has no parentWidget JsonFieldPage to get the icon path.").arg(type(), name()); + qWarning().noquote() << QString("%1 (\"%2\") has no parentWidget JsonFieldPage to get the icon path.").arg(type(), name()); } } expandedValuesItems.append(expandedValuesItem); diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index 195fa662934..e34c4d1359a 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -93,6 +93,8 @@ QList SysRootKitInformation::validate(const Kit *k) const KitConfigWidget *SysRootKitInformation::createConfigWidget(Kit *k) const { + QTC_ASSERT(k, return nullptr); + return new Internal::SysRootInformationConfigWidget(k, this); } @@ -103,6 +105,8 @@ KitInformation::ItemList SysRootKitInformation::toUserOutput(const Kit *k) const void SysRootKitInformation::addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const { + QTC_ASSERT(kit, return); + expander->registerFileVariables("SysRoot", tr("Sys Root"), [kit]() -> QString { return SysRootKitInformation::sysRoot(kit).toString(); }); @@ -202,6 +206,8 @@ QList ToolChainKitInformation::validate(const Kit *k) const void ToolChainKitInformation::upgrade(Kit *k) { + QTC_ASSERT(k, return); + const Core::Id oldIdV1 = KITINFORMATION_ID_V1; const Core::Id oldIdV2 = KITINFORMATION_ID_V2; @@ -285,6 +291,8 @@ static Core::Id findLanguage(const QString &ls) void ToolChainKitInformation::setup(Kit *k) { QTC_ASSERT(ToolChainManager::isLoaded(), return); + QTC_ASSERT(k, return); + const QVariantMap value = k->value(ToolChainKitInformation::id()).toMap(); for (auto i = value.constBegin(); i != value.constEnd(); ++i) { @@ -312,6 +320,7 @@ void ToolChainKitInformation::setup(Kit *k) KitConfigWidget *ToolChainKitInformation::createConfigWidget(Kit *k) const { + QTC_ASSERT(k, return nullptr); return new Internal::ToolChainInformationConfigWidget(k, this); } @@ -336,6 +345,8 @@ void ToolChainKitInformation::addToEnvironment(const Kit *k, Utils::Environment void ToolChainKitInformation::addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const { + QTC_ASSERT(kit, return); + // Compatibility with Qt Creator < 4.2: expander->registerVariable("Compiler:Name", tr("Compiler"), [kit]() -> QString { @@ -365,9 +376,7 @@ void ToolChainKitInformation::addToMacroExpander(Kit *kit, Utils::MacroExpander IOutputParser *ToolChainKitInformation::createOutputParser(const Kit *k) const { ToolChain *tc = toolChain(k, Constants::CXX_LANGUAGE_ID); - if (tc) - return tc->outputParser(); - return 0; + return tc ? tc->outputParser() : nullptr; } QSet ToolChainKitInformation::availableFeatures(const Kit *k) const @@ -385,9 +394,9 @@ Core::Id ToolChainKitInformation::id() ToolChain *ToolChainKitInformation::toolChain(const Kit *k, Core::Id language) { - QTC_ASSERT(ToolChainManager::isLoaded(), return 0); + QTC_ASSERT(ToolChainManager::isLoaded(), return nullptr); if (!k) - return 0; + return nullptr; QVariantMap value = k->value(ToolChainKitInformation::id()).toMap(); const QByteArray id = value.value(language.toString(), QByteArray()).toByteArray(); return ToolChainManager::findToolChain(id); @@ -395,6 +404,8 @@ ToolChain *ToolChainKitInformation::toolChain(const Kit *k, Core::Id language) QList ToolChainKitInformation::toolChains(const Kit *k) { + QTC_ASSERT(k, return QList()); + const QVariantMap value = k->value(ToolChainKitInformation::id()).toMap(); const QList tcList = Utils::transform(ToolChainManager::allLanguages().toList(), @@ -407,6 +418,7 @@ QList ToolChainKitInformation::toolChains(const Kit *k) void ToolChainKitInformation::setToolChain(Kit *k, ToolChain *tc) { QTC_ASSERT(tc, return); + QTC_ASSERT(k, return); QVariantMap result = k->value(ToolChainKitInformation::id()).toMap(); result.insert(tc->language().toString(), tc->id()); @@ -426,6 +438,7 @@ void ToolChainKitInformation::setToolChain(Kit *k, ToolChain *tc) void ToolChainKitInformation::setAllToolChainsToMatch(Kit *k, ToolChain *tc) { QTC_ASSERT(tc, return); + QTC_ASSERT(k, return); const QList allTcList = ToolChainManager::toolChains(); QTC_ASSERT(allTcList.contains(tc), return); @@ -464,6 +477,7 @@ void ToolChainKitInformation::setAllToolChainsToMatch(Kit *k, ToolChain *tc) void ToolChainKitInformation::clearToolChain(Kit *k, Core::Id language) { QTC_ASSERT(language.isValid(), return); + QTC_ASSERT(k, return); QVariantMap result = k->value(ToolChainKitInformation::id()).toMap(); result.insert(language.toString(), QByteArray()); @@ -557,11 +571,13 @@ QList DeviceTypeKitInformation::validate(const Kit *k) const KitConfigWidget *DeviceTypeKitInformation::createConfigWidget(Kit *k) const { + QTC_ASSERT(k, return nullptr); return new Internal::DeviceTypeInformationConfigWidget(k, this); } KitInformation::ItemList DeviceTypeKitInformation::toUserOutput(const Kit *k) const { + QTC_ASSERT(k, return {}); Core::Id type = deviceTypeId(k); QString typeDisplayName = tr("Unknown device type"); if (type.isValid()) { @@ -588,6 +604,7 @@ const Core::Id DeviceTypeKitInformation::deviceTypeId(const Kit *k) void DeviceTypeKitInformation::setDeviceTypeId(Kit *k, Core::Id type) { + QTC_ASSERT(k, return); k->setValue(DeviceTypeKitInformation::id(), type.toSetting()); } @@ -676,6 +693,7 @@ void DeviceKitInformation::setup(Kit *k) KitConfigWidget *DeviceKitInformation::createConfigWidget(Kit *k) const { + QTC_ASSERT(k, return nullptr); return new Internal::DeviceInformationConfigWidget(k, this); } @@ -693,6 +711,7 @@ KitInformation::ItemList DeviceKitInformation::toUserOutput(const Kit *k) const void DeviceKitInformation::addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const { + QTC_ASSERT(kit, return); expander->registerVariable("Device:HostAddress", tr("Host address"), [kit]() -> QString { const IDevice::ConstPtr device = DeviceKitInformation::device(kit); @@ -743,6 +762,7 @@ void DeviceKitInformation::setDevice(Kit *k, IDevice::ConstPtr dev) void DeviceKitInformation::setDeviceId(Kit *k, Core::Id id) { + QTC_ASSERT(k, return); k->setValue(DeviceKitInformation::id(), id.toSetting()); } @@ -802,6 +822,8 @@ QVariant EnvironmentKitInformation::defaultValue(const Kit *k) const QList EnvironmentKitInformation::validate(const Kit *k) const { QList result; + QTC_ASSERT(k, return result); + const QVariant variant = k->value(EnvironmentKitInformation::id()); if (!variant.isNull() && !variant.canConvert(QVariant::List)) { result.append(Task(Task::Error, tr("The environment setting value is invalid."), @@ -812,6 +834,8 @@ QList EnvironmentKitInformation::validate(const Kit *k) const void EnvironmentKitInformation::fix(Kit *k) { + QTC_ASSERT(k, return); + const QVariant variant = k->value(EnvironmentKitInformation::id()); if (!variant.isNull() && !variant.canConvert(QVariant::List)) { qWarning("Kit \"%s\" has a wrong environment value set.", qPrintable(k->displayName())); @@ -821,28 +845,22 @@ void EnvironmentKitInformation::fix(Kit *k) void EnvironmentKitInformation::addToEnvironment(const Kit *k, Utils::Environment &env) const { - const QVariant envValue = k->value(EnvironmentKitInformation::id()); - if (envValue.isValid()) { - const QStringList values = Utils::transform(envValue.toStringList(), [k](const QString &v) { - return k->macroExpander()->expand(v); - }); - env.modify(Utils::EnvironmentItem::fromStringList(values)); - } + const QStringList values + = Utils::transform(Utils::EnvironmentItem::toStringList(environmentChanges(k)), + [k](const QString &v) { return k->macroExpander()->expand(v); }); + env.modify(Utils::EnvironmentItem::fromStringList(values)); } KitConfigWidget *EnvironmentKitInformation::createConfigWidget(Kit *k) const { + QTC_ASSERT(k, return nullptr); return new Internal::KitEnvironmentConfigWidget(k, this); } KitInformation::ItemList EnvironmentKitInformation::toUserOutput(const Kit *k) const { - ItemList retVal; - QVariant envValue = k->value(EnvironmentKitInformation::id()); - if (envValue.isValid()) - retVal << qMakePair(QLatin1Literal("Environment"), envValue.toStringList().join(QLatin1Literal("
"))); - - return retVal; + return { qMakePair(tr("Environment"), + Utils::EnvironmentItem::toStringList(environmentChanges(k)).join("
")) }; } Core::Id EnvironmentKitInformation::id() diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 999394bf5b4..7b2e024f3e6 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -124,7 +124,8 @@ private: // -------------------------------------------------------------------- QbsBuildStep::QbsBuildStep(ProjectExplorer::BuildStepList *bsl) : - ProjectExplorer::BuildStep(bsl, Constants::QBS_BUILDSTEP_ID) + ProjectExplorer::BuildStep(bsl, Constants::QBS_BUILDSTEP_ID), + m_enableQmlDebugging(QtSupport::BaseQtVersion::isQmlDebuggingSupported(target()->kit())) { setDisplayName(tr("Qbs Build")); setQbsConfiguration(QVariantMap()); @@ -204,6 +205,8 @@ QVariantMap QbsBuildStep::qbsConfiguration(VariableHandling variableHandling) co { QVariantMap config = m_qbsConfiguration; config.insert(Constants::QBS_FORCE_PROBES_KEY, m_forceProbes); + if (m_enableQmlDebugging) + config.insert(Constants::QBS_CONFIG_QUICK_DEBUG_KEY, true); if (variableHandling == ExpandVariables) { const Utils::MacroExpander *expander = Utils::globalMacroExpander(); for (auto it = config.begin(), end = config.end(); it != end; ++it) { @@ -280,6 +283,7 @@ int QbsBuildStep::maxJobs() const } static QString forceProbesKey() { return QLatin1String("Qbs.forceProbesKey"); } +static QString enableQmlDebuggingKey() { return QLatin1String("Qbs.enableQmlDebuggingKey"); } bool QbsBuildStep::fromMap(const QVariantMap &map) { @@ -297,6 +301,7 @@ bool QbsBuildStep::fromMap(const QVariantMap &map) m_qbsBuildOptions.setRemoveExistingInstallation(map.value(QBS_CLEAN_INSTALL_ROOT) .toBool()); m_forceProbes = map.value(forceProbesKey()).toBool(); + m_enableQmlDebugging = map.value(enableQmlDebuggingKey()).toBool(); return true; } @@ -313,6 +318,7 @@ QVariantMap QbsBuildStep::toMap() const map.insert(QBS_CLEAN_INSTALL_ROOT, m_qbsBuildOptions.removeExistingInstallation()); map.insert(forceProbesKey(), m_forceProbes); + map.insert(enableQmlDebuggingKey(), m_enableQmlDebugging); return map; } @@ -412,13 +418,6 @@ QString QbsBuildStep::buildVariant() const return qbsConfiguration(PreserveVariables).value(Constants::QBS_CONFIG_VARIANT_KEY).toString(); } -bool QbsBuildStep::isQmlDebuggingEnabled() const -{ - QVariantMap data = qbsConfiguration(PreserveVariables); - return data.value(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY, false).toBool() - || data.value(Constants::QBS_CONFIG_QUICK_DEBUG_KEY, false).toBool(); -} - void QbsBuildStep::setBuildVariant(const QString &variant) { if (m_qbsConfiguration.value(Constants::QBS_CONFIG_VARIANT_KEY).toString() == variant) @@ -564,7 +563,7 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) : QString *errorMessage) { return validateProperties(edit, errorMessage); }); - m_ui->qmlDebuggingWarningText->setPixmap(Utils::Icons::WARNING.pixmap()); + m_ui->qmlDebuggingWarningIcon->setPixmap(Utils::Icons::WARNING.pixmap()); connect(m_ui->buildVariantComboBox, static_cast(&QComboBox::currentIndexChanged), @@ -635,7 +634,7 @@ void QbsBuildStepConfigWidget::updateState() } if (m_step->isQmlDebuggingEnabled()) - command += " Qt.declarative.qmlDebugging:true Qt.quick.qmlDebugging:true"; + command.append(Constants::QBS_CONFIG_QUICK_DEBUG_KEY).append(":true"); m_ui->commandLineTextEdit->setPlainText(command); QString summary = tr("Qbs: %1").arg(command); @@ -667,7 +666,7 @@ void QbsBuildStepConfigWidget::updatePropertyEdit(const QVariantMap &data) // remove data that is edited with special UIs: editable.remove(Constants::QBS_CONFIG_PROFILE_KEY); editable.remove(Constants::QBS_CONFIG_VARIANT_KEY); - editable.remove(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY); + editable.remove(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY); // For existing .user files editable.remove(Constants::QBS_CONFIG_QUICK_DEBUG_KEY); editable.remove(Constants::QBS_FORCE_PROBES_KEY); editable.remove(Constants::QBS_INSTALL_ROOT_KEY); @@ -788,17 +787,8 @@ void QbsBuildStepConfigWidget::applyCachedProperties() void QbsBuildStepConfigWidget::linkQmlDebuggingLibraryChecked(bool checked) { - QVariantMap data = m_step->qbsConfiguration(QbsBuildStep::PreserveVariables); - if (checked) { - data.insert(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY, checked); - data.insert(Constants::QBS_CONFIG_QUICK_DEBUG_KEY, checked); - } else { - data.remove(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY); - data.remove(Constants::QBS_CONFIG_QUICK_DEBUG_KEY); - } - m_ignoreChange = true; - m_step->setQbsConfiguration(data); + m_step->setQmlDebuggingEnabled(checked); m_ignoreChange = false; } diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h index 652267361a0..f1041526271 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.h +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h @@ -44,6 +44,10 @@ class QbsBuildStep : public ProjectExplorer::BuildStep { Q_OBJECT + // used in DebuggerRunConfigurationAspect + Q_PROPERTY(bool linkQmlDebuggingLibrary READ isQmlDebuggingEnabled + WRITE setQmlDebuggingEnabled NOTIFY qbsConfigurationChanged) + public: enum VariableHandling { @@ -78,7 +82,11 @@ public: void setForceProbes(bool force) { m_forceProbes = force; emit qbsConfigurationChanged(); } bool forceProbes() const { return m_forceProbes; } - bool isQmlDebuggingEnabled() const; + void setQmlDebuggingEnabled(bool debug) { + m_enableQmlDebugging = debug; + emit qbsConfigurationChanged(); + } + bool isQmlDebuggingEnabled() const { return m_enableQmlDebugging; } signals: void qbsConfigurationChanged(); @@ -116,6 +124,7 @@ private: QVariantMap m_qbsConfiguration; qbs::BuildOptions m_qbsBuildOptions; bool m_forceProbes = false; + bool m_enableQmlDebugging; // Temporary data: QStringList m_changedFiles; diff --git a/src/plugins/qbsprojectmanager/qbskitinformation.cpp b/src/plugins/qbsprojectmanager/qbskitinformation.cpp index b949d9325d1..7cdf47d32ea 100644 --- a/src/plugins/qbsprojectmanager/qbskitinformation.cpp +++ b/src/plugins/qbsprojectmanager/qbskitinformation.cpp @@ -30,6 +30,8 @@ #include #include +#include + #include #include @@ -89,11 +91,13 @@ QString QbsKitInformation::representation(const Kit *kit) QVariantMap QbsKitInformation::properties(const Kit *kit) { + QTC_ASSERT(kit, return QVariantMap()); return kit->value(id()).toMap(); } void QbsKitInformation::setProperties(Kit *kit, const QVariantMap &properties) { + QTC_ASSERT(kit, return); kit->setValue(id(), properties); } diff --git a/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp b/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp index e82a3381943..7c84847c6bb 100644 --- a/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp +++ b/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp @@ -50,6 +50,8 @@ ProjectExplorer::FileType fileType(const qbs::ArtifactData &artifact) return ProjectExplorer::FileType::Form; if (artifact.fileTags().contains("scxml")) return ProjectExplorer::FileType::StateChart; + if (artifact.fileTags().contains("qt.qml.qml")) + return ProjectExplorer::FileType::QML; return ProjectExplorer::FileType::Unknown; } @@ -101,13 +103,13 @@ QbsProjectManager::Internal::QbsGroupNode } void setupQbsProductData(QbsProjectManager::Internal::QbsProductNode *node, - const qbs::ProductData &prd, const qbs::Project &project) + const qbs::ProductData &prd) { using namespace QbsProjectManager::Internal; node->setEnabled(prd.isEnabled()); - node->setDisplayName(QbsProject::productDisplayName(project, prd)); + node->setDisplayName(prd.fullDisplayName()); node->setAbsoluteFilePathAndLine(Utils::FileName::fromString(prd.location().filePath()).parentDir(), -1); const QString &productPath = QFileInfo(prd.location().filePath()).absolutePath(); @@ -135,12 +137,11 @@ void setupQbsProductData(QbsProjectManager::Internal::QbsProductNode *node, setupArtifacts(genFiles, prd.generatedArtifacts()); } -QbsProjectManager::Internal::QbsProductNode * -buildProductNodeTree(const qbs::Project &project, const qbs::ProductData &prd) +QbsProjectManager::Internal::QbsProductNode *buildProductNodeTree(const qbs::ProductData &prd) { auto result = new QbsProjectManager::Internal::QbsProductNode(prd); - setupQbsProductData(result, prd, project); + setupQbsProductData(result, prd); return result; } @@ -160,7 +161,7 @@ void setupProjectNode(QbsProjectManager::Internal::QbsProjectNode *node, const q } foreach (const qbs::ProductData &prd, prjData.products()) - node->addNode(buildProductNodeTree(qbsProject, prd)); + node->addNode(buildProductNodeTree(prd)); if (!prjData.name().isEmpty()) node->setDisplayName(prjData.name()); diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index 4d11f082a47..91f0161eac4 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -640,18 +640,9 @@ void QbsProject::generateErrors(const qbs::ErrorInfo &e) } -QString QbsProject::productDisplayName(const qbs::Project &project, - const qbs::ProductData &product) -{ - QString displayName = product.name(); - if (product.profile() != project.profile()) - displayName.append(QLatin1String(" [")).append(product.profile()).append(QLatin1Char(']')); - return displayName; -} - QString QbsProject::uniqueProductName(const qbs::ProductData &product) { - return product.name() + QLatin1Char('.') + product.profile(); + return product.name() + QLatin1Char('.') + product.multiplexConfigurationId(); } void QbsProject::configureAsExampleProject(const QSet &platforms) @@ -1113,7 +1104,7 @@ void QbsProject::updateApplicationTargets() foreach (const qbs::ProductData &productData, m_projectData.allProducts()) { if (!productData.isEnabled() || !productData.isRunnable()) continue; - const QString displayName = productDisplayName(m_qbsProject, productData); + const QString displayName = productData.fullDisplayName(); if (productData.targetArtifacts().isEmpty()) { // No build yet. applications.list << BuildTargetInfo(displayName, FileName(), diff --git a/src/plugins/qbsprojectmanager/qbsproject.h b/src/plugins/qbsprojectmanager/qbsproject.h index 45befb2e675..afa2473f337 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.h +++ b/src/plugins/qbsprojectmanager/qbsproject.h @@ -101,8 +101,6 @@ public: bool needsSpecialDeployment() const override; void generateErrors(const qbs::ErrorInfo &e); - static QString productDisplayName(const qbs::Project &project, - const qbs::ProductData &product); static QString uniqueProductName(const qbs::ProductData &product); void configureAsExampleProject(const QSet &platforms) final; diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h b/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h index c0d8c2d9d30..8fe5f9170e1 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h @@ -67,8 +67,8 @@ const char QBS_VARIANT_RELEASE[] = "release"; const char QBS_CONFIG_VARIANT_KEY[] = "qbs.defaultBuildVariant"; const char QBS_CONFIG_PROFILE_KEY[] = "qbs.profile"; const char QBS_INSTALL_ROOT_KEY[] = "qbs.installRoot"; -const char QBS_CONFIG_DECLARATIVE_DEBUG_KEY[] = "Qt.declarative.qmlDebugging"; -const char QBS_CONFIG_QUICK_DEBUG_KEY[] = "Qt.quick.qmlDebugging"; +const char QBS_CONFIG_DECLARATIVE_DEBUG_KEY[] = "modules.Qt.declarative.qmlDebugging"; +const char QBS_CONFIG_QUICK_DEBUG_KEY[] = "modules.Qt.quick.qmlDebugging"; const char QBS_FORCE_PROBES_KEY[] = "qbspm.forceProbes"; // Icons: diff --git a/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp index bb0334cc39a..02da061d344 100644 --- a/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp @@ -408,7 +408,7 @@ QbsRunConfigurationFactory::availableCreators(Target *parent, CreationMode mode) } return Utils::transform(products, [this, project](const qbs::ProductData &product) { - const QString displayName = QbsProject::productDisplayName(project->qbsProject(), product); + const QString displayName = product.fullDisplayName(); const QString targetName = QbsProject::uniqueProductName(product) + rcNameSeparator() + displayName; return convert(displayName, targetName); }); diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp index 79293fd914d..afa40a033e4 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp +++ b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp @@ -35,6 +35,7 @@ #include #include +#include using namespace ProjectExplorer; using namespace Utils; @@ -144,6 +145,7 @@ FileName QmakeKitInformation::effectiveMkspec(const Kit *k) void QmakeKitInformation::setMkspec(Kit *k, const FileName &fn) { + QTC_ASSERT(k, return); k->setValue(QmakeKitInformation::id(), fn == defaultMkspec(k) ? QString() : fn.toString()); } diff --git a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.h b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.h index b4531db8959..45c3abc08cd 100644 --- a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.h +++ b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.h @@ -49,16 +49,19 @@ struct AddResourceHandler public: AddResourceHandler( const QString &_category, const QString &_filter, - AddResourceOperation _operation) + AddResourceOperation _operation, + int _priority = 0) : category(_category) ,filter(_filter) ,operation(_operation) + ,piority(_priority) { } QString category; QString filter; AddResourceOperation operation; + int piority; }; class DesignerActionToolBar : public Utils::StyledBar diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp index 6751ebf6e38..a8ce98471a7 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -395,14 +396,26 @@ void ItemLibraryWidget::addResources() QTC_ASSERT(document, return); QList handlers = QmlDesignerPlugin::instance()->viewManager().designerActionManager().addResourceHandler(); + QMultiMap map; for (const AddResourceHandler &handler : handlers) { map.insert(handler.category, handler.filter); } + QMap priorities; + for (const AddResourceHandler &handler : handlers) { + priorities.insert(handler.category, handler.piority); + } + + QStringList sortedKeys = map.uniqueKeys(); + Utils::sort(sortedKeys, [&priorities](const QString &first, + const QString &second){ + return priorities.value(first) < priorities.value(second); + }); + QStringList filters; - for (const QString &key : map.uniqueKeys()) { + for (const QString &key : sortedKeys) { QString str = key + " ("; str.append(map.values(key).join(" ")); str.append(")"); diff --git a/src/plugins/qtsupport/qtkitinformation.cpp b/src/plugins/qtsupport/qtkitinformation.cpp index 3437ed7116e..1653b48a16d 100644 --- a/src/plugins/qtsupport/qtkitinformation.cpp +++ b/src/plugins/qtsupport/qtkitinformation.cpp @@ -93,6 +93,7 @@ void QtKitInformation::fix(ProjectExplorer::Kit *k) ProjectExplorer::KitConfigWidget *QtKitInformation::createConfigWidget(ProjectExplorer::Kit *k) const { + QTC_ASSERT(k, return nullptr); return new Internal::QtKitConfigWidget(k, this); } @@ -120,15 +121,16 @@ ProjectExplorer::IOutputParser *QtKitInformation::createOutputParser(const Proje { if (qtVersion(k)) return new QtParser; - return 0; + return nullptr; } void QtKitInformation::addToMacroExpander(Kit *kit, MacroExpander *expander) const { + QTC_ASSERT(kit, return); expander->registerSubProvider( [kit]() -> MacroExpander * { BaseQtVersion *version = qtVersion(kit); - return version ? version->macroExpander() : 0; + return version ? version->macroExpander() : nullptr; }); expander->registerVariable("Qt:Name", tr("Name of Qt Version"), @@ -171,6 +173,7 @@ int QtKitInformation::qtVersionId(const ProjectExplorer::Kit *k) void QtKitInformation::setQtVersionId(ProjectExplorer::Kit *k, const int id) { + QTC_ASSERT(k, return); k->setValue(QtKitInformation::id(), id); } diff --git a/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp b/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp index a8701fdd323..0b26d4809e0 100644 --- a/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp +++ b/src/plugins/texteditor/codeassist/keywordscompletionassist.cpp @@ -212,7 +212,7 @@ IAssistProposal *KeywordsCompletionAssistProcessor::perform(const AssistInterfac } else { QList items = m_snippetCollector.collect(); items.append(generateProposalList(m_keywords.variables(), m_variableIcon)); - items.append(generateProposalList(m_keywords.variables(), m_variableIcon)); + items.append(generateProposalList(m_keywords.functions(), m_functionIcon)); return new GenericProposal(startPosition, items); } } diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 23a72bfa492..9443d3e89fd 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -364,7 +364,7 @@ CallgrindTool::CallgrindTool() // load external log file action = m_loadExternalLogFile = new QAction(this); - action->setIcon(Utils::Icons::OPENFILE.icon()); + action->setIcon(Utils::Icons::OPENFILE_TOOLBAR.icon()); action->setToolTip(tr("Load External Log File")); connect(action, &QAction::triggered, this, &CallgrindTool::loadExternalLogFile); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 3b6b372fe24..6ea73472881 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include @@ -482,6 +483,8 @@ public: bool attach() const; QString path() const; + void keyPressEvent(QKeyEvent *e); + private: void updateEnabled(); void saveOptions(); @@ -596,7 +599,7 @@ MemcheckTool::MemcheckTool() // Load external XML log file auto action = new QAction(this); - action->setIcon(Icons::OPENFILE.icon()); + action->setIcon(Icons::OPENFILE_TOOLBAR.icon()); action->setToolTip(tr("Load External XML Log File")); connect(action, &QAction::triggered, this, &MemcheckTool::loadExternalXmlLogFile); m_loadExternalLogFile = action; @@ -1379,6 +1382,15 @@ QString HeobDialog::path() const return m_pathChooser->path(); } +void HeobDialog::keyPressEvent(QKeyEvent *e) +{ + if (e->key() != Qt::Key_F1) + return QDialog::keyPressEvent(e); + + reject(); + Core::HelpManager::handleHelpRequest("qthelp://org.qt-project.qtcreator/doc/creator-heob.html"); +} + void HeobDialog::updateEnabled() { bool enableHeob = m_handleExceptionCombo->currentIndex() < 2; diff --git a/src/share/3rdparty/generic-highlighter/json.xml b/src/share/3rdparty/generic-highlighter/json.xml index a187fe8f3f5..28ad8e8a33d 100644 --- a/src/share/3rdparty/generic-highlighter/json.xml +++ b/src/share/3rdparty/generic-highlighter/json.xml @@ -12,7 +12,7 @@ ** http://tools.ietf.org/html/rfc4627 *************************************************************************** --> - + null diff --git a/src/share/3rdparty/generic-highlighter/xml.xml b/src/share/3rdparty/generic-highlighter/xml.xml index 7cff05c06b9..01658523a8a 100644 --- a/src/share/3rdparty/generic-highlighter/xml.xml +++ b/src/share/3rdparty/generic-highlighter/xml.xml @@ -6,7 +6,7 @@ ]> - + diff --git a/src/shared/qbs b/src/shared/qbs index 8e396382646..7a17be47f5e 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 8e396382646a9e1a3efb57bc77e303f90b7c80c0 +Subproject commit 7a17be47f5e93f46e118950d5410e73bc6476abd diff --git a/src/tools/valgrindfake/valgrindfake.qbs b/src/tools/valgrindfake/valgrindfake.qbs index 7348b1d8aff..6bd0b45e8e5 100644 --- a/src/tools/valgrindfake/valgrindfake.qbs +++ b/src/tools/valgrindfake/valgrindfake.qbs @@ -1,18 +1,12 @@ import qbs import qbs.Utilities -CppApplication { +QtcTool { name: "valgrind-fake" consoleApplication: true destinationDirectory: qtc.ide_bin_path + install: false Depends { name: "Qt"; submodules: ["network", "xml"]; } - Depends { name: "qtc" } - cpp.cxxLanguageVersion: "c++11" - - Properties { - condition: Utilities.versionCompare(Qt.core.version, "5.7") < 0 - cpp.minimumMacosVersion: project.minimumMacosVersion - } files: [ "main.cpp", diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp index 25fd1008d3d..25eca2c3ce8 100644 --- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp +++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp @@ -1266,7 +1266,7 @@ void tst_TestCore::testBasicStates() Exception::setShouldAssert(true); QPlainTextEdit textEdit; - textEdit.setPlainText(qmlString); + textEdit.setPlainText(QLatin1String(qmlString)); NotIndentingTextEditModifier textModifier(&textEdit); QScopedPointer model(Model::create("QtQuick.Item")); @@ -1372,7 +1372,7 @@ void tst_TestCore::testBasicStatesQtQuick20() Exception::setShouldAssert(true); QPlainTextEdit textEdit; - textEdit.setPlainText(qmlString); + textEdit.setPlainText(QLatin1String(qmlString)); NotIndentingTextEditModifier textModifier(&textEdit); QScopedPointer model(Model::create("QtQuick.Item")); @@ -2530,7 +2530,7 @@ void tst_TestCore::testRewriterId() "}\n"; QPlainTextEdit textEdit; - textEdit.setPlainText(qmlString); + textEdit.setPlainText(QLatin1String(qmlString)); NotIndentingTextEditModifier textModifier(&textEdit); QScopedPointer model(Model::create("QtQuick.Item")); @@ -2574,7 +2574,7 @@ void tst_TestCore::testRewriterNodeReparentingTransaction1() "}\n"; QPlainTextEdit textEdit; - textEdit.setPlainText(qmlString); + textEdit.setPlainText(QLatin1String(qmlString)); NotIndentingTextEditModifier textModifier(&textEdit); QScopedPointer model(Model::create("QtQuick.Item", 2, 0)); @@ -2619,7 +2619,7 @@ void tst_TestCore::testRewriterNodeReparentingTransaction2() "}\n"; QPlainTextEdit textEdit; - textEdit.setPlainText(qmlString); + textEdit.setPlainText(QLatin1String(qmlString)); NotIndentingTextEditModifier textModifier(&textEdit); QScopedPointer model(Model::create("QtQuick.Item", 2, 0)); @@ -2685,7 +2685,7 @@ void tst_TestCore::testRewriterNodeReparentingTransaction3() "}\n"; QPlainTextEdit textEdit; - textEdit.setPlainText(qmlString); + textEdit.setPlainText(QLatin1String(qmlString)); NotIndentingTextEditModifier textModifier(&textEdit); QScopedPointer model(Model::create("QtQuick.Item", 2, 0)); @@ -2735,7 +2735,7 @@ void tst_TestCore::testRewriterNodeReparentingTransaction4() "}\n"; QPlainTextEdit textEdit; - textEdit.setPlainText(qmlString); + textEdit.setPlainText(QLatin1String(qmlString)); NotIndentingTextEditModifier textModifier(&textEdit); QScopedPointer model(Model::create("QtQuick.Item",2,0)); @@ -2786,7 +2786,7 @@ void tst_TestCore::testRewriterAddNodeTransaction() "}\n"; QPlainTextEdit textEdit; - textEdit.setPlainText(qmlString); + textEdit.setPlainText(QLatin1String(qmlString)); NotIndentingTextEditModifier textModifier(&textEdit); QScopedPointer model(Model::create("QtQuick.Item", 2, 0)); @@ -2833,7 +2833,7 @@ void tst_TestCore::testRewriterComponentId() "}\n"; QPlainTextEdit textEdit; - textEdit.setPlainText(qmlString); + textEdit.setPlainText(QLatin1String(qmlString)); NotIndentingTextEditModifier textModifier(&textEdit); QScopedPointer model(Model::create("QtQuick.Item", 2, 0)); @@ -2864,7 +2864,7 @@ void tst_TestCore::testRewriterTransactionRewriter() "}\n"; QPlainTextEdit textEdit; - textEdit.setPlainText(qmlString); + textEdit.setPlainText(QLatin1String(qmlString)); NotIndentingTextEditModifier textModifier(&textEdit); QScopedPointer model(Model::create("QtQuick.Item", 2, 0)); @@ -2936,7 +2936,7 @@ void tst_TestCore::testRewriterPropertyDeclarations() "}\n"; QPlainTextEdit textEdit; - textEdit.setPlainText(qmlString); + textEdit.setPlainText(QLatin1String(qmlString)); NotIndentingTextEditModifier textModifier(&textEdit); QScopedPointer model(Model::create("QtQuick.Item")); @@ -2998,7 +2998,7 @@ void tst_TestCore::testRewriterPropertyAliases() "}\n"; QPlainTextEdit textEdit; - textEdit.setPlainText(qmlString); + textEdit.setPlainText(QLatin1String(qmlString)); NotIndentingTextEditModifier textModifier(&textEdit); QScopedPointer model(Model::create("QtQuick.Item")); @@ -3981,7 +3981,7 @@ char qmlString[] = "import QtQuick 2.1\n" "}\n"; QPlainTextEdit textEdit; - textEdit.setPlainText(qmlString); + textEdit.setPlainText(QLatin1String(qmlString)); NotIndentingTextEditModifier textModifier(&textEdit); QScopedPointer model(Model::create("QtQuick.Item")); @@ -4237,7 +4237,7 @@ void tst_TestCore::testMetaInfoQtQuick1Vs2() "}\n"; QPlainTextEdit textEdit; - textEdit.setPlainText(qmlString); + textEdit.setPlainText(QLatin1String(qmlString)); NotIndentingTextEditModifier textModifier(&textEdit); QScopedPointer model(Model::create("QtQuick.Item"));