Merge remote-tracking branch 'origin/10.0' into qds/dev

Change-Id: I51801c3bec7e29f7c7384d86d79b4fcabb4f99c1
This commit is contained in:
Tim Jenßen
2023-04-27 20:26:12 +02:00
46 changed files with 814 additions and 149 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2021 The Qt Company Ltd.
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
@@ -219,7 +219,7 @@
Ubuntu or Debian?}
\code
sudo apt-get install libglib2.0-dev libSM-dev libxrender-dev libfontconfig1-dev libxext-dev
sudo apt-get install libglib2.0-dev libsm-dev libxrender-dev libfontconfig1-dev libxext-dev
\endcode
If you use QtOpenGL, you also need:

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2020 The Qt Company Ltd.
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
@@ -30,7 +30,7 @@
\li g++
\li make
\li libglib2.0-dev
\li libSM-dev
\li libsm-dev
\li libxrender-dev
\li libfontconfig1-dev
\li libxext-dev

View File

@@ -19,7 +19,7 @@ Module {
// TODO: Could something like this be incorporated into the vcs module?
// Currently, the default repo dir is project.sourceDirectory, which
// does not make sense for Qt Creator.
var dir = sourceDirectory;
var dir = product.sourceDirectory;
while (true) {
if (File.exists(FileInfo.joinPaths(dir, ".git")))
return dir;

View File

@@ -273,13 +273,20 @@ def deploy_elfutils(qtc_install_dir, chrpath_bin, args):
if common.is_mac_platform():
return
libs = ['elf', 'dw']
version = '1'
def lib_name(name, version):
return ('lib' + name + '.so.' + version if common.is_linux_platform()
else name + '.dll')
version = '1'
libs = ['elf', 'dw']
elfutils_lib_path = os.path.join(args.elfutils_path, 'lib')
def find_elfutils_lib_path(path):
for root, _, files in os.walk(path):
if lib_name('elf', version) in files:
return root
return path
elfutils_lib_path = find_elfutils_lib_path(os.path.join(args.elfutils_path, 'lib'))
if common.is_linux_platform():
install_path = os.path.join(qtc_install_dir, 'lib', 'elfutils')
backends_install_path = install_path

View File

@@ -0,0 +1,33 @@
cmake_minimum_required(VERSION 3.16)
project(%{ProjectName} VERSION 0.1 LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 6.2 COMPONENTS Quick REQUIRED)
qt_add_executable(%{TargetName}
main.cpp
)
qt_add_qml_module(%{TargetName}
URI %{ProjectName}
VERSION 1.0
QML_FILES main.qml %{AdditionalQmlFiles}
)
set_target_properties(%{TargetName} PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
target_link_libraries(%{TargetName}
PRIVATE Qt6::Quick)
install(TARGETS %{TargetName}
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

View File

@@ -0,0 +1,79 @@
cmake_minimum_required(VERSION 3.14)
project(%{ProjectName} VERSION 0.1 LANGUAGES CXX)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@if %{HasTranslation}
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Quick LinguistTools)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Quick LinguistTools)
set(TS_FILES %{TsFileName})
@else
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Quick)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Quick)
@endif
set(PROJECT_SOURCES
%{MainCppFileName}
qml.qrc
@if %{HasTranslation}
${TS_FILES}
@endif
)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(%{ProjectName}
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
# Define target properties for Android with Qt 6 as:
# set_property(TARGET %{ProjectName} APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
# ${CMAKE_CURRENT_SOURCE_DIR}/android)
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
@if %{HasTranslation}
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
@endif
else()
if(ANDROID)
add_library(%{ProjectName} SHARED
${PROJECT_SOURCES}
)
# Define properties for Android with Qt 5 after find_package() calls as:
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
else()
add_executable(%{ProjectName}
${PROJECT_SOURCES}
)
endif()
@if %{HasTranslation}
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
@endif
endif()
target_link_libraries(%{ProjectName}
PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick)
set_target_properties(%{ProjectName} PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
install(TARGETS %{ProjectName}
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
if(QT_VERSION_MAJOR EQUAL 6)
qt_import_qml_plugins(%{ProjectName})
qt_finalize_executable(%{ProjectName})
endif()

View File

@@ -0,0 +1,40 @@
@if "%{UseVirtualKeyboard}" == "true"
QT += quick virtualkeyboard
@else
QT += quick
@endif
@if !%{IsQt6}
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
@endif
SOURCES += \\
%{MainCppFileName}
@if %{IsQt6}
resources.files = main.qml %{AdditionalQmlFiles}
resources.prefix = /$${TARGET}
RESOURCES += resources
@else
RESOURCES += qml.qrc
@endif
@if %{HasTranslation}
TRANSLATIONS += \\
%{TsFileName}
CONFIG += lrelease
CONFIG += embed_translations
@endif
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

View File

@@ -0,0 +1,48 @@
import qbs
CppApplication {
@if "%{UseVirtualKeyboard}" == "true"
Depends { name: "Qt"; submodules: ["quick", "virtualkeyboard"] }
@else
Depends { name: "Qt.quick" }
@endif
install: true
// Additional import path used to resolve QML modules in Qt Creator's code model
property pathList qmlImportPaths: []
@if !%{IsQt6}
cpp.defines: [
// You can make your code fail to compile if it uses deprecated APIs.
// In order to do so, uncomment the following line.
//"QT_DISABLE_DEPRECATED_BEFORE=0x060000" // disables all the APIs deprecated before Qt 6.0.0
]
@endif
files: [
"%{MainCppFileName}",
@if !%{IsQt6}
"main.qml",
"qml.qrc",
@endif
@if %{HasTranslation}
"%{TsFileName}",
@endif
]
@if %{HasTranslation}
Group {
fileTagsFilter: "qm"
Qt.core.resourcePrefix: "/i18n"
fileTags: "qt.core.resource_data"
}
@endif
@if %{IsQt6}
Group {
files: ["main.qml"%{AdditionalQmlFilesQbs}]
Qt.core.resourcePrefix: "%{ProjectName}/"
fileTags: ["qt.qml.qml", "qt.core.resource_data"]
}
@endif
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

View File

@@ -0,0 +1,48 @@
import QtQuick %{QtQuickVersion}
@if !%{IsQt6}
import QtQuick.Window %{QtQuickWindowVersion}
@endif
@if %{UseVirtualKeyboard}
import %{QtQuickVirtualKeyboardImport}
@endif
Window {
@if %{UseVirtualKeyboard}
id: window
@endif
width: 640
height: 480
visible: true
title: qsTr("Hello World")
@if %{UseVirtualKeyboard}
InputPanel {
id: inputPanel
z: 99
x: 0
y: window.height
width: window.width
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
}
}
}
}
@endif
}

View File

@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file>main.qml</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,230 @@
{
"version": 1,
"supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ],
"id": "V.QtQuickApplicationEmptyCompat",
"category": "D.ApplicationQt",
"trDescription": "Creates a Qt Quick application that contains an empty window.\n\nUse this \"compat\" version if you want to use other build systems than CMake or Qt versions lower than 6.",
"trDisplayName": "Qt Quick Application (compat)",
"trDisplayCategory": "Application (Qt)",
"icon": "icon.png",
"iconKind": "Themed",
"featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.6" ],
"enabled": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('QbsProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0}",
"options":
[
{ "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'qmake' ? value('ProFile') : (value('BuildSystem') === 'cmake' ? value('CMakeFile') : value('QbsFile'))}" },
{ "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" },
{ "key": "QbsFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qbs')}" },
{ "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" },
{ "key": "IsQt6", "value": "%{JS: value('QtVersion').IsQt6}" },
{ "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" },
{ "key": "QtQuickVersion", "value": "%{JS: value('QtVersion').QtQuickVersion}" },
{ "key": "QtQuickWindowVersion", "value": "%{JS: value('QtVersion').QtQuickWindowVersion}" },
{ "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: value('QtVersion').QtQuickVirtualKeyboardImport}" },
{ "key": "QtQuickFeature", "value": "%{JS: (value('QtQuickVersion')=='') ? 'QtSupport.Wizards.FeatureQt.6.2' : 'QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}'}" },
{ "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0}" },
{ "key": "HasTranslation", "value": "%{JS: value('TsFileName') !== ''}" },
{ "key": "SetQPAPhysicalSize", "value": "%{UseVirtualKeyboardByDefault}" },
{ "key": "AdditionalQmlFiles", "value": "" },
{ "key": "AdditionalQmlFilesQbs", "value": "" },
{ "key": "TargetName", "value": "%{JS: 'app' + value('ProjectName')}" }
],
"pages":
[
{
"trDisplayName": "Project Location",
"trShortTitle": "Location",
"typeId": "Project"
},
{
"trDisplayName": "Define Build System",
"trShortTitle": "Build System",
"typeId": "Fields",
"enabled": "%{JS: !value('IsSubproject')}",
"data":
[
{
"name": "BuildSystem",
"trDisplayName": "Build system:",
"type": "ComboBox",
"persistenceKey": "BuildSystemType",
"data":
{
"index": 1,
"items":
[
{
"trKey": "qmake",
"value": "qmake",
"condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}"
},
{
"trKey": "CMake",
"value": "cmake",
"condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}"
},
{
"trKey": "Qbs",
"value": "qbs",
"condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}"
}
]
}
}
]
},
{
"trDisplayName": "Define Project Details",
"trShortTitle": "Details",
"typeId": "Fields",
"data":
[
{
"name": "QtVersion",
"trDisplayName": "Minimum required Qt version:",
"type": "ComboBox",
"persistenceKey": "QtQuick.minimumQtVersion",
"data":
{
"index": 1,
"items":
[
{
"trKey": "Qt 6.2",
"value":
{
"QtQuickVersion": "",
"QtQuickWindowVersion": "",
"QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard",
"IsQt6": true
}
},
{
"trKey": "Qt 5.15",
"value":
{
"QtQuickVersion": "2.15",
"QtQuickWindowVersion": "2.15",
"QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.15",
"IsQt6": false
}
},
{
"trKey": "Qt 5.14",
"value":
{
"QtQuickVersion": "2.14",
"QtQuickWindowVersion": "2.14",
"QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.14",
"IsQt6": false
}
},
{
"trKey": "Qt 5.13",
"value":
{
"QtQuickVersion": "2.13",
"QtQuickWindowVersion": "2.13",
"QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4",
"IsQt6": false
}
},
{
"trKey": "Qt 5.12",
"value":
{
"QtQuickVersion": "2.12",
"QtQuickWindowVersion": "2.12",
"QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4",
"IsQt6": false
}
}
]
}
},
{
"name": "UseVirtualKeyboard",
"trDisplayName": "Use Qt Virtual Keyboard",
"type": "CheckBox",
"persistenceKey": "QtQuick.UseVirtualKeyboard.%{UseVirtualKeyboardByDefault}",
"data":
{
"checked": "%{UseVirtualKeyboardByDefault}"
}
}
]
},
{
"trDisplayName": "Translation File",
"trShortTitle": "Translation",
"typeId": "QtTranslation"
},
{
"trDisplayName": "Kit Selection",
"trShortTitle": "Kits",
"typeId": "Kits",
"enabled": "%{JS: !value('IsSubproject')}",
"data": {
"projectFilePath": "%{ProjectFile}",
"requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "%{QtQuickFeature}" ]
}
},
{
"trDisplayName": "Project Management",
"trShortTitle": "Summary",
"typeId": "Summary"
}
],
"generators":
[
{
"typeId": "File",
"data":
[
{
"source": "../app.pro",
"target": "%{ProFile}",
"openAsProject": true,
"condition": "%{JS: value('BuildSystem') === 'qmake'}"
},
{
"source": "%{JS: value('QtVersion').IsQt6 ? '../CMakeLists.6.x.txt' : '../CMakeLists.txt'}",
"target": "CMakeLists.txt",
"openAsProject": true,
"condition": "%{JS: value('BuildSystem') === 'cmake'}"
},
{
"source": "../app.qbs",
"target": "%{QbsFile}",
"openAsProject": true,
"condition": "%{JS: value('BuildSystem') === 'qbs'}"
},
{
"source": "../main.cpp",
"target": "%{MainCppFileName}"
},
{
"source": "main.qml.tpl",
"target": "main.qml",
"openInEditor": true
},
{
"source": "qml.qrc",
"condition": "%{JS: !value('QtVersion').IsQt6}"
},
{
"source": "../../translation.ts",
"target": "%{TsFileName}",
"condition": "%{HasTranslation}"
},
{
"source": "../../git.ignore",
"target": ".gitignore",
"condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}"
}
]
}
]
}

View File

@@ -0,0 +1,58 @@
%{Cpp:LicenseTemplate}\
%{JS: QtSupport.qtIncludes([], ["QtGui/QGuiApplication", "QtQml/QQmlApplicationEngine"])}
@if %{HasTranslation}
#include <QLocale>
#include <QTranslator>
@endif
int main(int argc, char *argv[])
{
@if %{UseVirtualKeyboard}
qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
@endif
@if !%{IsQt6}
@if %{SetQPAPhysicalSize}
if (qEnvironmentVariableIsEmpty("QTGLESSTREAM_DISPLAY")) {
qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("213"));
qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("120"));
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
}
@else
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
@endif
@endif
QGuiApplication app(argc, argv);
@if %{HasTranslation}
QTranslator translator;
const QStringList uiLanguages = QLocale::system().uiLanguages();
for (const QString &locale : uiLanguages) {
const QString baseName = "%{JS: value('ProjectName') + '_'}" + QLocale(locale).name();
if (translator.load(":/i18n/" + baseName)) {
app.installTranslator(&translator);
break;
}
}
@endif
QQmlApplicationEngine engine;
@if %{IsQt6}
const QUrl url(u"qrc:/%{JS: value('ProjectName')}/main.qml"_qs);
@else
const QUrl url(QStringLiteral("qrc:/main.qml"));
@endif
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)
QCoreApplication::exit(-1);
}, Qt::QueuedConnection);
engine.load(url);
return app.exec();
}

View File

@@ -0,0 +1,25 @@
; This file can be edited to change the style of the application
; Read "Qt Quick Controls 2 Configuration File" for details:
; https://doc.qt.io/qt/qtquickcontrols2-configuration.html
@if '%{QtQuickControlsStyle}' != 'Default'
[Controls]
Style=%{QtQuickControlsStyle}
@if '%{QtQuickControlsStyle}' == 'Universal'
[Universal]
Theme=%{QtQuickControlsStyleTheme}
;Accent=Steel
;Foreground=Brown
;Background=Steel
@endif
@if '%{QtQuickControlsStyle}' == 'Material'
[Material]
Theme=%{QtQuickControlsStyleTheme}
;Accent=BlueGrey
;Primary=BlueGray
;Foreground=Brown
;Background=Grey
@endif
@endif

View File

@@ -40138,11 +40138,11 @@ fails because Clang does not understand the target architecture.</source>
</message>
<message>
<source>Buffered output</source>
<translation type="unfinished"></translation>
<translation>Ausgabe puffern</translation>
</message>
<message>
<source>Enabling improves output performance, but results in delayed output.</source>
<translation type="unfinished"></translation>
<translation>Aktivieren dieser Option verbessert die Leistung der Anwendung, resultiert aber in verzögerter Ausgabe.</translation>
</message>
<message>
<source>Script:</source>
@@ -40162,15 +40162,15 @@ fails because Clang does not understand the target architecture.</source>
</message>
<message>
<source>Executable is empty.</source>
<translation type="unfinished"></translation>
<translation>Ausführbare Datei ist leer.</translation>
</message>
<message>
<source>%1 does not exist.</source>
<translation type="unfinished"></translation>
<translation>%1 existiert nicht.</translation>
</message>
<message>
<source>%1 is not an executable file.</source>
<translation type="unfinished"></translation>
<translation>%1 ist keine ausführbare Datei.</translation>
</message>
<message>
<source>&amp;Add</source>
@@ -40186,11 +40186,11 @@ fails because Clang does not understand the target architecture.</source>
</message>
<message>
<source>&amp;Clean Up</source>
<translation type="unfinished"></translation>
<translation>&amp;Bereiningen</translation>
</message>
<message>
<source>Remove all Python interpreters without a valid executable.</source>
<translation type="unfinished"></translation>
<translation>Entfernt alle Python-Interpreter ohne gültige ausführbare Datei.</translation>
</message>
<message>
<source>Interpreters</source>
@@ -40202,43 +40202,43 @@ fails because Clang does not understand the target architecture.</source>
</message>
<message>
<source>Plugins:</source>
<translation type="unfinished"></translation>
<translation>Plugins:</translation>
</message>
<message>
<source>Use Python Language Server</source>
<translation type="unfinished"></translation>
<translation>Python Language Server benutzen</translation>
</message>
<message>
<source>For a complete list of available options, consult the &lt;a href=&quot;https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md&quot;&gt;Python LSP Server configuration documentation&lt;/a&gt;.</source>
<translation type="unfinished"></translation>
<translation>Für eine vollständige Liste der verfügbaren Optionen siehe auch die &lt;a href=&quot;https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md&quot;&gt;Dokumentation zur Python LSP-Server-Konfiguration&lt;/a&gt;.</translation>
</message>
<message>
<source>Advanced</source>
<translation type="unfinished">Erweitert</translation>
<translation>Erweitert</translation>
</message>
<message>
<source>Language Server Configuration</source>
<translation type="unfinished"></translation>
<translation>Language Server-Konfiguration</translation>
</message>
<message>
<source> (Windowed)</source>
<translation type="unfinished"></translation>
<translation> (mit Fenster)</translation>
</message>
<message>
<source>Removing Python</source>
<translation type="unfinished"></translation>
<translation>Entferne Python</translation>
</message>
<message>
<source>Python:</source>
<translation type="unfinished"></translation>
<translation>Python:</translation>
</message>
<message>
<source>%1 installation missing for %2 (%3)</source>
<translation type="unfinished"></translation>
<translation>%1-Installation fehlt für %2 (%3)</translation>
</message>
<message>
<source>Install %1 for %2 using pip package installer.</source>
<translation type="unfinished"></translation>
<translation>Installiere %1 für %2 mit dem pip Paket-Installationsprogramm.</translation>
</message>
<message>
<source>Install</source>
@@ -40246,95 +40246,99 @@ fails because Clang does not understand the target architecture.</source>
</message>
<message>
<source>Install %1</source>
<translation type="unfinished"></translation>
<translatorcomment>This is the header of a progress bar</translatorcomment>
<translation>Installiere %1</translation>
</message>
<message>
<source>Running &quot;%1&quot; to install %2.</source>
<translation type="unfinished"></translation>
<translation>Führe &quot;%1&quot; aus, um %2 zu installieren.</translation>
</message>
<message>
<source>The %1 installation was canceled by %2.</source>
<translation type="unfinished"></translation>
<translatorcomment>%2 can be &quot;user&quot; or &quot;time out&quot; which doesn&apos;t work in non-english... so working around that.</translatorcomment>
<translation>Die Installation von %1 wurde abgebrochen: %2.</translation>
</message>
<message>
<source>user</source>
<translation type="unfinished"></translation>
<translatorcomment>Used as %2 in &quot;Die Installation von %1 wurde abgebrochen: %2.&quot;</translatorcomment>
<translation>Der Nutzer hat den Prozess abgebrochen</translation>
</message>
<message>
<source>time out</source>
<translation type="unfinished"></translation>
<translatorcomment>Used as %2 in &quot;Die Installation von %1 wurde abgebrochen: %2.&quot;</translatorcomment>
<translation>Zeitüberschreitung</translation>
</message>
<message>
<source>Installing the %1 failed with exit code %2</source>
<translation type="unfinished"></translation>
<translation>Installation von %1 ist mit dem Rückgabewert %2 fehlgeschlagen</translation>
</message>
<message>
<source>Run PySide6 project tool</source>
<translation type="unfinished"></translation>
<translation>PySide6 Projektwerkzeug ausführen</translation>
</message>
<message>
<source>PySide project tool:</source>
<translation type="unfinished"></translation>
<translation>PySide Projektwerkzeug:</translation>
</message>
<message>
<source>Enter location of PySide project tool.</source>
<translation type="unfinished"></translation>
<translation>Geben Sie den Ort des PySide Projektwerkzeugs ein.</translation>
</message>
<message>
<source>General</source>
<translation type="unfinished">Allgemein</translation>
<translation>Allgemein</translation>
</message>
<message>
<source>REPL</source>
<translation type="unfinished"></translation>
<translation>REPL</translation>
</message>
<message>
<source>Open interactive Python.</source>
<translation type="unfinished"></translation>
<translation>Interaktives Python öffnen.</translation>
</message>
<message>
<source>REPL Import File</source>
<translation type="unfinished"></translation>
<translation>REPL mit Datei-Import</translation>
</message>
<message>
<source>Open interactive Python and import file.</source>
<translation type="unfinished"></translation>
<translation>Interaktives Python öffnen und Datei importieren.</translation>
</message>
<message>
<source>REPL Import *</source>
<translation type="unfinished"></translation>
<translation>REPL mit *-Import</translation>
</message>
<message>
<source>Open interactive Python and import * from file.</source>
<translation type="unfinished"></translation>
<translation>Interaktives Python öffnen und alles (*) aus der Datei importieren.</translation>
</message>
<message>
<source>Open interactive Python. Either importing nothing, importing the current file, or importing everything (*) from the current file.</source>
<translation type="unfinished"></translation>
<translation>Interaktives Python öffnen. Importiert entweder nichts, die aktuelle Datei oder alles (*) aus der aktuellen Datei.</translation>
</message>
<message>
<source>No Python Selected</source>
<translation type="unfinished"></translation>
<translation>Kein Python ausgewählt</translation>
</message>
<message>
<source>Manage Python Interpreters</source>
<translation type="unfinished"></translation>
<translation>Python-Interpreter verwalten</translation>
</message>
<message>
<source>Python Language Server (%1)</source>
<translation type="unfinished"></translation>
<translation>Python Language Server (%1)</translation>
</message>
<message>
<source>Install Python language server (PyLS) for %1 (%2). The language server provides Python specific completion and annotation.</source>
<translation type="unfinished"></translation>
<translation>Python Language Server (PyLS) für %1 (%2) installieren. Der Language Server stellt Code-Vervollständigung und Annotationen für Python zur Verfügung.</translation>
</message>
<message>
<source>Searching Python binaries...</source>
<translation type="unfinished"></translation>
<translation>Suche ausführbare Python-Dateien...</translation>
</message>
<message>
<source>Found &quot;%1&quot; (%2)</source>
<translation type="unfinished"></translation>
<translation>&quot;%1&quot; (%2) gefunden</translation>
</message>
</context>
<context>

View File

@@ -246,7 +246,7 @@
</message>
<message>
<source>The directory %1 already contains a cbp file, which is recent enough. You can pass special arguments or change the used tool chain here and rerun CMake. Or simply finish the wizard directly.</source>
<translation type="obsolete"> %1 cbp 使 CMake</translation>
<translation type="obsolete"> %1 cbp 使 CMake</translation>
</message>
<message>
<source>The directory %1 does not contain a cbp file. Qt Creator needs to create this file by running CMake. Some projects require command line arguments to the initial CMake call.</source>
@@ -315,7 +315,7 @@
</message>
<message>
<source>&lt;b&gt;Unknown tool chain&lt;/b&gt;</source>
<translation type="obsolete">&lt;b&gt;&lt;/b&gt;</translation>
<translation type="obsolete">&lt;b&gt;&lt;/b&gt;</translation>
</message>
<message>
<source>Please enter the directory in which you want to build your project. </source>
@@ -3292,7 +3292,7 @@ at debugger startup.</source>
</message>
<message>
<source>&amp;Tool chain:</source>
<translation type="obsolete">(&amp;T)</translation>
<translation type="obsolete">(&amp;T)</translation>
</message>
<message>
<source>Break at &apos;&amp;main&apos;:</source>
@@ -3304,7 +3304,7 @@ at debugger startup.</source>
</message>
<message>
<source>Tool &amp;chain:</source>
<translation type="obsolete">(&amp;C)</translation>
<translation type="obsolete">(&amp;C)</translation>
</message>
<message>
<source>&amp;Host and port:</source>
@@ -4480,11 +4480,11 @@ Reason: %3</source>
</message>
<message>
<source>Tool chain:</source>
<translation type="obsolete"></translation>
<translation type="obsolete"></translation>
</message>
<message>
<source>&lt;Invalid tool chain&gt;</source>
<translation type="obsolete">&lt;&gt;</translation>
<translation type="obsolete">&lt;&gt;</translation>
</message>
<message>
<source>Generic Manager</source>
@@ -7385,11 +7385,11 @@ Preselects a desktop Qt for building the application if available.</source>
</message>
<message>
<source>using Qt version: &lt;b&gt;%1&lt;/b&gt;&lt;br&gt;with tool chain &lt;b&gt;%2&lt;/b&gt;&lt;br&gt;building in &lt;b&gt;%3&lt;/b&gt;</source>
<translation type="obsolete">使 Qt &lt;b&gt;%1&lt;/b&gt;&lt;br&gt; &lt;b&gt;%2&lt;/b&gt;&lt;br&gt; &lt;b&gt;%3&lt;/b&gt; </translation>
<translation type="obsolete">使 Qt &lt;b&gt;%1&lt;/b&gt;&lt;br&gt; &lt;b&gt;%2&lt;/b&gt;&lt;br&gt; &lt;b&gt;%3&lt;/b&gt; </translation>
</message>
<message>
<source>&lt;Invalid tool chain&gt;</source>
<translation type="obsolete">&lt;&gt;</translation>
<translation type="obsolete">&lt;&gt;</translation>
</message>
<message>
<source>General</source>
@@ -7426,7 +7426,7 @@ Preselects a desktop Qt for building the application if available.</source>
</message>
<message>
<source>&lt;No tool chain selected&gt;</source>
<translation type="obsolete">&lt;&gt;</translation>
<translation type="obsolete">&lt;&gt;</translation>
</message>
<message>
<source>An incompatible build exists in %1, which will be overwritten.</source>
@@ -7443,7 +7443,7 @@ Preselects a desktop Qt for building the application if available.</source>
</message>
<message>
<source>Tool chain:</source>
<translation type="obsolete"></translation>
<translation type="obsolete"></translation>
</message>
<message>
<source>Shadow build:</source>
@@ -7592,11 +7592,11 @@ Preselects a desktop Qt for building the application if available.</source>
</message>
<message>
<source>Qt Creator needs a build configuration set up to build. Configure a tool chain in Project mode.</source>
<translation type="obsolete">Qt Creator </translation>
<translation type="obsolete">Qt Creator </translation>
</message>
<message>
<source>Qt Creator needs a tool chain set up to build. Configure a tool chain in Project mode.</source>
<translation type="obsolete">Qt Creator </translation>
<translation type="obsolete">Qt Creator </translation>
</message>
<message>
<source>Cannot find Makefile. Check your build settings.</source>
@@ -7685,7 +7685,7 @@ Preselects a desktop Qt for building the application if available.</source>
</message>
<message>
<source>&lt;b&gt;Warning:&lt;/b&gt; The tool chain suggests using another mkspec.</source>
<translation type="obsolete">&lt;b&gt;&lt;/b&gt; 使 mkspec</translation>
<translation type="obsolete">&lt;b&gt;&lt;/b&gt; 使 mkspec</translation>
</message>
<message>
<source>Enable QML debugging:</source>
@@ -13411,7 +13411,7 @@ Requires &lt;b&gt;Qt 4.7.4&lt;/b&gt; or newer.</source>
</message>
<message>
<source>ABI detection failed: Make sure to use a matching tool chain when building.</source>
<translation type="obsolete">ABI 使</translation>
<translation type="obsolete">ABI 使</translation>
</message>
<message>
<source>No qmlscene installed.</source>
@@ -13466,7 +13466,7 @@ Requires &lt;b&gt;Qt 4.7.4&lt;/b&gt; or newer.</source>
<message>
<source>Building helper(s) with toolchain &apos;%1&apos;...
</source>
<translation>使 &apos;%1&apos; ...
<translation>使 &apos;%1&apos; ...
</translation>
</message>
<message>
@@ -13769,11 +13769,11 @@ with a password, which you can enter below.</source>
</message>
<message>
<source>The Symbian tool chain does not handle spaces in the project path &apos;%1&apos;.</source>
<translation type="obsolete">Symbian &apos;%1&apos; </translation>
<translation type="obsolete">Symbian &apos;%1&apos; </translation>
</message>
<message>
<source>The Symbian tool chain does not handle special characters in the project name &apos;%1&apos; well.</source>
<translation type="obsolete">Symbian &apos;%1&apos; </translation>
<translation type="obsolete">Symbian &apos;%1&apos; </translation>
</message>
</context>
<context>
@@ -18977,15 +18977,15 @@ Do you want to retry?</source>
</message>
<message>
<source>The following tool chain was already configured:&lt;br&gt;&amp;nbsp;%1&lt;br&gt;It was not configured again.</source>
<translation type="obsolete">&lt;br&gt;&amp;nbsp;%1&lt;br&gt;</translation>
<translation type="obsolete">&lt;br&gt;&amp;nbsp;%1&lt;br&gt;</translation>
</message>
<message>
<source>Duplicate Tool Chains detected</source>
<translation type="obsolete"></translation>
<translation type="obsolete"></translation>
</message>
<message>
<source>The following tool chains were already configured:&lt;br&gt;&amp;nbsp;%1&lt;br&gt;They were not configured again.</source>
<translation type="obsolete">&lt;br&gt;&amp;nbsp;%1&lt;br&gt;</translation>
<translation type="obsolete">&lt;br&gt;&amp;nbsp;%1&lt;br&gt;</translation>
</message>
</context>
<context>
@@ -20328,7 +20328,7 @@ if (a &amp;&amp;
</message>
<message>
<source>Tool chain:</source>
<translation type="obsolete"></translation>
<translation type="obsolete"></translation>
</message>
<message>
<source>Compiler:</source>
@@ -21416,7 +21416,7 @@ Do you want to retry?</source>
</message>
<message>
<source>No valid tool chain has been detected.&lt;br&gt;Define a correct tool chain in &quot;Options &gt; Tool Chains&quot;</source>
<translation type="obsolete">&lt;br&gt;</translation>
<translation type="obsolete">&lt;br&gt;</translation>
</message>
<message>
<source>Choose a build configuration:</source>
@@ -21424,7 +21424,7 @@ Do you want to retry?</source>
</message>
<message>
<source>Choose a tool chain:</source>
<translation type="obsolete"></translation>
<translation type="obsolete"></translation>
</message>
<message>
<source>Launching</source>
@@ -21562,11 +21562,11 @@ Do you want to retry?</source>
</message>
<message>
<source>No tool chain can produce code for this Qt version. Please define one or more tool chains.</source>
<translation type="obsolete"> Qt 使</translation>
<translation type="obsolete"> Qt 使</translation>
</message>
<message>
<source>Not all possible target environments can be supported due to missing tool chains.</source>
<translation type="obsolete"></translation>
<translation type="obsolete"></translation>
</message>
<message>
<source>The following ABIs are currently not supported:&lt;ul&gt;&lt;li&gt;%1&lt;/li&gt;&lt;/ul&gt;</source>
@@ -26093,11 +26093,11 @@ should a repository require SSH-authentication (see documentation on SSH and the
</message>
<message>
<source>Tool chain:</source>
<translation type="obsolete"></translation>
<translation type="obsolete"></translation>
</message>
<message>
<source>&lt;Invalid tool chain&gt;</source>
<translation type="obsolete">&lt;&gt;</translation>
<translation type="obsolete">&lt;&gt;</translation>
</message>
<message>
<source>Failed opening project &apos;%1&apos;: Project file does not exist</source>
@@ -26174,7 +26174,7 @@ should a repository require SSH-authentication (see documentation on SSH and the
</message>
<message>
<source>&lt;b&gt;Unknown tool chain&lt;/b&gt;</source>
<translation type="obsolete">&lt;b&gt;&lt;/b&gt;</translation>
<translation type="obsolete">&lt;b&gt;&lt;/b&gt;</translation>
</message>
</context>
<context>
@@ -26650,7 +26650,7 @@ references to elements in other files, loops, etc.)</source>
</message>
<message>
<source>&lt;p&gt;The project &lt;b&gt;%1&lt;/b&gt; is not yet configured.&lt;/p&gt;&lt;p&gt;Qt Creator uses the Qt version: &lt;b&gt;%2&lt;/b&gt; and the tool chain: &lt;b&gt;%3&lt;/b&gt; to parse the project. You can edit these in the &lt;b&gt;&lt;a href=&quot;edit&quot;&gt;options.&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;</source>
<translation type="obsolete">&lt;p&gt; &lt;b&gt;%1&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Qt Creator 使 Qt &lt;b&gt;%2&lt;/b&gt; &lt;b&gt;%3&lt;/b&gt; &lt;b&gt;&lt;a href=&quot;edit&quot;&gt;.&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;</translation>
<translation type="obsolete">&lt;p&gt; &lt;b&gt;%1&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Qt Creator 使 Qt &lt;b&gt;%2&lt;/b&gt; &lt;b&gt;%3&lt;/b&gt; &lt;b&gt;&lt;a href=&quot;edit&quot;&gt;.&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;</translation>
</message>
<message>
<source>Qt Version:</source>
@@ -26658,7 +26658,7 @@ references to elements in other files, loops, etc.)</source>
</message>
<message>
<source>Tool Chain:</source>
<translation type="obsolete"></translation>
<translation type="obsolete"></translation>
</message>
</context>
<context>

View File

@@ -248,7 +248,10 @@ bool FileInProjectFinder::findFileOrDirectory(const FilePath &originalPath, File
}
}
while (prefixToIgnore != -1) {
FilePath candidate = originalPath.resolvePath(m_projectDir);
QString candidateString = originalPath.toFSPathString();
candidateString.remove(0, prefixToIgnore);
candidateString.prepend(m_projectDir.toString());
const FilePath candidate = FilePath::fromString(candidateString);
const int matchLength = origLength - prefixToIgnore;
// FIXME: This might be a worse match than what we find later.
if (checkPath(candidate, matchLength, fileHandler, directoryHandler)) {

View File

@@ -62,6 +62,10 @@ bool FileReader::fetch(const FilePath &filePath, QIODevice::OpenMode mode)
return false;
}
m_data = *contents;
if (mode & QIODevice::Text)
m_data = m_data.replace("\r\n", "\n");
return true;
}

View File

@@ -122,7 +122,7 @@ static void findProcessPIDAndUser(QFutureInterface<PidUserPair> &fi, QStringList
if (!out.isEmpty()) {
QRegularExpressionMatch match;
qsizetype matchPos = out.indexOf(userIdPattern, 0, &match);
if (matchPos >= 0 && match.hasCaptured(1) && match.capturedLength(1) > 0) {
if (matchPos >= 0 && match.capturedLength(1) > 0) {
bool ok = false;
processUser = match.captured(1).toInt(&ok);
if (!ok)

View File

@@ -375,9 +375,15 @@ QSet<QString> internalTargets(const FilePath &proFile)
for (const CppEditor::ProjectPart::ConstPtr &projectPart : projectInfo->projectParts()) {
if (projectPart->buildTargetType != ProjectExplorer::BuildTargetType::Executable)
continue;
if (projectPart->projectFile == proFile.toString())
if (projectPart->projectFile != proFile.toString())
continue;
if (Utils::anyOf(projectPart->projectMacros, [](const ProjectExplorer::Macro &macro){
return macro.type == ProjectExplorer::MacroType::Define &&
macro.key == "QUICK_TEST_SOURCE_DIR";
})) {
result.insert(projectPart->buildSystemTarget);
}
}
return result;
}

View File

@@ -196,4 +196,10 @@ void ClangFormatGlobalConfigWidget::apply()
settings.write();
}
void ClangFormatGlobalConfigWidget::finish()
{
m_codeStyle->currentPreferences()->setTemporarilyReadOnly(
!ClangFormatSettings::instance().overrideDefaultFile());
}
} // namespace ClangFormat

View File

@@ -28,6 +28,7 @@ public:
QWidget *parent = nullptr);
~ClangFormatGlobalConfigWidget() override;
void apply() override;
void finish() override;
private:
void initCheckBoxes();

View File

@@ -171,12 +171,11 @@ clang::format::FormatStyle qtcStyle()
style.SpacesInCStyleCastParentheses = false;
style.SpacesInParentheses = false;
style.SpacesInSquareBrackets = false;
style.StatementMacros.emplace_back("Q_OBJECT");
style.StatementMacros.emplace_back("QT_BEGIN_NAMESPACE");
style.StatementMacros.emplace_back("QT_END_NAMESPACE");
addQtcStatementMacros(style);
style.Standard = FormatStyle::LS_Cpp11;
style.TabWidth = 4;
style.UseTab = FormatStyle::UT_Never;
style.Standard = FormatStyle::LS_Auto;
return style;
}
@@ -214,8 +213,9 @@ bool getCurrentOverriddenSettings(const Utils::FilePath &filePath)
const ProjectExplorer::Project *project = ProjectExplorer::SessionManager::projectForFile(
filePath);
return getProjectUseGlobalSettings(project)
? ClangFormatSettings::instance().overrideDefaultFile()
return getProjectUseGlobalSettings(project) ? !TextEditor::TextEditorSettings::codeStyle("Cpp")
->currentPreferences()
->isTemporarilyReadOnly()
: getProjectOverriddenSettings(project);
}
@@ -276,9 +276,44 @@ Utils::FilePath configForFile(const Utils::FilePath &fileName)
void addQtcStatementMacros(clang::format::FormatStyle &style)
{
static const std::vector<std::string> macros = {"Q_OBJECT",
static const std::vector<std::string> macros = {"Q_CLASSINFO",
"Q_ENUM",
"Q_ENUM_NS",
"Q_FLAG",
"Q_FLAG_NS",
"Q_GADGET",
"Q_GADGET_EXPORT",
"Q_INTERFACES",
"Q_MOC_INCLUDE",
"Q_NAMESPACE",
"Q_NAMESPACE_EXPORT",
"Q_OBJECT",
"Q_PROPERTY",
"Q_REVISION",
"Q_DISABLE_COPY",
"Q_SET_OBJECT_NAME",
"QT_BEGIN_NAMESPACE",
"QT_END_NAMESPACE"};
"QT_END_NAMESPACE",
"QML_ADDED_IN_MINOR_VERSION",
"QML_ANONYMOUS",
"QML_ATTACHED",
"QML_DECLARE_TYPE",
"QML_DECLARE_TYPEINFO",
"QML_ELEMENT",
"QML_EXTENDED",
"QML_EXTENDED_NAMESPACE",
"QML_EXTRA_VERSION",
"QML_FOREIGN",
"QML_FOREIGN_NAMESPACE",
"QML_IMPLEMENTS_INTERFACES",
"QML_INTERFACE",
"QML_NAMED_ELEMENT",
"QML_REMOVED_IN_MINOR_VERSION",
"QML_SINGLETON",
"QML_UNAVAILABLE",
"QML_UNCREATABLE",
"QML_VALUE_TYPE"};
for (const std::string &macro : macros) {
if (std::find(style.StatementMacros.begin(), style.StatementMacros.end(), macro)
== style.StatementMacros.end())

View File

@@ -628,10 +628,16 @@ void ClangFormatTest::testCommentBlock()
void ClangFormatTest::testClassIndentStructure()
{
insertLines({"class test {", " Q_OBJECT", " public:", "};"});
insertLines(
{"class test {", " Q_OBJECT", " QML_ELEMENT", " QML_SINGLETON", " public:", "};"});
m_indenter->indent(*m_cursor, QChar::Null, TextEditor::TabSettings());
QCOMPARE(documentLines(),
(std::vector<QString>{"class test {", " Q_OBJECT", "public:", "};"}));
(std::vector<QString>{"class test {",
" Q_OBJECT",
" QML_ELEMENT",
" QML_SINGLETON",
"public:",
"};"}));
}
void ClangFormatTest::testIndentInitializeVector()

View File

@@ -55,6 +55,7 @@ private:
connect(BuildManager::instance(), &BuildManager::buildQueueFinished,
this, &ProjectBuilder::onBuildFinished, Qt::QueuedConnection);
if (!BuildManager::isBuilding(target))
BuildManager::buildProjectWithDependencies(target->project());
}

View File

@@ -1469,7 +1469,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
// Android magic:
if (DeviceTypeKitAspect::deviceTypeId(k) == Android::Constants::ANDROID_DEVICE_TYPE) {
buildSteps()->appendStep(Android::Constants::ANDROID_BUILD_APK_ID);
const auto &bs = buildSteps()->steps().constLast();
const auto bs = buildSteps()->steps().constLast();
cmd.addArg("-DANDROID_PLATFORM:STRING="
+ bs->data(Android::Constants::AndroidNdkPlatform).toString());
auto ndkLocation = bs->data(Android::Constants::NdkLocation).value<FilePath>();

View File

@@ -100,7 +100,9 @@ Internal::PresetsData CMakeProject::combinePresets(Internal::PresetsData &cmakeP
Utils::sort(presetsList, [](const auto &left, const auto &right) {
const bool sameInheritance = left.inherits && right.inherits
&& left.inherits.value() == right.inherits.value();
if (!left.inherits || left.inherits.value().contains(right.name) || sameInheritance)
const bool leftInheritsRight = left.inherits
&& left.inherits.value().contains(right.name);
if ((left.inherits && !right.inherits) || leftInheritsRight || sameInheritance)
return false;
return true;
});

View File

@@ -391,7 +391,7 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input,
continue;
const auto mimeTypes = Utils::mimeTypesForFileName(si.path);
for (const auto &mime : mimeTypes)
if (mime.name() == headerMimeType)
if (mime.inherits(headerMimeType))
sources.push_back(sourceDir.absoluteFilePath(si.path));
}
}

View File

@@ -82,7 +82,7 @@ std::optional<PresetsDetails::Condition> parseCondition(const QJsonValue &jsonVa
if (type == "const") {
condition->type = type;
condition->constValue = object.value("const").toBool();
condition->constValue = object.value("value").toBool();
return condition;
}
@@ -215,14 +215,26 @@ bool parseConfigurePresets(const QJsonValue &jsonValue,
item.key = cacheKey.toUtf8();
item.type = CMakeConfigItem::typeStringToType(
cacheVariableObj.value("type").toString().toUtf8());
item.value = cacheVariableObj.value("type").toString().toUtf8();
item.value = cacheVariableObj.value("value").toString().toUtf8();
preset.cacheVariables.value() << item;
} else {
if (cacheValue.isBool()) {
preset.cacheVariables.value()
<< CMakeConfigItem(cacheKey.toUtf8(),
CMakeConfigItem::BOOL,
cacheValue.toBool() ? "ON" : "OFF");
} else if (CMakeConfigItem::toBool(cacheValue.toString()).has_value()) {
preset.cacheVariables.value()
<< CMakeConfigItem(cacheKey.toUtf8(),
CMakeConfigItem::BOOL,
cacheValue.toString().toUtf8());
} else {
preset.cacheVariables.value()
<< CMakeConfigItem(cacheKey.toUtf8(), cacheValue.toString().toUtf8());
}
}
}
const QJsonObject environmentObj = object.value("environment").toObject();
for (const QString &envKey : environmentObj.keys()) {

View File

@@ -85,7 +85,7 @@ QVariant FilterItem::data(int column, int role) const
return m_filter->shortcutString();
break;
case FilterIncludedByDefault:
if (role == Qt::CheckStateRole || role == SortRole || role == Qt::EditRole)
if (role == Qt::CheckStateRole || role == SortRole)
return m_filter->isIncludedByDefault() ? Qt::Checked : Qt::Unchecked;
break;
default:
@@ -102,7 +102,7 @@ Qt::ItemFlags FilterItem::flags(int column) const
if (column == FilterPrefix)
return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable;
if (column == FilterIncludedByDefault)
return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsUserCheckable;
return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable;
return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
}

View File

@@ -397,7 +397,7 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc)
const Environment thisEnvironment = rc->environment();
const auto tab = std::find_if(m_runControlTabs.begin(), m_runControlTabs.end(),
[&](const RunControlTab &tab) {
if (!tab.runControl || tab.runControl->isRunning())
if (!tab.runControl || tab.runControl->isRunning() || tab.runControl->isStarting())
return false;
return thisCommand == tab.runControl->commandLine()
&& thisWorkingDirectory == tab.runControl->workingDirectory()

View File

@@ -505,7 +505,6 @@ QmlJSEditorDocumentPrivate::QmlJSEditorDocumentPrivate(QmlJSEditorDocument *pare
this, &QmlJSEditorDocumentPrivate::updateOutlineModel);
modelManager->updateSourceFiles(Utils::FilePaths({parent->filePath()}), false);
settingsChanged();
}
QmlJSEditorDocumentPrivate::~QmlJSEditorDocumentPrivate()
@@ -818,6 +817,8 @@ QmlJSEditorDocument::QmlJSEditorDocument(Utils::Id id)
setId(id);
connect(this, &TextEditor::TextDocument::tabSettingsChanged,
d, &Internal::QmlJSEditorDocumentPrivate::invalidateFormatterCache);
connect(this, &TextEditor::TextDocument::openFinishedSuccessfully,
d, &Internal::QmlJSEditorDocumentPrivate::settingsChanged);
setSyntaxHighlighter(new QmlJSHighlighter(document()));
setCodec(QTextCodec::codecForName("UTF-8")); // qml files are defined to be utf-8
setIndenter(new Internal::Indenter(document()));

View File

@@ -211,9 +211,9 @@ static QList<ExampleItem *> parseTutorials(QXmlStreamReader *reader, const FileP
item->type = Tutorial;
QXmlStreamAttributes attributes = reader->attributes();
item->name = attributes.value(QLatin1String("name")).toString();
item->projectPath = projectsOffset
/ attributes.value(QLatin1String("projectPath")).toString();
item->hasSourceCode = !item->projectPath.isEmpty();
const QString projectPath = attributes.value(QLatin1String("projectPath")).toString();
item->projectPath = projectsOffset / projectPath;
item->hasSourceCode = !projectPath.isEmpty();
item->imageUrl = Utils::StyleHelper::dpiSpecificImageFile(
attributes.value(QLatin1String("imageUrl")).toString());
QPixmapCache::remove(item->imageUrl);

View File

@@ -28,23 +28,23 @@ int main(int argc, char *argv[])
static SafeRenderer::QSafeLayoutResourceReader layout("/layoutData/main/main.srl");
#if defined(USE_OUTPUTVERIFIER)
static OutputVerifier outputVerifier;
static SafeRenderer::OutputVerifier outputVerifier;
#if defined(HOST_BUILD)
//In host environment the TestVerifier must be explicitly created.
//In OpeWFD adaptation the MISRVerifier instance is created in the SafeWindow adaptation.
static TestVerifier testVerifier(outputVerifier);
static SafeRenderer::TestVerifier testVerifier(outputVerifier);
#endif
SafeWindow telltaleWindow(layout.size(), QSafePoint(0U, 0U), outputVerifier);
SafeRenderer::SafeWindow telltaleWindow(layout.size(), SafeRenderer::QSafePoint(0U, 0U), outputVerifier);
#else
SafeWindow telltaleWindow(layout.size(), QSafePoint(0U, 0U));
SafeRenderer::SafeWindow telltaleWindow(layout.size(), SafeRenderer::QSafePoint(0U, 0U));
#endif
static SafeRenderer::StateManager stateManager(telltaleWindow, layout);
telltaleWindow.requestUpdate(); //Request is required because eventHandler is not running yet.
#if defined(USE_OUTPUTVERIFIER)
EventHandler msgHandler(stateManager, telltaleWindow, outputVerifier);
SafeRenderer::EventHandler msgHandler(stateManager, telltaleWindow, outputVerifier);
#else
EventHandler msgHandler(stateManager, telltaleWindow);
SafeRenderer::EventHandler msgHandler(stateManager, telltaleWindow);
#endif
#if defined(HOST_BUILD)

View File

@@ -108,6 +108,9 @@ void CodeStyleEditor::finish()
{
if (m_widget)
m_widget->finish();
if (m_additionalGlobalSettingsWidget)
m_additionalGlobalSettingsWidget->finish();
}
} // TextEditor

View File

@@ -2913,9 +2913,9 @@ void TextEditorWidget::insertCodeSnippet(const QTextCursor &cursor_arg,
d->m_document->autoIndent(cursor);
cursor.endEditBlock();
const QColor &occurrencesColor
const QColor occurrencesColor
= textDocument()->fontSettings().toTextCharFormat(C_OCCURRENCES).background().color();
const QColor &renameColor
const QColor renameColor
= textDocument()->fontSettings().toTextCharFormat(C_OCCURRENCES_RENAME).background().color();
for (const CursorPart &part : cursorParts) {

View File

@@ -134,8 +134,10 @@ QPainterPath TextEditorOverlay::createSelectionPath(const QTextCursor &begin, co
int x = line.cursorToX(pos);
lineRect.setLeft(x - borderWidth);
lineRect.setRight(x + borderWidth);
lineRect.setBottom(lineRect.bottom() + borderWidth);
QPainterPath path;
path.addRect(lineRect);
path.translate(offset);
return path;
}
@@ -250,6 +252,8 @@ void TextEditorOverlay::paintSelection(QPainter *painter,
return;
QPainterPath path = createSelectionPath(begin, end, clip);
if (path.isEmpty())
return;
painter->save();
QColor penColor = fg;
@@ -305,6 +309,8 @@ void TextEditorOverlay::fillSelection(QPainter *painter,
return;
QPainterPath path = createSelectionPath(begin, end, clip);
if (path.isEmpty())
return;
painter->save();
painter->translate(-.5, -.5);

View File

@@ -133,7 +133,7 @@ void TextMark::paintAnnotation(QPainter &painter,
const QColor &markColor = annotationColor();
const FontSettings &fontSettings = m_baseTextDocument->fontSettings();
const AnnotationColors &colors = AnnotationColors::getAnnotationColors(
const AnnotationColors colors = AnnotationColors::getAnnotationColors(
markColor.isValid() ? markColor : painter.pen().color(),
fontSettings.toTextCharFormat(C_TEXT).background().color());

View File

@@ -155,7 +155,7 @@ void FunctionGraphicsItem::paint(QPainter *painter,
painter->save();
QRectF rect = this->rect();
const QColor &color = brush().color();
const QColor color = brush().color();
if (option->state & QStyle::State_Selected) {
QLinearGradient gradient(0, 0, rect.width(), 0);
gradient.setColorAt(0, color.darker(100));

View File

@@ -50,10 +50,6 @@ def main():
}
for useClang in [False, True]:
with TestSection(getCodeModelString(useClang)):
if (useClang and platform.system() in ('Windows', 'Microsoft')
and JIRA.isBugStillOpen(18607)):
test.warning("Skipping unstable tests on Windows", "See QTCREATORBUG-18607")
continue
if not startCreatorVerifyingClang(useClang):
continue
projectName = createNewNonQtProject(tempDir(), "project-csup03",

View File

@@ -42,8 +42,14 @@ def performAutoCompletionTest(editor, lineToStartRegEx, linePrefix, testFunc, *f
def checkIncludeCompletion(editor, isClangCodeModel):
test.log("Check auto-completion of include statements.")
# define special handlings
noProposal = ["detail/hea"]
noProposal = []
specialHandling = {"ios":"iostream", "cstd":"cstdio"}
if isClangCodeModel:
specialHandling["QDe"] = "QDebug"
for i in specialHandling.keys():
specialHandling[i] = " %s>" % specialHandling[i]
else:
noProposal += ["detail/hea"]
# define test function to perform the _real_ auto completion test on the current line
def testIncl(currentLine, *args):
@@ -69,25 +75,24 @@ def checkIncludeCompletion(editor, isClangCodeModel):
def checkSymbolCompletion(editor, isClangCodeModel):
test.log("Check auto-completion of symbols.")
# define special handlings
expectedSuggestion = {"in":["internal", "int", "INT_MAX", "INT_MIN"],
expectedSuggestion = {"in":["internal", "int", "intmax_t"],
"Dum":["Dummy", "dummy"], "Dummy::O":["ONE","one"],
"dummy.":["foo", "bla", "ONE", "one", "PI", "sfunc", "v1", "v2", "v3"],
"dummy.":["one", "ONE", "PI", "v1", "v2", "v3"],
"dummy.o":["one", "ONE"], "Dummy::In":["Internal", "INT"],
"Dummy::Internal::":["DOUBLE", "one"]
}
missing = ["Dummy::s", "Dummy::P", "dummy.b", "dummy.bla(", "internal.o", "freefunc2"]
expectedResults = {"dummy.":"dummy.foo(", "Dummy::s":"Dummy::sfunc()",
expectedResults = {"Dummy::s":"Dummy::sfunc()",
"Dummy::P":"Dummy::PI", "dummy.b":"dummy.bla(", "dummy.bla(":"dummy.bla(",
"internal.o":"internal.one", "freefunc2":"freefunc2(",
"using namespace st":"using namespace std", "afun":"afunc()"}
if isClangCodeModel:
missing.remove("internal.o")
expectedSuggestion["in"] = ["internal", "int"] # QTCREATORBUG-22728
expectedSuggestion["internal.o"] = ["one", "operator="]
missing = ["dummy.bla("]
expectedSuggestion["internal.o"] = ["one"]
if platform.system() in ('Microsoft', 'Windows'):
expectedSuggestion["using namespace st"] = ["std", "stdext"]
else:
expectedSuggestion["using namespace st"] = ["std", "struct ", "struct template"]
expectedSuggestion["using namespace st"] = ["std", "struct", "struct template"]
else:
expectedSuggestion["using namespace st"] = ["std", "st"]
# define test function to perform the _real_ auto completion test on the current line
@@ -101,26 +106,24 @@ def checkSymbolCompletion(editor, isClangCodeModel):
found = []
if propShown:
proposalListView = waitForObject(':popupFrame_Proposal_QListView')
found = dumpItems(proposalListView.model())
found = [i.strip() for i in dumpItems(proposalListView.model())]
diffShownExp = set(expectedSug.get(symbol, [])) - set(found)
if not test.verify(len(diffShownExp) == 0,
"Verify if all expected suggestions could be found"):
test.log("Expected but not found suggestions: %s" % diffShownExp,
"%s | %s" % (expectedSug[symbol], str(found)))
# select first item of the expected suggestion list
doubleClickItem(':popupFrame_Proposal_QListView', expectedSug.get(symbol, found)[0],
suggestionToClick = expectedSug.get(symbol, found)[0]
if isClangCodeModel:
suggestionToClick = " " + suggestionToClick
doubleClickItem(':popupFrame_Proposal_QListView', suggestionToClick,
5, 5, 0, Qt.LeftButton)
changedLine = str(lineUnderCursor(editor)).strip()
if symbol in expectedRes:
exp = expectedRes[symbol]
else:
exp = (symbol[:max(symbol.rfind(":"), symbol.rfind(".")) + 1]
+ expectedSug.get(symbol, found)[0])
if isClangCodeModel and changedLine != exp and JIRA.isBugStillOpen(15483):
test.xcompare(changedLine, exp, "Verify completion matches (QTCREATORBUG-15483).")
test.verify(changedLine.startswith(exp.replace("(", "").replace(")", "")),
"Verify completion starts with expected string.")
else:
+ expectedSug.get(symbol, found)[0]).strip()
test.compare(changedLine, exp, "Verify completion matches.")
performAutoCompletionTest(editor, ".*Complete symbols.*", "//",
@@ -143,6 +146,10 @@ def main():
return
editor = getEditorForFileSuffix("main.cpp")
if editor:
if useClang:
test.log("Wait for parsing to finish...")
progressBarWait(15000)
test.log("Parsing done.")
checkIncludeCompletion(editor, useClang)
checkSymbolCompletion(editor, useClang)
invokeMenuItem('File', 'Revert "main.cpp" to Saved')

View File

@@ -87,7 +87,6 @@ def main():
type(resultWidget, "<Return>")
waitFor("__getUrl__() != url or selText != __getSelectedText__()", 20000)
verifySelection(searchKeyword)
if not (searchKeyword == "QODBC" and JIRA.isBugStillOpen(10331)):
verifyUrl(urlDictionary[searchKeyword])
else:
test.verify(waitFor("noMatch in "

View File

@@ -48,14 +48,12 @@ def main():
pass
# open MyComponent.qml file for verification
docOpened = openDocument(myCompTE)
if JIRA.isBugStillOpen(28985):
# Work around QTCREATORBUG-28985
test.xverify(docOpened, "Was MyComponent.qml properly generated in project explorer?")
saveAndExit()
return
if not test.verify(docOpened, "Was MyComponent.qml properly generated in project explorer?"):
test.fatal("Could not open MyComponent.qml.")
saveAndExit()
return
# The workaround will be removed in master branch
# Following dead code left in intentionally to still allow merging forward changes in it.
editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
codeText = str(editorArea.plainText)
# there should be Text item in new file

View File

@@ -275,7 +275,9 @@ def __getCDB__():
"C:\\Program Files\\Windows Kits\\8.1\\Debuggers\\x86",
"C:\\Program Files\\Windows Kits\\8.1\\Debuggers\\x64",
"C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x86",
"C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64"]
"C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64",
"C:\\Program Files\\Windows Kits\\10\\Debuggers\\x86",
"C:\\Program Files\\Windows Kits\\10\\Debuggers\\x64"]
for cdbPath in possibleLocations:
cdb = os.path.join(cdbPath, "cdb.exe")
if os.path.exists(cdb):