diff options
author | Eike Ziller <eike.ziller@qt.io> | 2021-05-19 09:54:07 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2021-05-19 09:54:07 +0200 |
commit | f83be6debe8fcf4a635fae0e755776fd12f85dae (patch) | |
tree | fbf56dfee3c9142c0d1f3c7ad0718a8697d2d1b6 | |
parent | c49a0af5046157039da2194723e0fc4dd48956f5 (diff) | |
parent | 801dbdf9324a67462eb6756f4ea49b31ae2074bb (diff) | |
download | qt-creator-f83be6debe8fcf4a635fae0e755776fd12f85dae.tar.gz |
Merge remote-tracking branch 'origin/4.15'
Change-Id: Ia6558fc2423fd9cd84ca2282bfa60d102dff682e
21 files changed, 164 insertions, 35 deletions
diff --git a/coin/instructions/make_instructions.yaml b/coin/instructions/make_instructions.yaml index 1c517ce732..bee20f2527 100644 --- a/coin/instructions/make_instructions.yaml +++ b/coin/instructions/make_instructions.yaml @@ -23,7 +23,7 @@ instructions: maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to extract LLVM package, check logs." - type: ExecuteCommand - command: "python {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --elfutils-path {{.AgentWorkingDir}}/build/qt_temp/elfutils --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --with-tests --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + command: "python -u {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --elfutils-path {{.AgentWorkingDir}}/build/qt_temp/elfutils --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" maxTimeInSeconds: 36000 maxTimeBetweenOutput: 3600 userMessageOnFailure: "Failed to run build.py, check logs." @@ -50,7 +50,7 @@ instructions: maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to extract LLVM package, check logs." - type: ExecuteCommand - command: "python {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --keychain-unlock-script /Users/qt/unlock-keychain.sh --with-tests --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + command: "python -u {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --keychain-unlock-script /Users/qt/unlock-keychain.sh --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" maxTimeInSeconds: 36000 maxTimeBetweenOutput: 3600 userMessageOnFailure: "Failed to run build.py, check logs." @@ -92,7 +92,7 @@ instructions: maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to extract LLVM package, check logs." - type: ExecuteCommand - command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --python-path {{.AgentWorkingDir}}\\build\\qt_temp\\python --elfutils-path {{.AgentWorkingDir}}\\buid\\qt_temp\\elfutils --llvm-path {{.AgentWorkingDir}}\\build\\qt_temp\\libclang --with-tests --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache --add-config=-DWITH_SCCACHE_SUPPORT=ON" + command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --python-path {{.AgentWorkingDir}}\\build\\qt_temp\\python --elfutils-path {{.AgentWorkingDir}}\\buid\\qt_temp\\elfutils --llvm-path {{.AgentWorkingDir}}\\build\\qt_temp\\libclang --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache --add-config=-DWITH_SCCACHE_SUPPORT=ON" maxTimeInSeconds: 36000 maxTimeBetweenOutput: 3600 userMessageOnFailure: "Failed to run build.py, check logs." @@ -124,7 +124,7 @@ instructions: maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to extract python package, check logs." - type: ExecuteCommand - command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --python-path {{.AgentWorkingDir}}\\buid\\qt_temp\\python --no-qtcreator" + command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --python-path {{.AgentWorkingDir}}\\buid\\qt_temp\\python --no-qtcreator --no-zip" maxTimeInSeconds: 36000 maxTimeBetweenOutput: 3600 userMessageOnFailure: "Failed to run build.py, check logs." diff --git a/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc b/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc index c91b97bd71..7695af29e0 100644 --- a/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc @@ -141,7 +141,7 @@ For example: \badcode - git clone "ssh://user@codereview.qt-project.org:29418/qt-labs/qtquickdesigner-components" + git clone "https://codereview.qt-project.org/qt-labs/qtquickdesigner-components" \endcode Then use qmake from your Qt installation to build the module and to add it @@ -166,7 +166,7 @@ For example: \badcode - git clone ssh://user@codereview.qt-project.org:29418/qt/qtquicktimeline + git clone "https://codereview.qt-project.org/qt/qtquicktimeline" \endcode Then build the module and add it to your Qt as described in the previous diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp index b6c9c4b430..921267d015 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp +++ b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp @@ -35,6 +35,24 @@ int %{CN}::rowCount(const QModelIndex &parent) const // FIXME: Implement me! } +@if %{DynamicFetch} + +bool %{CN}::hasChildren(const QModelIndex &parent) const +{ + // FIXME: Implement me! +} + +bool %{CN}::canFetchMore(const QModelIndex &parent) const +{ + // FIXME: Implement me! + return false; +} + +void %{CN}::fetchMore(const QModelIndex &parent) +{ + // FIXME: Implement me! +} +@endif QVariant %{CN}::data(const QModelIndex &index, int role) const { diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h index 87812bdb59..fe1ef78cc6 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h +++ b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.h @@ -28,6 +28,14 @@ public: // Basic functionality: int rowCount(const QModelIndex &parent = QModelIndex()) const override; +@if %{DynamicFetch} + // Fetch data dynamically: + bool hasChildren(const QModelIndex &parent = QModelIndex()) const override; + + bool canFetchMore(const QModelIndex &parent) const override; + void fetchMore(const QModelIndex &parent) override; + +@endif QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; @if %{Editable} diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp index cda910e6f7..e8c71f18bb 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp +++ b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp @@ -42,6 +42,24 @@ int %{CN}::columnCount(const QModelIndex &parent) const // FIXME: Implement me! } +@if %{DynamicFetch} + +bool %{CN}::hasChildren(const QModelIndex &parent) const +{ + // FIXME: Implement me! +} + +bool %{CN}::canFetchMore(const QModelIndex &parent) const +{ + // FIXME: Implement me! + return false; +} + +void %{CN}::fetchMore(const QModelIndex &parent) +{ + // FIXME: Implement me! +} +@endif QVariant %{CN}::data(const QModelIndex &index, int role) const { diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h index f6a0ad59c2..b629356306 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h +++ b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.h @@ -29,6 +29,14 @@ public: int rowCount(const QModelIndex &parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; +@if %{DynamicFetch} + // Fetch data dynamically: + bool hasChildren(const QModelIndex &parent = QModelIndex()) const override; + + bool canFetchMore(const QModelIndex &parent) const override; + void fetchMore(const QModelIndex &parent) override; + +@endif QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; @if %{Editable} diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/github_workflows_build_cmake.yml b/share/qtcreator/templates/wizards/qtcreatorplugin/github_workflows_build_cmake.yml index bd5571b1d0..18ba641639 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/github_workflows_build_cmake.yml +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/github_workflows_build_cmake.yml @@ -212,10 +212,18 @@ jobs: set(ENV{NINJA_STATUS} "[%f/%t %o/sec] ") + set(build_plugin_py "scripts/build_plugin.py") + foreach(dir "share/qtcreator/scripts" "Qt Creator.app/Contents/Resources/scripts" "Contents/Resources/scripts") + if(EXISTS "${{ steps.qt_creator.outputs.qtc_dir }}/${dir}/build_plugin.py") + set(build_plugin_py "${dir}/build_plugin.py") + break() + endif() + endforeach() + execute_process( COMMAND python -u - ${{ steps.qt_creator.outputs.qtc_dir }}/scripts/build_plugin.py + "${{ steps.qt_creator.outputs.qtc_dir }}/${build_plugin_py}" --name "$ENV{PLUGIN_NAME}-$ENV{QT_CREATOR_VERSION}-${{ matrix.config.artifact }}" --src . --build build diff --git a/src/libs/utils/tooltip/tips.cpp b/src/libs/utils/tooltip/tips.cpp index cab6bad63c..2a1f4f8093 100644 --- a/src/libs/utils/tooltip/tips.cpp +++ b/src/libs/utils/tooltip/tips.cpp @@ -206,7 +206,12 @@ void TextTip::configure(const QPoint &pos) // Try to find a nice width without unnecessary wrapping. setWordWrap(false); int tipWidth = sizeHint().width(); - const int screenWidth = QGuiApplication::screenAt(pos)->availableGeometry().width(); + + QScreen *screen = QGuiApplication::screenAt(pos); + if (!screen) + screen = QGuiApplication::primaryScreen(); + + const int screenWidth = screen->availableGeometry().width(); const int maxDesiredWidth = int(screenWidth * .5); if (tipWidth > maxDesiredWidth) { setWordWrap(true); diff --git a/src/plugins/coreplugin/externaltool.cpp b/src/plugins/coreplugin/externaltool.cpp index dc5a7f009e..ceaa1465e4 100644 --- a/src/plugins/coreplugin/externaltool.cpp +++ b/src/plugins/coreplugin/externaltool.cpp @@ -666,7 +666,10 @@ void ExternalToolRunner::run() const CommandLine cmd{m_resolvedExecutable, m_resolvedArguments, CommandLine::Raw}; m_process->setCommand(cmd); m_process->setEnvironment(m_resolvedEnvironment); - MessageManager::writeDisrupting(tr("Starting external tool \"%1\"").arg(cmd.toUserOutput())); + const auto write = m_tool->outputHandling() == ExternalTool::ShowInPane + ? QOverload<const QString &>::of(MessageManager::writeDisrupting) + : QOverload<const QString &>::of(MessageManager::writeSilently); + write(tr("Starting external tool \"%1\"").arg(cmd.toUserOutput())); m_process->start(); } @@ -686,7 +689,10 @@ void ExternalToolRunner::finished(int exitCode, QProcess::ExitStatus status) } if (m_tool->modifiesCurrentDocument()) DocumentManager::unexpectFileChange(m_expectedFileName); - MessageManager::writeFlashing(tr("\"%1\" finished").arg(m_resolvedExecutable.toUserOutput())); + const auto write = m_tool->outputHandling() == ExternalTool::ShowInPane + ? QOverload<const QString &>::of(MessageManager::writeFlashing) + : QOverload<const QString &>::of(MessageManager::writeSilently); + write(tr("\"%1\" finished").arg(m_resolvedExecutable.toUserOutput())); deleteLater(); } diff --git a/src/plugins/cpptools/cpptoolstestcase.cpp b/src/plugins/cpptools/cpptoolstestcase.cpp index 7c138a1416..8a714b7df7 100644 --- a/src/plugins/cpptools/cpptoolstestcase.cpp +++ b/src/plugins/cpptools/cpptoolstestcase.cpp @@ -234,8 +234,9 @@ bool TestCase::waitUntilProjectIsFullyOpened(Project *project, int timeOutInMs) return QTest::qWaitFor( [project]() { - return !SessionManager::startupBuildSystem()->isParsing() - && CppModelManager::instance()->projectInfo(project).isValid(); + return SessionManager::startupBuildSystem() + && !SessionManager::startupBuildSystem()->isParsing() + && CppModelManager::instance()->projectInfo(project).isValid(); }, timeOutInMs); } diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 48636393d9..892a8421d5 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -1470,9 +1470,9 @@ void ClangClToolChainConfigWidget::setFromClangClToolChain() const auto *clangClToolChain = static_cast<const ClangClToolChain *>(toolChain()); if (clangClToolChain->isAutoDetected()) - m_llvmDirLabel->setText(clangClToolChain->compilerCommand().toUserOutput()); + m_llvmDirLabel->setText(QDir::toNativeSeparators(clangClToolChain->clangPath())); else - m_compilerCommand->setFilePath(clangClToolChain->compilerCommand()); + m_compilerCommand->setFilePath(Utils::FilePath::fromString(clangClToolChain->clangPath())); } static const MsvcToolChain *findMsvcToolChain(unsigned char wordWidth, Abi::OSFlavor flavor) @@ -1569,7 +1569,7 @@ static QList<ToolChain *> detectClangClToolChainInPath(const QString &clangClPat res << tc; } else { auto cltc = new ClangClToolChain; - cltc->setCompilerCommand(FilePath::fromString(clangClPath)); + cltc->setClangPath(clangClPath); cltc->setDisplayName(name); cltc->setDetection(ToolChain::AutoDetection); cltc->setLanguage(language); @@ -1587,18 +1587,18 @@ static QString compilerFromPath(const QString &path) void ClangClToolChainConfigWidget::applyImpl() { - FilePath compilerCommand = m_compilerCommand->filePath(); + Utils::FilePath clangClPath = m_compilerCommand->filePath(); auto clangClToolChain = static_cast<ClangClToolChain *>(toolChain()); - clangClToolChain->setCompilerCommand(compilerCommand); + clangClToolChain->setClangPath(clangClPath.toString()); - if (compilerCommand.fileName() != "clang-cl.exe") { + if (clangClPath.fileName() != "clang-cl.exe") { clangClToolChain->resetVarsBat(); setFromClangClToolChain(); return; } const QString displayedVarsBat = m_varsBatDisplayCombo->currentText(); - QList<ToolChain *> results = detectClangClToolChainInPath(compilerCommand.toString(), + QList<ToolChain *> results = detectClangClToolChainInPath(clangClPath.toString(), {}, displayedVarsBat); @@ -1638,22 +1638,26 @@ ClangClToolChain::ClangClToolChain() { setDisplayName("clang-cl"); setTypeDisplayName(QCoreApplication::translate("ProjectExplorer::ClangToolChainFactory", "Clang")); - setCompilerCommandKey("ProjectExplorer.ClangClToolChain.LlvmDir"); } bool ClangClToolChain::isValid() const { - return MsvcToolChain::isValid() && compilerCommand().exists() - && compilerCommand().fileName() == "clang-cl.exe"; + const QFileInfo fi(clangPath()); + return MsvcToolChain::isValid() && fi.exists() && fi.fileName() == "clang-cl.exe"; } void ClangClToolChain::addToEnvironment(Utils::Environment &env) const { MsvcToolChain::addToEnvironment(env); - QDir path = compilerCommand().toFileInfo().absoluteDir(); // bin folder + QDir path = QFileInfo(m_clangPath).absoluteDir(); // bin folder env.prependOrSetPath(path.canonicalPath()); } +Utils::FilePath ClangClToolChain::compilerCommand() const +{ + return Utils::FilePath::fromString(m_clangPath); +} + QStringList ClangClToolChain::suggestedMkspecList() const { const QString mkspec = "win32-clang-" + Abi::toString(targetAbi().osFlavor()); @@ -1665,11 +1669,44 @@ QList<OutputLineParser *> ClangClToolChain::createOutputParsers() const return {new ClangClParser}; } +static inline QString llvmDirKey() +{ + return QStringLiteral("ProjectExplorer.ClangClToolChain.LlvmDir"); +} + +QVariantMap ClangClToolChain::toMap() const +{ + QVariantMap result = MsvcToolChain::toMap(); + result.insert(llvmDirKey(), m_clangPath); + return result; +} + +bool ClangClToolChain::fromMap(const QVariantMap &data) +{ + if (!MsvcToolChain::fromMap(data)) + return false; + const QString clangPath = data.value(llvmDirKey()).toString(); + if (clangPath.isEmpty()) + return false; + m_clangPath = clangPath; + + return true; +} + std::unique_ptr<ToolChainConfigWidget> ClangClToolChain::createConfigurationWidget() { return std::make_unique<ClangClToolChainConfigWidget>(this); } +bool ClangClToolChain::operator==(const ToolChain &other) const +{ + if (!MsvcToolChain::operator==(other)) + return false; + + const auto *clangClTc = static_cast<const ClangClToolChain *>(&other); + return m_clangPath == clangClTc->m_clangPath; +} + Macros ClangClToolChain::msvcPredefinedMacros(const QStringList &cxxflags, const Utils::Environment &env) const { @@ -1683,7 +1720,7 @@ Macros ClangClToolChain::msvcPredefinedMacros(const QStringList &cxxflags, QStringList arguments = cxxflags; arguments.append(gccPredefinedMacrosOptions(language())); arguments.append("-"); - cpp.runBlocking({compilerCommand(), arguments}); + cpp.runBlocking({clangPath(), arguments}); if (cpp.result() != Utils::QtcProcess::Finished || cpp.exitCode() != 0) { // Show the warning but still parse the output. QTC_CHECK(false && "clang-cl exited with non-zero code."); diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h index 7dce6712e1..c5269b1646 100644 --- a/src/plugins/projectexplorer/msvctoolchain.h +++ b/src/plugins/projectexplorer/msvctoolchain.h @@ -164,18 +164,28 @@ public: bool isValid() const override; QStringList suggestedMkspecList() const override; void addToEnvironment(Utils::Environment &env) const override; + Utils::FilePath compilerCommand() const override; // FIXME: Remove QList<Utils::OutputLineParser *> createOutputParsers() const override; + QVariantMap toMap() const override; + bool fromMap(const QVariantMap &data) override; std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override; BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner( const Utils::Environment &env) const override; const QList<MsvcToolChain *> &msvcToolchains() const; + QString clangPath() const { return m_clangPath; } + void setClangPath(const QString &path) { m_clangPath = path; } Macros msvcPredefinedMacros(const QStringList &cxxflags, const Utils::Environment &env) const override; Utils::LanguageVersion msvcLanguageVersion(const QStringList &cxxflags, const Utils::Id &language, const Macros ¯os) const override; + + bool operator==(const ToolChain &) const override; + +private: + QString m_clangPath; }; // -------------------------------------------------------------------------- diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index ff2a827dcb..98df39036a 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -279,14 +279,7 @@ void ToolChain::toolChainUpdated() void ToolChain::setDetection(ToolChain::Detection de) { - if (d->m_detection == de) - return; - if (d->m_detection == ToolChain::UninitializedDetection) { - d->m_detection = de; - } else { - d->m_detection = de; - toolChainUpdated(); - } + d->m_detection = de; } QString ToolChain::typeDisplayName() const diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index 40c9db98b2..2c2a3c68b7 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -146,7 +146,7 @@ public: Utils::Id language() const; - Utils::FilePath compilerCommand() const; + virtual Utils::FilePath compilerCommand() const; // FIXME: De-virtualize. void setCompilerCommand(const Utils::FilePath &command); virtual QList<Utils::OutputLineParser *> createOutputParsers() const = 0; diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt index 2b26ad383f..e79c69ea6c 100644 --- a/src/plugins/qmldesigner/CMakeLists.txt +++ b/src/plugins/qmldesigner/CMakeLists.txt @@ -16,6 +16,7 @@ add_qtc_plugin(QmlDesigner PLUGIN_DEPENDS Core ProjectExplorer QmlJSEditor QmakeProjectManager QmlProjectManager QtSupport TextEditor + PLUGIN_RECOMMENDS QmlPreview SOURCES designersettings.cpp designersettings.h designmodecontext.cpp designmodecontext.h diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp index a16223eb60..9cb8dd1e79 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp +++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp @@ -190,6 +190,7 @@ Core::IDocument::OpenResult ResourceFile::load() const QString alias = felt.attribute(QLatin1String("alias")); File * const file = new File(p, fileName, alias); file->compress = felt.attribute(QLatin1String("compress")); + file->compressAlgo = felt.attribute(QLatin1String("compress-algo")); file->threshold = felt.attribute(QLatin1String("threshold")); p->file_list.append(file); } @@ -226,6 +227,8 @@ QString ResourceFile::contents() const felt.setAttribute(QLatin1String("alias"), file.alias); if (!file.compress.isEmpty()) felt.setAttribute(QLatin1String("compress"), file.compress); + if (!file.compressAlgo.isEmpty()) + felt.setAttribute(QLatin1String("compress-algo"), file.compressAlgo); if (!file.threshold.isEmpty()) felt.setAttribute(QLatin1String("threshold"), file.threshold); } diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h index 0afb55290c..a48fa402f1 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h +++ b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h @@ -84,6 +84,7 @@ public: // not used, only loaded and saved QString compress; + QString compressAlgo; QString threshold; private: diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp index 7439980df3..0614fbd2c7 100644 --- a/src/plugins/texteditor/codeassist/codeassistant.cpp +++ b/src/plugins/texteditor/codeassist/codeassistant.cpp @@ -482,7 +482,7 @@ void CodeAssistantPrivate::destroyContext() cancelCurrentRequest(); } else if (m_proposalWidget) { m_editorWidget->keepAutoCompletionHighlight(false); - if (m_proposalWidget->isVisible()) + if (m_proposalWidget->proposalIsVisible()) m_proposalWidget->closeProposal(); disconnect(m_proposalWidget, &QObject::destroyed, this, &CodeAssistantPrivate::finalizeProposal); diff --git a/src/tools/clangbackend/source/tokeninfo.cpp b/src/tools/clangbackend/source/tokeninfo.cpp index c33dd008c9..e8ece9c06d 100644 --- a/src/tools/clangbackend/source/tokeninfo.cpp +++ b/src/tools/clangbackend/source/tokeninfo.cpp @@ -384,7 +384,9 @@ void TokenInfo::identifierKind(const Cursor &cursor, Recursion recursion) if (cursor.isInvalidDeclaration()) return; - if (recursion == Recursion::FirstPass && cursor.kind() != CXCursor_NotImplemented) { + if (recursion == Recursion::FirstPass + && cursor.kind() != CXCursor_NotImplemented + && cursor.kind() != CXCursor_PreprocessingDirective) { const Cursor c = realCursor(cursor); if (!clang_isInvalid(c.kind()) && c != cursor) { identifierKind(c, Recursion::FirstPass); diff --git a/tests/unit/unittest/data/highlightingmarks.cpp b/tests/unit/unittest/data/highlightingmarks.cpp index fc3f792b85..7631534d35 100644 --- a/tests/unit/unittest/data/highlightingmarks.cpp +++ b/tests/unit/unittest/data/highlightingmarks.cpp @@ -790,3 +790,7 @@ static inline constexpr vecn<T, S> operator<(vecn<T, S> a, vecn<T, S> b) } const char *cyrillic = "б"; + +struct foo { +#define blubb +}; diff --git a/tests/unit/unittest/tokenprocessor-test.cpp b/tests/unit/unittest/tokenprocessor-test.cpp index 38755dce66..6d183cfc1f 100644 --- a/tests/unit/unittest/tokenprocessor-test.cpp +++ b/tests/unit/unittest/tokenprocessor-test.cpp @@ -1813,6 +1813,12 @@ TEST_F(TokenProcessor, CyrillicString) ASSERT_THAT(infos[5], IsHighlightingMark(792u, 24u, 3u, HighlightingType::StringLiteral)); } +TEST_F(TokenProcessor, PreProcessorInStruct) +{ + const auto infos = translationUnit.tokenInfosInRange(sourceRange(793, 14)); + ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Preprocessor)); +} + Data *TokenProcessor::d; void TokenProcessor::SetUpTestCase() |