Merge remote-tracking branch 'origin/5.0'

Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: Iba1e6cacaebf9bb4653ac77e981ddacaf729c52c
This commit is contained in:
Eike Ziller
2021-07-14 12:20:35 +02:00
153 changed files with 1374 additions and 803 deletions

View File

@@ -78,7 +78,7 @@ endif()
set(Qt5_FOUND ${Qt6_FOUND}) set(Qt5_FOUND ${Qt6_FOUND})
set(Qt5_VERSION ${Qt6_VERSION}) set(Qt5_VERSION ${Qt6_VERSION})
foreach(tool qmake lrelease moc rcc qhelpgenerator) foreach(tool qmake lrelease lupdate moc rcc qhelpgenerator)
if (TARGET Qt6::${tool} AND NOT TARGET Qt5::${tool}) if (TARGET Qt6::${tool} AND NOT TARGET Qt5::${tool})
add_executable(Qt5::${tool} IMPORTED GLOBAL) add_executable(Qt5::${tool} IMPORTED GLOBAL)
get_target_property(imported_location Qt6::${tool} IMPORTED_LOCATION) get_target_property(imported_location Qt6::${tool} IMPORTED_LOCATION)

View File

@@ -95,7 +95,7 @@ function(_create_ts_custom_target name)
endfunction() endfunction()
function(add_translation_targets file_prefix) function(add_translation_targets file_prefix)
if (NOT TARGET Qt5::lrelease) if (NOT TARGET Qt5::lrelease OR NOT TARGET Qt5::lupdate)
# No Qt translation tools were found: Skip this directory # No Qt translation tools were found: Skip this directory
message(WARNING "No Qt translation tools found, skipping translation targets. Add find_package(Qt5 COMPONENTS LinguistTools) to CMake to enable.") message(WARNING "No Qt translation tools found, skipping translation targets. Add find_package(Qt5 COMPONENTS LinguistTools) to CMake to enable.")
return() return()

View File

@@ -94,6 +94,8 @@ Debugging
(QTCREATORBUG-25762) (QTCREATORBUG-25762)
* Fixed that comments in startup commands resulted in message boxes * Fixed that comments in startup commands resulted in message boxes
(QTCREATORBUG-25666) (QTCREATORBUG-25666)
* Removed extra Server Start Script field in Attach to Running Server,
use a custom deploy step instead.
### GDB ### GDB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@@ -26,7 +26,7 @@
/*! /*!
\previouspage creator-deployment.html \previouspage creator-deployment.html
\page creator-deploying-android.html \page creator-deploying-android.html
\nextpage creator-deployment-embedded-linux.html \nextpage creator-deployment-b2qt.html
\title Deploying Applications to Android Devices \title Deploying Applications to Android Devices

View File

@@ -26,7 +26,7 @@
/*! /*!
\previouspage creator-developing-android.html \previouspage creator-developing-android.html
\page creator-developing-baremetal.html \page creator-developing-baremetal.html
\nextpage creator-developing-generic-linux.html \nextpage creator-developing-b2qt.html
\title Connecting Bare Metal Devices \title Connecting Bare Metal Devices

View File

@@ -405,8 +405,6 @@
applications. applications.
\li Select the \uicontrol {Break at "main"} check box to stop the \li Select the \uicontrol {Break at "main"} check box to stop the
debugger at the main function. debugger at the main function.
\li In the \uicontrol {Server start script} field, specify a
script file to run when the server starts.
\li In the \uicontrol {Override SysRoot} field, specify the path to \li In the \uicontrol {Override SysRoot} field, specify the path to
the \c sysroot to use instead of the default \c sysroot. the \c sysroot to use instead of the default \c sysroot.
\li In the \uicontrol {Init commands} field, enter the commands \li In the \uicontrol {Init commands} field, enter the commands

View File

@@ -77,15 +77,12 @@
\uicontrol {Open With} > \uicontrol {Qt Linguist} in the context menu. \uicontrol {Open With} > \uicontrol {Qt Linguist} in the context menu.
For more information about Qt Linguist, see \l{Qt Linguist Manual}. For more information about Qt Linguist, see \l{Qt Linguist Manual}.
\section1 Previewing QML Files \section1 Running QML Files
You can preview the current QML document in the QML Viewer (Qt Quick 1) or You can test the current QML document while you are developing an application.
QML Scene (Qt Quick 2). The preview tools enable you to load QML documents
for viewing and testing while you are developing an application.
To preview the currently active QML file, select \uicontrol Tools > To run the currently active QML file, select \uicontrol Tools >
\uicontrol External > \uicontrol {Qt Quick} > \uicontrol {Qt Quick 1 Preview \uicontrol External > \uicontrol {Qt Quick} > \uicontrol {QML Runtime}.
(qmlviewer)} or \uicontrol {Qt Quick 2 Preview (qmlscene)}.
\section1 Using External Text Editors \section1 Using External Text Editors

View File

@@ -0,0 +1,158 @@
/****************************************************************************
**
** Copyright (C) 2021 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-developing-b2qt.html
\previouspage creator-developing-baremetal.html
\nextpage creator-developing-generic-linux.html
\title Connecting Boot2Qt Devices
You can connect \l{Boot2Qt} devices to the development PC to run, debug,
and analyze applications built for them from \QC.
If you have a tool chain for building applications for \Boot2Qt devices
installed on the development PC, you can add it to \QC. You can then
select a \l{glossary-buildandrun-kit}{kit} with the \uicontrol \Boot2Qt
device type to build applications for and run them on the devices.
To be able to run and debug applications on \Boot2Qt devices,
you must add devices and select them in the \QC
\l{glossary-buildandrun-kit}{kit}.
\section1 Enabling the Boot2Qt Plugin
To enable the \Boot2Qt plugin:
\list 1
\li Select \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol {Device Support} > \uicontrol \Boot2Qt to
enable the plugin.
\li Select \uicontrol {Restart Now} to restart \QC and load the plugin.
\endlist
\section1 Adding Boot2Qt Devices
You use a wizard to create the connections. You can use either a
network connection or a USB connection. If \QC does not automatically
detect a device you connected with USB, you can use a wizard to
create a network connection to the device.
\note On Ubuntu Linux, the development user account must have access to
plugged in devices. To allow the development user access to the device
via USB, create a new \c udev rule, as described in
\l{https://doc.qt.io/QtForDeviceCreation/b2qt-requirements-x11.html#setting-up-usb-access-to-embedded-devices}
{Setting Up USB Access to Embedded Devices}.
You can edit the settings later in \uicontrol Tools > \uicontrol Options >
\uicontrol Devices > \uicontrol Devices.
\image qtcreator-boot2qt-device-configurations.png "Devices dialog"
You can protect the connections between \QC and a device by using an
\l{https://www.openssh.com/}{OpenSSH} connection. OpenSSH is a
connectivity tool for remote login using the SSH protocol. The OpenSSH
suite is not delivered with \QC, so you must download it and install it
on the development PC. Then, you must configure the paths to the tools in
\QC. For more information, see \l {Configuring SSH Connections}.
You need either a password or an SSH public and private key pair for
authentication. If you do not have an SSH key, you can use the ssh-keygen
tool to create it in \QC. For more information, see \l {Generating SSH Keys}.
\note \QC does not store passwords. If you use password authentication,
you may need to enter the password on every connection to the device,
or, if caching is enabled, at every \QC restart.
To reboot the selected device, select \uicontrol {Reboot Device}.
To restore the default application to the device, select
\uicontrol {Restore Default App}.
\section1 Flashing Boot2Qt Devices
To flash the \Boot2Qt image to an SD card with Flashing Wizard, select
\uicontrol Tools > \uicontrol {Flash Boot to Qt Device} and follow the
instructions of the wizard.
\image qtcreator-boot2qt-flashing-wizard.png "Boot2Qt Flashing Wizard"
\section1 Configuring Connections
To configure connections between \QC and a \Boot2Qt device and to
specify build and run settings for the device:
\list 1
\li Make sure that your device can be reached via an IP address or
connect it with a USB connection.
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol Kits >
\uicontrol {Qt Versions} > \uicontrol Add to add the Qt version
for \Boot2Qt.
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol Kits >
\uicontrol Compilers > \uicontrol Add to add the compiler for
building the applications.
\li Select \uicontrol Tools > \uicontrol {Flash Boot to Qt Device}
to flash the \Boot2Qt image to an SD card with Flashing Wizard.
\li To deploy applications and run them remotely on devices, specify
parameters for connecting to the devices over the network (\QC
automatically detects devices connected with USB):
\list 1
\li Select \uicontrol Tools > \uicontrol Options >
\uicontrol Devices > \uicontrol Devices > \uicontrol Add >
\uicontrol \Boot2Qt > \uicontrol {Finish}.
\image qtcreator-devices-boot2qt.png "Boot2Qt Network Device Setup wizard"
\li In the \uicontrol {Device name} field, enter a name for
the connection.
\li In the \uicontrol {Device address} field, enter the host
name or IP address of the device. This value will be
available in the \c %{Device:HostAddress} variable.
\li Click \uicontrol {Next} to create the connection.
You can edit the connection parameters in the
\uicontrol Devices tab. The wizard does not show
parameters that have sensible default values. One of
these is the SSH port number, which is available in
the variable \c %{Device:SshPort}.
\endlist
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol Kits >
\uicontrol Add to add a kit for building applications for the
device. Select the Qt version, compiler, and device that you
added above, and choose \uicontrol \Boot2Qt as the device type.
\li To specify build settings:
\list 1
\li Open a project for an application you want to develop for the
device.
\li Select \uicontrol Projects > \uicontrol {Build & Run} to enable
the kit that you specified above.
\endlist
\li Select \uicontrol Run to specify run settings. Usually, you can use
the default settings.
When you run the project, \QC deploys the application as
specified by the deploy steps. By default, \QC copies the
application files to the device. For more information, see
\l{Specifying Run Settings for Boot2Qt Devices}.
\endlist
*/

View File

@@ -0,0 +1,42 @@
/****************************************************************************
**
** Copyright (C) 2021 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-deployment-b2qt.html
\previouspage creator-deploying-android.html
\nextpage creator-deployment-embedded-linux.html
\title Deploying Applications to Boot2Qt Devices
You can specify the generic deployment steps for remote Linux devices also
for \l{Boot2Qt} devices.
\image qtcreator-boot2qt-deployment-steps.png "Boot2Qt deployment steps"
For more information, see \l{Generic Deployment Steps}.
In addition, to have your application launch on boot, select
\uicontrol {Add Deploy Step} > \uicontrol {Change Default Application}.
*/

View File

@@ -31,7 +31,7 @@
/*! /*!
\page creator-deployment-embedded-linux.html \page creator-deployment-embedded-linux.html
\previouspage creator-deploying-android.html \previouspage creator-deployment-b2qt.html
\if defined(qtdesignstudio) \if defined(qtdesignstudio)
\nextpage creator-connecting-mobile.html \nextpage creator-connecting-mobile.html
\else \else
@@ -104,47 +104,6 @@
support will crash when an SFTP upload is being attempted. This is not a bug support will crash when an SFTP upload is being attempted. This is not a bug
in \QC. in \QC.
\section1 Qt for Device Creation Deployment Steps
\if defined(qtcreator)
The deployment steps depend on the Qt for Device Creation version specified
in the kit.
\section2 Developing with Qt 5.8 or Earlier
The generic deployment steps are not available when developing with Qt for
Device Creation version 5.8 or earlier.
\image qtcreator-deployment-steps-b2qt-58.png
By default, \QC pushes the files to the device incrementally over an ADB
connection. When developing on Windows, executable permissions are set for
executable files after they are deployed to the device.
To execute custom commands, select \uicontrol {Add Deploy Step} >
\uicontrol {Custom Remote Command (via adb shell)} and enter the command to
execute.
\note You can add custom commands also as \l{Build Steps}{build steps}, to
have them executed when the application is built.
To have your application launch on boot, select \uicontrol {Add Deploy Step}
> \uicontrol {Make this application the default one}.
\section2 Developing with Qt 5.9 or Later
When developing with Qt for Device Creation version 5.9 or later, you can
specify the deployment steps described in this section in addition to the
generic deployment steps.
\endif
To execute custom commands when the application is deployed to the device,
select \uicontrol {Add Deploy Step} > \uicontrol {Run Custom Remote Command}
and enter the command to execute.
To have your application launch on boot, select \uicontrol {Add Deploy Step}
> \uicontrol {Change Default Application}.
\if defined(qtcreator) \if defined(qtcreator)
\include creator-projects-cmake-deploying.qdocinc cmake deploying embedded \include creator-projects-cmake-deploying.qdocinc cmake deploying embedded
\endif \endif

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2020 The Qt Company Ltd. ** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -77,7 +77,9 @@
{Reference Target Devices and Development Hosts} {Reference Target Devices and Development Hosts}
\li \l{https://doc.qt.io/QtForDeviceCreation/b2qt-installation-guides.html} \li \l{https://doc.qt.io/QtForDeviceCreation/b2qt-installation-guides.html}
{Installation Guides} {Installation Guides}
\li \l{Connecting Boot2Qt Devices}
\li \l{Specifying Run Settings for Boot2Qt Devices} \li \l{Specifying Run Settings for Boot2Qt Devices}
\li \l{Deploying Applications to Boot2Qt Devices}
\li \l{https://doc.qt.io/qtcreator/creator-overview-qtasam.html} \li \l{https://doc.qt.io/qtcreator/creator-overview-qtasam.html}
{Qt Creator Plugin for Qt Application Manager} {Qt Creator Plugin for Qt Application Manager}
\li \l{https://doc.qt.io/QtForDeviceCreation/index.html} \li \l{https://doc.qt.io/QtForDeviceCreation/index.html}

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2020 The Qt Company Ltd. ** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -41,7 +41,7 @@
host and on the device. host and on the device.
For more information on the deployment steps, see For more information on the deployment steps, see
\l{Deploying Applications to Generic Remote Linux Devices}. \l{Deploying Applications to Boot2Qt Devices}.
//! [run settings boot2qt] //! [run settings boot2qt]
*/ */

View File

@@ -29,7 +29,7 @@
\previouspage creator-developing-android.html \previouspage creator-developing-android.html
\nextpage studio-advanced.html \nextpage studio-advanced.html
\else \else
\previouspage creator-developing-baremetal.html \previouspage creator-developing-b2qt.html
\nextpage creator-developing-ios.html \nextpage creator-developing-ios.html
\endif \endif

View File

@@ -78,10 +78,9 @@
\li \l{Using External Tools} \li \l{Using External Tools}
You can use external tools directly from \QC. Qt Linguist, You can use external tools directly from \QC. Qt Linguist,
QML preview tools (QML Viewer and QML Scene), the default text QML utilities, the default text editor for your system, and the
editor for your system, and the \c sort tool are preconfigured for \c sort tool are preconfigured for use. You can change their default
use. You can change their default configurations and configure new configurations and configure new tools.
tools.
\endlist \endlist

View File

@@ -49,18 +49,25 @@
When you deploy the application to an Android device, \QC copies When you deploy the application to an Android device, \QC copies
the application files to the device. In addition, you can determine the application files to the device. In addition, you can determine
the Qt libraries to use. the Qt libraries to use.
\li \l {Deploying Applications to Boot2Qt Devices}
When you deploy the application to a Boot2Qt device, \QC copies
the application files to the connected device. You can then test
and debug the application on the device with \QC.
\li \l{Deploying Applications to Generic Remote Linux Devices} \li \l{Deploying Applications to Generic Remote Linux Devices}
When you deploy the application to a generic Linux-based device, \QC When you deploy the application to a generic Linux-based device, \QC
copies the application files to the connected device. You can test copies the application files to the connected device. You can then
and debug the application on the device. test and debug the application on the device with \QC.
\if defined(qtcreator) \if defined(qtcreator)
\li \l{Deploying Applications to QNX Neutrino Devices} \li \l{Deploying Applications to QNX Neutrino Devices}
When you deploy the application to a QNX Neutrino device, \QC copies When you deploy the application to a QNX Neutrino device, \QC copies
the application files to the connected device. You can test and the application files to the connected device. You can then test and
debug the application on the device. debug the application on the device with \QC.
\endif \endif
\endlist \endlist

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -69,6 +69,11 @@
to debug applications on them with GDB or a hardware debugger. to debug applications on them with GDB or a hardware debugger.
\endif \endif
\li \l{Connecting Boot2Qt Devices}
You can connect \l{Boot2Qt} devices to the development PC to run,
debug, and analyze applications built for them from \QC.
\li \l{Connecting Generic Remote Linux Devices} \li \l{Connecting Generic Remote Linux Devices}
If you have a tool chain for building applications for embedded If you have a tool chain for building applications for embedded

View File

@@ -59,7 +59,7 @@
\if defined(qtdesignstudio) \if defined(qtdesignstudio)
\section1 Selecting the Preview Tool \section1 Selecting the Preview Tool
By default, the \c qmlscene utility is used for previewing. To use some By default, the QML runtime is used for previewing. To use some
other tool, specify it in the \uicontrol {QML viewer} field in the run other tool, specify it in the \uicontrol {QML viewer} field in the run
settings of the project in the Projects mode. settings of the project in the Projects mode.

View File

@@ -73,10 +73,9 @@
\li \l{Using External Tools} \li \l{Using External Tools}
You can use external tools directly from \QC. lupdate and lrelease, You can use external tools directly from \QC. lupdate and lrelease,
QML preview tools (QML Viewer and QML Scene), the default text QML utilities, the default text editor for your system, and the
editor for your system, and the \c sort tool are preconfigured for \c sort tool are preconfigured for use. You can change their default
use. You can change their default configurations and configure new configurations and configure new tools.
tools.
\li \l{Managing Data Collection} \li \l{Managing Data Collection}
\if defined (qtcreator) \if defined (qtcreator)

View File

@@ -35,8 +35,8 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Source size") text: qsTr("Source size")
disabledState: !backendValues.%2_sourceSize_height.isAvailable blockedByTemplate: !backendValues.%2_sourceSize_height.isAvailable
&& !backendValues.%2_sourceSize_width.isAvailable && !backendValues.%2_sourceSize_width.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -53,8 +53,9 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { ControlLabel {
text: qsTr("W") //: The width of the object
//disabledStateSoft: !backendValues.%2_sourceSize_width.isAvailable text: qsTr("W", "width")
enabled: !backendValues.%2_sourceSize_width.isAvailable
} }
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -72,8 +73,9 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { ControlLabel {
text: qsTr("H") //: The height of the object
//disabledStateSoft: !backendValues.%2_sourceSize_height.isAvailable text: qsTr("H", "height")
enabled: !backendValues.%2_sourceSize_height.isAvailable
} }
ExpandingSpacer {} ExpandingSpacer {}
@@ -112,7 +114,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Asynchronous") text: qsTr("Asynchronous")
tooltip: qsTr("Loads images on the local filesystem asynchronously in a separate thread.") tooltip: qsTr("Loads images on the local filesystem asynchronously in a separate thread.")
disabledState: !backendValues.%2_asynchronous.isAvailable blockedByTemplate: !backendValues.%2_asynchronous.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -130,7 +132,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Auto transform") text: qsTr("Auto transform")
tooltip: qsTr("Automatically applies image transformation metadata such as EXIF orientation.") tooltip: qsTr("Automatically applies image transformation metadata such as EXIF orientation.")
disabledState: !backendValues.%2_autoTransform.isAvailable blockedByTemplate: !backendValues.%2_autoTransform.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -148,7 +150,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Cache") text: qsTr("Cache")
tooltip: qsTr("Caches the image.") tooltip: qsTr("Caches the image.")
disabledState: !backendValues.%2_cache.isAvailable blockedByTemplate: !backendValues.%2_cache.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -166,7 +168,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Mipmap") text: qsTr("Mipmap")
tooltip: qsTr("Uses mipmap filtering when the image is scaled or transformed.") tooltip: qsTr("Uses mipmap filtering when the image is scaled or transformed.")
disabledState: !backendValues.%2_mipmap.isAvailable blockedByTemplate: !backendValues.%2_mipmap.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -184,7 +186,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Mirror") text: qsTr("Mirror")
tooltip: qsTr("Inverts the image horizontally.") tooltip: qsTr("Inverts the image horizontally.")
disabledState: !backendValues.%2_mirror.isAvailable blockedByTemplate: !backendValues.%2_mirror.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -202,7 +204,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Smooth") text: qsTr("Smooth")
tooltip: qsTr("Smoothly filters the image when it is scaled or transformed.") tooltip: qsTr("Smoothly filters the image when it is scaled or transformed.")
disabledState: !backendValues.%2_smooth.isAvailable blockedByTemplate: !backendValues.%2_smooth.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -53,14 +53,11 @@ Section {
} }
PropertyLabel { PropertyLabel {
visible: majorQtQuickVersion > 1
text: qsTr("Smooth") text: qsTr("Smooth")
disabledState: !backendValues.smooth.isAvailable blockedByTemplate: !backendValues.smooth.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
visible: majorQtQuickVersion > 1
CheckBox { CheckBox {
implicitWidth: StudioTheme.Values.twoControlColumnWidth implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth + StudioTheme.Values.actionIndicatorWidth
@@ -73,14 +70,11 @@ Section {
} }
PropertyLabel { PropertyLabel {
visible: majorQtQuickVersion > 1
text: qsTr("Antialiasing") text: qsTr("Antialiasing")
disabledState: !backendValues.antialiasing.isAvailable blockedByTemplate: !backendValues.antialiasing.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
visible: majorQtQuickVersion > 1
CheckBox { CheckBox {
implicitWidth: StudioTheme.Values.twoControlColumnWidth implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth + StudioTheme.Values.actionIndicatorWidth
@@ -95,7 +89,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Focus") text: qsTr("Focus")
tooltip: qsTr("Sets focus on the component within the enclosing focus scope.") tooltip: qsTr("Sets focus on the component within the enclosing focus scope.")
disabledState: !backendValues.focus.isAvailable blockedByTemplate: !backendValues.focus.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -113,7 +107,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Focus on tab") text: qsTr("Focus on tab")
tooltip: qsTr("Adds the component to the tab focus chain.") tooltip: qsTr("Adds the component to the tab focus chain.")
disabledState: !backendValues.activeFocusOnTab.isAvailable blockedByTemplate: !backendValues.activeFocusOnTab.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -131,7 +125,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Baseline offset") text: qsTr("Baseline offset")
tooltip: qsTr("Position of the component's baseline in local coordinates.") tooltip: qsTr("Position of the component's baseline in local coordinates.")
disabledState: !backendValues.baselineOffset.isAvailable blockedByTemplate: !backendValues.baselineOffset.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -46,7 +46,7 @@ Column {
SectionLayout { SectionLayout {
PropertyLabel { PropertyLabel {
text: qsTr("Speed") text: qsTr("Speed")
disabledState: !backendValues.speed.isAvailable blockedByTemplate: !backendValues.speed.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -70,7 +70,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Playing") text: qsTr("Playing")
tooltip: qsTr("Whether the animation is playing or paused.") tooltip: qsTr("Whether the animation is playing or paused.")
disabledState: !backendValues.playing.isAvailable && !backendValues.paused.isAvailable blockedByTemplate: !backendValues.playing.isAvailable && !backendValues.paused.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -52,7 +52,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Source size") text: qsTr("Source size")
disabledState: !backendValues.sourceSize.isAvailable blockedByTemplate: !backendValues.sourceSize.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -68,7 +68,11 @@ Column {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("W") } ControlLabel {
//: The width of the object
text: qsTr("W", "width")
enabled: backendValues.sourceSize_width.isAvailable
}
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -84,7 +88,11 @@ Column {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("H") } ControlLabel {
//: The height of the object
text: qsTr("H", "height")
enabled: backendValues.sourceSize_height.isAvailable
}
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -95,7 +103,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Tile mode H") text: qsTr("Tile mode H")
disabledState: !backendValues.horizontalTileMode.isAvailable blockedByTemplate: !backendValues.horizontalTileMode.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -114,7 +122,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Tile mode V") text: qsTr("Tile mode V")
disabledState: !backendValues.verticalTileMode.isAvailable blockedByTemplate: !backendValues.verticalTileMode.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -192,9 +200,9 @@ Column {
} }
PropertyLabel { PropertyLabel {
text: qsTr("Mirror") // TODO remove Mirror checkbox when flipping is added to a global setion text: qsTr("Mirror")
tooltip: qsTr("Specifies whether the image should be horizontally inverted.") tooltip: qsTr("Specifies whether the image should be horizontally inverted.")
disabledState: !backendValues.mirror.isAvailable blockedByTemplate: !backendValues.mirror.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -212,7 +220,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Smooth") text: qsTr("Smooth")
tooltip: qsTr("Specifies whether the image is smoothly filtered when scaled or transformed.") tooltip: qsTr("Specifies whether the image is smoothly filtered when scaled or transformed.")
disabledState: !backendValues.smooth.isAvailable blockedByTemplate: !backendValues.smooth.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -230,7 +238,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Cache") text: qsTr("Cache")
tooltip: qsTr("Specifies whether the image should be cached.") tooltip: qsTr("Specifies whether the image should be cached.")
disabledState: !backendValues.cache.isAvailable blockedByTemplate: !backendValues.cache.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -248,7 +256,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Asynchronous") text: qsTr("Asynchronous")
tooltip: qsTr("Specifies that images on the local filesystem should be loaded asynchronously in a separate thread.") tooltip: qsTr("Specifies that images on the local filesystem should be loaded asynchronously in a separate thread.")
disabledState: !backendValues.asynchronous.isAvailable blockedByTemplate: !backendValues.asynchronous.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -66,7 +66,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Display") text: qsTr("Display")
tooltip: qsTr("Determines how the icon and text are displayed within the button.") tooltip: qsTr("Determines how the icon and text are displayed within the button.")
disabledState: !backendValues.display.isAvailable blockedByTemplate: !backendValues.display.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -118,7 +118,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Exclusive") text: qsTr("Exclusive")
tooltip: qsTr("Whether the button is exclusive.") tooltip: qsTr("Whether the button is exclusive.")
disabledState: !backendValues.autoExclusive.isAvailable blockedByTemplate: !backendValues.autoExclusive.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -51,7 +51,8 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Appearance") text: qsTr("Appearance")
tooltip: qsTr("Whether the button is flat and/or highlighted.") tooltip: qsTr("Whether the button is flat and/or highlighted.")
disabledState: !backendValues.flat.isAvailable blockedByTemplate: !backendValues.flat.isAvailable
&& !backendValues.highlighted.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -67,6 +67,7 @@ Section {
implicitWidth: StudioTheme.Values.twoControlColumnWidth implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth + StudioTheme.Values.actionIndicatorWidth
backendValue: backendValues.hoverEnabled backendValue: backendValues.hoverEnabled
enabled: backendValues.hoverEnabled.isAvailable
} }
ExpandingSpacer {} ExpandingSpacer {}
@@ -75,6 +76,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Focus policy") text: qsTr("Focus policy")
tooltip: qsTr("Focus policy of the control.") tooltip: qsTr("Focus policy of the control.")
blockedByTemplate: !backendValues.focusPolicy.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -85,6 +87,7 @@ Section {
backendValue: backendValues.focusPolicy backendValue: backendValues.focusPolicy
model: [ "TabFocus", "ClickFocus", "StrongFocus", "WheelFocus", "NoFocus" ] model: [ "TabFocus", "ClickFocus", "StrongFocus", "WheelFocus", "NoFocus" ]
scope: "Qt" scope: "Qt"
enabled: backendValues.focusPolicy.isAvailable
} }
ExpandingSpacer {} ExpandingSpacer {}
@@ -112,6 +115,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Wheel") text: qsTr("Wheel")
tooltip: qsTr("Whether control accepts wheel events.") tooltip: qsTr("Whether control accepts wheel events.")
blockedByTemplate: !backendValues.wheelEnabled.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -120,6 +124,7 @@ Section {
implicitWidth: StudioTheme.Values.twoControlColumnWidth implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth + StudioTheme.Values.actionIndicatorWidth
backendValue: backendValues.wheelEnabled backendValue: backendValues.wheelEnabled
enabled: backendValues.wheelEnabled.isAvailable
} }
ExpandingSpacer {} ExpandingSpacer {}

View File

@@ -48,50 +48,48 @@ Section {
PropertyLabel { text: qsTr("Vertical") } PropertyLabel { text: qsTr("Vertical") }
SecondColumnLayout { SecondColumnLayout {
SecondColumnLayout { SpinBox {
SpinBox { implicitWidth: StudioTheme.Values.twoControlColumnWidth
implicitWidth: StudioTheme.Values.twoControlColumnWidth + StudioTheme.Values.actionIndicatorWidth
+ StudioTheme.Values.actionIndicatorWidth maximumValue: 10000
maximumValue: 10000 minimumValue: -10000
minimumValue: -10000 realDragRange: 5000
realDragRange: 5000 decimals: 0
decimals: 0 backendValue: backendValues.topInset
backendValue: backendValues.topInset
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
MultiIconLabel {
icon0: StudioTheme.Constants.paddingFrame
icon1: StudioTheme.Constants.paddingEdge
tooltip: qsTr("Top inset for the background.")
//disabledStateSoft: !backendValues.topPadding.isAvailable
}
Spacer { implicitWidth: StudioTheme.Values.controlGap }
SpinBox {
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
maximumValue: 10000
minimumValue: -10000
realDragRange: 5000
decimals: 0
backendValue: backendValues.bottomInset
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
MultiIconLabel {
icon0: StudioTheme.Constants.paddingFrame
icon1: StudioTheme.Constants.paddingEdge
rotation: 180
tooltip: qsTr("Bottom inset for the background.")
//disabledStateSoft: !backendValues.bottomPadding.isAvailable
}
ExpandingSpacer {}
} }
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
MultiIconLabel {
icon0: StudioTheme.Constants.paddingFrame
icon1: StudioTheme.Constants.paddingEdge
tooltip: qsTr("Top inset for the background.")
enabled: !backendValues.topPadding.isAvailable
}
Spacer { implicitWidth: StudioTheme.Values.controlGap }
SpinBox {
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
maximumValue: 10000
minimumValue: -10000
realDragRange: 5000
decimals: 0
backendValue: backendValues.bottomInset
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
MultiIconLabel {
icon0: StudioTheme.Constants.paddingFrame
icon1: StudioTheme.Constants.paddingEdge
rotation: 180
tooltip: qsTr("Bottom inset for the background.")
enabled: !backendValues.bottomPadding.isAvailable
}
ExpandingSpacer {}
} }
PropertyLabel { text: qsTr("Horizontal") } PropertyLabel { text: qsTr("Horizontal") }
@@ -114,7 +112,7 @@ Section {
icon1: StudioTheme.Constants.paddingEdge icon1: StudioTheme.Constants.paddingEdge
rotation: 270 rotation: 270
tooltip: qsTr("Left inset for the background.") tooltip: qsTr("Left inset for the background.")
//disabledStateSoft: !backendValues.leftPadding.isAvailable enabled: !backendValues.leftPadding.isAvailable
} }
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -136,7 +134,7 @@ Section {
icon1: StudioTheme.Constants.paddingEdge icon1: StudioTheme.Constants.paddingEdge
rotation: 90 rotation: 90
tooltip: qsTr("Right inset for the background.") tooltip: qsTr("Right inset for the background.")
//disabledStateSoft: !backendValues.rightPadding.isAvailable enabled: !backendValues.rightPadding.isAvailable
} }
ExpandingSpacer {} ExpandingSpacer {}

View File

@@ -83,7 +83,8 @@ Column {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { ControlLabel {
text: qsTr("W") //: The width of the object
text: qsTr("W", "width")
tooltip: qsTr("Content width used for calculating the total implicit width.") tooltip: qsTr("Content width used for calculating the total implicit width.")
} }
@@ -102,7 +103,8 @@ Column {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { ControlLabel {
text: qsTr("H") //: The height of the object
text: qsTr("H", "height")
tooltip: qsTr("Content height used for calculating the total implicit height.") tooltip: qsTr("Content height used for calculating the total implicit height.")
} }

View File

@@ -64,7 +64,8 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { ControlLabel {
text: qsTr("W") //: The width of the object
text: qsTr("W", "width")
tooltip: qsTr("Content width used for calculating the total implicit width.") tooltip: qsTr("Content width used for calculating the total implicit width.")
} }
@@ -83,7 +84,8 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { ControlLabel {
text: qsTr("H") //: The height of the object
text: qsTr("H", "height")
tooltip: qsTr("Content height used for calculating the total implicit height.") tooltip: qsTr("Content height used for calculating the total implicit height.")
} }

View File

@@ -111,7 +111,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Indeterminate") text: qsTr("Indeterminate")
tooltip: qsTr("Whether the progress is indeterminate.") tooltip: qsTr("Whether the progress is indeterminate.")
disabledState: !backendValues.indeterminate.isAvailable blockedByTemplate: !backendValues.indeterminate.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -50,7 +50,8 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Appearance") text: qsTr("Appearance")
tooltip: qsTr("Whether the button is flat and/or highlighted.") tooltip: qsTr("Whether the button is flat and/or highlighted.")
disabledState: !backendValues.flat.isAvailable blockedByTemplate: !backendValues.flat.isAvailable
&& !backendValues.highlighted.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -61,7 +61,8 @@ Column {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { ControlLabel {
text: qsTr("W") //: The width of the object
text: qsTr("W", "width")
tooltip: qsTr("Content width used for calculating the total implicit width.") tooltip: qsTr("Content width used for calculating the total implicit width.")
} }
@@ -78,7 +79,8 @@ Column {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { ControlLabel {
text: qsTr("H") //: The height of the object
text: qsTr("H", "height")
tooltip: qsTr("Content height used for calculating the total implicit height.") tooltip: qsTr("Content height used for calculating the total implicit height.")
} }

View File

@@ -70,6 +70,7 @@ Column {
implicitWidth: StudioTheme.Values.twoControlColumnWidth implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth + StudioTheme.Values.actionIndicatorWidth
backendValue: backendValues.live backendValue: backendValues.live
enabled: backendValues.live.isAvailable
tooltip: qsTr("Whether the slider provides live value updates.") tooltip: qsTr("Whether the slider provides live value updates.")
} }
@@ -136,6 +137,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Drag threshold") text: qsTr("Drag threshold")
tooltip: qsTr("The threshold (in logical pixels) at which a drag event will be initiated.") tooltip: qsTr("The threshold (in logical pixels) at which a drag event will be initiated.")
blockedByTemplate: !backendValues.touchDragThreshold.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -146,6 +148,7 @@ Column {
maximumValue: 10000 maximumValue: 10000
decimals: 0 decimals: 0
backendValue: backendValues.touchDragThreshold backendValue: backendValues.touchDragThreshold
enabled: backendValues.touchDragThreshold.isAvailable
} }
ExpandingSpacer {} ExpandingSpacer {}
@@ -154,6 +157,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Snap mode") text: qsTr("Snap mode")
tooltip: qsTr("The snap mode of the slider.") tooltip: qsTr("The snap mode of the slider.")
blockedByTemplate: !backendValues.snapMode.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -164,6 +168,7 @@ Column {
backendValue: backendValues.snapMode backendValue: backendValues.snapMode
model: [ "NoSnap", "SnapOnRelease", "SnapAlways" ] model: [ "NoSnap", "SnapOnRelease", "SnapAlways" ]
scope: "RangeSlider" scope: "RangeSlider"
enabled: backendValues.snapMode.isAvailable
} }
ExpandingSpacer {} ExpandingSpacer {}

View File

@@ -85,7 +85,8 @@ Column {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { ControlLabel {
text: qsTr("W") //: The width of the object
text: qsTr("W", "width")
tooltip: qsTr("Content width used for calculating the total implicit width.") tooltip: qsTr("Content width used for calculating the total implicit width.")
} }
@@ -104,7 +105,8 @@ Column {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { ControlLabel {
text: qsTr("H") //: The height of the object
text: qsTr("H", "height")
tooltip: qsTr("Content height used for calculating the total implicit height.") tooltip: qsTr("Content height used for calculating the total implicit height.")
} }

View File

@@ -67,7 +67,10 @@ Section {
} }
SectionLayout { SectionLayout {
PropertyLabel { text: qsTr("Position") } PropertyLabel {
text: qsTr("Position")
enabled: xSpinBox.enabled || ySpinBox.enabled
}
SecondColumnLayout { SecondColumnLayout {
SpinBox { SpinBox {
@@ -86,6 +89,7 @@ Section {
ControlLabel { ControlLabel {
text: "X" text: "X"
tooltip: xSpinBox.enabled ? "X" : root.disbaledTooltip tooltip: xSpinBox.enabled ? "X" : root.disbaledTooltip
enabled: xSpinBox.enabled
} }
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -106,6 +110,7 @@ Section {
ControlLabel { ControlLabel {
text: "Y" text: "Y"
tooltip: xSpinBox.enabled ? "Y" : root.disbaledTooltip tooltip: xSpinBox.enabled ? "Y" : root.disbaledTooltip
enabled: ySpinBox.enabled
} }
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -115,7 +120,10 @@ Section {
ExpandingSpacer {} ExpandingSpacer {}
} }
PropertyLabel { text: qsTr("Size") } PropertyLabel {
text: qsTr("Size")
enabled: widthSpinBox.enabled || heightSpinBox.enabled
}
SecondColumnLayout { SecondColumnLayout {
SpinBox { SpinBox {
@@ -132,8 +140,10 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { ControlLabel {
text: qsTr("W") //: The width of the object
text: qsTr("W", "width")
tooltip: widthSpinBox.enabled ? qsTr("Width") : root.disbaledTooltip tooltip: widthSpinBox.enabled ? qsTr("Width") : root.disbaledTooltip
enabled: widthSpinBox.enabled
} }
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -152,8 +162,10 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { ControlLabel {
text: qsTr("H") //: The height of the object
text: qsTr("H", "height")
tooltip: heightSpinBox.enabled ? qsTr("Height") : root.disbaledTooltip tooltip: heightSpinBox.enabled ? qsTr("Height") : root.disbaledTooltip
enabled: heightSpinBox.enabled
} }
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -163,7 +175,10 @@ Section {
ExpandingSpacer {} ExpandingSpacer {}
} }
PropertyLabel { text: qsTr("Rotation") } PropertyLabel {
text: qsTr("Rotation")
blockedByTemplate: !backendValues.rotation.isAvailable
}
SecondColumnLayout { SecondColumnLayout {
SpinBox { SpinBox {
@@ -178,7 +193,10 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: "°" } ControlLabel {
text: "°"
enabled: backendValues.rotation.isAvailable
}
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -209,7 +227,10 @@ Section {
ExpandingSpacer {} ExpandingSpacer {}
} }
PropertyLabel { text: qsTr("Scale") } PropertyLabel {
text: qsTr("Scale")
blockedByTemplate: !backendValues.scale.isAvailable
}
SecondColumnLayout { SecondColumnLayout {
SpinBox { SpinBox {
@@ -226,7 +247,10 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: "%" } ControlLabel {
text: "%"
enabled: backendValues.scale.isAvailable
}
ExpandingSpacer {} ExpandingSpacer {}
} }
@@ -245,7 +269,10 @@ Section {
ExpandingSpacer {} ExpandingSpacer {}
} }
PropertyLabel { text: qsTr("Origin") } PropertyLabel {
text: qsTr("Origin")
blockedByTemplate: !backendValues.transformOrigin.isAvailable
}
SecondColumnLayout { SecondColumnLayout {
OriginControl { OriginControl {

View File

@@ -58,7 +58,10 @@ Column {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("W") } ControlLabel {
//: The width of the object
text: qsTr("W", "width")
}
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -72,7 +75,10 @@ Column {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("H") } ControlLabel {
//: The height of the object
text: qsTr("H", "height")
}
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -132,7 +138,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Cache") text: qsTr("Cache")
tooltip: qsTr("Cache buffer") tooltip: qsTr("Cache buffer")
disabledState: !backendValues.cacheBuffer.isAvailable blockedByTemplate: !backendValues.cacheBuffer.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -152,7 +158,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Navigation wraps") text: qsTr("Navigation wraps")
tooltip: qsTr("Whether the grid wraps key navigation.") tooltip: qsTr("Whether the grid wraps key navigation.")
disabledState: !backendValues.keyNavigationWraps.isAvailable blockedByTemplate: !backendValues.keyNavigationWraps.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -164,7 +164,10 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("W") } ControlLabel {
//: The width of the object
text: qsTr("W", "width")
}
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -179,7 +182,10 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("H") } ControlLabel {
//: The height of the object
text: qsTr("H", "height")
}
ExpandingSpacer {} ExpandingSpacer {}
} }
@@ -303,7 +309,10 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("W") } ControlLabel {
//: The width of the object
text: qsTr("W", "width")
}
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -319,7 +328,10 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("H") } ControlLabel {
//: The height of the object
text: qsTr("H", "height")
}
ExpandingSpacer {} ExpandingSpacer {}
} }

View File

@@ -241,7 +241,10 @@ SectionLayout {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("W") } ControlLabel {
//: The width of the object
text: qsTr("W", "width")
}
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -256,7 +259,10 @@ SectionLayout {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("H") } ControlLabel {
//: The height of the object
text: qsTr("H", "height")
}
ExpandingSpacer {} ExpandingSpacer {}
} }
@@ -278,7 +284,10 @@ SectionLayout {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("W") } ControlLabel {
//: The width of the object
text: qsTr("W", "width")
}
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -293,7 +302,10 @@ SectionLayout {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("H") } ControlLabel {
//: The height of the object
text: qsTr("H", "height")
}
ExpandingSpacer {} ExpandingSpacer {}
} }
@@ -315,7 +327,10 @@ SectionLayout {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("W") } ControlLabel {
//: The width of the object
text: qsTr("W", "width")
}
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -330,7 +345,10 @@ SectionLayout {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("H") } ControlLabel {
//: The height of the object
text: qsTr("H", "height")
}
ExpandingSpacer {} ExpandingSpacer {}
} }

View File

@@ -48,5 +48,23 @@ Section {
ExpandingSpacer {} ExpandingSpacer {}
} }
PropertyLabel {
text: qsTr("Layout direction")
blockedByTemplate: !backendValues.layoutDirection.isAvailable
}
SecondColumnLayout {
ComboBox {
scope: "Qt"
model: ["LeftToRight", "RightToLeft"]
backendValue: backendValues.layoutDirection
enabled: backendValues.layoutDirection.isAvailable
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
} }
} }

View File

@@ -48,5 +48,23 @@ Section {
ExpandingSpacer {} ExpandingSpacer {}
} }
PropertyLabel {
text: qsTr("Layout direction")
blockedByTemplate: !backendValues.layoutDirection.isAvailable
}
SecondColumnLayout {
ComboBox {
scope: "Qt"
model: ["LeftToRight", "RightToLeft"]
backendValue: backendValues.layoutDirection
enabled: backendValues.layoutDirection.isAvailable
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
} }
} }

View File

@@ -61,7 +61,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Layout direction") text: qsTr("Layout direction")
disabledState: !backendValues.layoutDirection.isAvailable blockedByTemplate: !backendValues.layoutDirection.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -81,7 +81,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Snap mode") text: qsTr("Snap mode")
tooltip: qsTr("Determines how the view scrolling will settle following a drag or flick.") tooltip: qsTr("Determines how the view scrolling will settle following a drag or flick.")
disabledState: !backendValues.snapMode.isAvailable blockedByTemplate: !backendValues.snapMode.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -119,7 +119,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Cache") text: qsTr("Cache")
tooltip: qsTr("Cache buffer.") tooltip: qsTr("Cache buffer.")
disabledState: !backendValues.cacheBuffer.isAvailable blockedByTemplate: !backendValues.cacheBuffer.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -139,7 +139,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Navigation wraps") text: qsTr("Navigation wraps")
tooltip: qsTr("Whether the grid wraps key navigation.") tooltip: qsTr("Whether the grid wraps key navigation.")
disabledState: !backendValues.keyNavigationWraps.isAvailable blockedByTemplate: !backendValues.keyNavigationWraps.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -166,7 +166,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Range") text: qsTr("Range")
tooltip: qsTr("Highlight range.") tooltip: qsTr("Highlight range.")
disabledState: !backendValues.highlightRangeMode.isAvailable blockedByTemplate: !backendValues.highlightRangeMode.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -186,7 +186,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Move duration") text: qsTr("Move duration")
tooltip: qsTr("Move animation duration of the highlight delegate.") tooltip: qsTr("Move animation duration of the highlight delegate.")
disabledState: !backendValues.highlightMoveDuration.isAvailable blockedByTemplate: !backendValues.highlightMoveDuration.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -206,7 +206,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Move velocity") text: qsTr("Move velocity")
tooltip: qsTr("Move animation velocity of the highlight delegate.") tooltip: qsTr("Move animation velocity of the highlight delegate.")
disabledState: !backendValues.highlightMoveVelocity.isAvailable blockedByTemplate: !backendValues.highlightMoveVelocity.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -226,7 +226,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Resize duration") text: qsTr("Resize duration")
tooltip: qsTr("Resize animation duration of the highlight delegate.") tooltip: qsTr("Resize animation duration of the highlight delegate.")
disabledState: !backendValues.highlightResizeDuration.isAvailable blockedByTemplate: !backendValues.highlightResizeDuration.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -246,7 +246,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Resize velocity") text: qsTr("Resize velocity")
tooltip: qsTr("Resize animation velocity of the highlight delegate.") tooltip: qsTr("Resize animation velocity of the highlight delegate.")
disabledState: !backendValues.highlightResizeVelocity.isAvailable blockedByTemplate: !backendValues.highlightResizeVelocity.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -266,7 +266,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Preferred begin") text: qsTr("Preferred begin")
tooltip: qsTr("Preferred highlight begin - must be smaller than Preferred end.") tooltip: qsTr("Preferred highlight begin - must be smaller than Preferred end.")
disabledState: !backendValues.preferredHighlightBegin.isAvailable blockedByTemplate: !backendValues.preferredHighlightBegin.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -286,7 +286,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Preferred end") text: qsTr("Preferred end")
tooltip: qsTr("Preferred highlight end - must be larger than Preferred begin.") tooltip: qsTr("Preferred highlight end - must be larger than Preferred begin.")
disabledState: !backendValues.preferredHighlightEnd.isAvailable blockedByTemplate: !backendValues.preferredHighlightEnd.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -306,7 +306,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Follows current") text: qsTr("Follows current")
tooltip: qsTr("Whether the highlight is managed by the view.") tooltip: qsTr("Whether the highlight is managed by the view.")
disabledState: !backendValues.highlightFollowsCurrentItem.isAvailable blockedByTemplate: !backendValues.highlightFollowsCurrentItem.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -43,7 +43,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Enable") text: qsTr("Enable")
tooltip: qsTr("Accepts mouse events.") tooltip: qsTr("Accepts mouse events.")
disabledState: !backendValues.enabled.isAvailable blockedByTemplate: !backendValues.enabled.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -71,7 +71,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Accepted buttons") text: qsTr("Accepted buttons")
tooltip: qsTr("Mouse buttons that the mouse area reacts to.") tooltip: qsTr("Mouse buttons that the mouse area reacts to.")
disabledState: !backendValues.acceptedButtons.isAvailable blockedByTemplate: !backendValues.acceptedButtons.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -91,7 +91,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Cursor shape") text: qsTr("Cursor shape")
tooltip: qsTr("Cursor shape for this mouse area.") tooltip: qsTr("Cursor shape for this mouse area.")
disabledState: !backendValues.cursorShape.isAvailable blockedByTemplate: !backendValues.cursorShape.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -134,7 +134,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Scroll gesture") text: qsTr("Scroll gesture")
tooltip: qsTr("Responds to scroll gestures from non-mouse devices.") tooltip: qsTr("Responds to scroll gestures from non-mouse devices.")
disabledState: !backendValues.scrollGestureEnabled.isAvailable blockedByTemplate: !backendValues.scrollGestureEnabled.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -152,7 +152,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Prevent stealing") text: qsTr("Prevent stealing")
tooltip: qsTr("Stops mouse events from being stolen from this mouse area.") tooltip: qsTr("Stops mouse events from being stolen from this mouse area.")
disabledState: !backendValues.preventStealing.isAvailable blockedByTemplate: !backendValues.preventStealing.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -170,7 +170,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Propagate events") text: qsTr("Propagate events")
tooltip: qsTr("Automatically propagates composed mouse events to other mouse areas.") tooltip: qsTr("Automatically propagates composed mouse events to other mouse areas.")
disabledState: !backendValues.propagateComposedEvents.isAvailable blockedByTemplate: !backendValues.propagateComposedEvents.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -58,7 +58,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Border width") text: qsTr("Border width")
disabledState: !backendValues.border_width.isAvailable blockedByTemplate: !backendValues.border_width.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -57,7 +57,7 @@ Column {
PropertyLabel { PropertyLabel {
text: qsTr("Layout direction") text: qsTr("Layout direction")
disabledState: !backendValues.layoutDirection.isAvailable blockedByTemplate: !backendValues.layoutDirection.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -162,7 +162,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Style name") text: qsTr("Style name")
tooltip: qsTr("Font's style.") tooltip: qsTr("Font's style.")
disabledState: !styleNameComboBox.enabled blockedByTemplate: !styleNameComboBox.enabled
} }
SecondColumnLayout { SecondColumnLayout {
@@ -298,6 +298,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Letter spacing") text: qsTr("Letter spacing")
tooltip: qsTr("Letter spacing for the font.") tooltip: qsTr("Letter spacing for the font.")
blockedByTemplate: !getBackendValue("letterSpacing").isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -318,6 +319,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Word spacing") text: qsTr("Word spacing")
tooltip: qsTr("Word spacing for the font.") tooltip: qsTr("Word spacing for the font.")
blockedByTemplate: !getBackendValue("wordSpacing").isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -339,7 +341,7 @@ Section {
visible: root.showLineHeight visible: root.showLineHeight
text: qsTr("Line height") text: qsTr("Line height")
tooltip: qsTr("Line height for the text.") tooltip: qsTr("Line height for the text.")
disabledState: !lineHeightSpinBox.enabled blockedByTemplate: !lineHeightSpinBox.enabled
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -49,4 +49,15 @@ T.Label {
anchors.fill: parent anchors.fill: parent
tooltip: label.text tooltip: label.text
} }
states: [
State {
name: "disabled"
when: !label.enabled
PropertyChanges {
target: label
color: StudioTheme.Values.themeTextColorDisabled
}
}
]
} }

View File

@@ -188,47 +188,30 @@ Item {
ListViewComboBox { ListViewComboBox {
id: dummyComboBox id: dummyComboBox
//property int myIndex: index
//property bool empty: dummyComboBox.initialModelData === ""
visible: myRepeater.count === 0 visible: myRepeater.count === 0
validator: RegExpValidator { regExp: /(^[a-z_]\w*|^[A-Z]\w*\.{1}([a-z_]\w*\.?)+)/ } validator: RegExpValidator { regExp: /(^[a-z_]\w*|^[A-Z]\w*\.{1}([a-z_]\w*\.?)+)/ }
actionIndicatorVisible: false actionIndicatorVisible: false
typeFilter: editableListView.typeFilter typeFilter: editableListView.typeFilter
//editText: modelData
//initialModelData: modelData
implicitWidth: StudioTheme.Values.singleControlColumnWidth implicitWidth: StudioTheme.Values.singleControlColumnWidth
width: implicitWidth width: implicitWidth
onFocusChanged: { onFocusChanged: {
//if (itemFilterComboBox.focus) if (dummyComboBox.editText !== "")
// myColumn.currentIndex = index
if (/*dummyComboBox.empty && */dummyComboBox.editText !== "") {
//myRepeater.dirty = false
editableListView.add(dummyComboBox.editText) editableListView.add(dummyComboBox.editText)
}
} }
onCompressedActivated: { onCompressedActivated: {
editableListView.activatedReason = reason editableListView.activatedReason = reason
if (/*dummyComboBox.empty && */dummyComboBox.editText !== "") { if (dummyComboBox.editText !== "")
//myRepeater.dirty = false
editableListView.add(dummyComboBox.editText) editableListView.add(dummyComboBox.editText)
} else { else
editableListView.replace(dummyComboBox.myIndex, dummyComboBox.editText) editableListView.replace(dummyComboBox.myIndex, dummyComboBox.editText)
}
} }
onHoverChanged: editableListView.delegateHover = dummyComboBox.hover onHoverChanged: editableListView.delegateHover = dummyComboBox.hover
} }
StudioControls.AbstractButton { StudioControls.AbstractButton {
id: plusButton id: plusButton
buttonIcon: StudioTheme.Constants.plus buttonIcon: StudioTheme.Constants.plus
@@ -241,6 +224,7 @@ Item {
myColumn.currentIndex = idx myColumn.currentIndex = idx
myColumn.currentItem.forceActiveFocus() myColumn.currentItem.forceActiveFocus()
} }
onHoveredChanged: editableListView.delegateHover = plusButton.hovered onHoveredChanged: editableListView.delegateHover = plusButton.hovered
} }
} }

View File

@@ -51,7 +51,8 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { ControlLabel {
text: qsTr("W") //: The width of the object
text: qsTr("W", "width")
tooltip: qsTr("Content width used for calculating the total implicit width.") tooltip: qsTr("Content width used for calculating the total implicit width.")
} }
@@ -68,7 +69,8 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { ControlLabel {
text: qsTr("H") //: The height of the object
text: qsTr("H", "height")
tooltip: qsTr("Content height used for calculating the total implicit height.") tooltip: qsTr("Content height used for calculating the total implicit height.")
} }
@@ -117,8 +119,8 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Origin") text: qsTr("Origin")
disabledState: (!backendValues.originX.isAvailable blockedByTemplate: !backendValues.originX.isAvailable
&& !backendValues.originY.isAvailable) && !backendValues.originY.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -133,7 +135,10 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: "X" } ControlLabel {
text: "X"
enabled: backendValues.originX.isAvailable
}
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -148,7 +153,10 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: "Y" } ControlLabel {
text: "Y"
enabled: backendValues.originY.isAvailable
}
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -159,7 +167,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Left margin") text: qsTr("Left margin")
disabledState: !backendValues.leftMargin.isAvailable blockedByTemplate: !backendValues.leftMargin.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -172,12 +180,13 @@ Section {
decimals: 0 decimals: 0
enabled: backendValue.isAvailable enabled: backendValue.isAvailable
} }
ExpandingSpacer {} ExpandingSpacer {}
} }
PropertyLabel { PropertyLabel {
text: qsTr("Right margin") text: qsTr("Right margin")
disabledState: !backendValues.rightMargin.isAvailable blockedByTemplate: !backendValues.rightMargin.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -196,7 +205,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Top margin") text: qsTr("Top margin")
disabledState: !backendValues.topMargin.isAvailable blockedByTemplate: !backendValues.topMargin.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -215,7 +224,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Bottom margin") text: qsTr("Bottom margin")
disabledState: !backendValues.bottomMargin.isAvailable blockedByTemplate: !backendValues.bottomMargin.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -54,7 +54,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Flick direction") text: qsTr("Flick direction")
disabledState: !backendValues.flickableDirection.isAvailable blockedByTemplate: !backendValues.flickableDirection.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -74,7 +74,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Behavior") text: qsTr("Behavior")
tooltip: qsTr("Whether the surface may be dragged beyond the Flickable's boundaries, or overshoot the Flickable's boundaries when flicked.") tooltip: qsTr("Whether the surface may be dragged beyond the Flickable's boundaries, or overshoot the Flickable's boundaries when flicked.")
disabledState: !backendValues.boundsBehavior.isAvailable blockedByTemplate: !backendValues.boundsBehavior.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -94,7 +94,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Movement") text: qsTr("Movement")
tooltip: qsTr("Whether the Flickable will give a feeling that the edges of the view are soft, rather than a hard physical boundary.") tooltip: qsTr("Whether the Flickable will give a feeling that the edges of the view are soft, rather than a hard physical boundary.")
disabledState: !backendValues.boundsMovement.isAvailable blockedByTemplate: !backendValues.boundsMovement.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -132,7 +132,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Deceleration") text: qsTr("Deceleration")
tooltip: qsTr("Flick deceleration") tooltip: qsTr("Flick deceleration")
disabledState: !backendValues.flickDeceleration.isAvailable blockedByTemplate: !backendValues.flickDeceleration.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -152,7 +152,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Press delay") text: qsTr("Press delay")
tooltip: qsTr("Time to delay delivering a press to children of the Flickable in milliseconds.") tooltip: qsTr("Time to delay delivering a press to children of the Flickable in milliseconds.")
disabledState: !backendValues.pressDelay.isAvailable blockedByTemplate: !backendValues.pressDelay.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -172,7 +172,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Pixel aligned") text: qsTr("Pixel aligned")
tooltip: qsTr("Sets the alignment of contentX and contentY to pixels (true) or subpixels (false).") tooltip: qsTr("Sets the alignment of contentX and contentY to pixels (true) or subpixels (false).")
disabledState: !backendValues.pixelAligned.isAvailable blockedByTemplate: !backendValues.pixelAligned.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -192,7 +192,7 @@ Section {
tooltip: qsTr("If set to true, then when the mouse or touchpoint moves far enough to begin dragging\n" tooltip: qsTr("If set to true, then when the mouse or touchpoint moves far enough to begin dragging\n"
+ "the content, the content will jump, such that the content pixel which was under the\n" + "the content, the content will jump, such that the content pixel which was under the\n"
+ "cursor or touchpoint when pressed remains under that point.") + "cursor or touchpoint when pressed remains under that point.")
disabledState: !backendValues.synchronousDrag.isAvailable blockedByTemplate: !backendValues.synchronousDrag.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -46,7 +46,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Capitalization") text: qsTr("Capitalization")
tooltip: qsTr("Capitalization for the text.") tooltip: qsTr("Capitalization for the text.")
disabledState: !getBackendValue("capitalization").isAvailable blockedByTemplate: !getBackendValue("capitalization").isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -66,7 +66,7 @@ Section {
PropertyLabel { PropertyLabel {
visible: root.showStyle visible: root.showStyle
text: qsTr("Style") text: qsTr("Style")
disabledState: !styleComboBox.enabled blockedByTemplate: !styleComboBox.enabled
} }
SecondColumnLayout { SecondColumnLayout {
@@ -101,7 +101,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Hinting") text: qsTr("Hinting")
tooltip: qsTr("Preferred hinting on the text.") tooltip: qsTr("Preferred hinting on the text.")
disabledState: !getBackendValue("hintingPreference").isAvailable blockedByTemplate: !getBackendValue("hintingPreference").isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -122,7 +122,7 @@ Section {
text: qsTr("Auto kerning") text: qsTr("Auto kerning")
tooltip: qsTr("Enables or disables the kerning OpenType feature when shaping the text. Disabling this may " + tooltip: qsTr("Enables or disables the kerning OpenType feature when shaping the text. Disabling this may " +
"improve performance when creating or changing the text, at the expense of some cosmetic features.") "improve performance when creating or changing the text, at the expense of some cosmetic features.")
disabledState: !getBackendValue("kerning").isAvailable blockedByTemplate: !getBackendValue("kerning").isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -142,7 +142,7 @@ Section {
tooltip: qsTr("Sometimes, a font will apply complex rules to a set of characters in order to display them correctly.\n" + tooltip: qsTr("Sometimes, a font will apply complex rules to a set of characters in order to display them correctly.\n" +
"In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, whereas in " + "In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, whereas in " +
"Latin script,\n it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features\nwhen they are not required, which will improve performance in most cases.") "Latin script,\n it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features\nwhen they are not required, which will improve performance in most cases.")
disabledState: !getBackendValue("preferShaping").isAvailable blockedByTemplate: !getBackendValue("preferShaping").isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -149,7 +149,13 @@ Section {
ExpandingSpacer {} ExpandingSpacer {}
} }
PropertyLabel { text: qsTr("Emphasis") } PropertyLabel {
text: qsTr("Emphasis")
blockedByTemplate: !fontSection.boldStyle.isAvailable
&& !fontSection.italicStyle.isAvailable
&& !fontSection.underlineStyle.isAvailable
&& !fontSection.strikeoutStyle.isAvailable
}
FontStyleButtons { FontStyleButtons {
bold: fontSection.boldStyle bold: fontSection.boldStyle
@@ -162,7 +168,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Capitalization") text: qsTr("Capitalization")
tooltip: qsTr("Capitalization for the text.") tooltip: qsTr("Capitalization for the text.")
disabledState: !getBackendValue("capitalization").isAvailable blockedByTemplate: !getBackendValue("capitalization").isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -182,6 +188,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Weight") text: qsTr("Weight")
tooltip: qsTr("Font's weight.") tooltip: qsTr("Font's weight.")
blockedByTemplate: styleNameComboBox.styleSet
} }
SecondColumnLayout { SecondColumnLayout {
@@ -201,7 +208,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Style name") text: qsTr("Style name")
tooltip: qsTr("Font's style.") tooltip: qsTr("Font's style.")
disabledState: !styleNameComboBox.enabled blockedByTemplate: !styleNameComboBox.enabled
} }
SecondColumnLayout { SecondColumnLayout {
@@ -223,7 +230,7 @@ Section {
PropertyLabel { PropertyLabel {
visible: fontSection.showStyle visible: fontSection.showStyle
text: qsTr("Style") text: qsTr("Style")
disabledState: !styleComboBox.enabled blockedByTemplate: !styleComboBox.enabled
} }
SecondColumnLayout { SecondColumnLayout {
@@ -257,7 +264,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Hinting") text: qsTr("Hinting")
tooltip: qsTr("Preferred hinting on the text.") tooltip: qsTr("Preferred hinting on the text.")
disabledState: !getBackendValue("hintingPreference").isAvailable blockedByTemplate: !getBackendValue("hintingPreference").isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -277,6 +284,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Letter spacing") text: qsTr("Letter spacing")
tooltip: qsTr("Letter spacing for the font.") tooltip: qsTr("Letter spacing for the font.")
blockedByTemplate: getBackendValue("letterSpacing").isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -297,6 +305,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Word spacing") text: qsTr("Word spacing")
tooltip: qsTr("Word spacing for the font.") tooltip: qsTr("Word spacing for the font.")
blockedByTemplate: !backendValue.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -318,7 +327,7 @@ Section {
text: qsTr("Auto kerning") text: qsTr("Auto kerning")
tooltip: qsTr("Enables or disables the kerning OpenType feature when shaping the text. Disabling this may " + tooltip: qsTr("Enables or disables the kerning OpenType feature when shaping the text. Disabling this may " +
"improve performance when creating or changing the text, at the expense of some cosmetic features.") "improve performance when creating or changing the text, at the expense of some cosmetic features.")
disabledState: !getBackendValue("kerning").isAvailable blockedByTemplate: !getBackendValue("kerning").isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -338,7 +347,7 @@ Section {
tooltip: qsTr("Sometimes, a font will apply complex rules to a set of characters in order to display them correctly.\n" + tooltip: qsTr("Sometimes, a font will apply complex rules to a set of characters in order to display them correctly.\n" +
"In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, whereas in " + "In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, whereas in " +
"Latin script,\n it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features\nwhen they are not required, which will improve performance in most cases.") "Latin script,\n it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features\nwhen they are not required, which will improve performance in most cases.")
disabledState: !getBackendValue("preferShaping").isAvailable blockedByTemplate: !getBackendValue("preferShaping").isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -26,7 +26,6 @@
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import HelperWidgets 2.0 import HelperWidgets 2.0
import StudioControls 1.0 as StudioControls
import StudioTheme 1.0 as StudioTheme import StudioTheme 1.0 as StudioTheme
Section { Section {
@@ -63,7 +62,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Source size") text: qsTr("Source size")
disabledState: !backendValues.sourceSize.isAvailable blockedByTemplate: !backendValues.sourceSize.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -79,7 +78,11 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("W") } ControlLabel {
//: The width of the object
text: qsTr("W", "width")
enabled: backendValues.sourceSize_width.isAvailable
}
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -95,7 +98,11 @@ Section {
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel { text: qsTr("H") } ControlLabel {
//: The height of the object
text: qsTr("H", "height")
enabled: backendValues.sourceSize_height.isAvailable
}
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -104,7 +111,6 @@ Section {
ExpandingSpacer {} ExpandingSpacer {}
} }
PropertyLabel { text: qsTr("Alignment H") } PropertyLabel { text: qsTr("Alignment H") }
SecondColumnLayout { SecondColumnLayout {
@@ -138,7 +144,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Asynchronous") text: qsTr("Asynchronous")
tooltip: qsTr("Loads images on the local filesystem asynchronously in a separate thread.") tooltip: qsTr("Loads images on the local filesystem asynchronously in a separate thread.")
disabledState: !backendValues.asynchronous.isAvailable blockedByTemplate: !backendValues.asynchronous.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -156,7 +162,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Auto transform") text: qsTr("Auto transform")
tooltip: qsTr("Automatically applies image transformation metadata such as EXIF orientation.") tooltip: qsTr("Automatically applies image transformation metadata such as EXIF orientation.")
disabledState: !backendValues.autoTransform.isAvailable blockedByTemplate: !backendValues.autoTransform.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -174,7 +180,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Cache") text: qsTr("Cache")
tooltip: qsTr("Caches the image.") tooltip: qsTr("Caches the image.")
disabledState: !backendValues.cache.isAvailable blockedByTemplate: !backendValues.cache.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -192,7 +198,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Mipmap") text: qsTr("Mipmap")
tooltip: qsTr("Uses mipmap filtering when the image is scaled or transformed.") tooltip: qsTr("Uses mipmap filtering when the image is scaled or transformed.")
disabledState: !backendValues.mipmap.isAvailable blockedByTemplate: !backendValues.mipmap.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -210,7 +216,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Mirror") text: qsTr("Mirror")
tooltip: qsTr("Inverts the image horizontally.") tooltip: qsTr("Inverts the image horizontally.")
disabledState: !backendValues.mirror.isAvailable blockedByTemplate: !backendValues.mirror.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -228,7 +234,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Smooth") text: qsTr("Smooth")
tooltip: qsTr("Smoothly filters the image when it is scaled or transformed.") tooltip: qsTr("Smoothly filters the image when it is scaled or transformed.")
disabledState: !backendValues.smooth.isAvailable blockedByTemplate: !backendValues.smooth.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -28,6 +28,7 @@ import QtQuick.Templates 2.15 as T
import StudioTheme 1.0 as StudioTheme import StudioTheme 1.0 as StudioTheme
Rectangle { Rectangle {
id: root
property alias tooltip: toolTipArea.tooltip property alias tooltip: toolTipArea.tooltip
property alias icon0: icon0.text property alias icon0: icon0.text
property alias icon1: icon1.text property alias icon1: icon1.text
@@ -69,4 +70,15 @@ Rectangle {
id: toolTipArea id: toolTipArea
anchors.fill: parent anchors.fill: parent
} }
states: [
State {
name: "disabled"
when: !root.enabled
PropertyChanges {
target: icon1
color: StudioTheme.Values.themeIconColorDisabled
}
}
]
} }

View File

@@ -37,7 +37,8 @@ Section {
SectionLayout { SectionLayout {
PropertyLabel { PropertyLabel {
text: qsTr("Vertical") text: qsTr("Vertical")
disabledState: (!backendValues.topPadding.isAvailable && !backendValues.bottomPadding.isAvailable) blockedByTemplate: !backendValues.topPadding.isAvailable
&& !backendValues.bottomPadding.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -57,7 +58,7 @@ Section {
icon0: StudioTheme.Constants.paddingFrame icon0: StudioTheme.Constants.paddingFrame
icon1: StudioTheme.Constants.paddingEdge icon1: StudioTheme.Constants.paddingEdge
tooltip: qsTr("Padding between the content and the top edge of the item.") tooltip: qsTr("Padding between the content and the top edge of the item.")
//disabledStateSoft: !backendValues.topPadding.isAvailable enabled: backendValues.topPadding.isAvailable
} }
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -79,7 +80,7 @@ Section {
icon1: StudioTheme.Constants.paddingEdge icon1: StudioTheme.Constants.paddingEdge
rotation: 180 rotation: 180
tooltip: qsTr("Padding between the content and the bottom edge of the item.") tooltip: qsTr("Padding between the content and the bottom edge of the item.")
//disabledStateSoft: !backendValues.bottomPadding.isAvailable enabled: backendValues.bottomPadding.isAvailable
} }
ExpandingSpacer {} ExpandingSpacer {}
@@ -87,7 +88,8 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Horizontal") text: qsTr("Horizontal")
disabledState: (!backendValues.leftPadding.isAvailable && !backendValues.rightPadding.isAvailable) blockedByTemplate: !backendValues.leftPadding.isAvailable
&& !backendValues.rightPadding.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -108,7 +110,7 @@ Section {
icon1: StudioTheme.Constants.paddingEdge icon1: StudioTheme.Constants.paddingEdge
rotation: 270 rotation: 270
tooltip: qsTr("Padding between the content and the left edge of the item.") tooltip: qsTr("Padding between the content and the left edge of the item.")
//disabledStateSoft: !backendValues.leftPadding.isAvailable enabled: backendValues.leftPadding.isAvailable
} }
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -130,7 +132,7 @@ Section {
icon1: StudioTheme.Constants.paddingEdge icon1: StudioTheme.Constants.paddingEdge
rotation: 90 rotation: 90
tooltip: qsTr("Padding between the content and the right edge of the item.") tooltip: qsTr("Padding between the content and the right edge of the item.")
//disabledStateSoft: !backendValues.rightPadding.isAvailable enabled: backendValues.rightPadding.isAvailable
} }
ExpandingSpacer {} ExpandingSpacer {}
@@ -139,7 +141,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Global") text: qsTr("Global")
tooltip: qsTr("Padding between the content and the edges of the items.") tooltip: qsTr("Padding between the content and the edges of the items.")
disabledState: !backendValues.padding.isAvailable blockedByTemplate: !backendValues.padding.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -33,12 +33,12 @@ T.Label {
property alias tooltip: toolTipArea.tooltip property alias tooltip: toolTipArea.tooltip
property bool disabledState: false property bool blockedByContext: false
property bool disabledStateSoft: false property bool blockedByTemplate: false // MCU
width: StudioTheme.Values.propertyLabelWidth width: StudioTheme.Values.propertyLabelWidth
color: StudioTheme.Values.themeTextColor color: StudioTheme.Values.themeTextColor
font.pixelSize: StudioTheme.Values.myFontSize // TODO font.pixelSize: StudioTheme.Values.myFontSize
elide: Text.ElideRight elide: Text.ElideRight
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
@@ -50,26 +50,35 @@ T.Label {
ToolTipArea { ToolTipArea {
id: toolTipArea id: toolTipArea
anchors.fill: parent anchors.fill: parent
tooltip: ((label.disabledState || label.disabledStateSoft) tooltip: label.blockedByTemplate
? qsTr("This property is not available in this configuration.") ? qsTr("This property is not available in this configuration.")
: label.text) : label.text
} }
states: [ states: [
State { State {
name: "disabled" name: "disabled"
when: label.disabledState when: !label.enabled && !(label.blockedByContext || label.blockedByTemplate)
PropertyChanges { PropertyChanges {
target: label target: label
color: StudioTheme.Values.themeTextColorDisabled color: StudioTheme.Values.themeTextColorDisabled
} }
}, },
State { State {
name: "disabledSoft" name: "blockedByContext"
when: label.disabledStateSoft when: label.blockedByContext
PropertyChanges { PropertyChanges {
target: label target: label
color: "red"//StudioTheme.Values.themeTextColorDisabled color: StudioTheme.Values.themeTextColorDisabled
}
},
State {
name: "blockedByTemplate"
when: label.blockedByTemplate
PropertyChanges {
target: label
color: StudioTheme.Values.themeTextColorDisabledMCU
font.strikeout: true
} }
} }
] ]

View File

@@ -65,7 +65,7 @@ Section {
implicitWidth: StudioTheme.Values.iconAreaWidth // TODO dedicated value implicitWidth: StudioTheme.Values.iconAreaWidth // TODO dedicated value
implicitHeight: StudioTheme.Values.height // TODO dedicated value implicitHeight: StudioTheme.Values.height // TODO dedicated value
T.Label { Label {
id: richTextEditorIcon id: richTextEditorIcon
anchors.fill: parent anchors.fill: parent
text: StudioTheme.Constants.edit text: StudioTheme.Constants.edit
@@ -120,7 +120,7 @@ Section {
PropertyLabel { PropertyLabel {
visible: root.showVerticalAlignment visible: root.showVerticalAlignment
text: qsTr("Wrap mode") text: qsTr("Wrap mode")
disabledState: !backendValues.wrapMode.isAvailable blockedByTemplate: !backendValues.wrapMode.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -141,7 +141,7 @@ Section {
PropertyLabel { PropertyLabel {
visible: root.showElide visible: root.showElide
text: qsTr("Elide") text: qsTr("Elide")
disabledState: !backendValues.elide.isAvailable blockedByTemplate: !backendValues.elide.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -163,7 +163,7 @@ Section {
visible: root.showElide visible: root.showElide
text: qsTr("Max line count") text: qsTr("Max line count")
tooltip: qsTr("Limits the number of lines that the text component will show.") tooltip: qsTr("Limits the number of lines that the text component will show.")
disabledState: !backendValues.maximumLineCount.isAvailable blockedByTemplate: !backendValues.maximumLineCount.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -202,7 +202,7 @@ Section {
PropertyLabel { PropertyLabel {
visible: root.showFormatProperty visible: root.showFormatProperty
text: qsTr("Format") text: qsTr("Format")
disabledState: !backendValues.textFormat.isAvailable blockedByTemplate: !backendValues.textFormat.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -223,7 +223,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Render type") text: qsTr("Render type")
tooltip: qsTr("Overrides the default rendering type for this component.") tooltip: qsTr("Overrides the default rendering type for this component.")
disabledState: !backendValues.renderType.isAvailable blockedByTemplate: !backendValues.renderType.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -244,7 +244,7 @@ Section {
visible: root.showFontSizeMode visible: root.showFontSizeMode
text: qsTr("Size mode") text: qsTr("Size mode")
tooltip: qsTr("Specifies how the font size of the displayed text is determined.") tooltip: qsTr("Specifies how the font size of the displayed text is determined.")
disabledState: !backendValues.fontSizeMode.isAvailable blockedByTemplate: !backendValues.fontSizeMode.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -266,8 +266,8 @@ Section {
PropertyLabel { PropertyLabel {
visible: root.showFontSizeMode visible: root.showFontSizeMode
text: qsTr("Min size") text: qsTr("Min size")
disabledState: !backendValues.minimumPixelSize.isAvailable blockedByTemplate: !backendValues.minimumPixelSize.isAvailable
&& !backendValues.minimumPointSize.isAvailable && !backendValues.minimumPointSize.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -288,7 +288,7 @@ Section {
ControlLabel { ControlLabel {
text: "px" text: "px"
tooltip: qsTr("Minimum font pixel size of scaled text.") tooltip: qsTr("Minimum font pixel size of scaled text.")
//disabledStateSoft: !backendValues.minimumPixelSize.isAvailable enabled: backendValues.minimumPixelSize.isAvailable
} }
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -308,7 +308,7 @@ Section {
ControlLabel { ControlLabel {
text: "pt" text: "pt"
tooltip: qsTr("Minimum font point size of scaled text.") tooltip: qsTr("Minimum font point size of scaled text.")
//disabledStateSoft: !backendValues.minimumPointSize.isAvailable enabled: backendValues.minimumPointSize.isAvailable
} }
ExpandingSpacer {} ExpandingSpacer {}
@@ -318,7 +318,7 @@ Section {
visible: root.showLineHeight visible: root.showLineHeight
text: qsTr("Line height") text: qsTr("Line height")
tooltip: qsTr("Line height for the text.") tooltip: qsTr("Line height for the text.")
disabledState: !lineHeightSpinBox.enabled blockedByTemplate: !lineHeightSpinBox.enabled
} }
SecondColumnLayout { SecondColumnLayout {
@@ -344,7 +344,7 @@ Section {
visible: root.showLineHeight visible: root.showLineHeight
text: qsTr("Line height mode") text: qsTr("Line height mode")
tooltip: qsTr("Determines how the line height is specified.") tooltip: qsTr("Determines how the line height is specified.")
disabledState: !backendValues.lineHeightMode.isAvailable blockedByTemplate: !backendValues.lineHeightMode.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -45,7 +45,7 @@ Section {
PropertyLabel { PropertyLabel {
visible: root.showWrapMode visible: root.showWrapMode
text: qsTr("Wrap mode") text: qsTr("Wrap mode")
disabledState: !backendValues.wrapMode.isAvailable blockedByTemplate: !backendValues.wrapMode.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -67,7 +67,7 @@ Section {
PropertyLabel { PropertyLabel {
visible: root.showElide visible: root.showElide
text: qsTr("Elide") text: qsTr("Elide")
disabledState: !backendValues.elide.isAvailable blockedByTemplate: !backendValues.elide.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -89,7 +89,7 @@ Section {
PropertyLabel { PropertyLabel {
visible: root.showFormatProperty visible: root.showFormatProperty
text: qsTr("Format") text: qsTr("Format")
disabledState: !backendValues.textFormat.isAvailable blockedByTemplate: !backendValues.textFormat.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -111,7 +111,7 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Render type") text: qsTr("Render type")
tooltip: qsTr("Overrides the default rendering type for this component.") tooltip: qsTr("Overrides the default rendering type for this component.")
disabledState: !backendValues.renderType.isAvailable blockedByTemplate: !backendValues.renderType.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -132,7 +132,7 @@ Section {
visible: root.showLineHeight visible: root.showLineHeight
text: qsTr("Line height mode") text: qsTr("Line height mode")
tooltip: qsTr("Determines how the line height is specified.") tooltip: qsTr("Determines how the line height is specified.")
disabledState: !backendValues.lineHeightMode.isAvailable blockedByTemplate: !backendValues.lineHeightMode.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -155,7 +155,7 @@ Section {
visible: root.showFontSizeMode visible: root.showFontSizeMode
text: qsTr("Size mode") text: qsTr("Size mode")
tooltip: qsTr("Specifies how the font size of the displayed text is determined.") tooltip: qsTr("Specifies how the font size of the displayed text is determined.")
disabledState: !backendValues.fontSizeMode.isAvailable blockedByTemplate: !backendValues.fontSizeMode.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -178,8 +178,8 @@ Section {
PropertyLabel { PropertyLabel {
visible: root.showFontSizeMode visible: root.showFontSizeMode
text: qsTr("Min size") text: qsTr("Min size")
disabledState: !backendValues.minimumPixelSize.isAvailable blockedByTemplate: !backendValues.minimumPixelSize.isAvailable
&& !backendValues.minimumPointSize.isAvailable && !backendValues.minimumPointSize.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
@@ -200,7 +200,7 @@ Section {
ControlLabel { ControlLabel {
text: "px" text: "px"
tooltip: qsTr("Minimum font pixel size of scaled text.") tooltip: qsTr("Minimum font pixel size of scaled text.")
//disabledStateSoft: !backendValues.minimumPixelSize.isAvailable enabled: backendValues.minimumPixelSize.isAvailable
} }
Spacer { implicitWidth: StudioTheme.Values.controlGap } Spacer { implicitWidth: StudioTheme.Values.controlGap }
@@ -220,7 +220,7 @@ Section {
ControlLabel { ControlLabel {
text: "pt" text: "pt"
tooltip: qsTr("Minimum font point size of scaled text.") tooltip: qsTr("Minimum font point size of scaled text.")
//disabledStateSoft: !backendValues.minimumPointSize.isAvailable enabled: backendValues.minimumPointSize.isAvailable
} }
ExpandingSpacer {} ExpandingSpacer {}
@@ -230,7 +230,7 @@ Section {
visible: root.showElide visible: root.showElide
text: qsTr("Max line count") text: qsTr("Max line count")
tooltip: qsTr("Limits the number of lines that the text component will show.") tooltip: qsTr("Limits the number of lines that the text component will show.")
disabledState: !backendValues.maximumLineCount.isAvailable blockedByTemplate: !backendValues.maximumLineCount.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {

View File

@@ -220,6 +220,7 @@ QtObject {
property string themeTextColorDisabled: Theme.color(Theme.DStextColorDisabled) property string themeTextColorDisabled: Theme.color(Theme.DStextColorDisabled)
property string themeTextSelectionColor: Theme.color(Theme.DStextSelectionColor) property string themeTextSelectionColor: Theme.color(Theme.DStextSelectionColor)
property string themeTextSelectedTextColor: Theme.color(Theme.DStextSelectedTextColor) property string themeTextSelectedTextColor: Theme.color(Theme.DStextSelectedTextColor)
property string themeTextColorDisabledMCU: "black" // TODO
property string themePlaceholderTextColor: Theme.color(Theme.DSplaceholderTextColor) property string themePlaceholderTextColor: Theme.color(Theme.DSplaceholderTextColor)
property string themePlaceholderTextColorInteraction: Theme.color(Theme.DSplaceholderTextColorInteraction) property string themePlaceholderTextColorInteraction: Theme.color(Theme.DSplaceholderTextColorInteraction)

View File

@@ -3,7 +3,7 @@
"supportedProjectTypes": [ "QmlProjectManager.QmlProject" ], "supportedProjectTypes": [ "QmlProjectManager.QmlProject" ],
"id": "QA.QtQuickUi", "id": "QA.QtQuickUi",
"category": "H.Project", "category": "H.Project",
"trDescription": "Creates a Qt Quick 2 UI project with a QML entry point. To use it, you need to have a QML runtime environment such as qmlscene set up.\n\nUse this only if you are prototyping. You cannot create a full application with this. Consider using a Qt Quick Application project instead.", "trDescription": "Creates a Qt Quick 2 UI project with a QML entry point. To use it, you need to have a QML runtime environment.\n\nUse this only if you are prototyping. You cannot create a full application with this. Consider using a Qt Quick Application project instead.",
"trDisplayName": "Qt Quick UI Prototype", "trDisplayName": "Qt Quick UI Prototype",
"trDisplayCategory": "Other Project", "trDisplayCategory": "Other Project",
"icon": "qtquickuiprototype.png", "icon": "qtquickuiprototype.png",

View File

@@ -57,8 +57,7 @@ Product {
var list = [ var list = [
"lrelease.xml", "lrelease.xml",
"lupdate.xml", "lupdate.xml",
"qmlscene.xml", "qml.xml",
"qmlviewer.xml",
] ]
if (qbs.targetOS.contains("windows")) if (qbs.targetOS.contains("windows"))
list.push("notepad_win.xml"); list.push("notepad_win.xml");

View File

@@ -51,18 +51,16 @@ public:
explicit MessageId(const QString &id) : variant(id) {} explicit MessageId(const QString &id) : variant(id) {}
explicit MessageId(const QJsonValue &value) explicit MessageId(const QJsonValue &value)
{ {
if (value.isUndefined())
return;
QTC_CHECK(value.isDouble() || value.isString());
if (value.isDouble()) if (value.isDouble())
*this = MessageId(value.toInt()); *this = MessageId(value.toInt());
else if (value.isString()) else if (value.isString())
*this = MessageId(value.toString()); *this = MessageId(value.toString());
else
m_valid = false;
} }
operator QJsonValue() const operator QJsonValue() const
{ {
QTC_CHECK(Utils::holds_alternative<int>(*this) || Utils::holds_alternative<QString>(*this));
if (auto id = Utils::get_if<int>(this)) if (auto id = Utils::get_if<int>(this))
return *id; return *id;
if (auto id = Utils::get_if<QString>(this)) if (auto id = Utils::get_if<QString>(this))
@@ -70,7 +68,7 @@ public:
return QJsonValue(); return QJsonValue();
} }
bool isValid() const { return true; } bool isValid() const { return m_valid; }
QString toString() const QString toString() const
{ {
@@ -80,6 +78,9 @@ public:
return QString::number(*id); return QString::number(*id);
return {}; return {};
} }
private:
bool m_valid = true;
}; };
struct ResponseHandler struct ResponseHandler

View File

@@ -188,6 +188,8 @@ public:
QString query() const { return typedValue<QString>(queryKey); } QString query() const { return typedValue<QString>(queryKey); }
void setQuery(const QString &query) { insert(queryKey, query); } void setQuery(const QString &query) { insert(queryKey, query); }
void setLimit(int limit) { insert("limit", limit); } // clangd extension
bool isValid() const override { return contains(queryKey); } bool isValid() const override { return contains(queryKey); }
}; };

View File

@@ -46,6 +46,8 @@ Utils::optional<EnvironmentItems> EnvironmentDialog::getEnvironmentItems(
tr("Edit Environment"), tr("Edit Environment"),
tr("Enter one environment variable per line.\n" tr("Enter one environment variable per line.\n"
"To set or change a variable, use VARIABLE=VALUE.\n" "To set or change a variable, use VARIABLE=VALUE.\n"
"To append to a variable, use VARIABLE+=VALUE.\n"
"To prepend to a variable, use VARIABLE=+VALUE.\n"
"Existing variables can be referenced in a VALUE with ${OTHER}.\n" "Existing variables can be referenced in a VALUE with ${OTHER}.\n"
"To clear a variable, put its name on a line with nothing else on it.\n" "To clear a variable, put its name on a line with nothing else on it.\n"
"To disable a variable, prefix the line with \"#\".")); "To disable a variable, prefix the line with \"#\"."));

View File

@@ -939,6 +939,26 @@ bool FilePath::isReadableDir() const
return fi.exists() && fi.isReadable() && fi.isDir(); return fi.exists() && fi.isReadable() && fi.isDir();
} }
bool FilePath::isFile() const
{
if (needsDevice()) {
QTC_ASSERT(s_deviceHooks.isFile, return false);
return s_deviceHooks.isFile(*this);
}
const QFileInfo fi{m_data};
return fi.exists() && fi.isFile();
}
bool FilePath::isDir() const
{
if (needsDevice()) {
QTC_ASSERT(s_deviceHooks.isDir, return false);
return s_deviceHooks.isDir(*this);
}
const QFileInfo fi{m_data};
return fi.exists() && fi.isDir();
}
bool FilePath::createDir() const bool FilePath::createDir() const
{ {
if (needsDevice()) { if (needsDevice()) {
@@ -1244,12 +1264,6 @@ bool FilePath::endsWith(const QString &s) const
return m_data.endsWith(s, caseSensitivity()); return m_data.endsWith(s, caseSensitivity());
} }
bool FilePath::isDir() const
{
QTC_CHECK(m_scheme.isEmpty()); // FIXME: Not implemented yet.
return QFileInfo(m_data).isDir();
}
/// \returns the relativeChildPath of FilePath to parent if FilePath is a child of parent /// \returns the relativeChildPath of FilePath to parent if FilePath is a child of parent
/// \note returns a empty FilePath if FilePath is not a child of parent /// \note returns a empty FilePath if FilePath is not a child of parent
/// That is, this never returns a path starting with "../" /// That is, this never returns a path starting with "../"

View File

@@ -77,6 +77,8 @@ public:
std::function<bool(const FilePath &)> isReadableDir; std::function<bool(const FilePath &)> isReadableDir;
std::function<bool(const FilePath &)> isWritableDir; std::function<bool(const FilePath &)> isWritableDir;
std::function<bool(const FilePath &)> isWritableFile; std::function<bool(const FilePath &)> isWritableFile;
std::function<bool(const FilePath &)> isFile;
std::function<bool(const FilePath &)> isDir;
std::function<bool(const FilePath &)> ensureWritableDir; std::function<bool(const FilePath &)> ensureWritableDir;
std::function<bool(const FilePath &)> ensureExistingFile; std::function<bool(const FilePath &)> ensureExistingFile;
std::function<bool(const FilePath &)> createDir; std::function<bool(const FilePath &)> createDir;
@@ -149,6 +151,8 @@ public:
bool isReadableDir() const; bool isReadableDir() const;
bool isRelativePath() const; bool isRelativePath() const;
bool isAbsolutePath() const { return !isRelativePath(); } bool isAbsolutePath() const { return !isRelativePath(); }
bool isFile() const;
bool isDir() const;
bool createDir() const; bool createDir() const;
QList<FilePath> dirEntries(const QStringList &nameFilters, QList<FilePath> dirEntries(const QStringList &nameFilters,
@@ -177,7 +181,6 @@ public:
bool startsWith(const QString &s) const; bool startsWith(const QString &s) const;
bool endsWith(const QString &s) const; bool endsWith(const QString &s) const;
bool isDir() const;
bool isNewerThan(const QDateTime &timeStamp) const; bool isNewerThan(const QDateTime &timeStamp) const;
QDateTime lastModified() const; QDateTime lastModified() const;
QFile::Permissions permissions() const; QFile::Permissions permissions() const;

View File

@@ -35,6 +35,10 @@
#include <qt_windows.h> #include <qt_windows.h>
#endif #endif
#ifdef Q_OS_MACOS
#include <sys/sysctl.h>
#endif
using namespace Utils; using namespace Utils;
Qt::CaseSensitivity HostOsInfo::m_overrideFileNameCaseSensitivity = Qt::CaseSensitive; Qt::CaseSensitivity HostOsInfo::m_overrideFileNameCaseSensitivity = Qt::CaseSensitive;
@@ -70,6 +74,17 @@ HostOsInfo::HostArchitecture HostOsInfo::hostArchitecture()
#endif #endif
} }
bool HostOsInfo::isRunningUnderRosetta()
{
#ifdef Q_OS_MACOS
int translated = 0;
auto size = sizeof(translated);
if (sysctlbyname("sysctl.proc_translated", &translated, &size, nullptr, 0) == 0)
return translated;
#endif
return false;
}
void HostOsInfo::setOverrideFileNameCaseSensitivity(Qt::CaseSensitivity sensitivity) void HostOsInfo::setOverrideFileNameCaseSensitivity(Qt::CaseSensitivity sensitivity)
{ {
m_useOverrideFileNameCaseSensitivity = true; m_useOverrideFileNameCaseSensitivity = true;

View File

@@ -73,6 +73,8 @@ public:
#endif #endif
} }
static bool isRunningUnderRosetta();
static QString withExecutableSuffix(const QString &executable) static QString withExecutableSuffix(const QString &executable)
{ {
return OsSpecificAspects::withExecutableSuffix(hostOs(), executable); return OsSpecificAspects::withExecutableSuffix(hostOs(), executable);

View File

@@ -529,69 +529,69 @@ bool PathChooser::validatePath(FancyLineEdit *edit, QString *errorMessage) const
*errorMessage = tr("The path \"%1\" expanded to an empty string.").arg(QDir::toNativeSeparators(path)); *errorMessage = tr("The path \"%1\" expanded to an empty string.").arg(QDir::toNativeSeparators(path));
return false; return false;
} }
const QFileInfo fi(expandedPath); const FilePath filePath = FilePath::fromString(expandedPath);
// Check if existing // Check if existing
switch (d->m_acceptingKind) { switch (d->m_acceptingKind) {
case PathChooser::ExistingDirectory: case PathChooser::ExistingDirectory:
if (!fi.exists()) { if (!filePath.exists()) {
if (errorMessage) if (errorMessage)
*errorMessage = tr("The path \"%1\" does not exist.").arg(QDir::toNativeSeparators(expandedPath)); *errorMessage = tr("The path \"%1\" does not exist.").arg(filePath.toUserOutput());
return false; return false;
} }
if (!fi.isDir()) { if (!filePath.isDir()) {
if (errorMessage) if (errorMessage)
*errorMessage = tr("The path \"%1\" is not a directory.").arg(QDir::toNativeSeparators(expandedPath)); *errorMessage = tr("The path \"%1\" is not a directory.").arg(filePath.toUserOutput());
return false; return false;
} }
break; break;
case PathChooser::File: case PathChooser::File:
if (!fi.exists()) { if (!filePath.exists()) {
if (errorMessage) if (errorMessage)
*errorMessage = tr("The path \"%1\" does not exist.").arg(QDir::toNativeSeparators(expandedPath)); *errorMessage = tr("The path \"%1\" does not exist.").arg(filePath.toUserOutput());
return false; return false;
} }
if (!fi.isFile()) { if (!filePath.isFile()) {
if (errorMessage) if (errorMessage)
*errorMessage = tr("The path \"%1\" is not a file.").arg(QDir::toNativeSeparators(expandedPath)); *errorMessage = tr("The path \"%1\" is not a file.").arg(filePath.toUserOutput());
return false; return false;
} }
break; break;
case PathChooser::SaveFile: case PathChooser::SaveFile:
if (!fi.absoluteDir().exists()) { if (!filePath.parentDir().exists()) {
if (errorMessage) if (errorMessage)
*errorMessage = tr("The directory \"%1\" does not exist.").arg(QDir::toNativeSeparators(fi.absolutePath())); *errorMessage = tr("The directory \"%1\" does not exist.").arg(filePath.toUserOutput());
return false; return false;
} }
if (fi.exists() && fi.isDir()) { if (filePath.exists() && filePath.isDir()) {
if (errorMessage) if (errorMessage)
*errorMessage = tr("The path \"%1\" is not a file.").arg(QDir::toNativeSeparators(fi.absolutePath())); *errorMessage = tr("The path \"%1\" is not a file.").arg(filePath.toUserOutput());
return false; return false;
} }
break; break;
case PathChooser::ExistingCommand: case PathChooser::ExistingCommand:
if (!fi.exists()) { if (!filePath.exists()) {
if (errorMessage) if (errorMessage)
*errorMessage = tr("The path \"%1\" does not exist.").arg(QDir::toNativeSeparators(expandedPath)); *errorMessage = tr("The path \"%1\" does not exist.").arg(filePath.toUserOutput());
return false; return false;
} }
if (!fi.isFile() || !fi.isExecutable()) { if (!filePath.isExecutableFile()) {
if (errorMessage) if (errorMessage)
*errorMessage = tr("The path \"%1\" is not an executable file.").arg(QDir::toNativeSeparators(expandedPath)); *errorMessage = tr("The path \"%1\" is not an executable file.").arg(filePath.toUserOutput());
return false; return false;
} }
break; break;
case PathChooser::Directory: case PathChooser::Directory:
if (fi.exists() && !fi.isDir()) { if (filePath.isDir()) {
if (errorMessage) if (errorMessage)
*errorMessage = tr("The path \"%1\" is not a directory.").arg(QDir::toNativeSeparators(expandedPath)); *errorMessage = tr("The path \"%1\" is not a directory.").arg(filePath.toUserOutput());
return false; return false;
} }
break; break;
case PathChooser::Command: case PathChooser::Command:
if (fi.exists() && !fi.isExecutable()) { if (filePath.exists() && !filePath.isExecutableFile()) {
if (errorMessage) if (errorMessage)
*errorMessage = tr("Cannot execute \"%1\".").arg(QDir::toNativeSeparators(expandedPath)); *errorMessage = tr("Cannot execute \"%1\".").arg(filePath.toUserOutput());
return false; return false;
} }
break; break;
@@ -601,7 +601,7 @@ bool PathChooser::validatePath(FancyLineEdit *edit, QString *errorMessage) const
} }
if (errorMessage) if (errorMessage)
*errorMessage = tr("Full path: \"%1\"").arg(QDir::toNativeSeparators(expandedPath)); *errorMessage = tr("Full path: \"%1\"").arg(filePath.toUserOutput());
return true; return true;
} }

View File

@@ -461,6 +461,8 @@ QString AndroidManager::androidNameForApiLevel(int x)
return QLatin1String("Android 10"); return QLatin1String("Android 10");
case 30: case 30:
return QLatin1String("Android 11"); return QLatin1String("Android 11");
case 31:
return QLatin1String("Android 12");
default: default:
return tr("Unknown Android version. API Level: %1").arg(x); return tr("Unknown Android version. API Level: %1").arg(x);
} }

View File

@@ -84,6 +84,8 @@ int platformNameToApiLevel(const QString &platformName)
apiLevel = 29; apiLevel = 29;
else if (apiLevelStr == 'R') else if (apiLevelStr == 'R')
apiLevel = 30; apiLevel = 30;
else if (apiLevelStr == 'S')
apiLevel = 31;
} }
} }
return apiLevel; return apiLevel;

View File

@@ -179,7 +179,7 @@ void GTestOutputReader::processOutputLine(const QByteArray &outputLine)
testResult->setResult(type); testResult->setResult(type);
testResult->setLine(match.captured(3).toInt()); testResult->setLine(match.captured(3).toInt());
const Utils::FilePath file = constructSourceFilePath(m_buildDir, match.captured(2)); const Utils::FilePath file = constructSourceFilePath(m_buildDir, match.captured(2));
if (!file.isEmpty()) if (file.exists())
testResult->setFileName(file); testResult->setFileName(file);
testResult->setDescription(match.captured(4)); testResult->setDescription(match.captured(4));
reportResult(testResult); reportResult(testResult);
@@ -247,7 +247,7 @@ void GTestOutputReader::handleDescriptionAndReportResult(TestResultPtr testResul
testResult->setResult(ResultType::MessageLocation); testResult->setResult(ResultType::MessageLocation);
testResult->setLine(innerMatch.captured(2).toInt()); testResult->setLine(innerMatch.captured(2).toInt());
const Utils::FilePath file = constructSourceFilePath(m_buildDir, innerMatch.captured(1)); const Utils::FilePath file = constructSourceFilePath(m_buildDir, innerMatch.captured(1));
if (!file.isEmpty()) if (file.exists())
testResult->setFileName(file); testResult->setFileName(file);
resultDescription << output; resultDescription << output;
} }

View File

@@ -39,11 +39,10 @@
namespace Autotest { namespace Autotest {
Utils::FilePath TestOutputReader::constructSourceFilePath(const Utils::FilePath &path, Utils::FilePath TestOutputReader::constructSourceFilePath(const Utils::FilePath &path,
const QString &filePath) const QString &file)
{ {
if (!filePath.isEmpty() && filePath.at(0) != '.') const Utils::FilePath filePath = path.resolvePath(file);
return Utils::FilePath::fromFileInfo(QFileInfo(filePath)); return filePath.exists() ? filePath : Utils::FilePath();
return (path / filePath).canonicalPath();
} }
TestOutputReader::TestOutputReader(const QFutureInterface<TestResultPtr> &futureInterface, TestOutputReader::TestOutputReader(const QFutureInterface<TestResultPtr> &futureInterface,
@@ -177,9 +176,8 @@ void TestOutputReader::checkForSanitizerOutput(const QByteArray &line)
if (m_sanitizerOutputMode == SanitizerOutputMode::Ubsan) { if (m_sanitizerOutputMode == SanitizerOutputMode::Ubsan) {
const Utils::FilePath path = constructSourceFilePath(m_buildDir, match.captured(1)); const Utils::FilePath path = constructSourceFilePath(m_buildDir, match.captured(1));
// path may be empty if not existing - so, provide at least what we have // path may be empty if not existing - so, provide at least what we have
m_sanitizerResult->setFileName(path.isEmpty() m_sanitizerResult->setFileName(
? Utils::FilePath::fromString(match.captured(1)) path.exists() ? path : Utils::FilePath::fromString(match.captured(1)));
: path);
m_sanitizerResult->setLine(match.captured(2).toInt()); m_sanitizerResult->setLine(match.captured(2).toInt());
} }
} }

View File

@@ -540,8 +540,10 @@ public:
void closeTempDocuments() void closeTempDocuments()
{ {
for (const Utils::FilePath &fp : qAsConst(openedFiles)) for (const Utils::FilePath &fp : qAsConst(openedFiles)) {
q->closeExtraFile(fp); if (!q->documentForFilePath(fp))
q->closeExtraFile(fp);
}
openedFiles.clear(); openedFiles.clear();
} }
@@ -690,7 +692,6 @@ public:
void sendGotoImplementationRequest(const Utils::Link &link); void sendGotoImplementationRequest(const Utils::Link &link);
void handleGotoImplementationResult(const GotoImplementationRequest::Response &response); void handleGotoImplementationResult(const GotoImplementationRequest::Response &response);
void handleDocumentInfoResults(); void handleDocumentInfoResults();
void closeTempDocuments();
void handleDeclDefSwitchReplies(); void handleDeclDefSwitchReplies();

View File

@@ -43,6 +43,8 @@
namespace ClangCodeModel { namespace ClangCodeModel {
namespace Internal { namespace Internal {
const int MaxResultCount = 10000;
class CppLocatorFilter : public CppTools::CppLocatorFilter class CppLocatorFilter : public CppTools::CppLocatorFilter
{ {
public: public:
@@ -67,6 +69,7 @@ public:
setDefaultShortcutString({}); setDefaultShortcutString({});
setEnabled(false); setEnabled(false);
setHidden(true); setHidden(true);
setMaxResultCount(MaxResultCount);
} }
}; };
@@ -94,6 +97,7 @@ public:
setDefaultShortcutString({}); setDefaultShortcutString({});
setEnabled(false); setEnabled(false);
setHidden(true); setHidden(true);
setMaxResultCount(MaxResultCount);
} }
}; };
@@ -121,6 +125,7 @@ public:
setDefaultShortcutString({}); setDefaultShortcutString({});
setEnabled(false); setEnabled(false);
setHidden(true); setHidden(true);
setMaxResultCount(MaxResultCount);
} }
}; };

View File

@@ -120,7 +120,11 @@ static clang::format::FormatStyle qtcStyle()
style.ExperimentalAutoDetectBinPacking = false; style.ExperimentalAutoDetectBinPacking = false;
style.FixNamespaceComments = true; style.FixNamespaceComments = true;
style.ForEachMacros = {"forever", "foreach", "Q_FOREACH", "BOOST_FOREACH"}; style.ForEachMacros = {"forever", "foreach", "Q_FOREACH", "BOOST_FOREACH"};
#if LLVM_VERSION_MAJOR >= 12
style.IncludeStyle.IncludeCategories = {{"^<Q.*", 200, 200, true}};
#else
style.IncludeStyle.IncludeCategories = {{"^<Q.*", 200, 200}}; style.IncludeStyle.IncludeCategories = {{"^<Q.*", 200, 200}};
#endif
style.IncludeStyle.IncludeIsMainRegex = "(Test)?$"; style.IncludeStyle.IncludeIsMainRegex = "(Test)?$";
style.IndentCaseLabels = false; style.IndentCaseLabels = false;
style.IndentWidth = 4; style.IndentWidth = 4;

View File

@@ -98,6 +98,7 @@ static Q_LOGGING_CATEGORY(cmakeBuildConfigurationLog, "qtc.cmake.bc", QtWarningM
const char CONFIGURATION_KEY[] = "CMake.Configuration"; const char CONFIGURATION_KEY[] = "CMake.Configuration";
const char DEVELOPMENT_TEAM_FLAG[] = "Ios:DevelopmentTeam:Flag"; const char DEVELOPMENT_TEAM_FLAG[] = "Ios:DevelopmentTeam:Flag";
const char PROVISIONING_PROFILE_FLAG[] = "Ios:ProvisioningProfile:Flag"; const char PROVISIONING_PROFILE_FLAG[] = "Ios:ProvisioningProfile:Flag";
const char CMAKE_OSX_ARCHITECTURES_FLAG[] = "CMAKE_OSX_ARCHITECTURES:DefaultFlag";
const char CMAKE_QT6_TOOLCHAIN_FILE_ARG[] = const char CMAKE_QT6_TOOLCHAIN_FILE_ARG[] =
"-DCMAKE_TOOLCHAIN_FILE:PATH=%{Qt:QT_INSTALL_PREFIX}/lib/cmake/Qt6/qt.toolchain.cmake"; "-DCMAKE_TOOLCHAIN_FILE:PATH=%{Qt:QT_INSTALL_PREFIX}/lib/cmake/Qt6/qt.toolchain.cmake";
@@ -890,6 +891,21 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
return QString(); return QString();
}); });
macroExpander()->registerVariable(CMAKE_OSX_ARCHITECTURES_FLAG,
tr("The CMake flag for the architecture on macOS"),
[target] {
if (HostOsInfo::isRunningUnderRosetta()) {
if (auto *qt = QtSupport::QtKitAspect::qtVersion(target->kit())) {
const Abis abis = qt->qtAbis();
for (const Abi &abi : abis) {
if (abi.architecture() == Abi::ArmArchitecture)
return QLatin1String("-DCMAKE_OSX_ARCHITECTURES=arm64");
}
}
}
return QLatin1String();
});
addAspect<SourceDirectoryAspect>(); addAspect<SourceDirectoryAspect>();
addAspect<BuildTypeAspect>(); addAspect<BuildTypeAspect>();
@@ -939,27 +955,33 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
} }
} }
if (isIos(k)) { const IDevice::ConstPtr device = DeviceKitAspect::device(k);
QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(k); if (device->osType() == Utils::OsTypeMac) {
if (qt && qt->qtVersion().majorVersion >= 6) { if (isIos(k)) {
// TODO it would be better if we could set QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(k);
// CMAKE_SYSTEM_NAME=iOS and CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=YES if (qt && qt->qtVersion().majorVersion >= 6) {
// and build with "cmake --build . -- -arch <arch>" instead of setting the architecture // TODO it would be better if we could set
// and sysroot in the CMake configuration, but that currently doesn't work with Qt/CMake // CMAKE_SYSTEM_NAME=iOS and CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=YES
// https://gitlab.kitware.com/cmake/cmake/-/issues/21276 // and build with "cmake --build . -- -arch <arch>" instead of setting the architecture
const Id deviceType = DeviceTypeKitAspect::deviceTypeId(k); // and sysroot in the CMake configuration, but that currently doesn't work with Qt/CMake
// TODO the architectures are probably not correct with Apple Silicon in the mix... // https://gitlab.kitware.com/cmake/cmake/-/issues/21276
const QString architecture = deviceType == Ios::Constants::IOS_DEVICE_TYPE const Id deviceType = DeviceTypeKitAspect::deviceTypeId(k);
? QLatin1String("arm64") // TODO the architectures are probably not correct with Apple Silicon in the mix...
: QLatin1String("x86_64"); const QString architecture = deviceType == Ios::Constants::IOS_DEVICE_TYPE
const QString sysroot = deviceType == Ios::Constants::IOS_DEVICE_TYPE ? QLatin1String("arm64")
? QLatin1String("iphoneos") : QLatin1String("x86_64");
: QLatin1String("iphonesimulator"); const QString sysroot = deviceType == Ios::Constants::IOS_DEVICE_TYPE
initialArgs.append(CMAKE_QT6_TOOLCHAIN_FILE_ARG); ? QLatin1String("iphoneos")
initialArgs.append("-DCMAKE_OSX_ARCHITECTURES:STRING=" + architecture); : QLatin1String("iphonesimulator");
initialArgs.append("-DCMAKE_OSX_SYSROOT:STRING=" + sysroot); initialArgs.append(CMAKE_QT6_TOOLCHAIN_FILE_ARG);
initialArgs.append("%{" + QLatin1String(DEVELOPMENT_TEAM_FLAG) + "}"); initialArgs.append("-DCMAKE_OSX_ARCHITECTURES:STRING=" + architecture);
initialArgs.append("%{" + QLatin1String(PROVISIONING_PROFILE_FLAG) + "}"); initialArgs.append("-DCMAKE_OSX_SYSROOT:STRING=" + sysroot);
initialArgs.append("%{" + QLatin1String(DEVELOPMENT_TEAM_FLAG) + "}");
initialArgs.append("%{" + QLatin1String(PROVISIONING_PROFILE_FLAG) + "}");
}
} else {
// macOS
initialArgs.append("%{" + QLatin1String(CMAKE_OSX_ARCHITECTURES_FLAG) + "}");
} }
} }

View File

@@ -203,9 +203,9 @@ QString CMakeConfigItem::expandedValue(const Utils::MacroExpander *expander) con
return expander ? expander->expand(QString::fromUtf8(value)) : QString::fromUtf8(value); return expander ? expander->expand(QString::fromUtf8(value)) : QString::fromUtf8(value);
} }
std::function<bool (const CMakeConfigItem &a, const CMakeConfigItem &b)> CMakeConfigItem::sortOperator() bool CMakeConfigItem::less(const CMakeConfigItem &a, const CMakeConfigItem &b)
{ {
return [](const CMakeConfigItem &a, const CMakeConfigItem &b) { return a.key < b.key; }; return a.key < b.key;
} }
CMakeConfigItem CMakeConfigItem::fromString(const QString &s) CMakeConfigItem CMakeConfigItem::fromString(const QString &s)
@@ -393,7 +393,7 @@ QList<CMakeConfigItem> CMakeConfigItem::itemsFromFile(const Utils::FilePath &cac
} }
} }
Utils::sort(result, CMakeConfigItem::sortOperator()); Utils::sort(result, &CMakeConfigItem::less);
return result; return result;

View File

@@ -62,7 +62,7 @@ public:
QString expandedValue(const ProjectExplorer::Kit *k) const; QString expandedValue(const ProjectExplorer::Kit *k) const;
QString expandedValue(const Utils::MacroExpander *expander) const; QString expandedValue(const Utils::MacroExpander *expander) const;
static std::function<bool(const CMakeConfigItem &a, const CMakeConfigItem &b)> sortOperator(); static bool less(const CMakeConfigItem &a, const CMakeConfigItem &b);
static CMakeConfigItem fromString(const QString &s); static CMakeConfigItem fromString(const QString &s);
static QList<CMakeConfigItem> itemsFromArguments(const QStringList &list); static QList<CMakeConfigItem> itemsFromArguments(const QStringList &list);
static QList<CMakeConfigItem> itemsFromFile(const Utils::FilePath &input, QString *errorMessage); static QList<CMakeConfigItem> itemsFromFile(const Utils::FilePath &input, QString *errorMessage);

View File

@@ -43,6 +43,7 @@
#include <projectexplorer/projectexplorersettings.h> #include <projectexplorer/projectexplorersettings.h>
#include <projectexplorer/task.h> #include <projectexplorer/task.h>
#include <projectexplorer/toolchain.h> #include <projectexplorer/toolchain.h>
#include <projectexplorer/devicesupport/idevice.h>
#include <qtsupport/baseqtversion.h> #include <qtsupport/baseqtversion.h>
#include <qtsupport/qtkitinformation.h> #include <qtsupport/qtkitinformation.h>
@@ -1094,7 +1095,7 @@ Tasks CMakeConfigurationKitAspect::validate(const Kit *k) const
if (!version || !version->isValid()) { if (!version || !version->isValid()) {
addWarning(tr("CMake configuration has a path to a qmake binary set, " addWarning(tr("CMake configuration has a path to a qmake binary set, "
"even though the kit has no valid Qt version.")); "even though the kit has no valid Qt version."));
} else if (qmakePath != version->qmakeCommand() && isQt4) { } else if (qmakePath != version->qmakeFilePath() && isQt4) {
addWarning(tr("CMake configuration has a path to a qmake binary set " addWarning(tr("CMake configuration has a path to a qmake binary set "
"that does not match the qmake binary path " "that does not match the qmake binary path "
"configured in the Qt version.")); "configured in the Qt version."));

View File

@@ -32,6 +32,7 @@
#include <coreplugin/helpmanager.h> #include <coreplugin/helpmanager.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <utils/environment.h>
#include <utils/pointeralgorithm.h> #include <utils/pointeralgorithm.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -64,6 +65,8 @@ CMakeToolManager::CMakeToolManager()
QTC_ASSERT(!m_instance, return); QTC_ASSERT(!m_instance, return);
m_instance = this; m_instance = this;
qRegisterMetaType<QString *>();
d = new CMakeToolManagerPrivate; d = new CMakeToolManagerPrivate;
connect(ICore::instance(), &ICore::saveSettingsRequested, connect(ICore::instance(), &ICore::saveSettingsRequested,
this, &CMakeToolManager::saveCMakeTools); this, &CMakeToolManager::saveCMakeTools);
@@ -177,6 +180,25 @@ void CMakeToolManager::updateDocumentation()
Core::HelpManager::registerDocumentation(docs); Core::HelpManager::registerDocumentation(docs);
} }
void CMakeToolManager::autoDetectCMakeForDevice(const FilePath &deviceRoot,
const QString &detectionSource,
QString *logMessage)
{
QStringList messages;
const FilePaths candidates = {FilePath::fromString("cmake").onDevice(deviceRoot)};
const Environment env = deviceRoot.deviceEnvironment();
for (const FilePath &candidate : candidates) {
const FilePath cmake = candidate.searchOnDevice(env.path());
if (!cmake.isEmpty()) {
registerCMakeByPath(cmake, detectionSource);
messages.append(tr("Found CMake binary: %1").arg(cmake.toUserOutput()));
}
}
if (logMessage)
*logMessage = messages.join('\n');
}
void CMakeToolManager::registerCMakeByPath(const FilePath &cmakePath, const QString &detectionSource) void CMakeToolManager::registerCMakeByPath(const FilePath &cmakePath, const QString &detectionSource)
{ {
const Id id = Id::fromString(cmakePath.toUserOutput()); const Id id = Id::fromString(cmakePath.toUserOutput());

View File

@@ -63,7 +63,11 @@ public:
static void updateDocumentation(); static void updateDocumentation();
public slots: public slots:
void registerCMakeByPath(const Utils::FilePath &cmakePath, const QString &detectionSource); void autoDetectCMakeForDevice(const Utils::FilePath &deviceRoot,
const QString &detectionSource,
QString *logMessage);
void registerCMakeByPath(const Utils::FilePath &cmakePath,
const QString &detectionSource);
signals: signals:
void cmakeAdded (const Utils::Id &id); void cmakeAdded (const Utils::Id &id);
@@ -81,3 +85,5 @@ private:
}; };
} // namespace CMakeProjectManager } // namespace CMakeProjectManager
Q_DECLARE_METATYPE(QString *)

View File

@@ -98,9 +98,8 @@ void CompilationDatabaseTests::testProject_data()
void CompilationDatabaseTests::addTestRow(const QByteArray &relativeFilePath) void CompilationDatabaseTests::addTestRow(const QByteArray &relativeFilePath)
{ {
const QString absoluteFilePath = m_tmpDir->absolutePath(relativeFilePath); const QString absoluteFilePath = m_tmpDir->absolutePath(relativeFilePath);
const QString fileName = QFileInfo(absoluteFilePath).fileName();
QTest::newRow(fileName.toUtf8().constData()) << absoluteFilePath; QTest::newRow(relativeFilePath.constData()) << absoluteFilePath;
} }
} // namespace CompilationDatabaseProjectManager } // namespace CompilationDatabaseProjectManager

View File

@@ -1751,9 +1751,6 @@ bool EditorManagerPrivate::closeEditors(const QList<IEditor*> &editors, CloseFla
emit m_instance->editorsClosed(Utils::toList(acceptedEditors)); emit m_instance->editorsClosed(Utils::toList(acceptedEditors));
foreach (IEditor *editor, acceptedEditors)
delete editor;
if (focusView) { if (focusView) {
activateView(focusView); activateView(focusView);
} else { } else {
@@ -1761,6 +1758,9 @@ bool EditorManagerPrivate::closeEditors(const QList<IEditor*> &editors, CloseFla
setCurrentEditor(currentView->currentEditor()); setCurrentEditor(currentView->currentEditor());
} }
foreach (IEditor *editor, acceptedEditors)
delete editor;
if (!EditorManager::currentEditor()) { if (!EditorManager::currentEditor()) {
emit m_instance->currentEditorChanged(nullptr); emit m_instance->currentEditorChanged(nullptr);
updateActions(); updateActions();

View File

@@ -165,8 +165,12 @@ void CurrentDocumentFind::updateCandidateFindFilter(QWidget *old, QWidget *now)
if (!impl) if (!impl)
candidate = candidate->parentWidget(); candidate = candidate->parentWidget();
} }
if (candidate == m_candidateWidget && impl == m_candidateFind) if (candidate == m_candidateWidget && impl == m_candidateFind) {
// trigger update of action state since a changed focus can still require disabling the
// Find/Replace action
emit changed();
return; return;
}
if (m_candidateWidget) if (m_candidateWidget)
disconnect(Aggregation::Aggregate::parentAggregate(m_candidateWidget), &Aggregation::Aggregate::changed, disconnect(Aggregation::Aggregate::parentAggregate(m_candidateWidget), &Aggregation::Aggregate::changed,
this, &CurrentDocumentFind::candidateAggregationChanged); this, &CurrentDocumentFind::candidateAggregationChanged);

View File

@@ -492,7 +492,7 @@ static void drawPrimitiveTweakedForDarkTheme(QStyle::PrimitiveElement element,
QPen outline(indicatorColor, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin); QPen outline(indicatorColor, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
painter->setPen(outline); painter->setPen(outline);
QColor fill(frameColor); QColor fill(frameColor);
fill.setAlphaF(0.8); fill.setAlphaF(0.8f);
painter->setBrush(fill); painter->setBrush(fill);
const double o = 3.5; const double o = 3.5;
painter->drawRect(QRectF(option->rect).adjusted(o, o, -o, -o)); painter->drawRect(QRectF(option->rect).adjusted(o, o, -o, -o));
@@ -675,9 +675,9 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
} }
if (option->state & State_HasFocus && (option->state & State_KeyboardFocusChange)) { if (option->state & State_HasFocus && (option->state & State_KeyboardFocusChange)) {
QColor highlight = option->palette.highlight().color(); QColor highlight = option->palette.highlight().color();
highlight.setAlphaF(0.4); highlight.setAlphaF(0.4f);
painter->setPen(QPen(highlight.lighter(), 1)); painter->setPen(QPen(highlight.lighter(), 1));
highlight.setAlphaF(0.3); highlight.setAlphaF(0.3f);
painter->setBrush(highlight); painter->setBrush(highlight);
painter->setRenderHint(QPainter::Antialiasing); painter->setRenderHint(QPainter::Antialiasing);
const QRectF rect = option->rect; const QRectF rect = option->rect;
@@ -743,10 +743,10 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
painter->setPen(Qt::NoPen); painter->setPen(Qt::NoPen);
QColor dark = StyleHelper::borderColor(); QColor dark = StyleHelper::borderColor();
dark.setAlphaF(0.4); dark.setAlphaF(0.4f);
QColor light = StyleHelper::baseColor(); QColor light = StyleHelper::baseColor();
light.setAlphaF(0.4); light.setAlphaF(0.4f);
painter->fillPath(path, light); painter->fillPath(path, light);
painter->save(); painter->save();
@@ -908,7 +908,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
case CE_SizeGrip: { case CE_SizeGrip: {
painter->save(); painter->save();
QColor dark = Qt::white; QColor dark = Qt::white;
dark.setAlphaF(0.1); dark.setAlphaF(0.1f);
int x, y, w, h; int x, y, w, h;
option->rect.getRect(&x, &y, &w, &h); option->rect.getRect(&x, &y, &w, &h);
int sw = qMin(h, w); int sw = qMin(h, w);

View File

@@ -334,7 +334,7 @@ auto removeAndExtractTemplate(QString type)
QString templateParameter; QString templateParameter;
int counter = 0; int counter = 0;
int start = 0; int start = 0;
int templateStart; int templateStart = 0;
for (int i = 0; i < type.length(); ++i) { for (int i = 0; i < type.length(); ++i) {
auto c = type[i]; auto c = type[i];
if (c == '<') { if (c == '<') {

View File

@@ -1665,8 +1665,8 @@ bool BreakHandler::contextMenuEvent(const ItemViewEvent &ev)
: locationsEnabled ? tr("Disable Location") : tr("Enable Location"), : locationsEnabled ? tr("Disable Location") : tr("Enable Location"),
!selectedLocations.isEmpty() && handlesIndividualLocations, !selectedLocations.isEmpty() && handlesIndividualLocations,
[this, selectedLocations, locationsEnabled] { [this, selectedLocations, locationsEnabled] {
for (const SubBreakpoint &sbp : selectedLocations) for (SubBreakpointItem * const sbp : selectedLocations)
requestSubBreakpointEnabling(sbp, !locationsEnabled); requestSubBreakpointEnabling(QPointer(sbp), !locationsEnabled);
} }
); );

View File

@@ -85,8 +85,6 @@ public:
QCheckBox *runInTerminalCheckBox; QCheckBox *runInTerminalCheckBox;
QCheckBox *useTargetExtendedRemoteCheckBox; QCheckBox *useTargetExtendedRemoteCheckBox;
PathChooser *debuginfoPathChooser; PathChooser *debuginfoPathChooser;
QLabel *serverStartScriptLabel;
PathChooser *serverStartScriptPathChooser;
QLabel *sysRootLabel; QLabel *sysRootLabel;
PathChooser *sysRootPathChooser; PathChooser *sysRootPathChooser;
QLabel *serverInitCommandsLabel; QLabel *serverInitCommandsLabel;
@@ -129,7 +127,6 @@ public:
bool breakAtMain = false; bool breakAtMain = false;
bool runInTerminal = false; bool runInTerminal = false;
bool useTargetExtendedRemote = false; bool useTargetExtendedRemote = false;
FilePath serverStartScript;
FilePath sysRoot; FilePath sysRoot;
QString serverInitCommands; QString serverInitCommands;
QString serverResetCommands; QString serverResetCommands;
@@ -144,7 +141,6 @@ bool StartApplicationParameters::equals(const StartApplicationParameters &rhs) c
&& runnable.workingDirectory == rhs.runnable.workingDirectory && runnable.workingDirectory == rhs.runnable.workingDirectory
&& breakAtMain == rhs.breakAtMain && breakAtMain == rhs.breakAtMain
&& runInTerminal == rhs.runInTerminal && runInTerminal == rhs.runInTerminal
&& serverStartScript == rhs.serverStartScript
&& sysRoot == rhs.sysRoot && sysRoot == rhs.sysRoot
&& serverInitCommands == rhs.serverInitCommands && serverInitCommands == rhs.serverInitCommands
&& serverResetCommands == rhs.serverResetCommands && serverResetCommands == rhs.serverResetCommands
@@ -184,7 +180,6 @@ void StartApplicationParameters::toSettings(QSettings *settings) const
settings->setValue("LastExternalBreakAtMain", breakAtMain); settings->setValue("LastExternalBreakAtMain", breakAtMain);
settings->setValue("LastExternalRunInTerminal", runInTerminal); settings->setValue("LastExternalRunInTerminal", runInTerminal);
settings->setValue("LastExternalUseTargetExtended", useTargetExtendedRemote); settings->setValue("LastExternalUseTargetExtended", useTargetExtendedRemote);
settings->setValue("LastServerStartScript", serverStartScript.toVariant());
settings->setValue("LastServerInitCommands", serverInitCommands); settings->setValue("LastServerInitCommands", serverInitCommands);
settings->setValue("LastServerResetCommands", serverResetCommands); settings->setValue("LastServerResetCommands", serverResetCommands);
settings->setValue("LastDebugInfoLocation", debugInfoLocation); settings->setValue("LastDebugInfoLocation", debugInfoLocation);
@@ -202,7 +197,6 @@ void StartApplicationParameters::fromSettings(const QSettings *settings)
breakAtMain = settings->value("LastExternalBreakAtMain").toBool(); breakAtMain = settings->value("LastExternalBreakAtMain").toBool();
runInTerminal = settings->value("LastExternalRunInTerminal").toBool(); runInTerminal = settings->value("LastExternalRunInTerminal").toBool();
useTargetExtendedRemote = settings->value("LastExternalUseTargetExtended").toBool(); useTargetExtendedRemote = settings->value("LastExternalUseTargetExtended").toBool();
serverStartScript = FilePath::fromVariant(settings->value("LastServerStartScript"));
serverInitCommands = settings->value("LastServerInitCommands").toString(); serverInitCommands = settings->value("LastServerInitCommands").toString();
serverResetCommands = settings->value("LastServerResetCommands").toString(); serverResetCommands = settings->value("LastServerResetCommands").toString();
debugInfoLocation = settings->value("LastDebugInfoLocation").toString(); debugInfoLocation = settings->value("LastDebugInfoLocation").toString();
@@ -260,17 +254,6 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
d->useTargetExtendedRemoteCheckBox = new QCheckBox(this); d->useTargetExtendedRemoteCheckBox = new QCheckBox(this);
d->serverStartScriptPathChooser = new PathChooser(this);
d->serverStartScriptPathChooser->setExpectedKind(PathChooser::File);
d->serverStartScriptPathChooser->setPromptDialogTitle(tr("Select Server Start Script"));
d->serverStartScriptPathChooser->setToolTip(tr(
"This option can be used to point to a script that will be used "
"to start a debug server. If the field is empty, "
"default methods to set up debug servers will be used."));
d->serverStartScriptLabel = new QLabel(tr("&Server start script:"), this);
d->serverStartScriptLabel->setBuddy(d->serverStartScriptPathChooser);
d->serverStartScriptLabel->setToolTip(d->serverStartScriptPathChooser->toolTip());
d->sysRootPathChooser = new PathChooser(this); d->sysRootPathChooser = new PathChooser(this);
d->sysRootPathChooser->setExpectedKind(PathChooser::Directory); d->sysRootPathChooser->setExpectedKind(PathChooser::Directory);
d->sysRootPathChooser->setHistoryCompleter("Debugger.SysRoot.History"); d->sysRootPathChooser->setHistoryCompleter("Debugger.SysRoot.History");
@@ -328,7 +311,6 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
formLayout->addRow(tr("Run in &terminal:"), d->runInTerminalCheckBox); formLayout->addRow(tr("Run in &terminal:"), d->runInTerminalCheckBox);
formLayout->addRow(tr("Break at \"&main\":"), d->breakAtMainCheckBox); formLayout->addRow(tr("Break at \"&main\":"), d->breakAtMainCheckBox);
formLayout->addRow(tr("Use target extended-remote to connect:"), d->useTargetExtendedRemoteCheckBox); formLayout->addRow(tr("Use target extended-remote to connect:"), d->useTargetExtendedRemoteCheckBox);
formLayout->addRow(d->serverStartScriptLabel, d->serverStartScriptPathChooser);
formLayout->addRow(d->sysRootLabel, d->sysRootPathChooser); formLayout->addRow(d->sysRootLabel, d->sysRootPathChooser);
formLayout->addRow(d->serverInitCommandsLabel, d->serverInitCommandsTextEdit); formLayout->addRow(d->serverInitCommandsLabel, d->serverInitCommandsTextEdit);
formLayout->addRow(d->serverResetCommandsLabel, d->serverResetCommandsTextEdit); formLayout->addRow(d->serverResetCommandsLabel, d->serverResetCommandsTextEdit);
@@ -418,8 +400,6 @@ void StartApplicationDialog::run(bool attachRemote)
dialog.setHistory(history); dialog.setHistory(history);
dialog.setParameters(history.back()); dialog.setParameters(history.back());
if (!attachRemote) { if (!attachRemote) {
dialog.d->serverStartScriptPathChooser->setVisible(false);
dialog.d->serverStartScriptLabel->setVisible(false);
dialog.d->serverInitCommandsTextEdit->setVisible(false); dialog.d->serverInitCommandsTextEdit->setVisible(false);
dialog.d->serverInitCommandsLabel->setVisible(false); dialog.d->serverInitCommandsLabel->setVisible(false);
dialog.d->serverResetCommandsTextEdit->setVisible(false); dialog.d->serverResetCommandsTextEdit->setVisible(false);
@@ -465,7 +445,6 @@ void StartApplicationDialog::run(bool attachRemote)
debugger->setBreakOnMain(newParameters.breakAtMain); debugger->setBreakOnMain(newParameters.breakAtMain);
debugger->setDebugInfoLocation(newParameters.debugInfoLocation); debugger->setDebugInfoLocation(newParameters.debugInfoLocation);
debugger->setInferior(inferior); debugger->setInferior(inferior);
debugger->setServerStartScript(newParameters.serverStartScript); // Note: This requires inferior.
debugger->setCommandsAfterConnect(newParameters.serverInitCommands); debugger->setCommandsAfterConnect(newParameters.serverInitCommands);
debugger->setCommandsForReset(newParameters.serverResetCommands); debugger->setCommandsForReset(newParameters.serverResetCommands);
debugger->setUseTerminal(newParameters.runInTerminal); debugger->setUseTerminal(newParameters.runInTerminal);
@@ -505,7 +484,6 @@ StartApplicationParameters StartApplicationDialog::parameters() const
result.serverPort = d->serverPortSpinBox->value(); result.serverPort = d->serverPortSpinBox->value();
result.serverAddress = d->channelOverrideEdit->text(); result.serverAddress = d->channelOverrideEdit->text();
result.runnable.executable = d->localExecutablePathChooser->filePath(); result.runnable.executable = d->localExecutablePathChooser->filePath();
result.serverStartScript = d->serverStartScriptPathChooser->filePath();
result.sysRoot = d->sysRootPathChooser->filePath(); result.sysRoot = d->sysRootPathChooser->filePath();
result.serverInitCommands = d->serverInitCommandsTextEdit->toPlainText(); result.serverInitCommands = d->serverInitCommandsTextEdit->toPlainText();
result.serverResetCommands = d->serverResetCommandsTextEdit->toPlainText(); result.serverResetCommands = d->serverResetCommandsTextEdit->toPlainText();
@@ -525,7 +503,6 @@ void StartApplicationDialog::setParameters(const StartApplicationParameters &p)
d->serverPortSpinBox->setValue(p.serverPort); d->serverPortSpinBox->setValue(p.serverPort);
d->channelOverrideEdit->setText(p.serverAddress); d->channelOverrideEdit->setText(p.serverAddress);
d->localExecutablePathChooser->setFilePath(p.runnable.executable); d->localExecutablePathChooser->setFilePath(p.runnable.executable);
d->serverStartScriptPathChooser->setFilePath(p.serverStartScript);
d->sysRootPathChooser->setFilePath(p.sysRoot); d->sysRootPathChooser->setFilePath(p.sysRoot);
d->serverInitCommandsTextEdit->setPlainText(p.serverInitCommands); d->serverInitCommandsTextEdit->setPlainText(p.serverInitCommands);
d->serverResetCommandsTextEdit->setPlainText(p.serverResetCommands); d->serverResetCommandsTextEdit->setPlainText(p.serverResetCommands);

View File

@@ -53,11 +53,14 @@ using namespace Debugger::Internal;
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Utils; using namespace Utils;
namespace Debugger {
const char DEBUGGER_INFORMATION_COMMAND[] = "Binary"; const char DEBUGGER_INFORMATION_COMMAND[] = "Binary";
const char DEBUGGER_INFORMATION_DISPLAYNAME[] = "DisplayName"; const char DEBUGGER_INFORMATION_DISPLAYNAME[] = "DisplayName";
const char DEBUGGER_INFORMATION_ID[] = "Id"; const char DEBUGGER_INFORMATION_ID[] = "Id";
const char DEBUGGER_INFORMATION_ENGINETYPE[] = "EngineType"; const char DEBUGGER_INFORMATION_ENGINETYPE[] = "EngineType";
const char DEBUGGER_INFORMATION_AUTODETECTED[] = "AutoDetected"; const char DEBUGGER_INFORMATION_AUTODETECTED[] = "AutoDetected"; // FIXME: Merge into DetectionSource
const char DEBUGGER_INFORMATION_DETECTION_SOURCE[] = "DetectionSource";
const char DEBUGGER_INFORMATION_VERSION[] = "Version"; const char DEBUGGER_INFORMATION_VERSION[] = "Version";
const char DEBUGGER_INFORMATION_ABIS[] = "Abis"; const char DEBUGGER_INFORMATION_ABIS[] = "Abis";
const char DEBUGGER_INFORMATION_LASTMODIFIED[] = "LastModified"; const char DEBUGGER_INFORMATION_LASTMODIFIED[] = "LastModified";
@@ -66,7 +69,7 @@ const char DEBUGGER_INFORMATION_WORKINGDIRECTORY[] = "WorkingDirectory";
//! Return the configuration of gdb as a list of --key=value //! Return the configuration of gdb as a list of --key=value
//! \note That the list will also contain some output not in this format. //! \note That the list will also contain some output not in this format.
static QString getConfigurationOfGdbCommand(const FilePath &command, const Utils::Environment &sysEnv) static QString getGdbConfiguration(const FilePath &command, const Environment &sysEnv)
{ {
// run gdb with the --configuration opion // run gdb with the --configuration opion
QtcProcess proc; QtcProcess proc;
@@ -93,8 +96,6 @@ static QString extractGdbTargetAbiStringFromGdbOutput(const QString &gdbOutput)
} }
namespace Debugger {
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// DebuggerItem // DebuggerItem
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@@ -113,6 +114,7 @@ DebuggerItem::DebuggerItem(const QVariantMap &data)
m_workingDirectory = FilePath::fromVariant(data.value(DEBUGGER_INFORMATION_WORKINGDIRECTORY)); m_workingDirectory = FilePath::fromVariant(data.value(DEBUGGER_INFORMATION_WORKINGDIRECTORY));
m_unexpandedDisplayName = data.value(DEBUGGER_INFORMATION_DISPLAYNAME).toString(); m_unexpandedDisplayName = data.value(DEBUGGER_INFORMATION_DISPLAYNAME).toString();
m_isAutoDetected = data.value(DEBUGGER_INFORMATION_AUTODETECTED, false).toBool(); m_isAutoDetected = data.value(DEBUGGER_INFORMATION_AUTODETECTED, false).toBool();
m_detectionSource = data.value(DEBUGGER_INFORMATION_DETECTION_SOURCE).toString();
m_version = data.value(DEBUGGER_INFORMATION_VERSION).toString(); m_version = data.value(DEBUGGER_INFORMATION_VERSION).toString();
m_engineType = DebuggerEngineType(data.value(DEBUGGER_INFORMATION_ENGINETYPE, m_engineType = DebuggerEngineType(data.value(DEBUGGER_INFORMATION_ENGINETYPE,
static_cast<int>(NoEngineType)).toInt()); static_cast<int>(NoEngineType)).toInt());
@@ -149,7 +151,7 @@ static bool isUVisionExecutable(const QFileInfo &fileInfo)
return baseName == "UV4"; return baseName == "UV4";
} }
void DebuggerItem::reinitializeFromFile(const Utils::Environment &sysEnv) void DebuggerItem::reinitializeFromFile(const Environment &sysEnv)
{ {
// CDB only understands the single-dash -version, whereas GDB and LLDB are // CDB only understands the single-dash -version, whereas GDB and LLDB are
// happy with both -version and --version. So use the "working" -version // happy with both -version and --version. So use the "working" -version
@@ -210,8 +212,8 @@ void DebuggerItem::reinitializeFromFile(const Utils::Environment &sysEnv)
const bool unableToFindAVersion = (0 == version); const bool unableToFindAVersion = (0 == version);
const bool gdbSupportsConfigurationFlag = (version >= 70700); const bool gdbSupportsConfigurationFlag = (version >= 70700);
if (gdbSupportsConfigurationFlag || unableToFindAVersion) { if (gdbSupportsConfigurationFlag || unableToFindAVersion) {
const auto gdbConfiguration = getConfigurationOfGdbCommand(m_command, sysEnv); const QString gdbConfiguration = getGdbConfiguration(m_command, sysEnv);
const auto gdbTargetAbiString = const QString gdbTargetAbiString =
extractGdbTargetAbiStringFromGdbOutput(gdbConfiguration); extractGdbTargetAbiStringFromGdbOutput(gdbConfiguration);
if (!gdbTargetAbiString.isEmpty()) { if (!gdbTargetAbiString.isEmpty()) {
m_abis.append(Abi::abiFromTargetTriplet(gdbTargetAbiString)); m_abis.append(Abi::abiFromTargetTriplet(gdbTargetAbiString));
@@ -298,11 +300,11 @@ QDateTime DebuggerItem::lastModified() const
QIcon DebuggerItem::decoration() const QIcon DebuggerItem::decoration() const
{ {
if (m_engineType == NoEngineType) if (m_engineType == NoEngineType)
return Utils::Icons::CRITICAL.icon(); return Icons::CRITICAL.icon();
if (!m_command.toFileInfo().isExecutable()) if (!m_command.toFileInfo().isExecutable())
return Utils::Icons::WARNING.icon(); return Icons::WARNING.icon();
if (!m_workingDirectory.isEmpty() && !m_workingDirectory.isDir()) if (!m_workingDirectory.isEmpty() && !m_workingDirectory.isDir())
return Utils::Icons::WARNING.icon(); return Icons::WARNING.icon();
return QIcon(); return QIcon();
} }
@@ -318,6 +320,7 @@ bool DebuggerItem::operator==(const DebuggerItem &other) const
return m_id == other.m_id return m_id == other.m_id
&& m_unexpandedDisplayName == other.m_unexpandedDisplayName && m_unexpandedDisplayName == other.m_unexpandedDisplayName
&& m_isAutoDetected == other.m_isAutoDetected && m_isAutoDetected == other.m_isAutoDetected
&& m_detectionSource == other.m_detectionSource
&& m_command == other.m_command && m_command == other.m_command
&& m_workingDirectory == other.m_workingDirectory; && m_workingDirectory == other.m_workingDirectory;
} }
@@ -331,6 +334,7 @@ QVariantMap DebuggerItem::toMap() const
data.insert(DEBUGGER_INFORMATION_WORKINGDIRECTORY, m_workingDirectory.toVariant()); data.insert(DEBUGGER_INFORMATION_WORKINGDIRECTORY, m_workingDirectory.toVariant());
data.insert(DEBUGGER_INFORMATION_ENGINETYPE, int(m_engineType)); data.insert(DEBUGGER_INFORMATION_ENGINETYPE, int(m_engineType));
data.insert(DEBUGGER_INFORMATION_AUTODETECTED, m_isAutoDetected); data.insert(DEBUGGER_INFORMATION_AUTODETECTED, m_isAutoDetected);
data.insert(DEBUGGER_INFORMATION_DETECTION_SOURCE, m_detectionSource);
data.insert(DEBUGGER_INFORMATION_VERSION, m_version); data.insert(DEBUGGER_INFORMATION_VERSION, m_version);
data.insert(DEBUGGER_INFORMATION_ABIS, abiNames()); data.insert(DEBUGGER_INFORMATION_ABIS, abiNames());
data.insert(DEBUGGER_INFORMATION_LASTMODIFIED, m_lastModified); data.insert(DEBUGGER_INFORMATION_LASTMODIFIED, m_lastModified);

View File

@@ -103,6 +103,9 @@ public:
Utils::FilePath workingDirectory() const { return m_workingDirectory; } Utils::FilePath workingDirectory() const { return m_workingDirectory; }
void setWorkingDirectory(const Utils::FilePath &workingPath) { m_workingDirectory = workingPath; } void setWorkingDirectory(const Utils::FilePath &workingPath) { m_workingDirectory = workingPath; }
QString detectionSource() const { return m_detectionSource; }
void setDetectionSource(const QString &source) { m_detectionSource = source; }
private: private:
DebuggerItem(const QVariant &id); DebuggerItem(const QVariant &id);
void initMacroExpander(); void initMacroExpander();
@@ -116,6 +119,7 @@ private:
QString m_version; QString m_version;
ProjectExplorer::Abis m_abis; ProjectExplorer::Abis m_abis;
QDateTime m_lastModified; QDateTime m_lastModified;
QString m_detectionSource;
friend class Internal::DebuggerConfigWidget; friend class Internal::DebuggerConfigWidget;
friend class Internal::DebuggerItemConfigWidget; friend class Internal::DebuggerItemConfigWidget;

View File

@@ -92,7 +92,7 @@ public:
QVariant registerDebugger(const DebuggerItem &item); QVariant registerDebugger(const DebuggerItem &item);
void readDebuggers(const FilePath &fileName, bool isSystem); void readDebuggers(const FilePath &fileName, bool isSystem);
void autoDetectCdbDebuggers(); void autoDetectCdbDebuggers();
void autoDetectGdbOrLldbDebuggers(const FilePath &deviceRoot); void autoDetectGdbOrLldbDebuggers(const FilePath &deviceRoot, const QString &detectionSource);
void autoDetectUvscDebuggers(); void autoDetectUvscDebuggers();
QString uniqueDisplayName(const QString &base); QString uniqueDisplayName(const QString &base);
@@ -556,7 +556,6 @@ void DebuggerConfigWidget::addDebugger()
{ {
DebuggerItem item; DebuggerItem item;
item.createId(); item.createId();
item.setAutoDetected(false);
item.setEngineType(NoEngineType); item.setEngineType(NoEngineType);
item.setUnexpandedDisplayName(d->uniqueDisplayName(tr("New Debugger"))); item.setUnexpandedDisplayName(d->uniqueDisplayName(tr("New Debugger")));
item.setAutoDetected(false); item.setAutoDetected(false);
@@ -715,7 +714,8 @@ static Utils::FilePaths searchGdbPathsFromRegistry()
return searchPaths; return searchPaths;
} }
void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePath &deviceRoot) void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePath &deviceRoot,
const QString &detectionSource)
{ {
const QStringList filters = {"gdb-i686-pc-mingw32", "gdb-i686-pc-mingw32.exe", "gdb", const QStringList filters = {"gdb-i686-pc-mingw32", "gdb-i686-pc-mingw32.exe", "gdb",
"gdb.exe", "lldb", "lldb.exe", "lldb-[1-9]*", "gdb.exe", "lldb", "lldb.exe", "lldb-[1-9]*",
@@ -784,14 +784,17 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePath &de
} }
DebuggerItem item; DebuggerItem item;
item.createId(); item.createId();
item.setDetectionSource(detectionSource);
// Intentionally set items with non-empty source as manual for now to
// give the user a chance to remove them. FIXME: Think of a better way.
item.setAutoDetected(detectionSource.isEmpty());
item.setCommand(command); item.setCommand(command);
item.reinitializeFromFile(); item.reinitializeFromFile();
if (item.engineType() == NoEngineType) if (item.engineType() == NoEngineType)
continue; continue;
//: %1: Debugger engine type (GDB, LLDB, CDB...), %2: Path //: %1: Debugger engine type (GDB, LLDB, CDB...), %2: Path
item.setUnexpandedDisplayName(tr("System %1 at %2") const QString name = detectionSource.isEmpty() ? tr("System %1 at %2") : tr("Detected %1 at %2");
.arg(item.engineTypeName()).arg(command.toUserOutput())); item.setUnexpandedDisplayName(name.arg(item.engineTypeName()).arg(command.toUserOutput()));
item.setAutoDetected(true);
m_model->addDebugger(item); m_model->addDebugger(item);
} }
} }
@@ -942,7 +945,7 @@ void DebuggerItemManagerPrivate::restoreDebuggers()
// Auto detect current. // Auto detect current.
autoDetectCdbDebuggers(); autoDetectCdbDebuggers();
autoDetectGdbOrLldbDebuggers({}); autoDetectGdbOrLldbDebuggers({}, {});
autoDetectUvscDebuggers(); autoDetectUvscDebuggers();
} }
@@ -1026,9 +1029,10 @@ void DebuggerItemManager::deregisterDebugger(const QVariant &id)
}); });
} }
void DebuggerItemManager::autoDetectDebuggersForDevice(const Utils::FilePath &deviceRoot) void DebuggerItemManager::autoDetectDebuggersForDevice(const FilePath &deviceRoot,
const QString &detectionSource)
{ {
d->autoDetectGdbOrLldbDebuggers(deviceRoot); d->autoDetectGdbOrLldbDebuggers(deviceRoot, detectionSource);
} }
} // namespace Debugger } // namespace Debugger

View File

@@ -52,7 +52,8 @@ public:
static QVariant registerDebugger(const DebuggerItem &item); static QVariant registerDebugger(const DebuggerItem &item);
static void deregisterDebugger(const QVariant &id); static void deregisterDebugger(const QVariant &id);
static void autoDetectDebuggersForDevice(const Utils::FilePath &deviceRoot); static void autoDetectDebuggersForDevice(const Utils::FilePath &deviceRoot,
const QString &detectionSource);
static const DebuggerItem *findByCommand(const Utils::FilePath &command); static const DebuggerItem *findByCommand(const Utils::FilePath &command);
static const DebuggerItem *findById(const QVariant &id); static const DebuggerItem *findById(const QVariant &id);

View File

@@ -185,9 +185,12 @@ void DebuggerKitAspect::setup(Kit *k)
// This improves the situation a bit if a cross-compilation tool chain has the // This improves the situation a bit if a cross-compilation tool chain has the
// same ABI as the host. // same ABI as the host.
if (level == DebuggerItem::MatchesPerfectly if (level == DebuggerItem::MatchesPerfectly
&& !item.command().needsDevice()
&& systemEnvironment.path().contains(item.command().parentDir())) { && systemEnvironment.path().contains(item.command().parentDir())) {
level = DebuggerItem::MatchesPerfectlyInPath; level = DebuggerItem::MatchesPerfectlyInPath;
} }
if (!item.detectionSource().isEmpty() && item.detectionSource() == k->autoDetectionSource())
level = DebuggerItem::MatchLevel(level + 2);
} else if (rawId.type() == QVariant::String) { } else if (rawId.type() == QVariant::String) {
// New structure. // New structure.
if (item.id() == rawId) { if (item.id() == rawId) {

View File

@@ -1746,9 +1746,10 @@ void DebuggerPlugin::getEnginesState(QByteArray *json) const
*json = QJsonDocument(QJsonObject::fromVariantMap(result)).toJson(); *json = QJsonDocument(QJsonObject::fromVariantMap(result)).toJson();
} }
void DebuggerPlugin::autoDetectDebuggersForDevice(const FilePath &deviceRoot) void DebuggerPlugin::autoDetectDebuggersForDevice(const FilePath &deviceRoot,
const QString &detectionId)
{ {
dd->m_debuggerItemManager.autoDetectDebuggersForDevice(deviceRoot); dd->m_debuggerItemManager.autoDetectDebuggersForDevice(deviceRoot, detectionId);
} }
void DebuggerPluginPrivate::attachToQmlPort() void DebuggerPluginPrivate::attachToQmlPort()

View File

@@ -59,7 +59,7 @@ private:
Q_SLOT void getEnginesState(QByteArray *json) const; Q_SLOT void getEnginesState(QByteArray *json) const;
// Called from DockerDevice // Called from DockerDevice
Q_SLOT void autoDetectDebuggersForDevice(const Utils::FilePath &deviceRoot); Q_SLOT void autoDetectDebuggersForDevice(const Utils::FilePath &deviceRoot, const QString &detectionId);
QVector<QObject *> createTestObjects() const override; QVector<QObject *> createTestObjects() const override;
}; };

View File

@@ -95,98 +95,6 @@ DebuggerEngine *createQmlEngine();
DebuggerEngine *createLldbEngine(); DebuggerEngine *createLldbEngine();
DebuggerEngine *createUvscEngine(); DebuggerEngine *createUvscEngine();
class LocalProcessRunner : public RunWorker
{
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::LocalProcessRunner)
public:
LocalProcessRunner(DebuggerRunTool *runTool, const CommandLine &command)
: RunWorker(runTool->runControl()), m_runTool(runTool), m_command(command)
{
connect(&m_proc, &QtcProcess::errorOccurred,
this, &LocalProcessRunner::handleError);
connect(&m_proc, &QtcProcess::readyReadStandardOutput,
this, &LocalProcessRunner::handleStandardOutput);
connect(&m_proc, &QtcProcess::readyReadStandardError,
this, &LocalProcessRunner::handleStandardError);
connect(&m_proc, &QtcProcess::finished,
this, &LocalProcessRunner::handleFinished);
}
void start() override
{
m_proc.setCommand(m_command);
m_proc.start();
}
void stop() override
{
m_proc.terminate();
}
void handleStandardOutput()
{
const QByteArray ba = m_proc.readAllStandardOutput();
const QString msg = QString::fromLocal8Bit(ba, ba.length());
m_runTool->appendMessage(msg, StdOutFormat);
}
void handleStandardError()
{
const QByteArray ba = m_proc.readAllStandardError();
const QString msg = QString::fromLocal8Bit(ba, ba.length());
m_runTool->appendMessage(msg, StdErrFormat);
}
void handleFinished()
{
if (m_proc.result() == QtcProcess::FinishedWithSuccess) {
// all good.
reportDone();
} else {
reportFailure(tr("Upload failed: %1").arg(m_proc.errorString()));
}
}
void handleError(QProcess::ProcessError error)
{
QString msg;
switch (error) {
case QProcess::FailedToStart:
msg = tr("The upload process failed to start. Shell missing?");
break;
case QProcess::Crashed:
msg = tr("The upload process crashed some time after starting "
"successfully.");
break;
case QProcess::Timedout:
msg = tr("The last waitFor...() function timed out. "
"The state of QProcess is unchanged, and you can try calling "
"waitFor...() again.");
break;
case QProcess::WriteError:
msg = tr("An error occurred when attempting to write "
"to the upload process. For example, the process may not be running, "
"or it may have closed its input channel.");
break;
case QProcess::ReadError:
msg = tr("An error occurred when attempting to read from "
"the upload process. For example, the process may not be running.");
break;
default:
msg = tr("An unknown error in the upload process occurred. "
"This is the default return value of error().");
}
m_runTool->showMessage(msg, StatusBar);
Core::AsynchronousMessageBox::critical(tr("Error"), msg);
}
QPointer<DebuggerRunTool> m_runTool;
CommandLine m_command;
Utils::QtcProcess m_proc;
};
class CoreUnpacker final : public RunWorker class CoreUnpacker final : public RunWorker
{ {
public: public:
@@ -421,16 +329,6 @@ void DebuggerRunTool::setCommandsForReset(const QString &commands)
m_runParameters.commandsForReset = commands; m_runParameters.commandsForReset = commands;
} }
void DebuggerRunTool::setServerStartScript(const FilePath &serverStartScript)
{
if (!serverStartScript.isEmpty()) {
// Provide script information about the environment
const CommandLine serverStarter(serverStartScript,
{m_runParameters.inferior.executable.toString(), m_runParameters.remoteChannel});
addStartDependency(new LocalProcessRunner(this, serverStarter));
}
}
void DebuggerRunTool::setDebugInfoLocation(const QString &debugInfoLocation) void DebuggerRunTool::setDebugInfoLocation(const QString &debugInfoLocation)
{ {
m_runParameters.debugInfoLocation = debugInfoLocation; m_runParameters.debugInfoLocation = debugInfoLocation;

Some files were not shown because too many files have changed in this diff Show More