From 6e75e7f4e41d0cd130ef07e03030c74bb73c9d6e Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Fri, 30 Nov 2018 08:55:53 +0100 Subject: [PATCH 01/14] Clang: Fix failing unit test ...amends 12dce3ef7ddf5a53d90a794a4645dea13a67f2bb. Change-Id: I93ef9b4dfaf0bbe9f4be1d0f2688eb5726938c81 Reviewed-by: Ivan Donchevskii --- tests/unit/unittest/compileroptionsbuilder-test.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/unit/unittest/compileroptionsbuilder-test.cpp b/tests/unit/unittest/compileroptionsbuilder-test.cpp index 6b2d1af11e3..097efd58032 100644 --- a/tests/unit/unittest/compileroptionsbuilder-test.cpp +++ b/tests/unit/unittest/compileroptionsbuilder-test.cpp @@ -440,7 +440,9 @@ TEST_F(CompilerOptionsBuilder, BuildAllOptions) ElementsAre( "-nostdlibinc", "-c", "-m64", "-target", "x86_64-apple-darwin10", "-arch", "x86_64", "-x", "c++", "-std=c++17", "-fcxx-exceptions", - "-fexceptions", "-Dfoo=bar", "-DprojectFoo=projectBar", "-undef", + "-fexceptions", "-Dfoo=bar", "-DprojectFoo=projectBar", + "-DBOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING=(39, 1, true, \"T = \")", + "-undef", "-I", IsPartOfHeader("wrappedQtHeaders"), "-I", IsPartOfHeader(QDir::toNativeSeparators("wrappedQtHeaders/QtCore").toStdString()), "-I", QDir::toNativeSeparators("/tmp/path"), From 8920d78bb298d96674d31ab6af7d22b904f9e69e Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Fri, 30 Nov 2018 15:12:33 +0100 Subject: [PATCH 02/14] Clang: Use -fms-compatibility-version with clang-cl toolchain It's used while building so let's also do that in Clang Code Model. Change-Id: I4e5e3ccc71d14c8d44049672e37380af2592390f Reviewed-by: Nikolai Kosjar --- src/plugins/cpptools/compileroptionsbuilder.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index 085e6fe132c..9ae36b75517 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -472,13 +472,15 @@ static QByteArray msCompatibilityVersionFromDefines(const ProjectExplorer::Macro void CompilerOptionsBuilder::addMsvcCompatibilityVersion() { - if (m_projectPart.toolchainType == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID) { - const ProjectExplorer::Macros macros = m_projectPart.toolChainMacros + m_projectPart.projectMacros; + if (m_projectPart.toolchainType == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID + || m_projectPart.toolchainType == ProjectExplorer::Constants::CLANG_CL_TOOLCHAIN_TYPEID) { + const ProjectExplorer::Macros macros = m_projectPart.toolChainMacros + + m_projectPart.projectMacros; const QByteArray msvcVersion = msCompatibilityVersionFromDefines(macros); if (!msvcVersion.isEmpty()) { const QString option = QLatin1String("-fms-compatibility-version=") - + QLatin1String(msvcVersion); + + QLatin1String(msvcVersion); m_options.append(option); } } From d51ddbb8f0ca819b204bddf55658ca62d3cce9b4 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Mon, 3 Dec 2018 11:25:49 +0200 Subject: [PATCH 03/14] [Android] Fix qml debugging for Qt 5.12 Since Qt 5.12.0 we don't use qmljsdebugger extra intent param anymore and we need to pass qmljsdebugger to the application arguments. Fixes: QTBUG-72132 Change-Id: Icefb75e94027b145832c114fd90579bd10bcb898 Reviewed-by: Eike Ziller --- src/plugins/android/androidrunnerworker.cpp | 16 +++++++++++++--- src/plugins/android/androidrunnerworker.h | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 8da140ab625..a4b6772f610 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -225,6 +225,8 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa << "Before Start ADB cmds:" << m_beforeStartAdbCommands << "After finish ADB cmds:" << m_afterFinishAdbCommands; m_gdbserverPath = AndroidGdbServerKitInformation::gdbServer(target->kit()).toString(); + QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit()); + m_useAppParamsForQmlDebugger = version->qtVersion() >= QtSupport::QtVersionNumber(5, 12); } AndroidRunnerWorker::~AndroidRunnerWorker() @@ -483,10 +485,18 @@ void AndroidRunnerWorker::asyncStartHelper() } m_afterFinishAdbCommands.push_back(removeForward.join(' ')); - args << "-e" << "qml_debug" << "true" - << "-e" << "qmljsdebugger" - << QString("port:%1,block,services:%2") + const QString qmljsdebugger = QString("port:%1,block,services:%2") .arg(m_qmlServer.port()).arg(QmlDebug::qmlDebugServices(m_qmlDebugServices)); + + if (m_useAppParamsForQmlDebugger) { + if (!m_extraAppParams.isEmpty()) + m_extraAppParams.prepend(' '); + m_extraAppParams.prepend("-qmljsdebugger=" + qmljsdebugger); + } else { + args << "-e" << "qml_debug" << "true" + << "-e" << "qmljsdebugger" + << qmljsdebugger; + } } diff --git a/src/plugins/android/androidrunnerworker.h b/src/plugins/android/androidrunnerworker.h index ee5ec87287a..18639683ae5 100644 --- a/src/plugins/android/androidrunnerworker.h +++ b/src/plugins/android/androidrunnerworker.h @@ -112,6 +112,7 @@ protected: QString m_extraAppParams; Utils::Environment m_extraEnvVars; QString m_gdbserverPath; + bool m_useAppParamsForQmlDebugger = false; }; } // namespace Internal From 39510f5382b6790a2e122ca101bac05141aaeb91 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 16 Nov 2018 11:03:27 +0100 Subject: [PATCH 04/14] Squish: Fix tst_CSUP02 Squish (and therefore the test) "is typing" too fast which breaks some assumption and the (nowadays?) normal behavior of the CppEditor. Fix this by introducing a delayedType() function to be more realistic when doing this test. Also removes a workaround for QTCREATORBUG-18769 as this seems no more valid at all. Task-number: QTCREATORBUG-18679 Change-Id: Ie43554c5b198bf3dc4a26ad12c8368f43bfd21af Reviewed-by: Christian Stenger Reviewed-by: Robert Loehning --- tests/system/suite_CSUP/tst_CSUP02/test.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/system/suite_CSUP/tst_CSUP02/test.py b/tests/system/suite_CSUP/tst_CSUP02/test.py index 147f1b09350..881a7e709e3 100644 --- a/tests/system/suite_CSUP/tst_CSUP02/test.py +++ b/tests/system/suite_CSUP/tst_CSUP02/test.py @@ -25,6 +25,13 @@ source("../../shared/qtcreator.py") +import time + +def delayedType(editor, text): + for c in text: + type(editor, c) + time.sleep(0.1) + # entry of test def main(): for useClang in [False, True]: @@ -46,15 +53,10 @@ def main(): # Focus "class derived from QObject" in the list and press Tab or Enter to complete the code. editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") mouseClick(editorWidget, 5, 5, 0, Qt.LeftButton) + jumpToFirstLine(editorWidget) type(editorWidget, "") type(editorWidget, "") - type(editorWidget, "class") - if useClang and JIRA.isBugStillOpen(18769): - snooze(4) - if platform.system() == "Darwin": - type(editorWidget, "") - else: - type(editorWidget, "") + delayedType(editorWidget, "class") listView = waitForObject(":popupFrame_Proposal_QListView") shownProposals = dumpItems(listView.model()) usedProposal = "class derived from QObject" From 0ece50d788411af50bbe292a3a77716f86b6cabb Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Mon, 3 Dec 2018 11:49:25 +0100 Subject: [PATCH 05/14] Doc: Add info on Qt Effects to Qt Design Studio Manual The include file is located in the Qt Design Studio repository. Change-Id: I37ba095a056bf7f83ddd778615f1d95f7bb1db14 Reviewed-by: Thomas Hartmann --- doc/src/qtquick/qtquick-components.qdoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/src/qtquick/qtquick-components.qdoc b/doc/src/qtquick/qtquick-components.qdoc index a5cb902760f..7a83860c722 100644 --- a/doc/src/qtquick/qtquick-components.qdoc +++ b/doc/src/qtquick/qtquick-components.qdoc @@ -427,6 +427,7 @@ \endlist \if defined(qtdesignstudio) + \include qtdesignstudio-visual-effects.qdocinc qml visual effects \include qtdesignstudio-components.qdocinc creating studio components \include qtdesignstudio-components.qdocinc studio components \endif From c975f2f3eae0ce4b94c07c63ffd737a17ed4c3c3 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Mon, 3 Dec 2018 10:30:26 +0100 Subject: [PATCH 06/14] Doc: Fix link to a CMake FAQ entry that was moved Change-Id: Ia520639640e045dbcd7a9e61d42009cb911a3179 Reviewed-by: Simon Hausmann --- doc/src/cmake/creator-projects-cmake.qdoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src/cmake/creator-projects-cmake.qdoc b/doc/src/cmake/creator-projects-cmake.qdoc index 022d8a9af42..2a29cac9c1d 100644 --- a/doc/src/cmake/creator-projects-cmake.qdoc +++ b/doc/src/cmake/creator-projects-cmake.qdoc @@ -125,8 +125,9 @@ in the \c {Modules} directory of your CMake installation. \note If you provide your own libraries, you also need to provide your own - \c {FindFoo.cmake} file. For more information, see - \l{http://vtk.org/Wiki/CMake_FAQ#Writing_FindXXX.cmake_files}{CMake FAQ}. + \c {FindXXX.cmake} file. For more information, see + \l{https://gitlab.kitware.com/cmake/community/wikis/FAQ#writing-findxxxcmake-files} + {Writing FindXXX.cmake files}. Syntax completion and highlighting work once your project successfully builds and links against the external library. From 257df2e4b8ca6d3e3407e0f4d5ee1ecbde965652 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 5 Dec 2018 07:49:05 +0100 Subject: [PATCH 07/14] LSP: fix crash after last server restart attempt The client got indirectly deleted from the manager while still in the parsing output function during the last restart attempt. Fixing it by freeing the client via deleteLater. Change-Id: I2539a8b96b5568dc2ae15a6bfe4f2ab02c280f67 Fixes: QTCREATORBUG-21635 Reviewed-by: Christian Stenger --- src/plugins/languageclient/languageclientmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp index bae73aec0bf..a282282f6dc 100644 --- a/src/plugins/languageclient/languageclientmanager.cpp +++ b/src/plugins/languageclient/languageclientmanager.cpp @@ -205,10 +205,10 @@ void LanguageClientManager::reportFinished(const MessageId &id, BaseClient *byCl void LanguageClientManager::deleteClient(BaseClient *client) { QTC_ASSERT(client, return); - client->disconnect(managerInstance); + client->disconnect(); managerInstance->removeMarks(client->id()); managerInstance->m_clients.removeAll(client); - delete client; + client->deleteLater(); } void LanguageClientManager::shutdown() From dd2f8cef9daec2b4c8bf988cc9e0679c4b01a009 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 3 Dec 2018 14:21:16 +0100 Subject: [PATCH 08/14] TextEditor: Chop of multi line proposal item texts Change-Id: I57e8b02bffc06a84dbee86e220956baea5ff80a3 Reviewed-by: Nikolai Kosjar --- .../codeassist/genericproposalwidget.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/plugins/texteditor/codeassist/genericproposalwidget.cpp b/src/plugins/texteditor/codeassist/genericproposalwidget.cpp index 079b7b2db1d..7680d09dee4 100644 --- a/src/plugins/texteditor/codeassist/genericproposalwidget.cpp +++ b/src/plugins/texteditor/codeassist/genericproposalwidget.cpp @@ -89,14 +89,19 @@ QVariant ModelAdapter::data(const QModelIndex &index, int role) const if (!index.isValid() || index.row() >= m_completionModel->size()) return QVariant(); - if (role == Qt::DisplayRole) - return m_completionModel->text(index.row()); - else if (role == Qt::DecorationRole) + if (role == Qt::DisplayRole) { + const QString text = m_completionModel->text(index.row()); + const int lineBreakPos = text.indexOf('\n'); + if (lineBreakPos < 0) + return text; + return QString(text.leftRef(lineBreakPos) + QLatin1String(" (...)")); + } else if (role == Qt::DecorationRole) { return m_completionModel->icon(index.row()); - else if (role == Qt::WhatsThisRole) + } else if (role == Qt::WhatsThisRole) { return m_completionModel->detail(index.row()); - else if (role == Qt::UserRole) + } else if (role == Qt::UserRole) { return m_completionModel->proposalItem(index.row())->requiresFixIts(); + } return QVariant(); } From 87762eb8eecfa5a794b323d2725a7e3ed4091967 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Tue, 4 Dec 2018 15:09:36 +0100 Subject: [PATCH 09/14] ClangFormat: Fix the end offset for the reformat call The intention was to add 200 lines to the current position, not 200 characters. Change-Id: I5b4de24077fc354611fdeba2d6747c239a3f9d5f Reviewed-by: Nikolai Kosjar --- src/plugins/clangformat/clangformatindenter.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/clangformat/clangformatindenter.cpp b/src/plugins/clangformat/clangformatindenter.cpp index 18a79889c10..f6142930896 100644 --- a/src/plugins/clangformat/clangformatindenter.cpp +++ b/src/plugins/clangformat/clangformatindenter.cpp @@ -203,9 +203,12 @@ Replacements replacements(const Utils::FileName &fileName, extraOffset = Utils::Text::utf8NthLineOffset( block->document(), buffer, block->blockNumber() - kMaxLinesFromCurrentBlock); } - buffer = buffer.mid(extraOffset, - std::min(buffer.size(), utf8Offset + kMaxLinesFromCurrentBlock) - - extraOffset); + int endOffset = Utils::Text::utf8NthLineOffset( + block->document(), buffer, block->blockNumber() + kMaxLinesFromCurrentBlock); + if (endOffset == -1) + endOffset = buffer.size(); + + buffer = buffer.mid(extraOffset, endOffset - extraOffset); utf8Offset -= extraOffset; const int emptySpaceLength = previousEmptyLinesLength(*block); From 40d902b9ee0bfbb8fa30dc388610bd78e858f5fb Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Tue, 4 Dec 2018 10:46:42 +0100 Subject: [PATCH 10/14] ProjectExplorer: Stop caching useless macro inspection report If there is a manually added compiler in "Menu: Tools > Options > Kits > Compilers" and either (1) "Apply" is clicked after Qt Creator start (2) or an invalid compiler path is inserted and "Apply" is clicked we don't have any macros. Thus, avoid populating the macro cache for this case. This avoids triggering SOFT ASSERT: "false && "__cplusplus is not predefined, assuming latest C++ we support."" in file toolchain.cpp, line 324 Change-Id: I23d20a24385824f4fa2ca6f39a8a04dc0eb0c308 Reviewed-by: Friedemann Kleint Reviewed-by: Christian Stenger Reviewed-by: Ivan Donchevskii --- src/plugins/projectexplorer/gcctoolchain.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 10102a794f1..936e9cd3279 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1083,6 +1083,10 @@ void GccToolChainConfigWidget::applyImpl() tc->setDisplayName(displayName); // reset display name tc->setPlatformCodeGenFlags(splitString(m_platformCodeGenFlagsLineEdit->text())); tc->setPlatformLinkerFlags(splitString(m_platformLinkerFlagsLineEdit->text())); + + if (m_macros.isEmpty()) + return; + tc->m_predefinedMacrosCache ->insert(tc->platformCodeGenFlags(), ToolChain::MacroInspectionReport{m_macros, From 42b38cc957aeb6120cc94e44dfaaad562d448f1b Mon Sep 17 00:00:00 2001 From: Marco Benelli Date: Wed, 5 Dec 2018 10:42:48 +0100 Subject: [PATCH 11/14] qmljs: update qt5QtQuick2-bundle.json for Qt 5.12 Task-number: QTCREATORBUG-21610 Change-Id: I37a5ac8ab16ea0e199e199a34a73453db7583c45 Reviewed-by: Kai Koehne --- .../qt5QtQuick2-bundle.json | 66 ++++++++++++++++--- 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/share/qtcreator/qml-type-descriptions/qt5QtQuick2-bundle.json b/share/qtcreator/qml-type-descriptions/qt5QtQuick2-bundle.json index 12683dc1af2..844e1075ef1 100644 --- a/share/qtcreator/qml-type-descriptions/qt5QtQuick2-bundle.json +++ b/share/qtcreator/qml-type-descriptions/qt5QtQuick2-bundle.json @@ -8,20 +8,31 @@ "__javascriptQt5__"], "supportedImports": [ "Qt.labs.calendar 1.0", - "Qt.labs.controls 1.0", - "Qt.labs.templates 1.0", "Qt.labs.folderlistmodel 2.0", "Qt.labs.folderlistmodel 2.1", "Qt.labs.folderlistmodel 2.2", + "Qt.labs.folderlistmodel 2.12", "Qt.labs.settings 1.0", + "Qt.labs.settings 1.1", "Qt.labs.platform 1.0", "Qt.WebSockets 1.0", + "Qt.WebSockets 1.1", "Qt3D.Animation 2.9", + "Qt3D.Animation 2.12", "Qt3D.Core 2.0", + "Qt3D.Core 2.9", + "Qt3D.Core 2.12", "Qt3D.Extras 2.0", + "Qt3D.Extras 2.9", + "Qt3D.Extras 2.12", "Qt3D.Input 2.0", + "Qt3D.Input 2.1", + "Qt3D.Input 2.12", "Qt3D.Logic 2.0", + "Qt3D.Logic 2.12", "Qt3D.Render 2.0", + "Qt3D.Render 2.9", + "Qt3D.Render 2.12", "Qt3D.Scene2D 2.9", "QtAudioEngine 1.0", "QtBluetooth 5.0", @@ -33,7 +44,13 @@ "QtBluetooth 5.7", "QtBluetooth 5.8", "QtBluetooth 5.9", + "QtBluetooth 5.11", + "QtBluetooth 5.12", + "QtCanvas3D 1.1", + "QtCharts 2.3", "QtDataVisualization 1.0", + "QtDataVisualization 1.3", + "QtGamePad 1.12", "QtGraphicalEffects 1.0", "QtMultimedia 5.0", "QtMultimedia 5.2", @@ -44,6 +61,7 @@ "QtMultimedia 5.7", "QtMultimedia 5.8", "QtMultimedia 5.9", + "QtMultimedia 5.12", "QtNfc 5.0", "QtNfc 5.2", "QtNfc 5.3", @@ -53,6 +71,8 @@ "QtNfc 5.7", "QtNfc 5.8", "QtNfc 5.9", + "QtNfc 5.11", + "QtNfc 5.12", "QtPositioning 5.0", "QtPositioning 5.2", "QtPositioning 5.3", @@ -61,28 +81,33 @@ "QtPositioning 5.6", "QtPositioning 5.7", "QtPositioning 5.8", + "QtPositioning 5.11", + "QtPositioning 5.12", "QtLocation 5.3", "QtLocation 5.5", "QtLocation 5.6", "QtLocation 5.8", "QtLocation 5.9", + "QtLocation 5.11", + "QtLocation 5.12", "QtPurchasing 1.0", + "QtPurchasing 1.12", "QtQml 2.0", "QtQml 2.1", "QtQml 2.2", + "QtQml 2.3", + "QtQml 2.12", "QtQml.Models 2.1", "QtQml.Models 2.2", "QtQml.Models 2.3", - "QtQuick.Controls 1.0", - "QtQuick.Controls 1.1", - "QtQuick.Controls 1.2", - "QtQuick.Controls 1.3", - "QtQuick.Controls 1.4", + "QtQml.Models 2.11", + "QtQml.Models 2.12", "QtQuick.Controls 2.0", "QtQuick.Controls 2.1", "QtQuick.Controls 2.2", "QtQuick.Controls 2.3", "QtQuick.Controls 2.4", + "QtQuick.Controls 2.5", "QtQuick.Controls.Material 2.0", "QtQuick.Controls.Material 2.1", "QtQuick.Controls.Material 2.2", @@ -104,18 +129,28 @@ "QtQuick.Layouts 1.1", "QtQuick.Layouts 1.2", "QtQuick.Layouts 1.3", + "QtQuick.Layouts 1.12", "QtQuick.LocalStorage 2.0", + "QtQuick.LocalStorage 2.11", + "QtQuick.LocalStorage 2.12", "QtQuick.Particles 2.0", + "QtQuick.Particles 2.12", + "QtQuick.Shapes 1.12", "QtQuick.Templates 2.0", "QtQuick.Templates 2.1", "QtQuick.Templates 2.2", + "QtQuick.Templates 2.5", "QtQuick.Window 2.0", "QtQuick.Window 2.1", "QtQuick.Window 2.2", "QtQuick.Window 2.3", "QtQuick.Window 2.10", "QtQuick.Window 2.11", + "QtQuick.Window 2.12", "QtQuick.XmlListModel 2.0", + "QtQuick.XmlListModel 2.12", + "QtRemoteObjects 5.12", + "QtScxml 5.8", "QtSensors 5.0", "QtSensors 5.1", "QtSensors 5.2", @@ -126,6 +161,8 @@ "QtSensors 5.7", "QtSensors 5.8", "QtSensors 5.9", + "QtSensors 5.11", + "QtSensors 5.12", "QtQuick 2.0", "QtQuick 2.1", "QtQuick 2.2", @@ -138,7 +175,15 @@ "QtQuick 2.9", "QtQuick 2.10", "QtQuick 2.11", + "QtQuick 2.12", "QtTest 1.0", + "QtTest 1.2", + "QtTest 1.12", + "QtVirtualKeyboard.VirtualKeyboard 2.4", + "QtVirtualKeyboard.Settings 2.2", + "QtVirtualKeyboard.Styles 2.1", + "QtScxml 5.8", + "QtWebChannel 1.0", "QtWebEngine 1.0", "QtWebEngine 1.1", "QtWebEngine 1.2", @@ -147,7 +192,12 @@ "QtWebEngine 1.5", "QtWebEngine 1.6", "QtWebEngine 1.7", + "QtWebEngine 1.8", + "QtWebSockets 1.1", + "QtWebView 1.0", + "QtWebView 1.1", "QtWebKit 3.0", - "Enginio 1.0" + "QtWinExtras 1.0" ] + } From 6889f4df80d21b2121eef85cac2a6f58dd946106 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Tue, 4 Dec 2018 12:53:04 +0100 Subject: [PATCH 12/14] Clang: Fix tooltip for pointer to class Detect and dereference pointer to get to the correct class. Fixes: QTCREATORBUG-21523 Change-Id: I679778b2cfbbce4466294dabdee096686f53f095 Reviewed-by: Ivan Donchevskii --- .../source/clangtooltipinfocollector.cpp | 14 ++++++++++++-- tests/unit/unittest/clangtooltipinfo-test.cpp | 12 ++++++++++++ tests/unit/unittest/data/tooltipinfo.cpp | 5 +++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/tools/clangbackend/source/clangtooltipinfocollector.cpp b/src/tools/clangbackend/source/clangtooltipinfocollector.cpp index a0b8223a18e..8eb15eb89e0 100644 --- a/src/tools/clangbackend/source/clangtooltipinfocollector.cpp +++ b/src/tools/clangbackend/source/clangtooltipinfocollector.cpp @@ -425,14 +425,24 @@ ToolTipInfo ToolTipInfoCollector::qDocInfo(const Cursor &cursor) const return result; } - if (cursor.kind() == CXCursor_VarDecl || cursor.kind() == CXCursor_FieldDecl) { - result.qdocMark = typeName(cursor.type()); + if (cursor.kind() == CXCursor_VarDecl || cursor.kind() == CXCursor_ParmDecl + || cursor.kind() == CXCursor_FieldDecl) { // maybe template instantiation if (cursor.type().kind() == CXType_Unexposed && cursor.type().canonical().kind() == CXType_Record) { result.qdocIdCandidates = qDocIdCandidates(cursor.type().canonical().declaration()); + result.qdocMark = typeName(cursor.type()); result.qdocCategory = ToolTipInfo::ClassOrNamespace; return result; } + + Type type = cursor.type(); + while (type.pointeeType().isValid()) + type = type.pointeeType(); + + const Cursor typeCursor = type.declaration(); + result.qdocIdCandidates = qDocIdCandidates(typeCursor); + result.qdocCategory = qdocCategory(typeCursor); + result.qdocMark = typeName(type); } // TODO: Handle also RValueReference() diff --git a/tests/unit/unittest/clangtooltipinfo-test.cpp b/tests/unit/unittest/clangtooltipinfo-test.cpp index baca6cb623d..807618deef2 100644 --- a/tests/unit/unittest/clangtooltipinfo-test.cpp +++ b/tests/unit/unittest/clangtooltipinfo-test.cpp @@ -584,6 +584,18 @@ TEST_F(ToolTipInfo, AutoTypeBuiltin) ASSERT_THAT(actual.text, Utf8StringLiteral("int")); } +TEST_F(ToolTipInfo, PointerToPointerToClass) +{ + ::ToolTipInfo expected(Utf8StringLiteral("Nuu **")); + expected.qdocIdCandidates = {Utf8StringLiteral("Nuu")}; + expected.qdocMark = Utf8StringLiteral("Nuu"); + expected.qdocCategory = ::ToolTipInfo::ClassOrNamespace; + + const ::ToolTipInfo actual = tooltip(200, 12); + + ASSERT_THAT(actual, IsToolTip(expected)); +} + // TODO: Test for qdoc entries, too. TEST_F(ToolTipInfo, AutoTypeEnum) { diff --git a/tests/unit/unittest/data/tooltipinfo.cpp b/tests/unit/unittest/data/tooltipinfo.cpp index 266d86bc47c..bfad1fdd0f0 100644 --- a/tests/unit/unittest/data/tooltipinfo.cpp +++ b/tests/unit/unittest/data/tooltipinfo.cpp @@ -194,3 +194,8 @@ void constructor() ExplicitCon(); ExplicitCon(2); } + +Nuu **pointers(Nuu **p1) +{ + return p1; +} From b52251099d8e54145a89eac9cc625a2baeac1bdf Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Wed, 5 Dec 2018 10:26:35 +0100 Subject: [PATCH 13/14] ClangTools: Fix plugin tests for clang 7 Change-Id: I52e7a822b03a989f9a01c6e19237d195781562e2 Reviewed-by: Ivan Donchevskii Reviewed-by: Marco Bubke --- src/plugins/clangtools/clangtoolsunittests.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/clangtools/clangtoolsunittests.cpp b/src/plugins/clangtools/clangtoolsunittests.cpp index eed554633a0..7cf401aa0e6 100644 --- a/src/plugins/clangtools/clangtoolsunittests.cpp +++ b/src/plugins/clangtools/clangtoolsunittests.cpp @@ -138,6 +138,8 @@ void ClangToolsUnitTests::testProject_data() QTest::addColumn("projectFilePath"); QTest::addColumn("expectedDiagCount"); + // For the simple project, we expect the following warning: + // warning: use nullptr [modernize-use-nullptr] addTestRow("simple/simple.qbs", 1); addTestRow("simple/simple.pro", 1); @@ -147,8 +149,12 @@ void ClangToolsUnitTests::testProject_data() addTestRow("stdc++11-includes/stdc++11-includes.qbs", 0); addTestRow("stdc++11-includes/stdc++11-includes.pro", 0); - addTestRow("qt-widgets-app/qt-widgets-app.qbs", 0); - addTestRow("qt-widgets-app/qt-widgets-app.pro", 0); + // For qt-widgets-app, we expect the following warning for "a.exec()", + // "a" being the QApplication object: + // warning: static member accessed through instance + // [readability-static-accessed-through-instance] + addTestRow("qt-widgets-app/qt-widgets-app.qbs", 1); + addTestRow("qt-widgets-app/qt-widgets-app.pro", 1); addTestRow("qt-essential-includes/qt-essential-includes.qbs", 0); addTestRow("qt-essential-includes/qt-essential-includes.pro", 0); From 3e9d7d290c278b8043b7eb6d346c69c27173a506 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 30 Nov 2018 15:43:52 +0100 Subject: [PATCH 14/14] Do not use invalid Qt version for parsing QMake projects By disallowing the use of kits with invalid Qt versions. This can happen when e.g. a Qt version is registered that was deleted later. Project parsing then fails anyhow, and on Windows even an assert triggers in debug mode. Better disallow using the kit and provide information why. Fixes: QTCREATORBUG-20825 Change-Id: Id6c084c3880c90e691882396653ce7cc6a531699 Reviewed-by: Leena Miettinen Reviewed-by: Christian Stenger --- src/plugins/qmakeprojectmanager/qmakeproject.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 2ec401c1725..abaf48d88a0 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -598,6 +598,8 @@ QList QmakeProject::projectIssues(const Kit *k) const QList result = Project::projectIssues(k); if (!QtSupport::QtKitInformation::qtVersion(k)) result.append(createProjectTask(Task::TaskType::Error, tr("No Qt version set in kit."))); + else if (!QtSupport::QtKitInformation::qtVersion(k)->isValid()) + result.append(createProjectTask(Task::TaskType::Error, tr("Qt version is invalid."))); if (!ToolChainKitInformation::toolChain(k, ProjectExplorer::Constants::CXX_LANGUAGE_ID)) result.append(createProjectTask(Task::TaskType::Error, tr("No C++ compiler set in kit."))); return result;