diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 756b0befa27..4e9e8f4c61d 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -651,6 +651,10 @@ function(add_qtc_executable name) endif() endif() + if (WITH_TESTS) + set(TEST_DEFINES WITH_TESTS SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}") + endif() + add_executable("${name}" ${_arg_SOURCES}) extend_qtc_target("${name}" diff --git a/coin/instructions/make_instructions.yaml b/coin/instructions/make_instructions.yaml index 2c9337ae191..1c517ce7323 100644 --- a/coin/instructions/make_instructions.yaml +++ b/coin/instructions/make_instructions.yaml @@ -13,7 +13,7 @@ instructions: maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to extract elfutils package, check logs." - type: ExecuteCommand - command: "curl --fail -L --retry 5 --retry-delay 5 -o {{.AgentWorkingDir}}/build/qt_temp/libclang.7z {{.Env.LLVM_BASE_URL}}-linux-Rhel7.6-gcc5.3-x86_64.7z" + command: "curl --fail -L --retry 5 --retry-delay 5 -o {{.AgentWorkingDir}}/build/qt_temp/libclang.7z {{.Env.LLVM_BASE_URL}}-linux-Ubuntu18.04-gcc9.3-x86_64.7z" maxTimeInSeconds: 3600 maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to download LLVM package, check logs." @@ -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 --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + 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" 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 --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + 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" 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 --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 --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." diff --git a/doc/qtcreator/src/user-interface/creator-ui.qdoc b/doc/qtcreator/src/user-interface/creator-ui.qdoc index 8a55b16cfa7..4b2a30a93af 100644 --- a/doc/qtcreator/src/user-interface/creator-ui.qdoc +++ b/doc/qtcreator/src/user-interface/creator-ui.qdoc @@ -407,7 +407,8 @@ \endif panes, select \uicontrol View > \uicontrol {Output Panes}. \if defined(qtcreator) - To display the \uicontrol {To-Do Entries} pane, enable the Todo plugin. + To display the \uicontrol {To-Do Entries} pane, enable the \uicontrol Todo + plugin. \endif For more information about the \uicontrol {QML Debugger Console} view, see @@ -555,7 +556,7 @@ To specify settings for displaying application output, select \uicontrol Tools > \uicontrol Options > \uicontrol {Build & Run} > - \uicontrol Application Output, or click the \uicontrol {Open Settings Page} + \uicontrol {Application Output}, or click the \uicontrol {Open Settings Page} button. You can select whether to open the \uicontrol{Application Output} pane on output when running or debugging applications, to clear old output on a new run, to word-wrap output, and to limit output to the specified number of lines. @@ -575,7 +576,7 @@ To specify whether to open the \uicontrol {Compile Output} pane on output when building applications, select \uicontrol Tools > \uicontrol Options > - \uicontrol {Build & Run} > \uicontrol Compile Output, and then select the + \uicontrol {Build & Run} > \uicontrol {Compile Output}, and then select the \uicontrol {Open pane when building} check box. In the \uicontrol {Limit output to} field, you can specify the maximum amount of build output lines to display in the pane. diff --git a/doc/qtdesignstudio/config/qtdesignstudio.qdocconf b/doc/qtdesignstudio/config/qtdesignstudio.qdocconf index 5e710b4e67d..587dd583b40 100644 --- a/doc/qtdesignstudio/config/qtdesignstudio.qdocconf +++ b/doc/qtdesignstudio/config/qtdesignstudio.qdocconf @@ -90,6 +90,7 @@ depends += qtwidgets \ qtsensors \ qttestlib \ qtuitools \ + qtvirtualkeyboard \ qtxml include(../../config/macros.qdocconf) diff --git a/doc/qtdesignstudio/examples/SimpleKeyboard/SimpleKeyboard.qml b/doc/qtdesignstudio/examples/SimpleKeyboard/SimpleKeyboard.qml new file mode 100644 index 00000000000..b38438d35cb --- /dev/null +++ b/doc/qtdesignstudio/examples/SimpleKeyboard/SimpleKeyboard.qml @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Design Studio. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import SimpleKeyboard 1.0 +import QtQuick.VirtualKeyboard 2.15 +import QtQuick.Window 2.2 + +Window { + id: window + width: Constants.width + height: Constants.height + Item { + id: cornerItem + x: 0 + y: 0 + } + + property int activeFocusItemBottom : activeFocusItem == null ? 0 : Math.min(height, cornerItem.mapFromItem(activeFocusItem, 0, activeFocusItem.height).y + 50) + + Swiper { + id: view + width: window.width + height: window.height + y: !inputPanel.active ? 0 : Math.min(0, window.height - inputPanel.height - activeFocusItemBottom) + Behavior on y { + NumberAnimation { + duration: 250 + easing.type: Easing.InOutQuad + } + } + } + + Rectangle { + id: inputPanelBackground + anchors.left: parent.left + anchors.right: parent.right + anchors.top: inputPanel.top + anchors.bottom: inputPanel.bottom + color: "black" + } + + InputPanel { + id: inputPanel + x: window.width/2 - width/2 + y: window.height + width: Math.min(window.width, window.height) + + states: State { + name: "visible" + when: inputPanel.active + PropertyChanges { + target: inputPanel + y: window.height - inputPanel.height + } + } + transitions: Transition { + from: "" + to: "visible" + reversible: true + ParallelAnimation { + NumberAnimation { + properties: "y" + duration: 250 + easing.type: Easing.InOutQuad + } + } + } + } +} + diff --git a/doc/qtdesignstudio/examples/SimpleKeyboard/SimpleKeyboard.qmlproject b/doc/qtdesignstudio/examples/SimpleKeyboard/SimpleKeyboard.qmlproject new file mode 100644 index 00000000000..eeabdb75f7a --- /dev/null +++ b/doc/qtdesignstudio/examples/SimpleKeyboard/SimpleKeyboard.qmlproject @@ -0,0 +1,45 @@ +import QmlProject 1.1 + +Project { + mainFile: "SimpleKeyboard.qml" + + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + + JavaScriptFiles { + directory: "." + } + + ImageFiles { + directory: "." + } + + Files { + filter: "*.conf" + files: ["qtquickcontrols2.conf"] + } + + Files { + filter: "qmldir" + directory: "." + } + + Files { + filter: "*.ttf;*.otf" + } + + Environment { + QT_QUICK_CONTROLS_CONF: "qtquickcontrols2.conf" + QT_AUTO_SCREEN_SCALE_FACTOR: "1" + QT_IM_MODULE: "qtvirtualkeyboard" + QT_VIRTUALKEYBOARD_DESKTOP_DISABLE: 1 + } + + /* List of plugin directories passed to QML runtime */ + importPaths: [ "imports", "asset_imports" ] + + /* Required for deployment */ + targetDirectory: "/opt/SimpleKeyboard" +} diff --git a/doc/qtdesignstudio/examples/doc/images/simplekeyboard-component.png b/doc/qtdesignstudio/examples/doc/images/simplekeyboard-component.png new file mode 100644 index 00000000000..68122584532 Binary files /dev/null and b/doc/qtdesignstudio/examples/doc/images/simplekeyboard-component.png differ diff --git a/doc/qtdesignstudio/examples/doc/images/simplekeyboard-project-details.png b/doc/qtdesignstudio/examples/doc/images/simplekeyboard-project-details.png new file mode 100644 index 00000000000..9a797d1fefb Binary files /dev/null and b/doc/qtdesignstudio/examples/doc/images/simplekeyboard-project-details.png differ diff --git a/doc/qtdesignstudio/examples/doc/images/simplekeyboard.png b/doc/qtdesignstudio/examples/doc/images/simplekeyboard.png new file mode 100644 index 00000000000..1faf1dad9ab Binary files /dev/null and b/doc/qtdesignstudio/examples/doc/images/simplekeyboard.png differ diff --git a/doc/qtdesignstudio/examples/doc/simplekeyboard.qdoc b/doc/qtdesignstudio/examples/doc/simplekeyboard.qdoc new file mode 100644 index 00000000000..ab63deab976 --- /dev/null +++ b/doc/qtdesignstudio/examples/doc/simplekeyboard.qdoc @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Design Studio documentation. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** +****************************************************************************/ + +/*! + \example SimpleKeyboard + \ingroup studioexamples + \brief Illustrates how to use a virtual keyboard in an application. + + \title Simple Keyboard + + \e {Simple Keyboard} provides a virtual keyboard for entering + text into several text fields. It uses functionality from the + \l{Qt Virtual Keyboard} module. + + \image simplekeyboard.png "Virtual keyboard opening from a text input field" + + The virtual keyboard is automatically displayed when users start entering + text into \l{Text Edit} or \l{Text Input} components. For more information + about using it, see \l{User Guide}{Virtual Keyboard: User Guide}. + + To test the virtual keyboard, you need to select the \inlineimage run_small.png + (\uicontrol Run) button to run the example on the desktop or a device. + The keyboard is not available during preview. + + \section1 Using a Virtual Keyboard + + First, we create an empty project, as described in \l {Creating Projects}. + For the purposes of this example, we call the project \e SimpleKeyboard. + We can use the default settings for other options, but we need to select + the \uicontrol {Use Qt Virtual Keyboard} check box on the + \uicontrol {Define Project Details} page. + + \image simplekeyboard-project-details.png "SimpleKeyboard project details" + + The project wizard template adds the Qt Quick Virtual Keyboard module + to the project and creates a component based on \l InputPanel in + \e SimpleKeyboard.qml. + + \image simplekeyboard-component.png "SimpleKeyboard component" + + We then create a tabbed UI that contains fields for entering text, among + other things. The virtual keyboard is automatically enabled for the text + edit and text input controls. +*/ diff --git a/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-using.qdoc b/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-using.qdoc index 4273f662fec..3fc3629a67e 100644 --- a/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-using.qdoc +++ b/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-using.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Bridge documentation. @@ -37,7 +37,7 @@ with Photoshop: \list - \li Arrange your art into artboards and organize it into groups and + \li Arrange your art into \e artboards and organize it into groups and layers that are imported into \QDS as separate files, depending on the choices you make when exporting designs. \li Use the Type tool to make sure that all of your text labels @@ -50,6 +50,10 @@ them to \QDS. \QDS deploys them to devices when you preview the UI. For more information, see \l{Using Custom Fonts}. + \note You can export only files that are saved in the Photoshop file format, + such as \e {.psd} and \e {.psb}. For all other document formats, \QDS + displays the following error message: \e {Document is not supported.} + \section2 Using Artboards The relationships between the groups and layers on an artboard are preserved diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index 064d1fed1b1..1f3a662d3ec 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -706,8 +706,8 @@ void Qt5InformationNodeInstanceServer::renderModelNodeImageView() void Qt5InformationNodeInstanceServer::doRenderModelNodeImageView() { - // Disable preview in Qt6 until QTBUG-QTBUG-88320 is fixed -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + // This crashes on Qt 6.0.x due to QtQuick3D issue, so the preview generation is disabled +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) || QT_VERSION >= QT_VERSION_CHECK(6, 1, 0) ServerNodeInstance instance; if (m_modelNodePreviewImageCommand.renderItemId() >= 0) instance = instanceForId(m_modelNodePreviewImageCommand.renderItemId()); diff --git a/src/app/main.cpp b/src/app/main.cpp index 74f245d2c16..bc5e61c7840 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -537,9 +537,11 @@ int main(int argc, char **argv) } } -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) if (!qEnvironmentVariableIsSet("QT_OPENGL")) QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); +#else + qputenv("QT_QUICK_BACKEND", "opengl"); #endif if (qEnvironmentVariableIsSet("QTCREATOR_DISABLE_NATIVE_MENUBAR") diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index dac933afc37..b6cf45b9931 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -537,7 +537,9 @@ void CMakeBuildStep::recreateBuildTargetsModel() // Remove the targets that do not exist in the build system // This can result when selected targets get renamed if (!targetList.empty()) { - Utils::erase(m_buildTargets, [targetList](const QString &bt) { return !targetList.contains(bt); }); + Utils::erase(m_buildTargets, [targetList](const QString &bt) { + return !bt.isEmpty() /* "current executable" */ && !targetList.contains(bt); + }); if (m_buildTargets.empty()) m_buildTargets.push_back(m_allTarget); } diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index 4e31bad6b36..d83169402c6 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -166,35 +166,36 @@ static FilePath qmakeFromCMakeCache(const CMakeConfig &config) if (!cmakeListTxt.open(QIODevice::WriteOnly)) { return FilePath(); } - cmakeListTxt.write(QByteArray(R"( - cmake_minimum_required(VERSION 3.15) - - project(qmake-probe LANGUAGES NONE) - - # Bypass Qt6's usage of find_dependency, which would require compiler - # and source code probing, which slows things unnecessarily - file(WRITE "${CMAKE_SOURCE_DIR}/CMakeFindDependencyMacro.cmake" - [=[ - macro(find_dependency dep) - endmacro() - ]=]) - set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}") - - find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED) - find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) - - if (CMAKE_CROSSCOMPILING) - find_program(qmake_binary - NAMES qmake qmake.bat - PATHS "${Qt${QT_VERSION_MAJOR}_DIR}/../../../bin" - NO_DEFAULT_PATH) - file(WRITE "${CMAKE_SOURCE_DIR}/qmake-location.txt" "${qmake_binary}") - else() - file(GENERATE - OUTPUT "${CMAKE_SOURCE_DIR}/qmake-location.txt" - CONTENT "$") - endif() - )")); + // FIXME replace by raw string when gcc 8+ is minimum + cmakeListTxt.write(QByteArray( +"cmake_minimum_required(VERSION 3.15)\n" +"\n" +"project(qmake-probe LANGUAGES NONE)\n" +"\n" +"# Bypass Qt6's usage of find_dependency, which would require compiler\n" +"# and source code probing, which slows things unnecessarily" +"file(WRITE \"${CMAKE_SOURCE_DIR}/CMakeFindDependencyMacro.cmake\"\n" +"[=[" +" macro(find_dependency dep)\n" +" endmacro()\n" +"]=])\n" +"set(CMAKE_MODULE_PATH \"${CMAKE_SOURCE_DIR}\")\n" +"\n" +"find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)\n" +"find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)\n" +"\n" +"if (CMAKE_CROSSCOMPILING)\n" +" find_program(qmake_binary\n" +" NAMES qmake qmake.bat\n" +" PATHS \"${Qt${QT_VERSION_MAJOR}_DIR}/../../../bin\"\n" +" NO_DEFAULT_PATH)\n" +" file(WRITE \"${CMAKE_SOURCE_DIR}/qmake-location.txt\" \"${qmake_binary}\")\n" +"else()\n" +" file(GENERATE\n" +" OUTPUT \"${CMAKE_SOURCE_DIR}/qmake-location.txt\"\n" +" CONTENT \"$\")\n" +"endif()\n" +)); cmakeListTxt.close(); SynchronousProcess cmake; diff --git a/src/plugins/coreplugin/editormanager/documentmodel.cpp b/src/plugins/coreplugin/editormanager/documentmodel.cpp index ad3e5aca832..5c7b624d30e 100644 --- a/src/plugins/coreplugin/editormanager/documentmodel.cpp +++ b/src/plugins/coreplugin/editormanager/documentmodel.cpp @@ -336,7 +336,7 @@ QVariant DocumentModelPrivate::data(const QModelIndex &index, int role) const return lockedIcon(); if (entry->pinned) return pinnedIcon(); - return QIcon(); + return QVariant(); case Qt::ToolTipRole: return entry->fileName().isEmpty() ? entry->displayName() : entry->fileName().toUserOutput(); default: diff --git a/src/plugins/coreplugin/opendocumentstreeview.cpp b/src/plugins/coreplugin/opendocumentstreeview.cpp index c6994c221b4..2b91f2033f0 100644 --- a/src/plugins/coreplugin/opendocumentstreeview.cpp +++ b/src/plugins/coreplugin/opendocumentstreeview.cpp @@ -102,7 +102,7 @@ OpenDocumentsTreeView::OpenDocumentsTreeView(QWidget *parent) : { m_delegate = new Internal::OpenDocumentsDelegate(this); setItemDelegate(m_delegate); - setIndentation(0); + setRootIsDecorated(false); setUniformRowHeights(true); setTextElideMode(Qt::ElideMiddle); setFrameStyle(QFrame::NoFrame); diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index ff3130877f2..79c035cd72a 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -318,7 +318,8 @@ IEditor *GitGrep::openEditor(const SearchResultItem &item, const QString topLevel = parameters.additionalParameters.toString(); IEditor *editor = m_client->openShowEditor( topLevel, params.ref, path, GitClient::ShowEditor::OnlyIfDifferent); - editor->gotoLine(item.mainRange().begin.line, item.mainRange().begin.column); + if (editor) + editor->gotoLine(item.mainRange().begin.line, item.mainRange().begin.column); return editor; } diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index 2c20e332347..7ee074bcf26 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -63,6 +63,8 @@ using namespace Utils; namespace ProjectExplorer { +const char KITINFORMATION_ID_V1[] = "PE.Profile.ToolChain"; +const char KITINFORMATION_ID_V2[] = "PE.Profile.ToolChains"; const char KITINFORMATION_ID_V3[] = "PE.Profile.ToolChainsV3"; // -------------------------------------------------------------------------- @@ -392,6 +394,65 @@ Tasks ToolChainKitAspect::validate(const Kit *k) const void ToolChainKitAspect::upgrade(Kit *k) { QTC_ASSERT(k, return); + + const Utils::Id oldIdV1 = KITINFORMATION_ID_V1; + const Utils::Id oldIdV2 = KITINFORMATION_ID_V2; + + // upgrade <=4.1 to 4.2 (keep old settings around for now) + { + const QVariant oldValue = k->value(oldIdV1); + const QVariant value = k->value(oldIdV2); + if (value.isNull() && !oldValue.isNull()) { + QVariantMap newValue; + if (oldValue.type() == QVariant::Map) { + // Used between 4.1 and 4.2: + newValue = oldValue.toMap(); + } else { + // Used up to 4.1: + newValue.insert(Deprecated::Toolchain::languageId(Deprecated::Toolchain::Cxx), oldValue.toString()); + + const Utils::Id typeId = DeviceTypeKitAspect::deviceTypeId(k); + if (typeId == Constants::DESKTOP_DEVICE_TYPE) { + // insert default C compiler which did not exist before + newValue.insert(Deprecated::Toolchain::languageId(Deprecated::Toolchain::C), + defaultToolChainIds().value(Utils::Id(Constants::C_LANGUAGE_ID))); + } + } + k->setValue(oldIdV2, newValue); + k->setSticky(oldIdV2, k->isSticky(oldIdV1)); + } + } + + // upgrade 4.2 to 4.3 (keep old settings around for now) + { + const QVariant oldValue = k->value(oldIdV2); + const QVariant value = k->value(ToolChainKitAspect::id()); + if (value.isNull() && !oldValue.isNull()) { + QVariantMap newValue = oldValue.toMap(); + QVariantMap::iterator it = newValue.find(Deprecated::Toolchain::languageId(Deprecated::Toolchain::C)); + if (it != newValue.end()) + newValue.insert(Utils::Id(Constants::C_LANGUAGE_ID).toString(), it.value()); + it = newValue.find(Deprecated::Toolchain::languageId(Deprecated::Toolchain::Cxx)); + if (it != newValue.end()) + newValue.insert(Utils::Id(Constants::CXX_LANGUAGE_ID).toString(), it.value()); + k->setValue(ToolChainKitAspect::id(), newValue); + k->setSticky(ToolChainKitAspect::id(), k->isSticky(oldIdV2)); + } + } + + // upgrade 4.3-temporary-master-state to 4.3: + { + const QVariantMap valueMap = k->value(ToolChainKitAspect::id()).toMap(); + QVariantMap result; + for (const QString &key : valueMap.keys()) { + const int pos = key.lastIndexOf('.'); + if (pos >= 0) + result.insert(key.mid(pos + 1), valueMap.value(key)); + else + result.insert(key, valueMap.value(key)); + } + k->setValue(ToolChainKitAspect::id(), result); + } } void ToolChainKitAspect::fix(Kit *k) diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index 4aad5c4bfd0..0b928b4e664 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -620,6 +620,7 @@ public: void setPanel(QWidget *panel) { + q->savePersistentSettings(); if (QWidget *widget = q->centralWidget()) { q->takeCentralWidget(); widget->hide(); // Don't delete. @@ -630,6 +631,7 @@ public: if (q->hasFocus()) // we get assigned focus from setFocusToCurrentMode, pass that on panel->setFocus(); } + q->loadPersistentSettings(); } ProjectWindow *q; @@ -670,9 +672,7 @@ void ProjectWindow::hideEvent(QHideEvent *event) void ProjectWindow::showEvent(QShowEvent *event) { FancyMainWindow::showEvent(event); - - // Delay appears to be necessary for the target setup page to have the correct layout. - QTimer::singleShot(0, this, &ProjectWindow::loadPersistentSettings); + loadPersistentSettings(); } ProjectWindow::~ProjectWindow() = default; @@ -681,6 +681,8 @@ const char PROJECT_WINDOW_KEY[] = "ProjectExplorer.ProjectWindow"; void ProjectWindow::savePersistentSettings() const { + if (!centralWidget()) + return; QSettings * const settings = ICore::settings(); settings->beginGroup(PROJECT_WINDOW_KEY); saveSettings(settings); @@ -689,6 +691,8 @@ void ProjectWindow::savePersistentSettings() const void ProjectWindow::loadPersistentSettings() { + if (!centralWidget()) + return; QSettings * const settings = ICore::settings(); settings->beginGroup(PROJECT_WINDOW_KEY); restoreSettings(settings); diff --git a/src/plugins/projectexplorer/projectwindow.h b/src/plugins/projectexplorer/projectwindow.h index c048a4ac460..73fb486b7af 100644 --- a/src/plugins/projectexplorer/projectwindow.h +++ b/src/plugins/projectexplorer/projectwindow.h @@ -55,6 +55,7 @@ class ProjectWindowPrivate; class ProjectWindow : public Utils::FancyMainWindow { + friend class ProjectWindowPrivate; Q_OBJECT public: diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 2ddef4d00f6..ff2a827dcbc 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -44,6 +44,7 @@ using namespace Utils; static const char ID_KEY[] = "ProjectExplorer.ToolChain.Id"; static const char DISPLAY_NAME_KEY[] = "ProjectExplorer.ToolChain.DisplayName"; static const char AUTODETECT_KEY[] = "ProjectExplorer.ToolChain.Autodetect"; +static const char LANGUAGE_KEY_V1[] = "ProjectExplorer.ToolChain.Language"; // For QtCreator <= 4.2 static const char LANGUAGE_KEY_V2[] = "ProjectExplorer.ToolChain.LanguageV2"; // For QtCreator > 4.2 namespace ProjectExplorer { @@ -86,8 +87,41 @@ public: ToolChain::HeaderPathsCache m_headerPathsCache; }; -} // Internal +// Deprecated used from QtCreator <= 4.2 + +Utils::Id fromLanguageV1(int language) +{ + switch (language) + { + case Deprecated::Toolchain::C : + return Utils::Id(Constants::C_LANGUAGE_ID); + case Deprecated::Toolchain::Cxx: + return Utils::Id(Constants::CXX_LANGUAGE_ID); + case Deprecated::Toolchain::None: + default: + return Utils::Id(); + } +} + +} // namespace Internal + +namespace Deprecated { +namespace Toolchain { +QString languageId(Language l) +{ + switch (l) { + case Language::None: + return QStringLiteral("None"); + case Language::C: + return QStringLiteral("C"); + case Language::Cxx: + return QStringLiteral("Cxx"); + }; + return QString(); +} +} // namespace Toolchain +} // namespace Deprecated /*! \class ProjectExplorer::ToolChain @@ -218,6 +252,15 @@ QVariantMap ToolChain::toMap() const result.insert(QLatin1String(ID_KEY), idToSave); result.insert(QLatin1String(DISPLAY_NAME_KEY), displayName()); result.insert(QLatin1String(AUTODETECT_KEY), isAutoDetected()); + // + int oldLanguageId = -1; + if (language() == ProjectExplorer::Constants::C_LANGUAGE_ID) + oldLanguageId = 1; + else if (language() == ProjectExplorer::Constants::CXX_LANGUAGE_ID) + oldLanguageId = 2; + if (oldLanguageId >= 0) + result.insert(LANGUAGE_KEY_V1, oldLanguageId); + // result.insert(QLatin1String(LANGUAGE_KEY_V2), language().toSetting()); if (!d->m_targetAbiKey.isEmpty()) result.insert(d->m_targetAbiKey, d->m_targetAbi.toString()); @@ -327,6 +370,8 @@ bool ToolChain::fromMap(const QVariantMap &data) d->m_language = Utils::Id::fromString(langId.mid(pos + 1)); else d->m_language = Utils::Id::fromString(langId); + } else if (data.contains(LANGUAGE_KEY_V1)) { // Import from old settings + d->m_language = Internal::fromLanguageV1(data.value(QLatin1String(LANGUAGE_KEY_V1)).toInt()); } if (!d->m_language.isValid()) diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index 22042c86424..40c9db98b22 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -52,6 +52,18 @@ namespace ProjectExplorer { namespace Internal { class ToolChainPrivate; } +namespace Deprecated { +// Deprecated in 4.3: +namespace Toolchain { +enum Language { + None = 0, + C, + Cxx +}; +QString languageId(Language l); +} // namespace Toolchain +} // namespace Deprecated + class ToolChainConfigWidget; class ToolChainFactory; class Kit; diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp index 017579c1a15..a58805a0886 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp @@ -299,7 +299,7 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model) for (const ItemLibraryEntry &entry : itemLibEntries) { NodeMetaInfo metaInfo = model->metaInfo(entry.typeName()); - bool valid = metaInfo.isValid() && metaInfo.majorVersion() == entry.majorVersion(); + bool valid = metaInfo.isValid() && metaInfo.majorVersion() >= entry.majorVersion(); bool isItem = valid && metaInfo.isSubclassOf("QtQuick.Item"); bool forceVisibility = valid && NodeHints::fromItemLibraryEntry(entry).visibleInLibrary(); diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp index a751bf5b1f0..21b47c312bf 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp @@ -78,10 +78,24 @@ bool isSupportedAttachedProperties(const QString &propertyName) QStringList supportedVersionsList() { - static const QStringList list = { - "2.0", "2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", - "2.10", "2.11", "2.12", "2.13", "2.14", "2.15" - }; + static const QStringList list = {"2.0", + "2.1", + "2.2", + "2.3", + "2.4", + "2.5", + "2.6", + "2.7", + "2.8", + "2.9", + "2.10", + "2.11", + "2.12", + "2.13", + "2.14", + "2.15", + "6.0", + "6.1"}; return list; } diff --git a/src/plugins/qmlpreview/CMakeLists.txt b/src/plugins/qmlpreview/CMakeLists.txt index 69d0eddcacb..532dd8999f2 100644 --- a/src/plugins/qmlpreview/CMakeLists.txt +++ b/src/plugins/qmlpreview/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(Qt5 COMPONENTS QmlDebug REQUIRED) - add_qtc_plugin(QmlPreview PUBLIC_DEPENDS QmlDebug DEPENDS QmlJS @@ -28,7 +26,7 @@ extend_qtc_plugin(QmlPreview # who needs it in older but special built Qt versions aswell string(REGEX MATCH "^[0-9]*" QT_VERSION_MAJOR ${Qt5_VERSION}) get_target_property(qmldebugprivate_include_directories - Qt${QT_VERSION_MAJOR}::QmlDebugPrivate + Qt${QT_VERSION_MAJOR}::QmlPrivate INTERFACE_INCLUDE_DIRECTORIES ) find_file(have_qml_debug_translation_protocol @@ -37,6 +35,6 @@ find_file(have_qml_debug_translation_protocol ) extend_qtc_plugin(QmlPreview CONDITION have_qml_debug_translation_protocol - DEPENDS Qt5::QmlDebugPrivate + PUBLIC_DEPENDS Qt5::QmlPrivate PUBLIC_DEFINES "FOUND_QML_DEBUG_TRANSLATION_PROTOCOL" ) diff --git a/src/plugins/qmlprofiler/qmlevent.h b/src/plugins/qmlprofiler/qmlevent.h index 344ef1a7cef..59fa8f506c8 100644 --- a/src/plugins/qmlprofiler/qmlevent.h +++ b/src/plugins/qmlprofiler/qmlevent.h @@ -34,6 +34,7 @@ #include #include +#include #include namespace QmlProfiler { diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 454c0d7b01f..e9feec7f2a4 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -526,8 +526,11 @@ Tasks BaseQtVersion::validateKit(const Kit *k) qtAbiString.append(' '); qtAbiString.append(qtAbi.toString()); - if (!fullMatch) - fullMatch = supportedAbis.contains(qtAbi); + if (!fullMatch) { + fullMatch = supportedAbis.contains(qtAbi) + && qtAbi.wordWidth() == targetAbi.wordWidth() + && qtAbi.architecture() == targetAbi.architecture(); + } if (!fuzzyMatch && !fullMatch) { fuzzyMatch = Utils::anyOf(supportedAbis, [&](const Abi &abi) { return qtAbi.isCompatibleWith(abi); diff --git a/src/plugins/qtsupport/qtkitinformation.cpp b/src/plugins/qtsupport/qtkitinformation.cpp index f3baef0157c..d15e6d79ee6 100644 --- a/src/plugins/qtsupport/qtkitinformation.cpp +++ b/src/plugins/qtsupport/qtkitinformation.cpp @@ -222,8 +222,11 @@ void QtKitAspect::fix(Kit *k) QList possibleTcs = ToolChainManager::toolChains([version](const ToolChain *t) { if (!t->isValid() || t->language() != ProjectExplorer::Constants::CXX_LANGUAGE_ID) return false; - return Utils::anyOf(version->qtAbis(), - [t](const Abi &qtAbi) { return t->supportedAbis().contains(qtAbi); }); + return Utils::anyOf(version->qtAbis(), [t](const Abi &qtAbi) { + return t->supportedAbis().contains(qtAbi) + && t->targetAbi().wordWidth() == qtAbi.wordWidth() + && t->targetAbi().architecture() == qtAbi.architecture(); + }); }); if (!possibleTcs.isEmpty()) { // Prefer exact matches. diff --git a/src/plugins/texteditor/textmark.cpp b/src/plugins/texteditor/textmark.cpp index abaac7c430f..94137d9ade4 100644 --- a/src/plugins/texteditor/textmark.cpp +++ b/src/plugins/texteditor/textmark.cpp @@ -400,9 +400,9 @@ void TextMark::setSettingsPage(Id settingsPage) m_settingsAction = new QAction; m_settingsAction->setIcon(Utils::Icons::SETTINGS_TOOLBAR.icon()); m_settingsAction->setToolTip(tr("Show Diagnostic Settings")); - QObject::connect(m_settingsAction, &QAction::triggered, [this, settingsPage] { - Core::ICore::showOptionsDialog(settingsPage); - }); + QObject::connect(m_settingsAction, &QAction::triggered, Core::ICore::instance(), + [settingsPage] { Core::ICore::showOptionsDialog(settingsPage); }, + Qt::QueuedConnection); } TextMarkRegistry::TextMarkRegistry(QObject *parent) diff --git a/src/shared/qbs b/src/shared/qbs index 2f6eecdc96f..86eb6974126 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 2f6eecdc96fcd693cecef8011d8f9500c7872fc7 +Subproject commit 86eb6974126b4fdf4cfa3340b7a80833479f2d37 diff --git a/src/tools/sdktool/addkitoperation.cpp b/src/tools/sdktool/addkitoperation.cpp index 8b6a3355c96..8746705ac3c 100644 --- a/src/tools/sdktool/addkitoperation.cpp +++ b/src/tools/sdktool/addkitoperation.cpp @@ -64,7 +64,7 @@ const char DEBUGGER_BINARY[] = "Binary"; const char DEVICE_TYPE[] = "PE.Profile.DeviceType"; const char DEVICE_ID[] = "PE.Profile.Device"; const char SYSROOT[] = "PE.Profile.SysRoot"; -const char TOOLCHAIN[] = "PE.Profile.ToolChains"; +const char TOOLCHAIN[] = "PE.Profile.ToolChainsV3"; const char MKSPEC[] = "QtPM4.mkSpecInformation"; const char QT[] = "QtSupport.QtInformation"; const char CMAKE_ID[] = "CMakeProjectManager.CMakeKitInformation"; diff --git a/tests/unit/unittest/CMakeLists.txt b/tests/unit/unittest/CMakeLists.txt index c8087d75697..5a2c21c03cc 100644 --- a/tests/unit/unittest/CMakeLists.txt +++ b/tests/unit/unittest/CMakeLists.txt @@ -240,7 +240,7 @@ string(REPLACE "$$QTCREATOR_VERSION" "${IDE_VERSION}" plugin_json_in ${plugin_js string(REPLACE "$$QTCREATOR_COMPAT_VERSION" "${IDE_VERSION_COMPAT}" plugin_json_in ${plugin_json_in}) string(REPLACE "$$QTCREATOR_COPYRIGHT_YEAR" "${IDE_COPYRIGHT_YEAR}" plugin_json_in ${plugin_json_in}) string(REPLACE "$$dependencyList" "\"Dependencies\" : []" plugin_json_in ${plugin_json_in}) -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CppTools.json" ${plugin_json_in}}) +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CppTools.json" ${plugin_json_in}) extend_qtc_test(unittest CONDITION TARGET libclang