Merge remote-tracking branch 'origin/7.0'
Change-Id: I967615c66a11bb4823a6b403ca59e63dd1971032
BIN
doc/qtcreator/images/icons/message.png
Normal file
After Width: | Height: | Size: 204 B |
Before Width: | Height: | Size: 404 B After Width: | Height: | Size: 404 B |
BIN
doc/qtcreator/images/icons/savefile.png
Normal file
After Width: | Height: | Size: 142 B |
BIN
doc/qtcreator/images/icons/stopwatch.png
Normal file
After Width: | Height: | Size: 283 B |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 22 KiB |
BIN
doc/qtcreator/images/qtcreator-cmake-generator.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
doc/qtcreator/images/qtcreator-cmake-kit-configuration.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
doc/qtcreator/images/qtcreator-find-incremental.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 17 KiB |
BIN
doc/qtcreator/images/qtcreator-logging-category-viewer.png
Normal file
After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 29 KiB |
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Copyright (C) 2022 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -31,17 +31,31 @@
|
||||
\title CMake Build Configuration
|
||||
|
||||
Configuring medium-sized to large CMake projects in \QC can be a
|
||||
challenge due to the number of options that you need to pass to
|
||||
challenge due to the number of variables that you need to pass to
|
||||
CMake to configure the project correctly. To make this easier,
|
||||
\QC creates an initial configuration for you based on the kit
|
||||
settings and displays it in the \uicontrol {Initial CMake parameters}
|
||||
field and in a table that lists the parameter names and values.
|
||||
settings and displays it in \uicontrol {Initial Configuration} in
|
||||
the \l{Specifying Build Settings}{Build Settings} of the project.
|
||||
|
||||
\image qtcreator-cmake-build-settings-initial.png "CMake build settings"
|
||||
|
||||
Parameter names are listed in the \uicontrol Key column. Names with a
|
||||
common prefix (up to the first underscore character) are grouped under
|
||||
the prefix.
|
||||
You can view and edit the actual values of the variables that are passed
|
||||
to CMake. Variable names are listed in the \uicontrol Key column and their
|
||||
current values in the \uicontrol Value column. For more information
|
||||
about the available variables, see \l{CMake: cmake-variables(7)}.
|
||||
For more information about Qt-specific variables, see
|
||||
\l{CMake Variable Reference}.
|
||||
|
||||
You can specify additional CMake options, such as \c {--find-debug},
|
||||
\c {--preset}, \c {--trace-expand}, or \c {--warn-uninitialized}, in
|
||||
\uicontrol {Additional CMake options}. For more information about
|
||||
the available options, see \l{CMake: cmake(1)}.
|
||||
|
||||
After successfully running CMake, you can view and modify the current
|
||||
configuration in \uicontrol {Current Configuration}.
|
||||
|
||||
Select \uicontrol {Kit Configuration} to edit the CMake settings for the
|
||||
build and run kit selected for the project.
|
||||
|
||||
\section1 Multi-Config Support
|
||||
|
||||
@@ -59,35 +73,36 @@
|
||||
|
||||
When developing with Qt 6 for iOS, only the Xcode generator is supported.
|
||||
|
||||
\section1 Modifying Initial Parameters
|
||||
\section1 Modifying Variable Values
|
||||
|
||||
In the \uicontrol Value column, you can view and edit the actual values
|
||||
of the parameters that are passed to CMake.
|
||||
You can view and edit the actual values of the variables that
|
||||
are passed to CMake in \uicontrol {Initial Configuration} or
|
||||
\uicontrol {Current Configuration}.
|
||||
|
||||
\image qtcreator-cmake-build-settings.png "CMake parameters"
|
||||
\image qtcreator-cmake-build-settings.png "CMake variables"
|
||||
|
||||
To view all parameters, select the \uicontrol Advanced check box.
|
||||
To view all variables, select the \uicontrol Advanced check box.
|
||||
|
||||
To add parameters, select \uicontrol Add, and then select the type of
|
||||
the parameter that you are adding: \uicontrol Boolean, \uicontrol String,
|
||||
To add variables, select \uicontrol Add, and then select the type of
|
||||
the variable that you are adding: \uicontrol Boolean, \uicontrol String,
|
||||
\uicontrol Directory, or \uicontrol File.
|
||||
|
||||
To change the type of the selected parameter, right-click the
|
||||
parameter name in the \uicontrol Key column, and then select
|
||||
To change the type of the selected variable, right-click the
|
||||
variable name in the \uicontrol Key column, and then select
|
||||
\uicontrol {Force to bool}, \uicontrol {Force to file},
|
||||
\uicontrol {Force to directory}, or \uicontrol {Force to string}
|
||||
in the context menu.
|
||||
|
||||
To copy the name or value of the selected parameter to the clipboard,
|
||||
To copy the name or value of the selected variable to the clipboard,
|
||||
select \uicontrol Copy in the context menu.
|
||||
|
||||
To modify the value of a parameter, double-click it, or select it,
|
||||
To modify the value of a variable, double-click it, or select it,
|
||||
and then select \uicontrol Edit.
|
||||
|
||||
You can apply actions to multiple parameters at a time. To clear
|
||||
You can apply actions to multiple variables at a time. To clear
|
||||
the selection, select \uicontrol {Clear Selection}.
|
||||
|
||||
To remove the selected parameters, select \uicontrol Unset. To undo
|
||||
To remove the selected variables, select \uicontrol Unset. To undo
|
||||
the removal, select \uicontrol Set.
|
||||
|
||||
To reset all the changes that you made, select \uicontrol Reset.
|
||||
@@ -95,23 +110,27 @@
|
||||
To modify the environment variable values for the CMake build environment,
|
||||
select \uicontrol {Batch Edit}. For more information, see \l{Batch Editing}.
|
||||
|
||||
To save the changes, select \uicontrol {Apply Configuration Changes}.
|
||||
Keep in mind that a configuration change might trigger a follow-up
|
||||
configuration change.
|
||||
To build using the current configuration, select \uicontrol {Run CMake}.
|
||||
While building, the button text changes to \uicontrol {Stop CMake}. Select
|
||||
the button to cancel the current build.
|
||||
|
||||
The parameter values that you change are passed via \c -D<option>=<value>
|
||||
The variable values that you change are passed via \c -D<option>=<value>
|
||||
to CMake, which stores the options in the CMakeCache.txt file. This means
|
||||
that if you remove the build directory, all the custom parameters that are
|
||||
not part of the initial CMake parameters are also removed.
|
||||
that if you remove the build directory, all the custom variables that are
|
||||
not part of the initial CMake configuration are also removed.
|
||||
|
||||
To reconfigure a project using the modified parameters,
|
||||
To reconfigure a project using the modified variable values,
|
||||
select \uicontrol Build > \uicontrol {Clear CMake Configuration}, which
|
||||
removes the CMakeCache.txt file. This enables you to do a full rebuild.
|
||||
|
||||
\section1 Re-configuring with Initial Parameters
|
||||
\section1 Re-configuring with Initial Variables
|
||||
|
||||
To reset CMake parameters to the initial ones, select
|
||||
\uicontrol {Re-configure with Initial Parameters}.
|
||||
To reset CMake variables to the initial ones, select
|
||||
\uicontrol {Re-configure with Initial Variables} in
|
||||
\uicontrol {Initial Configuration}. \QC deletes the current CMake
|
||||
configuration and runs CMake. The initial configuration values are
|
||||
stored in the CMakeLists.txt.user file, so deleting a build directory
|
||||
does not delete the initial configuration.
|
||||
|
||||
To be asked before \QC resets the changes, select \uicontrol Tools >
|
||||
\uicontrol Options > \uicontrol {Build & Run} > \uicontrol CMake >
|
||||
@@ -167,14 +186,16 @@
|
||||
\li Install Ninja.
|
||||
\li Add the path to the Ninja executable to the value of the PATH system
|
||||
variable.
|
||||
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol Kits, and
|
||||
then select the build and run kit for the project.
|
||||
\li In \uicontrol Projects > \uicontrol {Build & Run} > \uicontrol Build
|
||||
> \uicontrol {Build Settings}, select \uicontrol {Kit Configuration}.
|
||||
\image qtcreator-cmake-kit-configuration.png "Kit CMake Configuration dialog"
|
||||
\li Select \uicontrol Change next to the \uicontrol {CMake generator}
|
||||
field to open the \uicontrol {CMake Generator} dialog.
|
||||
\image qtcreator-build-steps-cmake-ninja.png
|
||||
\li In the \uicontrol Generator field, select \uicontrol Ninja.
|
||||
\li Select \uicontrol OK to return to the \uicontrol Kits tab.
|
||||
\li Select \uicontrol OK or \uicontrol Apply to save your changes.
|
||||
\image qtcreator-cmake-generator.png "CMake Generator dialog"
|
||||
\li In \uicontrol Generator, select \uicontrol Ninja.
|
||||
\li Select \uicontrol OK to save your changes and close the dialog.
|
||||
\li Close the \uicontrol {Kit CMake Configuration} dialog to return to
|
||||
\uicontrol {Build Settings}.
|
||||
\endlist
|
||||
|
||||
\note To make sure that old build artifacts don't get in the way
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2022 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -37,7 +37,9 @@
|
||||
\li Press \key {Ctrl+F} or select \uicontrol Edit >
|
||||
\uicontrol {Find/Replace} > \uicontrol {Find/Replace}.
|
||||
|
||||
\li Enter the text you are looking for.
|
||||
\li In \uicontrol Find, enter the text you are looking for.
|
||||
|
||||
\image qtcreator-find-incremental.png
|
||||
|
||||
If the text is found, all occurrences are highlighted as you type.
|
||||
|
||||
@@ -46,10 +48,14 @@
|
||||
occurrence click \inlineimage icons/prev.png
|
||||
(\uicontrol {Find Previous}), or press \key {Shift+F3}.
|
||||
|
||||
\li To select all found occurrences in a file, select
|
||||
\uicontrol {Select All}.
|
||||
|
||||
\endlist
|
||||
|
||||
You can restrict the search in the \uicontrol Find field by selecting one
|
||||
or several search criteria:
|
||||
You can restrict the search in the \uicontrol Find field by selecting
|
||||
\inlineimage icons/qtcreator-new-search-icon.png
|
||||
. Select one or several search criteria:
|
||||
|
||||
\list
|
||||
|
||||
@@ -114,6 +120,8 @@
|
||||
\uicontrol Tools > \uicontrol Options > \uicontrol {Text Editor} >
|
||||
\uicontrol Display > \uicontrol {Highlight search results on the scrollbar}.
|
||||
|
||||
To search using more advanced options, select \uicontrol Advanced.
|
||||
|
||||
\section1 Advanced Search
|
||||
|
||||
To search through projects, files on a file system, files in all project
|
||||
|
@@ -113,6 +113,14 @@
|
||||
\externalpage https://doc.qt.io/QtApplicationManager/
|
||||
\title Qt Application Manager
|
||||
*/
|
||||
/*!
|
||||
\externalpage https://cmake.org/cmake/help/latest/manual/cmake.1.html
|
||||
\title CMake: cmake(1)
|
||||
*/
|
||||
/*!
|
||||
\externalpage https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html
|
||||
\title CMake: cmake-variables(7)
|
||||
*/
|
||||
/*!
|
||||
\externalpage https://cmake.org/cmake/help/latest/command/install.html
|
||||
\title CMake: install command
|
||||
|
@@ -0,0 +1,97 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2022 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator 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.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\page creator-logging-viewer.html
|
||||
\if defined(qtdesignstudio)
|
||||
\previouspage creator-quick-ui-forms.html
|
||||
\else
|
||||
\previouspage creator-task-lists.html
|
||||
\endif
|
||||
\nextpage creator-telemetry.html
|
||||
|
||||
\title Inspecting Internal Logs
|
||||
|
||||
You can inspect internal log messages of \QC at runtime without having to
|
||||
restart it or configure the logging rules. Log messages are helpful when
|
||||
you develop \QC, need to investigate some problem you are facing, or want
|
||||
to take a look behind the scenes.
|
||||
|
||||
To open the log viewer and start collecting log information, select
|
||||
\uicontrol Tools > \uicontrol {Debug \QC} > \uicontrol {Show Logs}.
|
||||
|
||||
\image qtcreator-logging-category-viewer.png
|
||||
|
||||
The viewer displays log messages from the selected logging categories.
|
||||
If you have logging rules defined, they might be listed on startup.
|
||||
Otherwise, the list of categories is extended while you are using \QC.
|
||||
|
||||
\note Messages are not cached, so the viewer displays only messages that
|
||||
are recorded after you enabled a category.
|
||||
|
||||
\section1 Viewing Logs
|
||||
|
||||
To enable logging categories, select them in \uicontrol Category.
|
||||
\uicontrol Type specifies the minimum level of messages to display from
|
||||
the respective category. To change the minimum level, double-click the
|
||||
type and select another value.
|
||||
|
||||
If you enable more than one category, you can specify different colors for
|
||||
the messages in each category. Double-click the value of \uicontrol Color to
|
||||
pick colors for the categories.
|
||||
|
||||
To store information about the currently enabled categories, select
|
||||
\uicontrol {Save Enabled as Preset} in the context-menu. To load the
|
||||
saved information, select \uicontrol {Update from Preset}.
|
||||
|
||||
To save the content of the displayed messages, select
|
||||
\inlineimage icons/savefile.png
|
||||
(\uicontrol {Save Log}). To copy all or selected messages, select
|
||||
\uicontrol {Copy All} or \uicontrol {Copy Selected Logs} in the
|
||||
context menu.
|
||||
|
||||
To clean the content of displayed messages select
|
||||
\inlineimage icons/clean_pane_small.png
|
||||
(\uicontrol Clear).
|
||||
|
||||
To temporarily stop logging, select \inlineimage icons/stop_small.png
|
||||
(\uicontrol {Stop Logging}). To continue logging, select
|
||||
\inlineimage icons/run_small.png
|
||||
(\uicontrol {Start Logging}).
|
||||
|
||||
By default, logging categories and messages coming directly from Qt are
|
||||
disabled. To display them, select \inlineimage icons/qtlogo-16.png
|
||||
(\uicontrol {Toggle logging of Qt internal loggings.})
|
||||
|
||||
New messages automatically scroll the message display to the bottom.
|
||||
To stop automatic scrolling, toggle \inlineimage icons/arrowdown.png
|
||||
(\uicontrol {Auto Scroll}).
|
||||
|
||||
By default, messages are listed with a timestamp, without message
|
||||
type. To hide and show this information, toggle
|
||||
\inlineimage icons/stopwatch.png
|
||||
(\uicontrol Timestamps) and \inlineimage icons/message.png
|
||||
(\uicontrol {Message Types}).
|
||||
*/
|
@@ -32,7 +32,7 @@
|
||||
/*!
|
||||
\previouspage creator-editor-external.html
|
||||
\page creator-task-lists.html
|
||||
\nextpage creator-telemetry.html
|
||||
\nextpage creator-logging-viewer.html
|
||||
|
||||
\title Showing Task List Files in Issues Pane
|
||||
|
||||
|
@@ -28,7 +28,7 @@
|
||||
\if defined(qtdesignstudio)
|
||||
\previouspage creator-quick-ui-forms.html
|
||||
\else
|
||||
\previouspage creator-task-lists.html
|
||||
\previouspage creator-logging-viewer.html
|
||||
\endif
|
||||
\nextpage collecting-usage-statistics.html
|
||||
|
||||
|
@@ -57,7 +57,7 @@
|
||||
|
||||
The process to add files to deploy depends on the build system you use.
|
||||
|
||||
\section2 CMake
|
||||
\section2 CMake Builds
|
||||
|
||||
When using CMake as the build system, use the \l{CMake: install command}
|
||||
{install} command in the CMakeLists.txt file to add the missing files.
|
||||
@@ -75,7 +75,7 @@
|
||||
)
|
||||
\endcode
|
||||
|
||||
\section2 qmake
|
||||
\section2 qmake Builds
|
||||
|
||||
When using qmake, edit the \l{Variables#installs}{INSTALLS variable} in
|
||||
the project \c .pro file.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Copyright (C) 2022 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -95,6 +95,11 @@
|
||||
corresponding source code by clicking the error message or by using
|
||||
keyboard shortcuts.
|
||||
|
||||
\li \l{Inspecting Internal Logs}
|
||||
|
||||
You can inspect internal log messages of \QC. They may be
|
||||
helpful when developing \QC or investigating problems.
|
||||
|
||||
\li \l{Managing Data Collection}
|
||||
|
||||
If you agreed to pseudonymous data collection during \QC
|
||||
|
@@ -113,6 +113,16 @@
|
||||
git ls-files "*.cpp" "*.h" > MyProject.files
|
||||
\endcode
|
||||
|
||||
\section2 Precompiled Headers
|
||||
|
||||
To use precompiled headers in a generic project, add the \c pch tag after
|
||||
a file path in the \c .files file, separated by the pipe character (|).
|
||||
For example:
|
||||
|
||||
\badcode
|
||||
src/pch.h|pch
|
||||
\endcode
|
||||
|
||||
\section1 Specifying Include Paths and Framework Paths
|
||||
|
||||
The include paths are specified in the \tt{.includes} file, one include
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Copyright (C) 2022 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -57,9 +57,11 @@
|
||||
|
||||
\section1 Managing Build Configurations
|
||||
|
||||
Specify build settings in \uicontrol Projects > \uicontrol {Build & Run}
|
||||
> \uicontrol Build > \uicontrol {Build Settings}.
|
||||
|
||||
\image qtcreator-build-configurations.png "Build Settings"
|
||||
|
||||
You specify build settings in the \uicontrol Projects mode.
|
||||
To add a new build configuration, click \uicontrol Add and select the type of
|
||||
configuration you would like to add. The options you have depend on the
|
||||
build system that you selected for the project. You can add as many build
|
||||
|
@@ -228,6 +228,7 @@
|
||||
\li \l{Keyboard Shortcuts}
|
||||
\li \l{Using External Tools}
|
||||
\li \l{Showing Task List Files in Issues Pane}
|
||||
\li \l{Inspecting Internal Logs}
|
||||
\li \l{Managing Data Collection}
|
||||
\list
|
||||
\li \l {Collecting Usage Statistics}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Copyright (C) 2022 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -107,8 +107,11 @@
|
||||
algorithm for calculating the differences, select \uicontrol Patience.
|
||||
To only show text changes, select \uicontrol {Ignore Whitespace}.
|
||||
|
||||
To filter log entries by the text in the commit message or by strings that
|
||||
were added or removed, select \uicontrol Filter.
|
||||
To filter log entries by the text in the commit message, by strings that
|
||||
were added or removed, or by author, select \uicontrol Filter. Enter a
|
||||
search sting in the \uicontrol {Filter by message},
|
||||
\uicontrol {Filter by content}, or \uicontrol {Filter by author} field.
|
||||
Select \uicontrol {Case Sensitive} to make filtering consider case.
|
||||
|
||||
To follow only the first parent on merge commits, select
|
||||
\uicontrol {First Parent}.
|
||||
@@ -116,6 +119,9 @@
|
||||
To toggle between textual and visual representation of the log, select
|
||||
\uicontrol Graph.
|
||||
|
||||
To toggle color coding of different parts of the log entries, select
|
||||
\uicontrol Color.
|
||||
|
||||
To show log also for previous names of the file, select \uicontrol Follow.
|
||||
|
||||
Select \inlineimage icons/reload_gray.png
|
||||
|
21
qbs/imports/QtcManualtest.qbs
Normal file
@@ -0,0 +1,21 @@
|
||||
import qbs
|
||||
import qbs.FileInfo
|
||||
|
||||
QtcProduct {
|
||||
type: ["application"]
|
||||
|
||||
Depends { name: "Qt.testlib" }
|
||||
Depends { name: "copyable_resource" }
|
||||
targetName: "tst_" + name.split(' ').join("")
|
||||
|
||||
cpp.rpaths: [
|
||||
project.buildDirectory + '/' + qtc.ide_library_path,
|
||||
project.buildDirectory + '/' + qtc.ide_plugin_path
|
||||
]
|
||||
cpp.defines: {
|
||||
var defines = base.filter(function(d) { return d !== "QT_RESTRICTED_CAST_FROM_ASCII"; });
|
||||
return defines;
|
||||
}
|
||||
|
||||
install: false
|
||||
}
|
@@ -4,7 +4,7 @@ import qbs.FileInfo
|
||||
|
||||
Project {
|
||||
name: "Qt Creator"
|
||||
minimumQbsVersion: "1.8.0"
|
||||
minimumQbsVersion: "1.19.0"
|
||||
property string minimumMacosVersion: "10.12"
|
||||
property bool withAutotests: qbs.buildVariant === "debug"
|
||||
property path ide_source_tree: path
|
||||
|
@@ -181,6 +181,15 @@ def diffContext(ctx, old, new):
|
||||
|
||||
return report
|
||||
|
||||
|
||||
def stringify(obj):
|
||||
stringTypes = (str, unicode) if sys.version_info.major == 2 else (str)
|
||||
if isinstance(obj, stringTypes):
|
||||
return obj
|
||||
if isinstance(obj, bytes):
|
||||
tmp = obj.decode('cp1252') if platform.system() in ('Microsoft','Windows') else obj.decode()
|
||||
return tmp
|
||||
|
||||
# --- The main program
|
||||
|
||||
oldGenerator = Generator()
|
||||
@@ -203,21 +212,21 @@ newContextSet = set(newTree.keys())
|
||||
for c in sorted(oldContextSet.difference(newContextSet)):
|
||||
report = diffContext(c, oldTree[c], {})
|
||||
if report:
|
||||
print(report.encode('utf-8'))
|
||||
print(stringify(report.encode('utf-8')))
|
||||
else:
|
||||
unchangedContexts += 1
|
||||
|
||||
for c in sorted(newContextSet.difference(oldContextSet)):
|
||||
report = diffContext(c, {}, newTree[c])
|
||||
if report:
|
||||
print(report.encode('utf-8'))
|
||||
print(stringify(report.encode('utf-8')))
|
||||
else:
|
||||
unchangedContexts += 1
|
||||
|
||||
for c in sorted(newContextSet.intersection(oldContextSet)):
|
||||
report = diffContext(c, oldTree[c], newTree[c])
|
||||
if report:
|
||||
print(report.encode('utf-8'))
|
||||
print(stringify(report.encode('utf-8')))
|
||||
else:
|
||||
unchangedContexts += 1
|
||||
|
||||
|
@@ -11,7 +11,10 @@ set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets REQUIRED)
|
||||
|
||||
set_property(SOURCE clazy_example.cpp icontest.cpp PROPERTY SKIP_AUTOMOC ON)
|
||||
|
||||
add_executable(examples
|
||||
clazy_example.cpp
|
||||
@@ -20,4 +23,4 @@ add_executable(examples
|
||||
tidy_example.h
|
||||
)
|
||||
|
||||
target_link_libraries(examples PRIVATE Qt5::Widgets)
|
||||
target_link_libraries(examples PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
|
||||
|
@@ -113,9 +113,6 @@ TestObject::TestObject()
|
||||
for (auto obj : list) {
|
||||
}
|
||||
|
||||
// -Wclazy-qdatetime-utc
|
||||
QDateTime::currentDateTime().toTime_t();
|
||||
|
||||
// -Wclazy-qfileinfo-exists
|
||||
// -Wclazy-qstring-allocations
|
||||
QFileInfo("filename").exists();
|
||||
@@ -134,8 +131,5 @@ TestObject::TestObject()
|
||||
str.mid(5).toInt(&ok);
|
||||
|
||||
// -Wclazy-qstring-arg
|
||||
QString("%1 %2").arg("1").arg("2");
|
||||
(void) QString("%1 %2").arg("1").arg("2");
|
||||
}
|
||||
|
||||
// Note: A fatal error like an unresolved include will make clazy stop emitting any diagnostics.
|
||||
// #include "clazy_example.moc"
|
||||
|
@@ -27,12 +27,13 @@
|
||||
|
||||
#define Macro
|
||||
|
||||
class Class {
|
||||
class Class : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Q_PROPERTY(bool property READ readProperty CONSTANT);
|
||||
void publicFunction();
|
||||
void static publicStaticFunction();
|
||||
Q_PROPERTY(int property READ publicStaticFunction CONSTANT)
|
||||
int publicFunction() { return 0; }
|
||||
int static publicStaticFunction() { return 0; }
|
||||
template<int> void publicTemplateFunction();
|
||||
template<int> void static publicStaticTemplateFunction();
|
||||
|
||||
@@ -43,8 +44,8 @@ signals:
|
||||
void signal();
|
||||
|
||||
public slots:
|
||||
void publicSlot();
|
||||
template<int> void publicTemplateSlot();
|
||||
void publicSlot() {}
|
||||
// template<int> void publicTemplateSlot() {}
|
||||
|
||||
protected:
|
||||
void protectedFunction();
|
||||
@@ -56,8 +57,8 @@ protected:
|
||||
int static protectedStaticVariable;
|
||||
|
||||
protected slots:
|
||||
void protectedSlot();
|
||||
template<int> void protectedTemplateSlot();
|
||||
void protectedSlot() {}
|
||||
// template<int> void protectedTemplateSlot() {}
|
||||
|
||||
private:
|
||||
void privateFunction();
|
||||
@@ -67,9 +68,10 @@ private:
|
||||
template<int> void static privateStaticTemplateFunction();
|
||||
|
||||
private slots:
|
||||
void privateSlot();
|
||||
template<int> void privateTemplateSlot();
|
||||
void privateSlot() {}
|
||||
// template<int> void privateTemplateSlot() {}
|
||||
|
||||
private:
|
||||
int privateVariable;
|
||||
int static privateStaticVariable;
|
||||
};
|
||||
|
@@ -71,7 +71,7 @@ public:
|
||||
// misc-noexcept-move-constructor
|
||||
// misc-unconventional-assign-operator
|
||||
// misc-unused-parameters
|
||||
Base operator=(Base &¶m) {}
|
||||
Base operator=(Base &¶m) { return {}; }
|
||||
virtual int function()
|
||||
{
|
||||
// modernize-use-nullptr
|
||||
@@ -116,7 +116,7 @@ void afterMove(Base &&base)
|
||||
Base moved(std::move(base));
|
||||
|
||||
// misc-use-after-move
|
||||
base.value;
|
||||
(void) base.value;
|
||||
}
|
||||
|
||||
// google-runtime-references
|
||||
@@ -144,7 +144,7 @@ public:
|
||||
auto b = {0.5f, 0.5f, 0.5f, 0.5f};
|
||||
|
||||
// misc-fold-init-type
|
||||
std::accumulate(std::begin(b), std::end(b), 0);
|
||||
(void) std::accumulate(std::begin(b), std::end(b), 0);
|
||||
|
||||
// google-readability-casting, misc-incorrect-roundings
|
||||
auto c = (int)(getDouble() + 0.5);
|
||||
@@ -197,6 +197,7 @@ public:
|
||||
std::system("echo ");
|
||||
// cert-err52-cpp
|
||||
setjmp(nullptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// google-default-arguments
|
||||
@@ -251,7 +252,7 @@ int main()
|
||||
// modernize-loop-convert
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
// cppcoreguidelines-pro-bounds-constant-array-index
|
||||
arr[i];
|
||||
(void) arr[i];
|
||||
}
|
||||
|
||||
std::vector<std::pair<int, int>> w;
|
||||
|
@@ -556,7 +556,12 @@ bool isSubclassOf(QObject *object, const QByteArray &superTypeName)
|
||||
|
||||
void getPropertyCache(QObject *object, QQmlEngine *engine)
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||
QQuickDesignerSupportProperties::getPropertyCache(object, engine);
|
||||
#else
|
||||
Q_UNUSED(engine);
|
||||
QQuickDesignerSupportProperties::getPropertyCache(object);
|
||||
#endif
|
||||
}
|
||||
|
||||
void registerNotifyPropertyChangeCallBack(void (*callback)(QObject *, const PropertyName &))
|
||||
|
@@ -90,6 +90,103 @@ Item {
|
||||
selectedAssetsChanged()
|
||||
}
|
||||
|
||||
RegExpValidator {
|
||||
id: folderNameValidator
|
||||
regExp: /^(\w[^*/><?\\|:]*)$/
|
||||
}
|
||||
|
||||
Dialog {
|
||||
id: renameFolderDialog
|
||||
|
||||
title: qsTr("Rename folder")
|
||||
anchors.centerIn: parent
|
||||
closePolicy: Popup.CloseOnEscape
|
||||
implicitWidth: 280
|
||||
modal: true
|
||||
|
||||
property bool renameError: false
|
||||
|
||||
contentItem: Column {
|
||||
spacing: 2
|
||||
|
||||
StudioControls.TextField {
|
||||
id: folderRename
|
||||
|
||||
actionIndicator.visible: false
|
||||
translationIndicator.visible: false
|
||||
width: renameFolderDialog.width - 12
|
||||
validator: folderNameValidator
|
||||
|
||||
onEditChanged: renameFolderDialog.renameError = false
|
||||
Keys.onEnterPressed: btnRename.onClicked()
|
||||
Keys.onReturnPressed: btnRename.onClicked()
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("Folder Name cannot be empty.")
|
||||
color: "#ff0000"
|
||||
visible: folderRename.text === "" && !renameFolderDialog.renameError
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("Could not rename directory. Make sure no folder with the same name exists.")
|
||||
wrapMode: Text.WordWrap
|
||||
width: renameFolderDialog.width
|
||||
color: "#ff0000"
|
||||
visible: renameFolderDialog.renameError
|
||||
}
|
||||
|
||||
Item { // spacer
|
||||
width: 1
|
||||
height: 10
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("If the folder has assets in use, renaming it might cause the project to not work correctly.")
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
wrapMode: Text.WordWrap
|
||||
width: renameFolderDialog.width
|
||||
leftPadding: 10
|
||||
rightPadding: 10
|
||||
}
|
||||
|
||||
Item { // spacer
|
||||
width: 1
|
||||
height: 20
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.right: parent.right
|
||||
|
||||
Button {
|
||||
id: btnRename
|
||||
|
||||
text: qsTr("Rename")
|
||||
enabled: folderRename.text !== ""
|
||||
onClicked: {
|
||||
var success = assetsModel.renameFolder(contextDir.dirPath, folderRename.text)
|
||||
if (success)
|
||||
renameFolderDialog.accept()
|
||||
|
||||
renameFolderDialog.renameError = !success
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: qsTr("Cancel")
|
||||
onClicked: renameFolderDialog.reject()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onOpened: {
|
||||
folderRename.text = contextDir.dirName
|
||||
folderRename.selectAll()
|
||||
folderRename.forceActiveFocus()
|
||||
renameFolderDialog.renameError = false
|
||||
}
|
||||
}
|
||||
|
||||
Dialog {
|
||||
id: newFolderDialog
|
||||
|
||||
@@ -113,6 +210,7 @@ Item {
|
||||
|
||||
actionIndicator.visible: false
|
||||
translationIndicator.visible: false
|
||||
validator: folderNameValidator
|
||||
|
||||
Keys.onEnterPressed: btnCreate.onClicked()
|
||||
Keys.onReturnPressed: btnCreate.onClicked()
|
||||
@@ -261,6 +359,13 @@ Item {
|
||||
height: visible ? StudioTheme.Values.border : 0
|
||||
}
|
||||
|
||||
StudioControls.MenuItem {
|
||||
text: qsTr("Rename Folder")
|
||||
visible: isDirContextMenu
|
||||
height: visible ? implicitHeight : 0
|
||||
onTriggered: renameFolderDialog.open()
|
||||
}
|
||||
|
||||
StudioControls.MenuItem {
|
||||
text: qsTr("New Folder")
|
||||
onTriggered: newFolderDialog.open()
|
||||
|
@@ -0,0 +1,225 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2022 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** 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 General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Templates 2.15 as T
|
||||
import StudioTheme 1.0 as StudioTheme
|
||||
|
||||
T.Switch {
|
||||
id: root
|
||||
|
||||
property alias actionIndicator: actionIndicator
|
||||
|
||||
// This property is used to indicate the global hover state
|
||||
property bool hover: root.hovered && root.enabled
|
||||
property bool edit: false
|
||||
|
||||
property alias actionIndicatorVisible: actionIndicator.visible
|
||||
property real __actionIndicatorWidth: StudioTheme.Values.actionIndicatorWidth
|
||||
property real __actionIndicatorHeight: StudioTheme.Values.actionIndicatorHeight
|
||||
|
||||
property alias labelVisible: switchLabel.visible
|
||||
property alias labelColor: switchLabel.color
|
||||
|
||||
property alias fontFamily: switchLabel.font.family
|
||||
property alias fontPixelSize: switchLabel.font.pixelSize
|
||||
|
||||
font.pixelSize: StudioTheme.Values.myFontSize
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: StudioTheme.Values.switchSpacing
|
||||
hoverEnabled: true
|
||||
activeFocusOnTab: false
|
||||
|
||||
ActionIndicator {
|
||||
id: actionIndicator
|
||||
myControl: root
|
||||
width: actionIndicator.visible ? root.__actionIndicatorWidth : 0
|
||||
height: actionIndicator.visible ? root.__actionIndicatorHeight : 0
|
||||
}
|
||||
|
||||
indicator: Rectangle {
|
||||
id: switchBackground
|
||||
x: actionIndicator.width
|
||||
y: 0
|
||||
z: 5
|
||||
implicitWidth: StudioTheme.Values.height * 2
|
||||
implicitHeight: StudioTheme.Values.height
|
||||
radius: StudioTheme.Values.height * 0.5
|
||||
color: StudioTheme.Values.themeControlBackground
|
||||
border.width: StudioTheme.Values.border
|
||||
border.color: StudioTheme.Values.themeControlOutline
|
||||
|
||||
Rectangle {
|
||||
id: switchIndicator
|
||||
|
||||
readonly property real gap: 5
|
||||
property real size: switchBackground.implicitHeight - switchIndicator.gap * 2
|
||||
|
||||
x: root.checked ? parent.width - width - switchIndicator.gap
|
||||
: switchIndicator.gap
|
||||
y: switchIndicator.gap
|
||||
width: switchIndicator.size
|
||||
height: switchIndicator.size
|
||||
radius: switchIndicator.size * 0.5
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
border.width: 0
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: T.Label {
|
||||
id: switchLabel
|
||||
leftPadding: switchBackground.x + switchBackground.width + root.spacing
|
||||
rightPadding: 0
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: root.text
|
||||
font: root.font
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
visible: text !== ""
|
||||
}
|
||||
|
||||
property bool __default: root.enabled && !root.hover && !actionIndicator.hover && !root.pressed
|
||||
property bool __globalHover: root.enabled && actionIndicator.hover && !root.pressed
|
||||
property bool __hover: root.hover && !actionIndicator.hover && !root.pressed
|
||||
property bool __press: root.hover && root.pressed
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "default"
|
||||
when: root.__default && !root.checked
|
||||
PropertyChanges {
|
||||
target: switchBackground
|
||||
color: StudioTheme.Values.themeControlBackground
|
||||
border.color: StudioTheme.Values.themeControlOutline
|
||||
}
|
||||
PropertyChanges {
|
||||
target: switchIndicator
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "globalHover"
|
||||
when: root.__globalHover && !root.checked
|
||||
PropertyChanges {
|
||||
target: switchBackground
|
||||
color: StudioTheme.Values.themeControlBackgroundGlobalHover
|
||||
border.color: StudioTheme.Values.themeControlOutline
|
||||
}
|
||||
PropertyChanges {
|
||||
target: switchIndicator
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hover"
|
||||
when: root.__hover && !root.checked
|
||||
PropertyChanges {
|
||||
target: switchBackground
|
||||
color: StudioTheme.Values.themeControlBackgroundHover
|
||||
border.color: StudioTheme.Values.themeControlOutline
|
||||
}
|
||||
PropertyChanges {
|
||||
target: switchIndicator
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "press"
|
||||
when: root.__press && !root.checked
|
||||
PropertyChanges {
|
||||
target: switchBackground
|
||||
color: StudioTheme.Values.themeControlBackgroundInteraction
|
||||
border.color: StudioTheme.Values.themeControlOutlineInteraction
|
||||
}
|
||||
PropertyChanges {
|
||||
target: switchIndicator
|
||||
color: StudioTheme.Values.themeInteraction
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "disable"
|
||||
when: !root.enabled && !root.checked
|
||||
PropertyChanges {
|
||||
target: switchBackground
|
||||
color: StudioTheme.Values.themeControlBackgroundDisabled
|
||||
border.color: StudioTheme.Values.themeControlOutlineDisabled
|
||||
}
|
||||
PropertyChanges {
|
||||
target: switchIndicator
|
||||
color: StudioTheme.Values.themeTextColorDisabled
|
||||
}
|
||||
PropertyChanges {
|
||||
target: switchLabel
|
||||
color: StudioTheme.Values.themeTextColorDisabled
|
||||
}
|
||||
},
|
||||
|
||||
State {
|
||||
name: "defaultChecked"
|
||||
when: root.__default && root.checked
|
||||
extend: "default"
|
||||
PropertyChanges {
|
||||
target: switchBackground
|
||||
color: StudioTheme.Values.themeInteraction
|
||||
border.color: StudioTheme.Values.themeInteraction
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "globalHoverChecked"
|
||||
when: root.__globalHover && root.checked
|
||||
extend: "globalHover"
|
||||
PropertyChanges {
|
||||
target: switchBackground
|
||||
color: StudioTheme.Values.themeInteractionHover
|
||||
border.color: StudioTheme.Values.themeInteractionHover
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hoverChecked"
|
||||
when: root.__hover && root.checked
|
||||
extend: "hover"
|
||||
PropertyChanges {
|
||||
target: switchBackground
|
||||
color: StudioTheme.Values.themeInteractionHover
|
||||
border.color: StudioTheme.Values.themeInteractionHover
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "pressChecked"
|
||||
when: root.__press && root.checked
|
||||
extend: "press"
|
||||
},
|
||||
State {
|
||||
name: "disableChecked"
|
||||
when: !root.enabled && root.checked
|
||||
extend: "disable"
|
||||
}
|
||||
]
|
||||
}
|
@@ -72,6 +72,8 @@ QtObject {
|
||||
property real radioButtonIndicatorWidth: 14
|
||||
property real radioButtonIndicatorHeight: 14
|
||||
|
||||
property real switchSpacing: values.checkBoxSpacing
|
||||
|
||||
property real columnWidth: 225 + (175 * (values.scaleFactor * 2))
|
||||
|
||||
property real marginTopBottom: 4
|
||||
@@ -214,6 +216,8 @@ QtObject {
|
||||
property string themeWarning: Theme.color(Theme.DSwarningColor)
|
||||
property string themeDisabled: Theme.color(Theme.DSdisabledColor)
|
||||
|
||||
property string themeInteractionHover: Theme.color(Theme.DSinteractionHover)
|
||||
|
||||
property string themeAliasIconChecked: Theme.color(Theme.DSnavigatorAliasIconChecked)
|
||||
|
||||
// Control colors
|
||||
|
@@ -65,7 +65,7 @@
|
||||
})"
|
||||
},
|
||||
{
|
||||
"trKey": "2560 x 1440 (QHD)",
|
||||
"trKey": "2560 x 1440",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '2560',
|
||||
@@ -73,7 +73,7 @@
|
||||
})"
|
||||
},
|
||||
{
|
||||
"trKey": "1920 x 1080 (FullHD)",
|
||||
"trKey": "1920 x 1080",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '1920',
|
||||
@@ -97,7 +97,7 @@
|
||||
})"
|
||||
},
|
||||
{
|
||||
"trKey": "1280 x 720 (HD)",
|
||||
"trKey": "1280 x 720",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '1280',
|
||||
|
@@ -70,7 +70,7 @@
|
||||
})"
|
||||
},
|
||||
{
|
||||
"trKey": "720 x 1280 (HD)",
|
||||
"trKey": "720 x 1280",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '720',
|
||||
@@ -78,7 +78,7 @@
|
||||
})"
|
||||
},
|
||||
{
|
||||
"trKey": "1280 x 720 (HD)",
|
||||
"trKey": "1280 x 720",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '1280',
|
||||
|
@@ -67,7 +67,7 @@
|
||||
})"
|
||||
},
|
||||
{
|
||||
"trKey": "2560 x 1440 (QHD)",
|
||||
"trKey": "2560 x 1440",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '2560',
|
||||
@@ -75,7 +75,7 @@
|
||||
})"
|
||||
},
|
||||
{
|
||||
"trKey": "1920 x 1080 (FullHD)",
|
||||
"trKey": "1920 x 1080",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '1920',
|
||||
@@ -99,7 +99,7 @@
|
||||
})"
|
||||
},
|
||||
{
|
||||
"trKey": "1280 x 720 (HD)",
|
||||
"trKey": "1280 x 720",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '1280',
|
||||
|
@@ -9,15 +9,23 @@ Project {
|
||||
|
||||
/* Include .qml, .js, and image files from current directory and subdirectories */
|
||||
QmlFiles {
|
||||
directory: "."
|
||||
directory: "content"
|
||||
}
|
||||
|
||||
QmlFiles {
|
||||
directory: "imports"
|
||||
}
|
||||
|
||||
JavaScriptFiles {
|
||||
directory: "."
|
||||
directory: "content"
|
||||
}
|
||||
|
||||
JavaScriptFiles {
|
||||
directory: "imports"
|
||||
}
|
||||
|
||||
ImageFiles {
|
||||
directory: "."
|
||||
directory: "content"
|
||||
}
|
||||
|
||||
Files {
|
||||
@@ -34,6 +42,18 @@ Project {
|
||||
filter: "*.ttf;*.otf"
|
||||
}
|
||||
|
||||
Files {
|
||||
filter: "*.wav;*.mp3"
|
||||
}
|
||||
|
||||
Files {
|
||||
filter: "*.mp4"
|
||||
}
|
||||
|
||||
Files {
|
||||
filter: "*.glsl;*.glslv;*.glslf;*.vsh;*.fsh;*.vert;*.frag"
|
||||
}
|
||||
|
||||
Files {
|
||||
filter: "*.mesh"
|
||||
directory: "asset_imports"
|
||||
@@ -61,13 +81,20 @@ Project {
|
||||
@endif
|
||||
|
||||
/* List of plugin directories passed to QML runtime */
|
||||
importPaths: [ ".", "imports", "asset_imports" ]
|
||||
importPaths: [ "imports", "asset_imports" ]
|
||||
|
||||
/* Required for deployment */
|
||||
targetDirectory: "/opt/%{ProjectName}"
|
||||
|
||||
qdsVersion: "3.0"
|
||||
|
||||
@if %{IsQt6Project}
|
||||
/* If any modules the project imports require widgets (e.g. QtCharts), widgetApp must be true */
|
||||
widgetApp: true
|
||||
@endif
|
||||
|
||||
multilanguageSupport: true
|
||||
supportedLanguages: ["en"]
|
||||
primaryLanguage: "en"
|
||||
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@
|
||||
"items":
|
||||
[
|
||||
{
|
||||
"trKey": "2960 x 1440 (QHD)",
|
||||
"trKey": "2960 x 1440",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '2960',
|
||||
@@ -71,7 +71,7 @@
|
||||
})"
|
||||
},
|
||||
{
|
||||
"trKey": "1920 x 1080 (FullHD)",
|
||||
"trKey": "1920 x 1080",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '1920',
|
||||
@@ -95,7 +95,7 @@
|
||||
})"
|
||||
},
|
||||
{
|
||||
"trKey": "1280 x 720 (HD)",
|
||||
"trKey": "1280 x 720",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '1280',
|
||||
|
@@ -55,7 +55,7 @@
|
||||
"items":
|
||||
[
|
||||
{
|
||||
"trKey": "1080 x 1920 (FullHD)",
|
||||
"trKey": "1080 x 1920",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '1080',
|
||||
@@ -79,7 +79,7 @@
|
||||
})"
|
||||
},
|
||||
{
|
||||
"trKey": "720 x 1280 (HD)",
|
||||
"trKey": "720 x 1280",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '720',
|
||||
|
@@ -53,7 +53,7 @@
|
||||
"items":
|
||||
[
|
||||
{
|
||||
"trKey": "1080 x 1920 (FullHD)",
|
||||
"trKey": "1080 x 1920",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '1080',
|
||||
@@ -77,7 +77,7 @@
|
||||
})"
|
||||
},
|
||||
{
|
||||
"trKey": "720 x 1280 (HD)",
|
||||
"trKey": "720 x 1280",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '720',
|
||||
|
@@ -53,7 +53,7 @@
|
||||
"items":
|
||||
[
|
||||
{
|
||||
"trKey": "1080 x 1920 (FullHD)",
|
||||
"trKey": "1080 x 1920",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '1080',
|
||||
@@ -77,7 +77,7 @@
|
||||
})"
|
||||
},
|
||||
{
|
||||
"trKey": "720 x 1280 (HD)",
|
||||
"trKey": "720 x 1280",
|
||||
"value":
|
||||
"({
|
||||
'ScreenWidth': '720',
|
||||
|
@@ -1,8 +1,6 @@
|
||||
import qbs
|
||||
|
||||
QtApplication {
|
||||
cpp.cxxLanguageVersion: "c++11"
|
||||
|
||||
cpp.defines: [
|
||||
// You can make your code fail to compile if it uses deprecated APIs.
|
||||
// In order to do so, uncomment the following line.
|
||||
@@ -10,6 +8,7 @@ QtApplication {
|
||||
]
|
||||
|
||||
consoleApplication: true
|
||||
install: true
|
||||
files: [
|
||||
"%{CppFileName}",
|
||||
@if %{HasTranslation}
|
||||
@@ -24,10 +23,4 @@ QtApplication {
|
||||
fileTags: "qt.core.resource_data"
|
||||
}
|
||||
@endif
|
||||
|
||||
Group { // Properties for the produced executable
|
||||
fileTagsFilter: "application"
|
||||
qbs.install: true
|
||||
qbs.installDir: "bin"
|
||||
}
|
||||
}
|
||||
|
@@ -2,11 +2,6 @@ import qbs
|
||||
|
||||
CppApplication {
|
||||
consoleApplication: true
|
||||
install: true
|
||||
files: "%{CFileName}"
|
||||
|
||||
Group { // Properties for the produced executable
|
||||
fileTagsFilter: "application"
|
||||
qbs.install: true
|
||||
qbs.installDir: "bin"
|
||||
}
|
||||
}
|
||||
|
@@ -2,11 +2,6 @@ import qbs
|
||||
|
||||
CppApplication {
|
||||
consoleApplication: true
|
||||
install: true
|
||||
files: "%{CppFileName}"
|
||||
|
||||
Group { // Properties for the produced executable
|
||||
fileTagsFilter: "application"
|
||||
qbs.install: true
|
||||
qbs.installDir: "bin"
|
||||
}
|
||||
}
|
||||
|
@@ -7,6 +7,8 @@ CppApplication {
|
||||
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}
|
||||
@@ -43,9 +45,4 @@ CppApplication {
|
||||
fileTags: ["qt.qml.qml", "qt.core.resource_data"]
|
||||
}
|
||||
@endif
|
||||
Group { // Properties for the produced executable
|
||||
fileTagsFilter: "application"
|
||||
qbs.install: true
|
||||
qbs.installDir: "bin"
|
||||
}
|
||||
}
|
||||
|
@@ -35,6 +35,8 @@ DSerrorColor=ffdf3a3a
|
||||
DSwarningColor=warning
|
||||
DSdisabledColor=ff707070
|
||||
|
||||
DSinteractionHover=ff74cbfc
|
||||
|
||||
DScontrolBackground=ff2e2f30
|
||||
DScontrolBackgroundInteraction=ff3d3d3d
|
||||
DScontrolBackgroundDisabled=ff2e2f30
|
||||
@@ -263,7 +265,6 @@ ProgressBarBackgroundColor=normalBackground
|
||||
SplitterColor=splitterColor
|
||||
TextColorDisabled=textDisabled
|
||||
TextColorError=ffff4040
|
||||
TextColorHighlight=ffff0000
|
||||
TextColorHighlightBackground=7a6f1c
|
||||
TextColorLink=textColorLink
|
||||
TextColorLinkVisited=textColorLinkVisited
|
||||
|
@@ -26,6 +26,8 @@ DSerrorColor=ffdf3a3a
|
||||
DSwarningColor=warning
|
||||
DSdisabledColor=ff8e8e8e
|
||||
|
||||
DSinteractionHover=ff74cbfc
|
||||
|
||||
DScontrolBackground=ffeaeaea
|
||||
DScontrolBackgroundInteraction=ffc9c9c9
|
||||
DScontrolBackgroundDisabled=ffeaeaea
|
||||
@@ -254,7 +256,6 @@ ProgressBarBackgroundColor=18ffffff
|
||||
SplitterColor=splitterColor
|
||||
TextColorDisabled=55000000
|
||||
TextColorError=ffff0000
|
||||
TextColorHighlight=ffa0a0a4
|
||||
TextColorHighlightBackground=ffef0b
|
||||
TextColorLink=ff0057ae
|
||||
TextColorLinkVisited=ff644a9b
|
||||
|
@@ -40,6 +40,8 @@ DSerrorColor=ffdf3a3a
|
||||
DSwarningColor=warning
|
||||
DSdisabledColor=ff8e8e8e
|
||||
|
||||
DSinteractionHover=ff74cbfc
|
||||
|
||||
DScontrolBackground=ffeaeaea
|
||||
DScontrolBackgroundInteraction=ffc9c9c9
|
||||
DScontrolBackgroundDisabled=ffeaeaea
|
||||
@@ -268,7 +270,6 @@ ProgressBarBackgroundColor=28000000
|
||||
SplitterColor=splitter
|
||||
TextColorDisabled=textDisabled
|
||||
TextColorError=ffff4040
|
||||
TextColorHighlight=ffff0000
|
||||
TextColorHighlightBackground=ffef0b
|
||||
TextColorLink=ff007af4
|
||||
TextColorLinkVisited=ffa57aff
|
||||
|
@@ -37,6 +37,8 @@ DSerrorColor=ffdf3a3a
|
||||
DSwarningColor=warning
|
||||
DSdisabledColor=ff707070
|
||||
|
||||
DSinteractionHover=ff74cbfc
|
||||
|
||||
DScontrolBackground=ff2e2f30
|
||||
DScontrolBackgroundInteraction=ff3d3d3d
|
||||
DScontrolBackgroundDisabled=ff2e2f30
|
||||
@@ -265,7 +267,6 @@ ProgressBarBackgroundColor=a0606060
|
||||
SplitterColor=splitter
|
||||
TextColorDisabled=textDisabled
|
||||
TextColorError=ffff4040
|
||||
TextColorHighlight=ffff0000
|
||||
TextColorHighlightBackground=8a7f2c
|
||||
TextColorLink=textColorLink
|
||||
TextColorLinkVisited=textColorLinkVisited
|
||||
|
@@ -39,6 +39,8 @@ DSerrorColor=ffdf3a3a
|
||||
DSwarningColor=warning
|
||||
DSdisabledColor=ff707070
|
||||
|
||||
DSinteractionHover=ff74cbfc
|
||||
|
||||
DScontrolBackground=ff2e2f30
|
||||
DScontrolBackgroundInteraction=ff3d3d3d
|
||||
DScontrolBackgroundDisabled=ff2e2f30
|
||||
@@ -267,7 +269,6 @@ ProgressBarBackgroundColor=a0606060
|
||||
SplitterColor=splitter
|
||||
TextColorDisabled=textDisabled
|
||||
TextColorError=ffff4040
|
||||
TextColorHighlight=ffff0000
|
||||
TextColorHighlightBackground=7a6f1c
|
||||
TextColorLink=textColorLink
|
||||
TextColorLinkVisited=textColorLinkVisited
|
||||
|
@@ -35,6 +35,8 @@ DSerrorColor=ffdf3a3a
|
||||
DSwarningColor=warning
|
||||
DSdisabledColor=ff8e8e8e
|
||||
|
||||
DSinteractionHover=ff74cbfc
|
||||
|
||||
DScontrolBackground=ffeaeaea
|
||||
DScontrolBackgroundInteraction=ffc9c9c9
|
||||
DScontrolBackgroundDisabled=ffeaeaea
|
||||
@@ -263,7 +265,6 @@ ProgressBarBackgroundColor=28000000
|
||||
SplitterColor=splitter
|
||||
TextColorDisabled=textDisabled
|
||||
TextColorError=ffff4040
|
||||
TextColorHighlight=ffff0000
|
||||
TextColorHighlightBackground=ffef0b
|
||||
TextColorLink=ff007af4
|
||||
TextColorLinkVisited=ffa57aff
|
||||
|
@@ -33,6 +33,8 @@ DSerrorColor=ffdf3a3a
|
||||
DSwarningColor=warning
|
||||
DSdisabledColor=ff707070
|
||||
|
||||
DSinteractionHover=ff74cbfc
|
||||
|
||||
DScontrolBackground=ff2e2f30
|
||||
DScontrolBackgroundInteraction=ff3d3d3d
|
||||
DScontrolBackgroundDisabled=ff2e2f30
|
||||
@@ -261,7 +263,6 @@ ProgressBarBackgroundColor=a0606060
|
||||
SplitterColor=splitter
|
||||
TextColorDisabled=textDisabled
|
||||
TextColorError=ffff4040
|
||||
TextColorHighlight=ffff0000
|
||||
TextColorHighlightBackground=ffef0b
|
||||
TextColorLink=ff007af4
|
||||
TextColorLinkVisited=ffa57aff
|
||||
|
@@ -25,18 +25,6 @@ if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(ArchSuffix 64)
|
||||
endif()
|
||||
|
||||
# statically link MSVC runtime
|
||||
# see https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#how-can-i-build-my-msvc-application-with-a-static-runtime
|
||||
# TODO change to MSVC_RUNTIME_LIBRARY when CMake 3.15 is required
|
||||
# set_property(TARGET qtcreatorcdbext PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
foreach(flag_var
|
||||
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
||||
if(${flag_var} MATCHES "/MD")
|
||||
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
add_qtc_library(qtcreatorcdbext
|
||||
COMPONENT qtcreatorcdbext
|
||||
DEPENDS ${DbgEngLib}
|
||||
@@ -60,6 +48,9 @@ add_qtc_library(qtcreatorcdbext
|
||||
|
||||
qtc_library_enabled(_library_enabled qtcreatorcdbext)
|
||||
if (_library_enabled)
|
||||
# statically link MSVC runtime
|
||||
set_property(TARGET qtcreatorcdbext PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
|
||||
find_package(Python3 3.8 COMPONENTS Development)
|
||||
|
||||
if (NOT ${Python3_Development_FOUND})
|
||||
|
@@ -61,6 +61,7 @@ public:
|
||||
QString host() const { return url.host(); }
|
||||
quint16 port() const { return url.port(); }
|
||||
QString userName() const { return url.userName(); }
|
||||
QString userAtHost() const { return userName().isEmpty() ? host() : userName() + '@' + host(); }
|
||||
void setHost(const QString &host) { url.setHost(host); }
|
||||
void setPort(int port) { url.setPort(port); }
|
||||
void setUserName(const QString &name) { url.setUserName(name); }
|
||||
|
@@ -215,7 +215,11 @@ void BaseAspect::setupLabel()
|
||||
if (d->m_labelText.isEmpty() && d->m_labelPixmap.isNull())
|
||||
return;
|
||||
d->m_label = new QLabel(d->m_labelText);
|
||||
d->m_label->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
||||
d->m_label->setTextInteractionFlags(d->m_label->textInteractionFlags()
|
||||
| Qt::TextSelectableByMouse);
|
||||
connect(d->m_label, &QLabel::linkActivated, this, [this](const QString &link) {
|
||||
emit labelLinkActivated(link);
|
||||
});
|
||||
if (!d->m_labelPixmap.isNull())
|
||||
d->m_label->setPixmap(d->m_labelPixmap);
|
||||
registerSubWidget(d->m_label);
|
||||
|
@@ -142,6 +142,7 @@ public:
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
void labelLinkActivated(const QString &link);
|
||||
|
||||
protected:
|
||||
QLabel *label() const;
|
||||
|
@@ -738,6 +738,8 @@ MimeType Utils::mimeTypeForFile(const QFileInfo &fileInfo, MimeMatchMode mode)
|
||||
MimeType Utils::mimeTypeForFile(const FilePath &filePath, MimeMatchMode mode)
|
||||
{
|
||||
MimeDatabase mdb;
|
||||
if (filePath.needsDevice())
|
||||
return mdb.mimeTypeForUrl(filePath.toUrl());
|
||||
return mdb.mimeTypeForFile(filePath.toString(), MimeDatabase::MatchMode(mode));
|
||||
}
|
||||
|
||||
|
@@ -263,9 +263,6 @@ public:
|
||||
void setAbortOnMetaChars(bool abort) { m_abortOnMetaChars = abort; }
|
||||
bool isAbortOnMetaChars() const { return m_abortOnMetaChars; }
|
||||
|
||||
void setRunAsRoot(bool on) { m_runAsRoot = on; }
|
||||
bool runAsRoot() const { return m_runAsRoot; }
|
||||
|
||||
void setBelowNormalPriority() { m_belowNormalPriority = true; }
|
||||
bool isBelowNormalPriority() const { return m_belowNormalPriority; }
|
||||
void setNativeArguments(const QString &arguments) { m_nativeArguments = arguments; }
|
||||
@@ -287,7 +284,6 @@ private:
|
||||
bool m_lowPriority = false;
|
||||
bool m_unixTerminalDisabled = false;
|
||||
bool m_abortOnMetaChars = true;
|
||||
bool m_runAsRoot = false;
|
||||
};
|
||||
|
||||
class TerminalImpl : public ProcessInterface
|
||||
@@ -319,7 +315,6 @@ public:
|
||||
void customStart(const CommandLine &command, const FilePath &workingDirectory,
|
||||
const Environment &environment) override
|
||||
{
|
||||
m_terminal.setRunAsRoot(runAsRoot());
|
||||
m_terminal.setAbortOnMetaChars(isAbortOnMetaChars());
|
||||
m_terminal.setCommand(command);
|
||||
m_terminal.setWorkingDirectory(workingDirectory);
|
||||
@@ -568,6 +563,7 @@ public:
|
||||
, q(parent)
|
||||
, m_process(newProcessInstance(parent, processImpl, processMode, terminalMode))
|
||||
, m_processMode(processMode)
|
||||
, m_terminalMode(terminalMode)
|
||||
{
|
||||
connect(m_process, &ProcessInterface::started,
|
||||
q, &QtcProcess::started);
|
||||
@@ -606,45 +602,29 @@ public:
|
||||
return filePath.searchInPath();
|
||||
}
|
||||
|
||||
void defaultStart()
|
||||
void defaultStart(const CommandLine &commandLine, const FilePath &workingDirectory,
|
||||
const Environment &environment)
|
||||
{
|
||||
clearForRun();
|
||||
|
||||
if (m_commandLine.executable().needsDevice()) {
|
||||
QTC_ASSERT(s_deviceHooks.startProcessHook, return);
|
||||
s_deviceHooks.startProcessHook(*q);
|
||||
return;
|
||||
}
|
||||
|
||||
if (processLog().isDebugEnabled()) {
|
||||
static int n = 0;
|
||||
qCDebug(processLog) << "STARTING PROCESS: " << ++n << " " << m_commandLine.toUserOutput();
|
||||
qCDebug(processLog) << "STARTING PROCESS: " << ++n << " " << commandLine.toUserOutput();
|
||||
}
|
||||
|
||||
Environment env;
|
||||
if (m_haveEnv) {
|
||||
if (m_environment.size() == 0)
|
||||
qWarning("QtcProcess::start: Empty environment set when running '%s'.",
|
||||
qPrintable(m_commandLine.executable().toString()));
|
||||
env = m_environment;
|
||||
} else {
|
||||
env = Environment::systemEnvironment();
|
||||
}
|
||||
m_process->setProcessEnvironment(env.toProcessEnvironment());
|
||||
m_process->setWorkingDirectory(m_workingDirectory.path());
|
||||
m_process->setProcessEnvironment(environment.toProcessEnvironment());
|
||||
m_process->setWorkingDirectory(workingDirectory.path());
|
||||
|
||||
QString command;
|
||||
QString commandString;
|
||||
ProcessArgs arguments;
|
||||
const bool success = ProcessArgs::prepareCommand(m_commandLine, &command, &arguments, &env,
|
||||
&m_workingDirectory);
|
||||
const bool success = ProcessArgs::prepareCommand(commandLine, &commandString, &arguments,
|
||||
&environment, &workingDirectory);
|
||||
|
||||
if (m_commandLine.executable().osType() == OsTypeWindows) {
|
||||
if (commandLine.executable().osType() == OsTypeWindows) {
|
||||
QString args;
|
||||
if (m_useCtrlCStub) {
|
||||
if (m_process->isLowPriority())
|
||||
ProcessArgs::addArg(&args, "-nice");
|
||||
ProcessArgs::addArg(&args, QDir::toNativeSeparators(command));
|
||||
command = QCoreApplication::applicationDirPath()
|
||||
ProcessArgs::addArg(&args, QDir::toNativeSeparators(commandString));
|
||||
commandString = QCoreApplication::applicationDirPath()
|
||||
+ QLatin1String("/qtcreator_ctrlc_stub.exe");
|
||||
} else if (m_process->isLowPriority()) {
|
||||
m_process->setBelowNormalPriority();
|
||||
@@ -655,7 +635,7 @@ public:
|
||||
#endif
|
||||
// Note: Arguments set with setNativeArgs will be appended to the ones
|
||||
// passed with start() below.
|
||||
start(command, QStringList(), m_writeData);
|
||||
start(commandString, QStringList(), workingDirectory, m_writeData);
|
||||
} else {
|
||||
if (!success) {
|
||||
q->setErrorString(tr("Error in command line."));
|
||||
@@ -664,13 +644,14 @@ public:
|
||||
emit q->errorOccurred(QProcess::UnknownError);
|
||||
return;
|
||||
}
|
||||
start(command, arguments.toUnixArgs(), m_writeData);
|
||||
start(commandString, arguments.toUnixArgs(), workingDirectory, m_writeData);
|
||||
}
|
||||
}
|
||||
|
||||
void start(const QString &program, const QStringList &arguments, const QByteArray &writeData)
|
||||
void start(const QString &program, const QStringList &arguments,
|
||||
const FilePath &workingDirectory, const QByteArray &writeData)
|
||||
{
|
||||
const FilePath programFilePath = resolve(m_workingDirectory, FilePath::fromString(program));
|
||||
const FilePath programFilePath = resolve(workingDirectory, FilePath::fromString(program));
|
||||
if (programFilePath.exists() && programFilePath.isExecutableFile()) {
|
||||
s_start.measureAndRun(&ProcessInterface::start, m_process, program, arguments, writeData);
|
||||
} else {
|
||||
@@ -680,13 +661,42 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
CommandLine fullCommandLine() const
|
||||
{
|
||||
if (!m_runAsRoot || HostOsInfo::isWindowsHost())
|
||||
return m_commandLine;
|
||||
CommandLine rootCommand("sudo", {"-A"});
|
||||
rootCommand.addCommandLineAsArgs(m_commandLine);
|
||||
return rootCommand;
|
||||
}
|
||||
|
||||
Environment fullEnvironment() const
|
||||
{
|
||||
Environment env;
|
||||
if (m_haveEnv) {
|
||||
if (m_environment.size() == 0)
|
||||
qWarning("QtcProcess::start: Empty environment set when running '%s'.",
|
||||
qPrintable(m_commandLine.executable().toString()));
|
||||
env = m_environment;
|
||||
} else {
|
||||
env = Environment::systemEnvironment();
|
||||
}
|
||||
|
||||
// TODO: needs SshSettings
|
||||
// if (m_runAsRoot)
|
||||
// RunControl::provideAskPassEntry(env);
|
||||
return env;
|
||||
}
|
||||
|
||||
QtcProcess *q;
|
||||
ProcessInterface *m_process;
|
||||
const ProcessMode m_processMode;
|
||||
const QtcProcess::TerminalMode m_terminalMode;
|
||||
CommandLine m_commandLine;
|
||||
FilePath m_workingDirectory;
|
||||
Environment m_environment;
|
||||
QByteArray m_writeData;
|
||||
bool m_runAsRoot = false;
|
||||
bool m_haveEnv = false;
|
||||
bool m_useCtrlCStub = false;
|
||||
|
||||
@@ -774,6 +784,11 @@ ProcessMode QtcProcess::processMode() const
|
||||
return d->m_processMode;
|
||||
}
|
||||
|
||||
QtcProcess::TerminalMode QtcProcess::terminalMode() const
|
||||
{
|
||||
return d->m_terminalMode;
|
||||
}
|
||||
|
||||
void QtcProcess::setEnvironment(const Environment &env)
|
||||
{
|
||||
d->m_environment = env;
|
||||
@@ -791,12 +806,17 @@ const Environment &QtcProcess::environment() const
|
||||
return d->m_environment;
|
||||
}
|
||||
|
||||
bool QtcProcess::hasEnvironment() const
|
||||
{
|
||||
return d->m_haveEnv;
|
||||
}
|
||||
|
||||
void QtcProcess::setCommand(const CommandLine &cmdLine)
|
||||
{
|
||||
if (d->m_workingDirectory.needsDevice() && cmdLine.executable().needsDevice()) {
|
||||
QTC_CHECK(d->m_workingDirectory.host() == cmdLine.executable().host());
|
||||
}
|
||||
d->m_commandLine = cmdLine;
|
||||
d->m_commandLine = cmdLine;
|
||||
}
|
||||
|
||||
const CommandLine &QtcProcess::commandLine() const
|
||||
@@ -831,10 +851,18 @@ void QtcProcess::setUseCtrlCStub(bool enabled)
|
||||
|
||||
void QtcProcess::start()
|
||||
{
|
||||
if (d->m_commandLine.executable().needsDevice()) {
|
||||
QTC_ASSERT(s_deviceHooks.startProcessHook, return);
|
||||
s_deviceHooks.startProcessHook(*this);
|
||||
return;
|
||||
}
|
||||
d->clearForRun();
|
||||
const CommandLine cmd = d->fullCommandLine();
|
||||
const Environment env = d->fullEnvironment();
|
||||
if (d->m_process->isCustomStart())
|
||||
d->m_process->customStart(d->m_commandLine, d->m_workingDirectory, d->m_environment);
|
||||
d->m_process->customStart(cmd, d->m_workingDirectory, env);
|
||||
else
|
||||
d->defaultStart();
|
||||
d->defaultStart(cmd, d->m_workingDirectory, env);
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
@@ -905,7 +933,12 @@ void QtcProcess::setAbortOnMetaChars(bool abort)
|
||||
|
||||
void QtcProcess::setRunAsRoot(bool on)
|
||||
{
|
||||
d->m_process->setRunAsRoot(on);
|
||||
d->m_runAsRoot = on;
|
||||
}
|
||||
|
||||
bool QtcProcess::isRunAsRoot() const
|
||||
{
|
||||
return d->m_runAsRoot;
|
||||
}
|
||||
|
||||
void QtcProcess::setStandardInputFile(const QString &inputFile)
|
||||
|
@@ -90,6 +90,7 @@ public:
|
||||
~QtcProcess();
|
||||
|
||||
ProcessMode processMode() const;
|
||||
TerminalMode terminalMode() const;
|
||||
|
||||
enum Result {
|
||||
// Finished successfully. Unless an ExitCodeInterpreter is set
|
||||
@@ -111,6 +112,7 @@ public:
|
||||
void setEnvironment(const Environment &env);
|
||||
void unsetEnvironment();
|
||||
const Environment &environment() const;
|
||||
bool hasEnvironment() const;
|
||||
|
||||
void setCommand(const CommandLine &cmdLine);
|
||||
const CommandLine &commandLine() const;
|
||||
@@ -122,6 +124,7 @@ public:
|
||||
void setLowPriority();
|
||||
void setDisableUnixTerminal();
|
||||
void setRunAsRoot(bool on);
|
||||
bool isRunAsRoot() const;
|
||||
|
||||
void setAbortOnMetaChars(bool abort);
|
||||
|
||||
|
@@ -142,7 +142,6 @@ public:
|
||||
QProcess::ProcessError m_error = QProcess::UnknownError;
|
||||
QString m_errorString;
|
||||
bool m_abortOnMetaChars = true;
|
||||
bool m_runAsRoot = false;
|
||||
|
||||
// Used on Unix only
|
||||
QtcProcess m_process;
|
||||
@@ -431,8 +430,6 @@ void TerminalProcess::start()
|
||||
+ QLatin1String("/" RELATIVE_LIBEXEC_PATH "/qtcreator_process_stub");
|
||||
|
||||
QStringList allArgs = terminalArgs.toUnixArgs();
|
||||
if (d->m_runAsRoot)
|
||||
allArgs << "sudo" << "-A";
|
||||
|
||||
allArgs << stubPath
|
||||
<< modeOption(d->m_terminalMode)
|
||||
@@ -797,11 +794,6 @@ const Environment &TerminalProcess::environment() const
|
||||
return d->m_environment;
|
||||
}
|
||||
|
||||
void TerminalProcess::setRunAsRoot(bool on)
|
||||
{
|
||||
d->m_runAsRoot = on;
|
||||
}
|
||||
|
||||
QProcess::ProcessError TerminalProcess::error() const
|
||||
{
|
||||
return d->m_error;
|
||||
|
@@ -52,8 +52,6 @@ public:
|
||||
void setEnvironment(const Environment &env);
|
||||
const Environment &environment() const;
|
||||
|
||||
void setRunAsRoot(bool on);
|
||||
|
||||
QProcess::ProcessError error() const;
|
||||
QString errorString() const;
|
||||
|
||||
|
@@ -109,7 +109,6 @@ public:
|
||||
SplitterColor,
|
||||
TextColorDisabled,
|
||||
TextColorError,
|
||||
TextColorHighlight,
|
||||
TextColorHighlightBackground,
|
||||
TextColorLink,
|
||||
TextColorLinkVisited,
|
||||
|
@@ -473,28 +473,6 @@ QString AndroidConfig::apiLevelNameFor(const SdkPlatform *platform)
|
||||
QString("android-%1").arg(platform->apiLevel()) : "";
|
||||
}
|
||||
|
||||
int AndroidConfig::platformNameToApiLevel(const QString &platformName)
|
||||
{
|
||||
int apiLevel = -1;
|
||||
static const QRegularExpression re("(android-)(?<apiLevel>[0-9A-Z]{1,})",
|
||||
QRegularExpression::CaseInsensitiveOption);
|
||||
QRegularExpressionMatch match = re.match(platformName);
|
||||
if (match.hasMatch()) {
|
||||
QString apiLevelStr = match.captured("apiLevel");
|
||||
bool isUInt;
|
||||
apiLevel = apiLevelStr.toUInt(&isUInt);
|
||||
if (!isUInt) {
|
||||
if (apiLevelStr == 'Q')
|
||||
apiLevel = 29;
|
||||
else if (apiLevelStr == 'R')
|
||||
apiLevel = 30;
|
||||
else if (apiLevelStr == 'S')
|
||||
apiLevel = 31;
|
||||
}
|
||||
}
|
||||
return apiLevel;
|
||||
}
|
||||
|
||||
bool AndroidConfig::isCmdlineSdkToolsInstalled() const
|
||||
{
|
||||
QString toolPath("cmdline-tools/latest/bin/sdkmanager");
|
||||
|
@@ -91,7 +91,6 @@ public:
|
||||
|
||||
static QStringList apiLevelNamesFor(const SdkPlatformList &platforms);
|
||||
static QString apiLevelNameFor(const SdkPlatform *platform);
|
||||
static int platformNameToApiLevel(const QString &platformName);
|
||||
|
||||
Utils::FilePath sdkLocation() const;
|
||||
void setSdkLocation(const Utils::FilePath &sdkLocation);
|
||||
|
@@ -673,23 +673,24 @@ AndroidDeviceFactory::AndroidDeviceFactory()
|
||||
":/android/images/androiddevice.png");
|
||||
|
||||
setConstructionFunction(&AndroidDevice::create);
|
||||
setCanCreate(m_androidConfig.sdkToolsOk());
|
||||
setCreator([this] {
|
||||
AvdDialog dialog = AvdDialog(m_androidConfig, Core::ICore::dialogParent());
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
return IDevice::Ptr();
|
||||
if (m_androidConfig.sdkToolsOk()) {
|
||||
setCreator([this] {
|
||||
AvdDialog dialog = AvdDialog(m_androidConfig, Core::ICore::dialogParent());
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
return IDevice::Ptr();
|
||||
|
||||
const IDevice::Ptr dev = dialog.device();
|
||||
if (const auto androidDev = static_cast<AndroidDevice *>(dev.data())) {
|
||||
qCDebug(androidDeviceLog, "Created new Android AVD id \"%s\".",
|
||||
qPrintable(androidDev->avdName()));
|
||||
} else {
|
||||
AndroidDeviceWidget::criticalDialog(
|
||||
AndroidDevice::tr("The device info returned from AvdDialog is invalid."));
|
||||
}
|
||||
const IDevice::Ptr dev = dialog.device();
|
||||
if (const auto androidDev = static_cast<AndroidDevice *>(dev.data())) {
|
||||
qCDebug(androidDeviceLog, "Created new Android AVD id \"%s\".",
|
||||
qPrintable(androidDev->avdName()));
|
||||
} else {
|
||||
AndroidDeviceWidget::criticalDialog(
|
||||
AndroidDevice::tr("The device info returned from AvdDialog is invalid."));
|
||||
}
|
||||
|
||||
return IDevice::Ptr(dev);
|
||||
});
|
||||
return IDevice::Ptr(dev);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include "androidconfigurations.h"
|
||||
#include "androidconstants.h"
|
||||
#include "androidmanager.h"
|
||||
#include "avdmanageroutputparser.h"
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -691,7 +692,7 @@ AndroidSdkPackage *SdkManagerOutputParser::parsePlatform(const QStringList &data
|
||||
SdkPlatform *platform = nullptr;
|
||||
GenericPackageData packageData;
|
||||
if (parseAbstractData(packageData, data, 2, "Platform")) {
|
||||
const int apiLevel = AndroidConfig::platformNameToApiLevel(packageData.headerParts.at(1));
|
||||
const int apiLevel = platformNameToApiLevel(packageData.headerParts.at(1));
|
||||
if (apiLevel == -1) {
|
||||
qCDebug(sdkManagerLog) << "Platform: Cannot parse api level:"<< data;
|
||||
return nullptr;
|
||||
@@ -711,7 +712,7 @@ QPair<SystemImage *, int> SdkManagerOutputParser::parseSystemImage(const QString
|
||||
QPair <SystemImage *, int> result(nullptr, -1);
|
||||
GenericPackageData packageData;
|
||||
if (parseAbstractData(packageData, data, 4, "System-image")) {
|
||||
const int apiLevel = AndroidConfig::platformNameToApiLevel(packageData.headerParts.at(1));
|
||||
const int apiLevel = platformNameToApiLevel(packageData.headerParts.at(1));
|
||||
if (apiLevel == -1) {
|
||||
qCDebug(sdkManagerLog) << "System-image: Cannot parse api level:"<< data;
|
||||
return result;
|
||||
|
@@ -24,7 +24,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "avdmanageroutputparser.h"
|
||||
#include "androidconfigurations.h"
|
||||
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <utils/algorithm.h>
|
||||
@@ -34,6 +33,7 @@
|
||||
#include <utils/variant.h>
|
||||
|
||||
#include <QLoggingCategory>
|
||||
#include <QRegularExpression>
|
||||
#include <QSettings>
|
||||
|
||||
namespace {
|
||||
@@ -98,7 +98,7 @@ static Utils::optional<AndroidDeviceInfo> parseAvd(const QStringList &deviceInfo
|
||||
QSettings avdInfo(avdInfoFile.toString(), QSettings::IniFormat);
|
||||
value = avdInfo.value(avdInfoTargetKey).toString();
|
||||
if (!value.isEmpty())
|
||||
avd.sdk = AndroidConfig::platformNameToApiLevel(value);
|
||||
avd.sdk = platformNameToApiLevel(value);
|
||||
else
|
||||
qCDebug(avdOutputParserLog)
|
||||
<< "Avd Parsing: Cannot find sdk API:" << avdInfoFile.toString();
|
||||
@@ -164,5 +164,27 @@ AndroidDeviceInfoList parseAvdList(const QString &output, QStringList *avdErrorP
|
||||
return avdList;
|
||||
}
|
||||
|
||||
int platformNameToApiLevel(const QString &platformName)
|
||||
{
|
||||
int apiLevel = -1;
|
||||
static const QRegularExpression re("(android-)(?<apiLevel>[0-9A-Z]{1,})",
|
||||
QRegularExpression::CaseInsensitiveOption);
|
||||
QRegularExpressionMatch match = re.match(platformName);
|
||||
if (match.hasMatch()) {
|
||||
QString apiLevelStr = match.captured("apiLevel");
|
||||
bool isUInt;
|
||||
apiLevel = apiLevelStr.toUInt(&isUInt);
|
||||
if (!isUInt) {
|
||||
if (apiLevelStr == 'Q')
|
||||
apiLevel = 29;
|
||||
else if (apiLevelStr == 'R')
|
||||
apiLevel = 30;
|
||||
else if (apiLevelStr == 'S')
|
||||
apiLevel = 31;
|
||||
}
|
||||
}
|
||||
return apiLevel;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Android
|
||||
|
@@ -31,6 +31,7 @@ namespace Internal {
|
||||
const char avdManufacturerError[] = "no longer exists as a device";
|
||||
|
||||
AndroidDeviceInfoList parseAvdList(const QString &output, QStringList *avdErrorPaths);
|
||||
int platformNameToApiLevel(const QString &platformName);
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Android
|
||||
|
@@ -126,7 +126,6 @@ BareMetalDeviceFactory::BareMetalDeviceFactory()
|
||||
setCombinedIcon(":/baremetal/images/baremetaldevicesmall.png",
|
||||
":/baremetal/images/baremetaldevice.png");
|
||||
setConstructionFunction(&BareMetalDevice::create);
|
||||
setCanCreate(true);
|
||||
setCreator([] {
|
||||
BareMetalDeviceConfigurationWizard wizard;
|
||||
if (wizard.exec() != QDialog::Accepted)
|
||||
|
@@ -96,7 +96,8 @@ CommandLine StLinkUtilGdbServerProvider::command() const
|
||||
if (!m_resetBoard)
|
||||
cmd.addArg("--no-reset");
|
||||
|
||||
cmd.addArg("--stlink_version=" + QString::number(m_transport));
|
||||
if (m_transport != UnspecifiedTransport)
|
||||
cmd.addArg("--stlink_version=" + QString::number(m_transport));
|
||||
cmd.addArg("--listen_port=" + QString::number(channel().port()));
|
||||
cmd.addArg("--verbose=" + QString::number(m_verboseLevel));
|
||||
|
||||
@@ -301,6 +302,9 @@ void StLinkUtilGdbServerProviderConfigWidget::populateTransportLayers()
|
||||
m_transportLayerComboBox->insertItem(
|
||||
m_transportLayerComboBox->count(), tr("ST-LINK/V2"),
|
||||
StLinkUtilGdbServerProvider::RawUsb);
|
||||
m_transportLayerComboBox->insertItem(
|
||||
m_transportLayerComboBox->count(), tr("Keep unspecified"),
|
||||
StLinkUtilGdbServerProvider::UnspecifiedTransport);
|
||||
}
|
||||
|
||||
void StLinkUtilGdbServerProviderConfigWidget::setFromProvider()
|
||||
|
@@ -42,7 +42,7 @@ namespace Internal {
|
||||
class StLinkUtilGdbServerProvider final : public GdbServerProvider
|
||||
{
|
||||
public:
|
||||
enum TransportLayer { ScsiOverUsb = 1, RawUsb = 2 };
|
||||
enum TransportLayer { ScsiOverUsb = 1, RawUsb = 2, UnspecifiedTransport };
|
||||
|
||||
QVariantMap toMap() const final;
|
||||
bool fromMap(const QVariantMap &data) final;
|
||||
|
@@ -287,7 +287,6 @@ QdbLinuxDeviceFactory::QdbLinuxDeviceFactory()
|
||||
setDisplayName(QdbDevice::tr("Boot2Qt Device"));
|
||||
setCombinedIcon(":/qdb/images/qdbdevicesmall.png", ":/qdb/images/qdbdevice.png");
|
||||
setConstructionFunction(&QdbDevice::create);
|
||||
setCanCreate(true);
|
||||
setCreator([] {
|
||||
QdbDeviceWizard wizard(Core::ICore::dialogParent());
|
||||
if (wizard.exec() != QDialog::Accepted)
|
||||
|
@@ -415,7 +415,7 @@ ClangdTextMark::ClangdTextMark(const FilePath &filePath,
|
||||
QVector<QAction *> actions;
|
||||
QAction *action = new QAction();
|
||||
action->setIcon(QIcon::fromTheme("edit-copy", Icons::COPY.icon()));
|
||||
action->setToolTip(tr("Clang Code Model Marks", "Copy to Clipboard"));
|
||||
action->setToolTip(tr("Copy to Clipboard", "Clang Code Model Marks"));
|
||||
QObject::connect(action, &QAction::triggered, [diag = m_diagnostic]() {
|
||||
const QString text = ClangDiagnosticWidget::createText({diag},
|
||||
ClangDiagnosticWidget::InfoBar);
|
||||
|
@@ -654,6 +654,10 @@ void ClangdTestTooltips::test()
|
||||
timer.stop();
|
||||
|
||||
QEXPECT_FAIL("TypeName_ResolveTemplateTypeAlias", "typedef already resolved in AST", Abort);
|
||||
if (client()->versionNumber() >= QVersionNumber(14)) {
|
||||
QEXPECT_FAIL("TypeNameIntroducedByUsingDeclarationQualified",
|
||||
"https://github.com/clangd/clangd/issues/989", Abort);
|
||||
}
|
||||
QCOMPARE(int(helpItem.category()), expectedCategory);
|
||||
QEXPECT_FAIL("TemplateClassQualified", "Additional look-up needed?", Abort);
|
||||
QCOMPARE(helpItem.helpIds(), expectedIds);
|
||||
|
@@ -135,6 +135,7 @@ private:
|
||||
void batchEditConfiguration();
|
||||
void reconfigureWithInitialParameters(CMakeBuildConfiguration *bc);
|
||||
void updateInitialCMakeArguments();
|
||||
void kitCMakeConfiguration();
|
||||
|
||||
CMakeBuildConfiguration *m_buildConfiguration;
|
||||
QTreeView *m_configView;
|
||||
@@ -155,6 +156,7 @@ private:
|
||||
InfoLabel *m_warningMessageLabel;
|
||||
|
||||
QPushButton *m_batchEditButton = nullptr;
|
||||
QPushButton *m_kitConfiguration = nullptr;
|
||||
};
|
||||
|
||||
static QModelIndex mapToSource(const QAbstractItemView *view, const QModelIndex &idx)
|
||||
@@ -220,6 +222,11 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
|
||||
updateConfigurationStateIndex(index);
|
||||
});
|
||||
|
||||
m_kitConfiguration = new QPushButton(tr("Kit Configuration"));
|
||||
m_kitConfiguration->setToolTip(tr("Edit the current kit's CMake configuration."));
|
||||
m_kitConfiguration->setFixedWidth(m_kitConfiguration->sizeHint().width());
|
||||
connect(m_kitConfiguration, &QPushButton::clicked, this, [this]() { kitCMakeConfiguration(); });
|
||||
|
||||
m_filterEdit = new FancyLineEdit;
|
||||
m_filterEdit->setPlaceholderText(tr("Filter"));
|
||||
m_filterEdit->setFiltering(true);
|
||||
@@ -253,6 +260,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
|
||||
auto stretcher = new HeaderViewStretcher(m_configView->header(), 0);
|
||||
m_configView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
m_configView->setSelectionBehavior(QAbstractItemView::SelectItems);
|
||||
m_configView->setAlternatingRowColors(true);
|
||||
m_configView->setFrameShape(QFrame::NoFrame);
|
||||
m_configView->setItemDelegate(new ConfigModelItemDelegate(m_buildConfiguration->project()->projectDirectory(),
|
||||
m_configView));
|
||||
@@ -332,12 +340,12 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
|
||||
},
|
||||
m_warningMessageLabel,
|
||||
Space(10),
|
||||
m_configurationStates,
|
||||
Row{m_kitConfiguration, m_configurationStates},
|
||||
Group {
|
||||
cmakeConfiguration,
|
||||
Row {
|
||||
bc->aspect<InitialCMakeArgumentsAspect>(),
|
||||
bc->aspect<AdditionalCMakeArgumentsAspect>()
|
||||
bc->aspect<AdditionalCMakeOptionsAspect>()
|
||||
},
|
||||
m_reconfigureButton,
|
||||
}
|
||||
@@ -484,6 +492,23 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
|
||||
updateInitialCMakeArguments();
|
||||
});
|
||||
|
||||
connect(bc->aspect<InitialCMakeArgumentsAspect>(),
|
||||
&Utils::BaseAspect::labelLinkActivated,
|
||||
this,
|
||||
[this](const QString &link) {
|
||||
const CMakeTool *tool = CMakeKitAspect::cmakeTool(
|
||||
m_buildConfiguration->target()->kit());
|
||||
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options");
|
||||
});
|
||||
connect(bc->aspect<AdditionalCMakeOptionsAspect>(),
|
||||
&Utils::BaseAspect::labelLinkActivated,
|
||||
this,
|
||||
[this](const QString &link) {
|
||||
const CMakeTool *tool = CMakeKitAspect::cmakeTool(
|
||||
m_buildConfiguration->target()->kit());
|
||||
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options");
|
||||
});
|
||||
|
||||
updateSelection();
|
||||
updateConfigurationStateSelection();
|
||||
}
|
||||
@@ -498,10 +523,14 @@ void CMakeBuildSettingsWidget::batchEditConfiguration()
|
||||
auto editor = new QPlainTextEdit(dialog);
|
||||
|
||||
auto label = new QLabel(dialog);
|
||||
label->setText(tr("Enter one CMake variable per line.\n"
|
||||
"To set or change a variable, use -D<variable>:<type>=<value>.\n"
|
||||
"<type> can have one of the following values: FILEPATH, PATH, BOOL, INTERNAL, or STRING.\n"
|
||||
"To unset a variable, use -U<variable>.\n"));
|
||||
label->setText(tr("Enter one CMake <a href=\"variable\">variable</a> per line.<br/>"
|
||||
"To set or change a variable, use -D<variable>:<type>=<value>.<br/>"
|
||||
"<type> can have one of the following values: FILEPATH, PATH, BOOL, INTERNAL, or STRING.<br/>"
|
||||
"To unset a variable, use -U<variable>.<br/>"));
|
||||
connect(label, &QLabel::linkActivated, this, [this](const QString &link) {
|
||||
const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildConfiguration->target()->kit());
|
||||
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-variables.7.html");
|
||||
});
|
||||
editor->setMinimumSize(800, 200);
|
||||
|
||||
auto chooser = new Utils::VariableChooser(dialog);
|
||||
@@ -525,9 +554,9 @@ void CMakeBuildSettingsWidget::batchEditConfiguration()
|
||||
return expander->expand(s);
|
||||
});
|
||||
const bool isInitial = isInitialConfiguration();
|
||||
QStringList unknownArguments;
|
||||
QStringList unknownOptions;
|
||||
CMakeConfig config = CMakeConfig::fromArguments(isInitial ? lines : expandedLines,
|
||||
unknownArguments);
|
||||
unknownOptions);
|
||||
for (auto &ci : config)
|
||||
ci.isInitial = isInitial;
|
||||
|
||||
@@ -602,6 +631,38 @@ void CMakeBuildSettingsWidget::updateInitialCMakeArguments()
|
||||
m_buildConfiguration->aspect<InitialCMakeArgumentsAspect>()->value()));
|
||||
}
|
||||
|
||||
void CMakeBuildSettingsWidget::kitCMakeConfiguration()
|
||||
{
|
||||
m_buildConfiguration->kit()->blockNotification();
|
||||
|
||||
auto dialog = new QDialog(this);
|
||||
dialog->setWindowTitle(tr("Kit CMake Configuration"));
|
||||
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||
dialog->setModal(true);
|
||||
connect(dialog, &QDialog::finished, this, [=]{
|
||||
m_buildConfiguration->kit()->unblockNotification();
|
||||
});
|
||||
|
||||
CMakeKitAspect kitAspect;
|
||||
CMakeGeneratorKitAspect generatorAspect;
|
||||
CMakeConfigurationKitAspect configurationKitAspect;
|
||||
|
||||
auto layout = new QGridLayout(dialog);
|
||||
|
||||
kitAspect.createConfigWidget(m_buildConfiguration->kit())
|
||||
->addToLayoutWithLabel(layout->parentWidget());
|
||||
generatorAspect.createConfigWidget(m_buildConfiguration->kit())
|
||||
->addToLayoutWithLabel(layout->parentWidget());
|
||||
configurationKitAspect.createConfigWidget(m_buildConfiguration->kit())
|
||||
->addToLayoutWithLabel(layout->parentWidget());
|
||||
|
||||
layout->setColumnStretch(1, 1);
|
||||
|
||||
dialog->setMinimumWidth(400);
|
||||
dialog->resize(800, 1);
|
||||
dialog->show();
|
||||
}
|
||||
|
||||
void CMakeBuildSettingsWidget::setError(const QString &message)
|
||||
{
|
||||
m_buildConfiguration->buildDirectoryAspect()->setProblem(message);
|
||||
@@ -658,10 +719,10 @@ void CMakeBuildSettingsWidget::updateButtonState()
|
||||
m_resetButton->setEnabled(m_configModel->hasChanges(isInitial) && !isParsing);
|
||||
|
||||
m_buildConfiguration->aspect<InitialCMakeArgumentsAspect>()->setVisible(isInitialConfiguration());
|
||||
m_buildConfiguration->aspect<AdditionalCMakeArgumentsAspect>()->setVisible(!isInitialConfiguration());
|
||||
m_buildConfiguration->aspect<AdditionalCMakeOptionsAspect>()->setVisible(!isInitialConfiguration());
|
||||
|
||||
m_buildConfiguration->aspect<InitialCMakeArgumentsAspect>()->setEnabled(!isParsing);
|
||||
m_buildConfiguration->aspect<AdditionalCMakeArgumentsAspect>()->setEnabled(!isParsing);
|
||||
m_buildConfiguration->aspect<AdditionalCMakeOptionsAspect>()->setEnabled(!isParsing);
|
||||
|
||||
// Update label and text boldness of the reconfigure button
|
||||
QFont reconfigureButtonFont = m_reconfigureButton->font();
|
||||
@@ -704,12 +765,27 @@ void CMakeBuildSettingsWidget::updateFromKit()
|
||||
const Kit *k = m_buildConfiguration->kit();
|
||||
const CMakeConfig config = CMakeConfigurationKitAspect::configuration(k);
|
||||
|
||||
// First the key value parameters
|
||||
ConfigModel::KitConfiguration configHash;
|
||||
for (const CMakeConfigItem &i : config)
|
||||
configHash.insert(QString::fromUtf8(i.key),
|
||||
qMakePair(QString::fromUtf8(i.value), i.expandedValue(k)));
|
||||
configHash.insert(QString::fromUtf8(i.key), i);
|
||||
|
||||
m_configModel->setConfigurationFromKit(configHash);
|
||||
|
||||
// Then the additional parameters
|
||||
const QStringList additionalKitCMake = ProcessArgs::splitArgs(
|
||||
CMakeConfigurationKitAspect::additionalConfiguration(k));
|
||||
const QStringList additionalInitialCMake = ProcessArgs::splitArgs(
|
||||
m_buildConfiguration->aspect<InitialCMakeArgumentsAspect>()->value());
|
||||
|
||||
QStringList mergedArgumentList;
|
||||
std::set_union(additionalInitialCMake.begin(),
|
||||
additionalInitialCMake.end(),
|
||||
additionalKitCMake.begin(),
|
||||
additionalKitCMake.end(),
|
||||
std::back_inserter(mergedArgumentList));
|
||||
m_buildConfiguration->aspect<InitialCMakeArgumentsAspect>()->setValue(
|
||||
ProcessArgs::joinArgs(mergedArgumentList));
|
||||
}
|
||||
|
||||
void CMakeBuildSettingsWidget::updateConfigurationStateIndex(int index)
|
||||
@@ -885,6 +961,18 @@ bool CMakeBuildSettingsWidget::eventFilter(QObject *target, QEvent *event)
|
||||
auto menu = new QMenu(this);
|
||||
connect(menu, &QMenu::triggered, menu, &QMenu::deleteLater);
|
||||
|
||||
auto help = new QAction(tr("Help"), this);
|
||||
menu->addAction(help);
|
||||
connect(help, &QAction::triggered, this, [=] {
|
||||
const CMakeConfigItem item = ConfigModel::dataItemFromIndex(idx).toCMakeConfigItem();
|
||||
|
||||
const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildConfiguration->target()->kit());
|
||||
const QString linkUrl = "%1/variable/" + QString::fromUtf8(item.key) + ".html";
|
||||
CMakeTool::openCMakeHelpUrl(tool, linkUrl);
|
||||
});
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
QAction *action = nullptr;
|
||||
if ((action = createForceAction(ConfigModel::DataItem::BOOLEAN, idx)))
|
||||
menu->addAction(action);
|
||||
@@ -1052,7 +1140,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
|
||||
auto initialCMakeArgumentsAspect = addAspect<InitialCMakeArgumentsAspect>();
|
||||
initialCMakeArgumentsAspect->setMacroExpanderProvider([this] { return macroExpander(); });
|
||||
|
||||
auto additionalCMakeArgumentsAspect = addAspect<AdditionalCMakeArgumentsAspect>();
|
||||
auto additionalCMakeArgumentsAspect = addAspect<AdditionalCMakeOptionsAspect>();
|
||||
additionalCMakeArgumentsAspect->setMacroExpanderProvider([this] { return macroExpander(); });
|
||||
|
||||
macroExpander()->registerVariable(DEVELOPMENT_TEAM_FLAG,
|
||||
@@ -1352,7 +1440,7 @@ void CMakeBuildConfiguration::setInitialCMakeArguments(const QStringList &args)
|
||||
|
||||
QStringList CMakeBuildConfiguration::additionalCMakeArguments() const
|
||||
{
|
||||
return ProcessArgs::splitArgs(aspect<AdditionalCMakeArgumentsAspect>()->value());
|
||||
return ProcessArgs::splitArgs(aspect<AdditionalCMakeOptionsAspect>()->value());
|
||||
}
|
||||
|
||||
void CMakeBuildConfiguration::setAdditionalCMakeArguments(const QStringList &args)
|
||||
@@ -1364,7 +1452,7 @@ void CMakeBuildConfiguration::setAdditionalCMakeArguments(const QStringList &arg
|
||||
[](const QString &s) {
|
||||
return !s.isEmpty();
|
||||
});
|
||||
aspect<AdditionalCMakeArgumentsAspect>()->setValue(
|
||||
aspect<AdditionalCMakeOptionsAspect>()->setValue(
|
||||
ProcessArgs::joinArgs(nonEmptyAdditionalArguments));
|
||||
}
|
||||
|
||||
@@ -1373,13 +1461,13 @@ void CMakeBuildConfiguration::filterConfigArgumentsFromAdditionalCMakeArguments(
|
||||
// On iOS the %{Ios:DevelopmentTeam:Flag} evalues to something like
|
||||
// -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM:STRING=MAGICSTRING
|
||||
// which is already part of the CMake variables and should not be also
|
||||
// in the addtional CMake parameters
|
||||
// in the addtional CMake options
|
||||
const QStringList arguments = ProcessArgs::splitArgs(
|
||||
aspect<AdditionalCMakeArgumentsAspect>()->value());
|
||||
QStringList unknownArguments;
|
||||
const CMakeConfig config = CMakeConfig::fromArguments(arguments, unknownArguments);
|
||||
aspect<AdditionalCMakeOptionsAspect>()->value());
|
||||
QStringList unknownOptions;
|
||||
const CMakeConfig config = CMakeConfig::fromArguments(arguments, unknownOptions);
|
||||
|
||||
aspect<AdditionalCMakeArgumentsAspect>()->setValue(ProcessArgs::joinArgs(unknownArguments));
|
||||
aspect<AdditionalCMakeOptionsAspect>()->setValue(ProcessArgs::joinArgs(unknownOptions));
|
||||
}
|
||||
|
||||
void CMakeBuildConfiguration::setError(const QString &message)
|
||||
@@ -1635,7 +1723,7 @@ const QStringList InitialCMakeArgumentsAspect::allValues() const
|
||||
return initialCMakeArguments;
|
||||
}
|
||||
|
||||
void InitialCMakeArgumentsAspect::setAllValues(const QString &values, QStringList &additionalArguments)
|
||||
void InitialCMakeArgumentsAspect::setAllValues(const QString &values, QStringList &additionalOptions)
|
||||
{
|
||||
QStringList arguments = values.split('\n', Qt::SkipEmptyParts);
|
||||
for (QString &arg: arguments) {
|
||||
@@ -1646,13 +1734,13 @@ void InitialCMakeArgumentsAspect::setAllValues(const QString &values, QStringLis
|
||||
if (arg.startsWith("-T"))
|
||||
arg.replace("-T", "-DCMAKE_GENERATOR_TOOLSET:STRING=");
|
||||
}
|
||||
m_cmakeConfiguration = CMakeConfig::fromArguments(arguments, additionalArguments);
|
||||
m_cmakeConfiguration = CMakeConfig::fromArguments(arguments, additionalOptions);
|
||||
for (CMakeConfigItem &ci : m_cmakeConfiguration)
|
||||
ci.isInitial = true;
|
||||
|
||||
// Display the unknown arguments in "Additional CMake parameters"
|
||||
const QString additionalArgumentsValue = ProcessArgs::joinArgs(additionalArguments);
|
||||
BaseAspect::setValueQuietly(additionalArgumentsValue);
|
||||
// Display the unknown arguments in "Additional CMake Options"
|
||||
const QString additionalOptionsValue = ProcessArgs::joinArgs(additionalOptions);
|
||||
BaseAspect::setValueQuietly(additionalOptionsValue);
|
||||
}
|
||||
|
||||
void InitialCMakeArgumentsAspect::setCMakeConfiguration(const CMakeConfig &config)
|
||||
@@ -1677,18 +1765,18 @@ void InitialCMakeArgumentsAspect::toMap(QVariantMap &map) const
|
||||
InitialCMakeArgumentsAspect::InitialCMakeArgumentsAspect()
|
||||
{
|
||||
setSettingsKey("CMake.Initial.Parameters");
|
||||
setLabelText(tr("Additional CMake parameters:"));
|
||||
setLabelText(tr("Additional CMake <a href=\"options\">options</a>:"));
|
||||
setDisplayStyle(LineEditDisplay);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// - AdditionalCMakeParametersAspect:
|
||||
// - AdditionalCMakeOptionsAspect:
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
AdditionalCMakeArgumentsAspect::AdditionalCMakeArgumentsAspect()
|
||||
AdditionalCMakeOptionsAspect::AdditionalCMakeOptionsAspect()
|
||||
{
|
||||
setSettingsKey("CMake.Additional.Parameters");
|
||||
setLabelText(tr("Additional CMake parameters:"));
|
||||
setSettingsKey("CMake.Additional.Options");
|
||||
setLabelText(tr("Additional CMake <a href=\"options\">options</a>:"));
|
||||
setDisplayStyle(LineEditDisplay);
|
||||
}
|
||||
|
||||
|
@@ -164,12 +164,12 @@ public:
|
||||
void toMap(QVariantMap &map) const final;
|
||||
};
|
||||
|
||||
class AdditionalCMakeArgumentsAspect final : public Utils::StringAspect
|
||||
class AdditionalCMakeOptionsAspect final : public Utils::StringAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AdditionalCMakeArgumentsAspect();
|
||||
AdditionalCMakeOptionsAspect();
|
||||
};
|
||||
|
||||
class SourceDirectoryAspect final : public Utils::StringAspect
|
||||
|
@@ -310,7 +310,7 @@ static CMakeConfigItem unsetItemFromString(const QString &input)
|
||||
return item;
|
||||
}
|
||||
|
||||
CMakeConfig CMakeConfig::fromArguments(const QStringList &list, QStringList &unknownArguments)
|
||||
CMakeConfig CMakeConfig::fromArguments(const QStringList &list, QStringList &unknownOptions)
|
||||
{
|
||||
CMakeConfig result;
|
||||
bool inSet = false;
|
||||
@@ -343,7 +343,7 @@ CMakeConfig CMakeConfig::fromArguments(const QStringList &list, QStringList &unk
|
||||
continue;
|
||||
}
|
||||
|
||||
unknownArguments.append(i);
|
||||
unknownOptions.append(i);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@@ -91,7 +91,7 @@ public:
|
||||
|
||||
const QList<CMakeConfigItem> &toList() const { return *this; }
|
||||
|
||||
static CMakeConfig fromArguments(const QStringList &list, QStringList &unknownArguments);
|
||||
static CMakeConfig fromArguments(const QStringList &list, QStringList &unknownOptions);
|
||||
static CMakeConfig fromFile(const Utils::FilePath &input, QString *errorMessage);
|
||||
|
||||
QByteArray valueOf(const QByteArray &key) const;
|
||||
|
@@ -352,6 +352,11 @@ public:
|
||||
m_label(createSubWidget<ElidingLabel>()),
|
||||
m_changeButton(createSubWidget<QPushButton>())
|
||||
{
|
||||
const CMakeTool *tool = CMakeKitAspect::cmakeTool(kit);
|
||||
connect(this, &KitAspectWidget::labelLinkActivated, this, [=](const QString &link) {
|
||||
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-generators.7.html");
|
||||
});
|
||||
|
||||
m_label->setToolTip(ki->description());
|
||||
m_changeButton->setText(tr("Change..."));
|
||||
refresh();
|
||||
@@ -391,12 +396,18 @@ private:
|
||||
const QString platform = CMakeGeneratorKitAspect::platform(kit());
|
||||
const QString toolset = CMakeGeneratorKitAspect::toolset(kit());
|
||||
|
||||
const QString message = tr("%1 - %2, Platform: %3, Toolset: %4")
|
||||
.arg(extraGenerator.isEmpty() ? tr("<none>") : extraGenerator)
|
||||
.arg(generator.isEmpty() ? tr("<none>") : generator)
|
||||
.arg(platform.isEmpty() ? tr("<none>") : platform)
|
||||
.arg(toolset.isEmpty() ? tr("<none>") : toolset);
|
||||
m_label->setText(message);
|
||||
QStringList messageLabel;
|
||||
if (!extraGenerator.isEmpty())
|
||||
messageLabel << extraGenerator << " - ";
|
||||
|
||||
messageLabel << generator;
|
||||
|
||||
if (!platform.isEmpty())
|
||||
messageLabel << ", " << tr("Platform") << ": " << platform;
|
||||
if (!toolset.isEmpty())
|
||||
messageLabel << ", " << tr("Toolset") << ": " << toolset;
|
||||
|
||||
m_label->setText(messageLabel.join(""));
|
||||
}
|
||||
|
||||
void changeGenerator()
|
||||
@@ -490,6 +501,8 @@ private:
|
||||
extraGeneratorCombo->currentData().toString(),
|
||||
platformEdit->isEnabled() ? platformEdit->text() : QString(),
|
||||
toolsetEdit->isEnabled() ? toolsetEdit->text() : QString());
|
||||
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -561,7 +574,7 @@ CMakeGeneratorKitAspect::CMakeGeneratorKitAspect()
|
||||
{
|
||||
setObjectName(QLatin1String("CMakeGeneratorKitAspect"));
|
||||
setId(GENERATOR_ID);
|
||||
setDisplayName(tr("CMake generator"));
|
||||
setDisplayName(tr("CMake <a href=\"generator\">generator</a>"));
|
||||
setDescription(tr("CMake generator defines how a project is built when using CMake.<br>"
|
||||
"This setting is ignored when using other build systems."));
|
||||
setPriority(19000);
|
||||
@@ -925,15 +938,20 @@ private:
|
||||
|
||||
QTC_ASSERT(!m_editor, return);
|
||||
|
||||
const CMakeTool *tool = CMakeKitAspect::cmakeTool(kit());
|
||||
|
||||
m_dialog = new QDialog(m_summaryLabel->window());
|
||||
m_dialog->setWindowTitle(tr("Edit CMake Configuration"));
|
||||
auto layout = new QVBoxLayout(m_dialog);
|
||||
m_editor = new QPlainTextEdit;
|
||||
auto editorLabel = new QLabel(m_dialog);
|
||||
editorLabel->setText(tr("Enter one CMake variable per line.\n"
|
||||
"To set a variable, use -D<variable>:<type>=<value>.\n"
|
||||
"<type> can have one of the following values: FILEPATH, PATH, "
|
||||
editorLabel->setText(tr("Enter one CMake <a href=\"variable\">variable</a> per line.<br/>"
|
||||
"To set a variable, use -D<variable>:<type>=<value>.<br/>"
|
||||
"<type> can have one of the following values: FILEPATH, PATH, "
|
||||
"BOOL, INTERNAL, or STRING."));
|
||||
connect(editorLabel, &QLabel::linkActivated, this, [=](const QString &link) {
|
||||
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-variables.7.html");
|
||||
});
|
||||
m_editor->setMinimumSize(800, 200);
|
||||
|
||||
auto chooser = new VariableChooser(m_dialog);
|
||||
@@ -942,7 +960,10 @@ private:
|
||||
|
||||
m_additionalEditor = new QLineEdit;
|
||||
auto additionalLabel = new QLabel(m_dialog);
|
||||
additionalLabel->setText(tr("Additional CMake parameters: "));
|
||||
additionalLabel->setText(tr("Additional CMake <a href=\"options\">options</a>:"));
|
||||
connect(additionalLabel, &QLabel::linkActivated, this, [=](const QString &link) {
|
||||
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options");
|
||||
});
|
||||
|
||||
auto additionalChooser = new VariableChooser(m_dialog);
|
||||
additionalChooser->addSupportedWidget(m_additionalEditor);
|
||||
@@ -984,16 +1005,16 @@ private:
|
||||
QTC_ASSERT(m_editor, return);
|
||||
KitGuard guard(kit());
|
||||
|
||||
QStringList unknownArguments;
|
||||
QStringList unknownOptions;
|
||||
const CMakeConfig config = CMakeConfig::fromArguments(m_editor->toPlainText().split('\n'),
|
||||
unknownArguments);
|
||||
unknownOptions);
|
||||
CMakeConfigurationKitAspect::setConfiguration(kit(), config);
|
||||
|
||||
QString additionalConfiguration = m_additionalEditor->text();
|
||||
if (!unknownArguments.isEmpty()) {
|
||||
if (!unknownOptions.isEmpty()) {
|
||||
if (!additionalConfiguration.isEmpty())
|
||||
additionalConfiguration += " ";
|
||||
additionalConfiguration += ProcessArgs::joinArgs(unknownArguments);
|
||||
additionalConfiguration += ProcessArgs::joinArgs(unknownOptions);
|
||||
}
|
||||
CMakeConfigurationKitAspect::setAdditionalConfiguration(kit(), additionalConfiguration);
|
||||
}
|
||||
|
@@ -27,6 +27,8 @@
|
||||
|
||||
#include "cmaketoolmanager.h"
|
||||
|
||||
#include <coreplugin/helpmanager.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -380,6 +382,34 @@ FilePath CMakeTool::searchQchFile(const FilePath &executable)
|
||||
return {};
|
||||
}
|
||||
|
||||
QString CMakeTool::documentationUrl(const Version &version, bool online)
|
||||
{
|
||||
if (online) {
|
||||
QString helpVersion = "latest";
|
||||
if (!(version.major == 0 && version.minor == 0))
|
||||
helpVersion = QString("v%1.%2").arg(version.major).arg(version.minor);
|
||||
|
||||
return QString("https://cmake.org/cmake/help/%1").arg(helpVersion);
|
||||
}
|
||||
|
||||
return QString("qthelp://org.cmake.%1.%2.%3/doc")
|
||||
.arg(version.major)
|
||||
.arg(version.minor)
|
||||
.arg(version.patch);
|
||||
}
|
||||
|
||||
void CMakeTool::openCMakeHelpUrl(const CMakeTool *tool, const QString &linkUrl)
|
||||
{
|
||||
bool online = true;
|
||||
Version version;
|
||||
if (tool && tool->isValid()) {
|
||||
online = tool->qchFilePath().isEmpty();
|
||||
version = tool->version();
|
||||
}
|
||||
|
||||
Core::HelpManager::showHelpUrl(linkUrl.arg(documentationUrl(version, online)));
|
||||
}
|
||||
|
||||
void CMakeTool::readInformation() const
|
||||
{
|
||||
QTC_ASSERT(m_introspection, return );
|
||||
|
@@ -112,6 +112,9 @@ public:
|
||||
QString detectionSource() const { return m_detectionSource; }
|
||||
void setDetectionSource(const QString &source) { m_detectionSource = source; }
|
||||
|
||||
static QString documentationUrl(const Version &version, bool online);
|
||||
static void openCMakeHelpUrl(const CMakeTool *tool, const QString &linkUrl);
|
||||
|
||||
private:
|
||||
void readInformation() const;
|
||||
|
||||
|
@@ -64,6 +64,18 @@ QVariant ConfigModel::data(const QModelIndex &idx, int role) const
|
||||
return Utils::TreeModel<>::data(idx, role);
|
||||
}
|
||||
|
||||
bool ConfigModel::setData(const QModelIndex &idx, const QVariant &data, int role)
|
||||
{
|
||||
Utils::TreeItem *item = itemForIndex(idx);
|
||||
bool res = item ? item->setData(idx.column(), data, role) : false;
|
||||
if (res) {
|
||||
const QModelIndex keyIdx = idx.sibling(idx.row(), 0);
|
||||
const QModelIndex valueIdx = idx.sibling(idx.row(), 1);
|
||||
emit dataChanged(keyIdx, valueIdx);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
ConfigModel::~ConfigModel() = default;
|
||||
|
||||
void ConfigModel::appendConfiguration(const QString &key,
|
||||
@@ -84,9 +96,9 @@ void ConfigModel::appendConfiguration(const QString &key,
|
||||
internalItem.isUserNew = true;
|
||||
|
||||
if (m_kitConfiguration.contains(key))
|
||||
internalItem.kitValue = isInitial ? m_kitConfiguration.value(key).first
|
||||
: m_kitConfiguration.value(key).second;
|
||||
|
||||
internalItem.kitValue = QString::fromUtf8(
|
||||
isInitial ? m_kitConfiguration.value(key).value
|
||||
: m_macroExpander->expand(m_kitConfiguration.value(key).value));
|
||||
m_configuration.append(internalItem);
|
||||
setConfiguration(m_configuration);
|
||||
}
|
||||
@@ -99,12 +111,38 @@ void ConfigModel::setConfiguration(const QList<DataItem> &config)
|
||||
void ConfigModel::setConfigurationFromKit(const KitConfiguration &kitConfig)
|
||||
{
|
||||
m_kitConfiguration = kitConfig;
|
||||
QHash<QString, InternalDataItem> initialConfig;
|
||||
|
||||
// Update the kit values for initial configuration keys
|
||||
for (InternalDataItem &i : m_configuration) {
|
||||
if (!i.isInitial)
|
||||
continue;
|
||||
if (m_kitConfiguration.contains(i.key))
|
||||
i.kitValue = i.isInitial ? m_kitConfiguration.value(i.key).first
|
||||
: m_kitConfiguration.value(i.key).second;
|
||||
i.kitValue = QString::fromUtf8(m_kitConfiguration.value(i.key).value);
|
||||
initialConfig.insert(i.key, i);
|
||||
}
|
||||
|
||||
// Add new initial configuration kit keys
|
||||
for (const auto &ki : kitConfig) {
|
||||
if (!initialConfig.contains(QString::fromUtf8(ki.key))) {
|
||||
InternalDataItem i((DataItem(ki)));
|
||||
i.isUserNew = true;
|
||||
i.isInitial = true;
|
||||
i.newValue = i.value;
|
||||
i.kitValue = i.value;
|
||||
m_configuration.append(i);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove kit values when the kit's keys are removed
|
||||
for (const auto &i : initialConfig) {
|
||||
if (!kitConfig.contains(i.key)) {
|
||||
auto existing = std::find(m_configuration.begin(), m_configuration.end(), i);
|
||||
if (existing != m_configuration.end())
|
||||
existing->kitValue.clear();
|
||||
}
|
||||
}
|
||||
|
||||
setConfiguration(m_configuration);
|
||||
}
|
||||
|
||||
@@ -276,11 +314,15 @@ void ConfigModel::setBatchEditConfiguration(const CMakeConfig &config)
|
||||
auto existing = std::find(m_configuration.begin(), m_configuration.end(), di);
|
||||
if (existing != m_configuration.end()) {
|
||||
existing->isUnset = c.isUnset;
|
||||
if (!c.isUnset) {
|
||||
existing->isUserChanged = true;
|
||||
const QString newValue = QString::fromUtf8(c.value);
|
||||
// Allow a different value when the user didn't change anything (don't mark the same value as new)
|
||||
// But allow the same value (going back) when the user did a change
|
||||
const bool canSetValue = (existing->value != newValue && !existing->isUserChanged)
|
||||
|| existing->isUserChanged;
|
||||
if (!c.isUnset && canSetValue) {
|
||||
existing->isUserChanged = existing->value != newValue;
|
||||
existing->setType(c.type);
|
||||
existing->value = QString::fromUtf8(c.value);
|
||||
existing->newValue = existing->value;
|
||||
existing->newValue = newValue;
|
||||
}
|
||||
} else if (!c.isUnset) {
|
||||
InternalDataItem i(di);
|
||||
@@ -439,59 +481,53 @@ QVariant ConfigModelTreeItem::data(int column, int role) const
|
||||
return dataItem->isInitial ? "1" : "0";
|
||||
}
|
||||
|
||||
switch (column) {
|
||||
case 0:
|
||||
switch (role) {
|
||||
case Qt::DisplayRole:
|
||||
return dataItem->key.isEmpty() ? QCoreApplication::translate("CMakeProjectManager::ConfigModel", "<UNSET>") : dataItem->key;
|
||||
case Qt::EditRole:
|
||||
return dataItem->key;
|
||||
case Qt::ToolTipRole:
|
||||
return toolTip();
|
||||
case Qt::FontRole: {
|
||||
QFont font;
|
||||
font.setBold(dataItem->isUserNew);
|
||||
font.setStrikeOut((!dataItem->inCMakeCache && !dataItem->isUserNew) || dataItem->isUnset);
|
||||
return font;
|
||||
}
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
case 1: {
|
||||
const QString value = currentValue();
|
||||
const auto boolValue = CMakeConfigItem::toBool(value);
|
||||
const bool isTrue = boolValue.has_value() && boolValue.value();
|
||||
auto fontRole = [this]() -> QFont {
|
||||
QFont font;
|
||||
font.setBold((dataItem->isUserChanged || dataItem->isUserNew) && !dataItem->isUnset);
|
||||
font.setStrikeOut((!dataItem->inCMakeCache && !dataItem->isUserNew) || dataItem->isUnset);
|
||||
font.setItalic((dataItem->isInitial && !dataItem->kitValue.isEmpty())
|
||||
|| (!dataItem->isInitial && !dataItem->initialValue.isEmpty()));
|
||||
return font;
|
||||
};
|
||||
|
||||
switch (role) {
|
||||
case Qt::CheckStateRole:
|
||||
return (dataItem->type == ConfigModel::DataItem::BOOLEAN)
|
||||
? QVariant(isTrue ? Qt::Checked : Qt::Unchecked) : QVariant();
|
||||
case Qt::DisplayRole:
|
||||
return value;
|
||||
case Qt::EditRole:
|
||||
return (dataItem->type == ConfigModel::DataItem::BOOLEAN) ? QVariant(isTrue) : QVariant(value);
|
||||
case Qt::FontRole: {
|
||||
QFont font;
|
||||
font.setBold((dataItem->isUserChanged || dataItem->isUserNew) && !dataItem->isUnset);
|
||||
font.setStrikeOut((!dataItem->inCMakeCache && !dataItem->isUserNew) || dataItem->isUnset);
|
||||
return font;
|
||||
}
|
||||
case Qt::ForegroundRole: {
|
||||
bool mismatch = false;
|
||||
if (dataItem->isInitial)
|
||||
mismatch = !dataItem->kitValue.isEmpty() && dataItem->kitValue != value;
|
||||
else
|
||||
mismatch = !dataItem->initialValue.isEmpty() && dataItem->initialValue != value;
|
||||
return Utils::creatorTheme()->color(mismatch ? Utils::Theme::TextColorHighlight
|
||||
: Utils::Theme::TextColorNormal);
|
||||
}
|
||||
case Qt::ToolTipRole: {
|
||||
return toolTip();
|
||||
}
|
||||
default:
|
||||
auto foregroundRole = [this](const QString &value) -> QColor {
|
||||
bool mismatch = false;
|
||||
if (dataItem->isInitial)
|
||||
mismatch = !dataItem->kitValue.isEmpty() && dataItem->kitValue != value;
|
||||
else
|
||||
mismatch = !dataItem->initialValue.isEmpty() && dataItem->initialValue != value;
|
||||
return Utils::creatorTheme()->color(mismatch ? Utils::Theme::TextColorError
|
||||
: Utils::Theme::TextColorNormal);
|
||||
};
|
||||
|
||||
const QString value = currentValue();
|
||||
const auto boolValue = CMakeConfigItem::toBool(value);
|
||||
const bool isTrue = boolValue.has_value() && boolValue.value();
|
||||
|
||||
switch (role) {
|
||||
case Qt::CheckStateRole:
|
||||
if (column == 0)
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
return (dataItem->type == ConfigModel::DataItem::BOOLEAN)
|
||||
? QVariant(isTrue ? Qt::Checked : Qt::Unchecked)
|
||||
: QVariant();
|
||||
case Qt::DisplayRole:
|
||||
if (column == 0)
|
||||
return dataItem->key.isEmpty()
|
||||
? QCoreApplication::translate("CMakeProjectManager::ConfigModel", "<UNSET>")
|
||||
: dataItem->key;
|
||||
return value;
|
||||
case Qt::EditRole:
|
||||
if (column == 0)
|
||||
return dataItem->key;
|
||||
return (dataItem->type == ConfigModel::DataItem::BOOLEAN) ? QVariant(isTrue)
|
||||
: QVariant(value);
|
||||
case Qt::FontRole:
|
||||
return fontRole();
|
||||
case Qt::ForegroundRole:
|
||||
return foregroundRole(value);
|
||||
case Qt::ToolTipRole:
|
||||
return toolTip();
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
|
@@ -133,6 +133,7 @@ public:
|
||||
~ConfigModel() override;
|
||||
|
||||
QVariant data(const QModelIndex &idx, int role) const final;
|
||||
bool setData(const QModelIndex &idx, const QVariant &data, int role) final;
|
||||
|
||||
void appendConfiguration(const QString &key,
|
||||
const QString &value = QString(),
|
||||
@@ -145,7 +146,7 @@ public:
|
||||
void setInitialParametersConfiguration(const CMakeConfig &config);
|
||||
void setConfiguration(const QList<DataItem> &config);
|
||||
|
||||
using KitConfiguration = QHash<QString, QPair<QString,QString>>;
|
||||
using KitConfiguration = QHash<QString, CMakeConfigItem>;
|
||||
void setConfigurationFromKit(const KitConfiguration &kitConfig);
|
||||
|
||||
void flush();
|
||||
|
@@ -325,10 +325,10 @@ void FileApiReader::writeConfigurationIntoBuildDirectory(const QStringList &conf
|
||||
QTC_CHECK(buildDir.ensureWritableDir());
|
||||
|
||||
QByteArray contents;
|
||||
QStringList unknownArguments;
|
||||
QStringList unknownOptions;
|
||||
contents.append("# This file is managed by Qt Creator, do not edit!\n\n");
|
||||
contents.append(
|
||||
transform(CMakeConfig::fromArguments(configurationArguments, unknownArguments).toList(),
|
||||
transform(CMakeConfig::fromArguments(configurationArguments, unknownOptions).toList(),
|
||||
[](const CMakeConfigItem &item) { return item.toCMakeSetLine(nullptr); })
|
||||
.join('\n')
|
||||
.toUtf8());
|
||||
|
@@ -1,7 +1,7 @@
|
||||
if (NOT IS_ABSOLUTE ${IDE_LOGO_PATH})
|
||||
set(IDE_LOGO_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${IDE_LOGO_PATH}")
|
||||
endif()
|
||||
configure_file(core.qrc.cmakein core_cmake.qrc)
|
||||
configure_file(core_logo.qrc.cmakein core_logo_cmake.qrc)
|
||||
|
||||
add_qtc_plugin(Core
|
||||
DEPENDS Qt5::PrintSupport Qt5::Qml Qt5::Sql Qt5::Gui Qt5::GuiPrivate
|
||||
@@ -15,7 +15,8 @@ add_qtc_plugin(Core
|
||||
actionmanager/commandsfile.cpp actionmanager/commandsfile.h
|
||||
basefilewizard.cpp basefilewizard.h
|
||||
basefilewizardfactory.cpp basefilewizardfactory.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/core_cmake.qrc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/core_logo_cmake.qrc
|
||||
core.qrc
|
||||
core_global.h
|
||||
coreconstants.h
|
||||
coreicons.cpp coreicons.h
|
||||
|
@@ -1,12 +1,10 @@
|
||||
<RCC>
|
||||
<qresource prefix="/core">
|
||||
<file alias="images/qtcreatorlogo-big.png">images/logo/128/QtProject-qtcreator.png</file>
|
||||
<file alias="images/qtcreatorlogo-big@2x.png">images/logo/256/QtProject-qtcreator.png</file>
|
||||
<file>images/settingscategory_core.png</file>
|
||||
<file>images/settingscategory_core@2x.png</file>
|
||||
<file>images/settingscategory_design.png</file>
|
||||
<file>images/settingscategory_design@2x.png</file>
|
||||
<file alias="images/qtlogo.png">images/logo/16/Qt_logo_green.png</file>
|
||||
<file alias="images/qtlogo@2x.png">images/logo/32/Qt_logo_green.png</file>
|
||||
<file>images/qtlogo.png</file>
|
||||
<file>images/qtlogo@2x.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@@ -1,10 +0,0 @@
|
||||
<RCC>
|
||||
<qresource prefix="/core">
|
||||
<file alias="images/qtcreatorlogo-big.png">${IDE_LOGO_PATH}/images/logo/128/QtProject-qtcreator.png</file>
|
||||
<file alias="images/qtcreatorlogo-big@2x.png">${IDE_LOGO_PATH}/images/logo/256/QtProject-qtcreator.png</file>
|
||||
<file alias="images/settingscategory_core.png">${CMAKE_CURRENT_SOURCE_DIR}/images/settingscategory_core.png</file>
|
||||
<file alias="images/settingscategory_core@2x.png">${CMAKE_CURRENT_SOURCE_DIR}/images/settingscategory_core@2x.png</file>
|
||||
<file alias="images/settingscategory_design.png">${CMAKE_CURRENT_SOURCE_DIR}/images/settingscategory_design.png</file>
|
||||
<file alias="images/settingscategory_design@2x.png">${CMAKE_CURRENT_SOURCE_DIR}/images/settingscategory_design@2x.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
6
src/plugins/coreplugin/core_logo.qrc
Normal file
@@ -0,0 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/core">
|
||||
<file alias="images/qtcreatorlogo-big.png">images/logo/128/QtProject-qtcreator.png</file>
|
||||
<file alias="images/qtcreatorlogo-big@2x.png">images/logo/256/QtProject-qtcreator.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
6
src/plugins/coreplugin/core_logo.qrc.cmakein
Normal file
@@ -0,0 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/core">
|
||||
<file alias="images/qtcreatorlogo-big.png">${IDE_LOGO_PATH}/images/logo/128/QtProject-qtcreator.png</file>
|
||||
<file alias="images/qtcreatorlogo-big@2x.png">${IDE_LOGO_PATH}/images/logo/256/QtProject-qtcreator.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@@ -37,6 +37,7 @@ Project {
|
||||
"basefilewizardfactory.h",
|
||||
"core.qrc",
|
||||
"core_global.h",
|
||||
"core_logo.qrc",
|
||||
"coreconstants.h",
|
||||
"coreicons.cpp",
|
||||
"coreicons.h",
|
||||
|
BIN
src/plugins/coreplugin/images/qtlogo.png
Normal file
After Width: | Height: | Size: 404 B |
Before Width: | Height: | Size: 681 B After Width: | Height: | Size: 681 B |
@@ -66,6 +66,9 @@ IWelcomePage::~IWelcomePage()
|
||||
QPalette WelcomePageFrame::buttonPalette(bool isActive, bool isCursorInside, bool forText)
|
||||
{
|
||||
QPalette pal;
|
||||
pal.setBrush(QPalette::Window, {});
|
||||
pal.setBrush(QPalette::WindowText, {});
|
||||
|
||||
Theme *theme = Utils::creatorTheme();
|
||||
if (isActive) {
|
||||
if (forText) {
|
||||
|
@@ -81,7 +81,8 @@ QWidget *panelBar(QWidget *parent)
|
||||
auto frame = new QWidget(parent);
|
||||
frame->setAutoFillBackground(true);
|
||||
frame->setMinimumWidth(WelcomePageHelpers::HSpacing);
|
||||
QPalette pal = frame->palette();
|
||||
QPalette pal;
|
||||
pal.setBrush(QPalette::Window, {});
|
||||
pal.setColor(QPalette::Window, themeColor(Theme::Welcome_BackgroundPrimaryColor));
|
||||
frame->setPalette(pal);
|
||||
return frame;
|
||||
|
@@ -251,7 +251,7 @@ F2TestCase::F2TestCase(CppEditorAction action,
|
||||
|
||||
const QString curTestName = QLatin1String(QTest::currentTestFunction());
|
||||
const QString tag = QLatin1String(QTest::currentDataTag());
|
||||
const bool useClangd = ClangdSettings::instance().useClangd();
|
||||
const bool useClangd = m_testKit;
|
||||
if (useClangd) {
|
||||
if (curTestName == "testFollowSymbolQObjectConnect"
|
||||
|| curTestName == "testFollowSymbolQObjectOldStyleConnect") {
|
||||
@@ -442,7 +442,7 @@ F2TestCase::F2TestCase(CppEditorAction action,
|
||||
// qDebug() << "Expected line:" << expectedLine;
|
||||
// qDebug() << "Expected column:" << expectedColumn;
|
||||
|
||||
if (!ClangdSettings::instance().useClangd()) {
|
||||
if (!useClangd) {
|
||||
QEXPECT_FAIL("globalVarFromEnum", "Contributor works on a fix.", Abort);
|
||||
QEXPECT_FAIL("matchFunctionSignature_Follow_5", "foo(int) resolved as CallAST", Abort);
|
||||
}
|
||||
|