Merge remote-tracking branch 'origin/4.15'

Change-Id: I75ffc79eeb8d73296a2271a636fae48e35427947
This commit is contained in:
Eike Ziller
2021-05-05 11:46:19 +02:00
33 changed files with 455 additions and 68 deletions

View File

@@ -651,6 +651,10 @@ function(add_qtc_executable name)
endif() endif()
endif() endif()
if (WITH_TESTS)
set(TEST_DEFINES WITH_TESTS SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
endif()
add_executable("${name}" ${_arg_SOURCES}) add_executable("${name}" ${_arg_SOURCES})
extend_qtc_target("${name}" extend_qtc_target("${name}"

View File

@@ -13,7 +13,7 @@ instructions:
maxTimeBetweenOutput: 360 maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to extract elfutils package, check logs." userMessageOnFailure: "Failed to extract elfutils package, check logs."
- type: ExecuteCommand - 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 maxTimeInSeconds: 3600
maxTimeBetweenOutput: 360 maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to download LLVM package, check logs." userMessageOnFailure: "Failed to download LLVM package, check logs."
@@ -23,7 +23,7 @@ instructions:
maxTimeBetweenOutput: 360 maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to extract LLVM package, check logs." userMessageOnFailure: "Failed to extract LLVM package, check logs."
- type: ExecuteCommand - 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 maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600 maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to run build.py, check logs." userMessageOnFailure: "Failed to run build.py, check logs."
@@ -50,7 +50,7 @@ instructions:
maxTimeBetweenOutput: 360 maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to extract LLVM package, check logs." userMessageOnFailure: "Failed to extract LLVM package, check logs."
- type: ExecuteCommand - 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 maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600 maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to run build.py, check logs." userMessageOnFailure: "Failed to run build.py, check logs."
@@ -92,7 +92,7 @@ instructions:
maxTimeBetweenOutput: 360 maxTimeBetweenOutput: 360
userMessageOnFailure: "Failed to extract LLVM package, check logs." userMessageOnFailure: "Failed to extract LLVM package, check logs."
- type: ExecuteCommand - 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 maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600 maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to run build.py, check logs." userMessageOnFailure: "Failed to run build.py, check logs."

View File

@@ -407,7 +407,8 @@
\endif \endif
panes, select \uicontrol View > \uicontrol {Output Panes}. panes, select \uicontrol View > \uicontrol {Output Panes}.
\if defined(qtcreator) \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 \endif
For more information about the \uicontrol {QML Debugger Console} view, see For more information about the \uicontrol {QML Debugger Console} view, see
@@ -555,7 +556,7 @@
To specify settings for displaying application output, select To specify settings for displaying application output, select
\uicontrol Tools > \uicontrol Options > \uicontrol {Build & Run} > \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 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, 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. 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 To specify whether to open the \uicontrol {Compile Output} pane on output
when building applications, select \uicontrol Tools > \uicontrol Options > 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. \uicontrol {Open pane when building} check box.
In the \uicontrol {Limit output to} field, you can specify the maximum In the \uicontrol {Limit output to} field, you can specify the maximum
amount of build output lines to display in the pane. amount of build output lines to display in the pane.

View File

@@ -90,6 +90,7 @@ depends += qtwidgets \
qtsensors \ qtsensors \
qttestlib \ qttestlib \
qtuitools \ qtuitools \
qtvirtualkeyboard \
qtxml qtxml
include(../../config/macros.qdocconf) include(../../config/macros.qdocconf)

View File

@@ -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
}
}
}
}
}

View File

@@ -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"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -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.
*/

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2020 The Qt Company Ltd. ** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Bridge documentation. ** This file is part of the Qt Bridge documentation.
@@ -37,7 +37,7 @@
with Photoshop: with Photoshop:
\list \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 layers that are imported into \QDS as separate files, depending
on the choices you make when exporting designs. on the choices you make when exporting designs.
\li Use the Type tool to make sure that all of your text labels \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 them to \QDS. \QDS deploys them to devices when you preview the UI. For more
information, see \l{Using Custom Fonts}. 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 \section2 Using Artboards
The relationships between the groups and layers on an artboard are preserved The relationships between the groups and layers on an artboard are preserved

View File

@@ -706,8 +706,8 @@ void Qt5InformationNodeInstanceServer::renderModelNodeImageView()
void Qt5InformationNodeInstanceServer::doRenderModelNodeImageView() void Qt5InformationNodeInstanceServer::doRenderModelNodeImageView()
{ {
// Disable preview in Qt6 until QTBUG-QTBUG-88320 is fixed // 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) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) || QT_VERSION >= QT_VERSION_CHECK(6, 1, 0)
ServerNodeInstance instance; ServerNodeInstance instance;
if (m_modelNodePreviewImageCommand.renderItemId() >= 0) if (m_modelNodePreviewImageCommand.renderItemId() >= 0)
instance = instanceForId(m_modelNodePreviewImageCommand.renderItemId()); instance = instanceForId(m_modelNodePreviewImageCommand.renderItemId());

View File

@@ -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")) if (!qEnvironmentVariableIsSet("QT_OPENGL"))
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
#else
qputenv("QT_QUICK_BACKEND", "opengl");
#endif #endif
if (qEnvironmentVariableIsSet("QTCREATOR_DISABLE_NATIVE_MENUBAR") if (qEnvironmentVariableIsSet("QTCREATOR_DISABLE_NATIVE_MENUBAR")

View File

@@ -537,7 +537,9 @@ void CMakeBuildStep::recreateBuildTargetsModel()
// Remove the targets that do not exist in the build system // Remove the targets that do not exist in the build system
// This can result when selected targets get renamed // This can result when selected targets get renamed
if (!targetList.empty()) { 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()) if (m_buildTargets.empty())
m_buildTargets.push_back(m_allTarget); m_buildTargets.push_back(m_allTarget);
} }

View File

@@ -166,35 +166,36 @@ static FilePath qmakeFromCMakeCache(const CMakeConfig &config)
if (!cmakeListTxt.open(QIODevice::WriteOnly)) { if (!cmakeListTxt.open(QIODevice::WriteOnly)) {
return FilePath(); return FilePath();
} }
cmakeListTxt.write(QByteArray(R"( // FIXME replace by raw string when gcc 8+ is minimum
cmake_minimum_required(VERSION 3.15) cmakeListTxt.write(QByteArray(
"cmake_minimum_required(VERSION 3.15)\n"
project(qmake-probe LANGUAGES NONE) "\n"
"project(qmake-probe LANGUAGES NONE)\n"
# Bypass Qt6's usage of find_dependency, which would require compiler "\n"
# and source code probing, which slows things unnecessarily "# Bypass Qt6's usage of find_dependency, which would require compiler\n"
file(WRITE "${CMAKE_SOURCE_DIR}/CMakeFindDependencyMacro.cmake" "# and source code probing, which slows things unnecessarily"
[=[ "file(WRITE \"${CMAKE_SOURCE_DIR}/CMakeFindDependencyMacro.cmake\"\n"
macro(find_dependency dep) "[=["
endmacro() " macro(find_dependency dep)\n"
]=]) " endmacro()\n"
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}") "]=])\n"
"set(CMAKE_MODULE_PATH \"${CMAKE_SOURCE_DIR}\")\n"
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED) "\n"
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) "find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)\n"
"find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)\n"
if (CMAKE_CROSSCOMPILING) "\n"
find_program(qmake_binary "if (CMAKE_CROSSCOMPILING)\n"
NAMES qmake qmake.bat " find_program(qmake_binary\n"
PATHS "${Qt${QT_VERSION_MAJOR}_DIR}/../../../bin" " NAMES qmake qmake.bat\n"
NO_DEFAULT_PATH) " PATHS \"${Qt${QT_VERSION_MAJOR}_DIR}/../../../bin\"\n"
file(WRITE "${CMAKE_SOURCE_DIR}/qmake-location.txt" "${qmake_binary}") " NO_DEFAULT_PATH)\n"
else() " file(WRITE \"${CMAKE_SOURCE_DIR}/qmake-location.txt\" \"${qmake_binary}\")\n"
file(GENERATE "else()\n"
OUTPUT "${CMAKE_SOURCE_DIR}/qmake-location.txt" " file(GENERATE\n"
CONTENT "$<TARGET_PROPERTY:Qt${QT_VERSION_MAJOR}::qmake,IMPORTED_LOCATION>") " OUTPUT \"${CMAKE_SOURCE_DIR}/qmake-location.txt\"\n"
endif() " CONTENT \"$<TARGET_PROPERTY:Qt${QT_VERSION_MAJOR}::qmake,IMPORTED_LOCATION>\")\n"
)")); "endif()\n"
));
cmakeListTxt.close(); cmakeListTxt.close();
SynchronousProcess cmake; SynchronousProcess cmake;

View File

@@ -336,7 +336,7 @@ QVariant DocumentModelPrivate::data(const QModelIndex &index, int role) const
return lockedIcon(); return lockedIcon();
if (entry->pinned) if (entry->pinned)
return pinnedIcon(); return pinnedIcon();
return QIcon(); return QVariant();
case Qt::ToolTipRole: case Qt::ToolTipRole:
return entry->fileName().isEmpty() ? entry->displayName() : entry->fileName().toUserOutput(); return entry->fileName().isEmpty() ? entry->displayName() : entry->fileName().toUserOutput();
default: default:

View File

@@ -102,7 +102,7 @@ OpenDocumentsTreeView::OpenDocumentsTreeView(QWidget *parent) :
{ {
m_delegate = new Internal::OpenDocumentsDelegate(this); m_delegate = new Internal::OpenDocumentsDelegate(this);
setItemDelegate(m_delegate); setItemDelegate(m_delegate);
setIndentation(0); setRootIsDecorated(false);
setUniformRowHeights(true); setUniformRowHeights(true);
setTextElideMode(Qt::ElideMiddle); setTextElideMode(Qt::ElideMiddle);
setFrameStyle(QFrame::NoFrame); setFrameStyle(QFrame::NoFrame);

View File

@@ -318,7 +318,8 @@ IEditor *GitGrep::openEditor(const SearchResultItem &item,
const QString topLevel = parameters.additionalParameters.toString(); const QString topLevel = parameters.additionalParameters.toString();
IEditor *editor = m_client->openShowEditor( IEditor *editor = m_client->openShowEditor(
topLevel, params.ref, path, GitClient::ShowEditor::OnlyIfDifferent); 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; return editor;
} }

View File

@@ -63,6 +63,8 @@ using namespace Utils;
namespace ProjectExplorer { 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"; const char KITINFORMATION_ID_V3[] = "PE.Profile.ToolChainsV3";
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@@ -392,6 +394,65 @@ Tasks ToolChainKitAspect::validate(const Kit *k) const
void ToolChainKitAspect::upgrade(Kit *k) void ToolChainKitAspect::upgrade(Kit *k)
{ {
QTC_ASSERT(k, return); 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) void ToolChainKitAspect::fix(Kit *k)

View File

@@ -620,6 +620,7 @@ public:
void setPanel(QWidget *panel) void setPanel(QWidget *panel)
{ {
q->savePersistentSettings();
if (QWidget *widget = q->centralWidget()) { if (QWidget *widget = q->centralWidget()) {
q->takeCentralWidget(); q->takeCentralWidget();
widget->hide(); // Don't delete. widget->hide(); // Don't delete.
@@ -630,6 +631,7 @@ public:
if (q->hasFocus()) // we get assigned focus from setFocusToCurrentMode, pass that on if (q->hasFocus()) // we get assigned focus from setFocusToCurrentMode, pass that on
panel->setFocus(); panel->setFocus();
} }
q->loadPersistentSettings();
} }
ProjectWindow *q; ProjectWindow *q;
@@ -670,9 +672,7 @@ void ProjectWindow::hideEvent(QHideEvent *event)
void ProjectWindow::showEvent(QShowEvent *event) void ProjectWindow::showEvent(QShowEvent *event)
{ {
FancyMainWindow::showEvent(event); FancyMainWindow::showEvent(event);
loadPersistentSettings();
// Delay appears to be necessary for the target setup page to have the correct layout.
QTimer::singleShot(0, this, &ProjectWindow::loadPersistentSettings);
} }
ProjectWindow::~ProjectWindow() = default; ProjectWindow::~ProjectWindow() = default;
@@ -681,6 +681,8 @@ const char PROJECT_WINDOW_KEY[] = "ProjectExplorer.ProjectWindow";
void ProjectWindow::savePersistentSettings() const void ProjectWindow::savePersistentSettings() const
{ {
if (!centralWidget())
return;
QSettings * const settings = ICore::settings(); QSettings * const settings = ICore::settings();
settings->beginGroup(PROJECT_WINDOW_KEY); settings->beginGroup(PROJECT_WINDOW_KEY);
saveSettings(settings); saveSettings(settings);
@@ -689,6 +691,8 @@ void ProjectWindow::savePersistentSettings() const
void ProjectWindow::loadPersistentSettings() void ProjectWindow::loadPersistentSettings()
{ {
if (!centralWidget())
return;
QSettings * const settings = ICore::settings(); QSettings * const settings = ICore::settings();
settings->beginGroup(PROJECT_WINDOW_KEY); settings->beginGroup(PROJECT_WINDOW_KEY);
restoreSettings(settings); restoreSettings(settings);

View File

@@ -55,6 +55,7 @@ class ProjectWindowPrivate;
class ProjectWindow : public Utils::FancyMainWindow class ProjectWindow : public Utils::FancyMainWindow
{ {
friend class ProjectWindowPrivate;
Q_OBJECT Q_OBJECT
public: public:

View File

@@ -44,6 +44,7 @@ using namespace Utils;
static const char ID_KEY[] = "ProjectExplorer.ToolChain.Id"; static const char ID_KEY[] = "ProjectExplorer.ToolChain.Id";
static const char DISPLAY_NAME_KEY[] = "ProjectExplorer.ToolChain.DisplayName"; static const char DISPLAY_NAME_KEY[] = "ProjectExplorer.ToolChain.DisplayName";
static const char AUTODETECT_KEY[] = "ProjectExplorer.ToolChain.Autodetect"; 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 static const char LANGUAGE_KEY_V2[] = "ProjectExplorer.ToolChain.LanguageV2"; // For QtCreator > 4.2
namespace ProjectExplorer { namespace ProjectExplorer {
@@ -86,8 +87,41 @@ public:
ToolChain::HeaderPathsCache m_headerPathsCache; 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 \class ProjectExplorer::ToolChain
@@ -218,6 +252,15 @@ QVariantMap ToolChain::toMap() const
result.insert(QLatin1String(ID_KEY), idToSave); result.insert(QLatin1String(ID_KEY), idToSave);
result.insert(QLatin1String(DISPLAY_NAME_KEY), displayName()); result.insert(QLatin1String(DISPLAY_NAME_KEY), displayName());
result.insert(QLatin1String(AUTODETECT_KEY), isAutoDetected()); result.insert(QLatin1String(AUTODETECT_KEY), isAutoDetected());
// <Compatibility with QtC 4.2>
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);
// </Compatibility>
result.insert(QLatin1String(LANGUAGE_KEY_V2), language().toSetting()); result.insert(QLatin1String(LANGUAGE_KEY_V2), language().toSetting());
if (!d->m_targetAbiKey.isEmpty()) if (!d->m_targetAbiKey.isEmpty())
result.insert(d->m_targetAbiKey, d->m_targetAbi.toString()); 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)); d->m_language = Utils::Id::fromString(langId.mid(pos + 1));
else else
d->m_language = Utils::Id::fromString(langId); 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()) if (!d->m_language.isValid())

View File

@@ -52,6 +52,18 @@ namespace ProjectExplorer {
namespace Internal { class ToolChainPrivate; } 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 ToolChainConfigWidget;
class ToolChainFactory; class ToolChainFactory;
class Kit; class Kit;

View File

@@ -299,7 +299,7 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model)
for (const ItemLibraryEntry &entry : itemLibEntries) { for (const ItemLibraryEntry &entry : itemLibEntries) {
NodeMetaInfo metaInfo = model->metaInfo(entry.typeName()); 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 isItem = valid && metaInfo.isSubclassOf("QtQuick.Item");
bool forceVisibility = valid && NodeHints::fromItemLibraryEntry(entry).visibleInLibrary(); bool forceVisibility = valid && NodeHints::fromItemLibraryEntry(entry).visibleInLibrary();

View File

@@ -78,10 +78,24 @@ bool isSupportedAttachedProperties(const QString &propertyName)
QStringList supportedVersionsList() QStringList supportedVersionsList()
{ {
static const QStringList list = { static const QStringList list = {"2.0",
"2.0", "2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.1",
"2.10", "2.11", "2.12", "2.13", "2.14", "2.15" "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; return list;
} }

View File

@@ -1,5 +1,3 @@
find_package(Qt5 COMPONENTS QmlDebug REQUIRED)
add_qtc_plugin(QmlPreview add_qtc_plugin(QmlPreview
PUBLIC_DEPENDS QmlDebug PUBLIC_DEPENDS QmlDebug
DEPENDS QmlJS DEPENDS QmlJS
@@ -28,7 +26,7 @@ extend_qtc_plugin(QmlPreview
# who needs it in older but special built Qt versions aswell # who needs it in older but special built Qt versions aswell
string(REGEX MATCH "^[0-9]*" QT_VERSION_MAJOR ${Qt5_VERSION}) string(REGEX MATCH "^[0-9]*" QT_VERSION_MAJOR ${Qt5_VERSION})
get_target_property(qmldebugprivate_include_directories get_target_property(qmldebugprivate_include_directories
Qt${QT_VERSION_MAJOR}::QmlDebugPrivate Qt${QT_VERSION_MAJOR}::QmlPrivate
INTERFACE_INCLUDE_DIRECTORIES INTERFACE_INCLUDE_DIRECTORIES
) )
find_file(have_qml_debug_translation_protocol find_file(have_qml_debug_translation_protocol
@@ -37,6 +35,6 @@ find_file(have_qml_debug_translation_protocol
) )
extend_qtc_plugin(QmlPreview extend_qtc_plugin(QmlPreview
CONDITION have_qml_debug_translation_protocol CONDITION have_qml_debug_translation_protocol
DEPENDS Qt5::QmlDebugPrivate PUBLIC_DEPENDS Qt5::QmlPrivate
PUBLIC_DEFINES "FOUND_QML_DEBUG_TRANSLATION_PROTOCOL" PUBLIC_DEFINES "FOUND_QML_DEBUG_TRANSLATION_PROTOCOL"
) )

View File

@@ -34,6 +34,7 @@
#include <QMetaType> #include <QMetaType>
#include <initializer_list> #include <initializer_list>
#include <limits>
#include <type_traits> #include <type_traits>
namespace QmlProfiler { namespace QmlProfiler {

View File

@@ -526,8 +526,11 @@ Tasks BaseQtVersion::validateKit(const Kit *k)
qtAbiString.append(' '); qtAbiString.append(' ');
qtAbiString.append(qtAbi.toString()); qtAbiString.append(qtAbi.toString());
if (!fullMatch) if (!fullMatch) {
fullMatch = supportedAbis.contains(qtAbi); fullMatch = supportedAbis.contains(qtAbi)
&& qtAbi.wordWidth() == targetAbi.wordWidth()
&& qtAbi.architecture() == targetAbi.architecture();
}
if (!fuzzyMatch && !fullMatch) { if (!fuzzyMatch && !fullMatch) {
fuzzyMatch = Utils::anyOf(supportedAbis, [&](const Abi &abi) { fuzzyMatch = Utils::anyOf(supportedAbis, [&](const Abi &abi) {
return qtAbi.isCompatibleWith(abi); return qtAbi.isCompatibleWith(abi);

View File

@@ -222,8 +222,11 @@ void QtKitAspect::fix(Kit *k)
QList<ToolChain *> possibleTcs = ToolChainManager::toolChains([version](const ToolChain *t) { QList<ToolChain *> possibleTcs = ToolChainManager::toolChains([version](const ToolChain *t) {
if (!t->isValid() || t->language() != ProjectExplorer::Constants::CXX_LANGUAGE_ID) if (!t->isValid() || t->language() != ProjectExplorer::Constants::CXX_LANGUAGE_ID)
return false; return false;
return Utils::anyOf(version->qtAbis(), return Utils::anyOf(version->qtAbis(), [t](const Abi &qtAbi) {
[t](const Abi &qtAbi) { return t->supportedAbis().contains(qtAbi); }); return t->supportedAbis().contains(qtAbi)
&& t->targetAbi().wordWidth() == qtAbi.wordWidth()
&& t->targetAbi().architecture() == qtAbi.architecture();
});
}); });
if (!possibleTcs.isEmpty()) { if (!possibleTcs.isEmpty()) {
// Prefer exact matches. // Prefer exact matches.

View File

@@ -400,9 +400,9 @@ void TextMark::setSettingsPage(Id settingsPage)
m_settingsAction = new QAction; m_settingsAction = new QAction;
m_settingsAction->setIcon(Utils::Icons::SETTINGS_TOOLBAR.icon()); m_settingsAction->setIcon(Utils::Icons::SETTINGS_TOOLBAR.icon());
m_settingsAction->setToolTip(tr("Show Diagnostic Settings")); m_settingsAction->setToolTip(tr("Show Diagnostic Settings"));
QObject::connect(m_settingsAction, &QAction::triggered, [this, settingsPage] { QObject::connect(m_settingsAction, &QAction::triggered, Core::ICore::instance(),
Core::ICore::showOptionsDialog(settingsPage); [settingsPage] { Core::ICore::showOptionsDialog(settingsPage); },
}); Qt::QueuedConnection);
} }
TextMarkRegistry::TextMarkRegistry(QObject *parent) TextMarkRegistry::TextMarkRegistry(QObject *parent)

View File

@@ -64,7 +64,7 @@ const char DEBUGGER_BINARY[] = "Binary";
const char DEVICE_TYPE[] = "PE.Profile.DeviceType"; const char DEVICE_TYPE[] = "PE.Profile.DeviceType";
const char DEVICE_ID[] = "PE.Profile.Device"; const char DEVICE_ID[] = "PE.Profile.Device";
const char SYSROOT[] = "PE.Profile.SysRoot"; 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 MKSPEC[] = "QtPM4.mkSpecInformation";
const char QT[] = "QtSupport.QtInformation"; const char QT[] = "QtSupport.QtInformation";
const char CMAKE_ID[] = "CMakeProjectManager.CMakeKitInformation"; const char CMAKE_ID[] = "CMakeProjectManager.CMakeKitInformation";

View File

@@ -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_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 "$$QTCREATOR_COPYRIGHT_YEAR" "${IDE_COPYRIGHT_YEAR}" plugin_json_in ${plugin_json_in})
string(REPLACE "$$dependencyList" "\"Dependencies\" : []" 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 extend_qtc_test(unittest
CONDITION TARGET libclang CONDITION TARGET libclang