diff --git a/cmake/FindQt5.cmake b/cmake/FindQt5.cmake index dbbb07681f3..4fde452733d 100644 --- a/cmake/FindQt5.cmake +++ b/cmake/FindQt5.cmake @@ -78,7 +78,7 @@ endif() set(Qt5_FOUND ${Qt6_FOUND}) 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}) add_executable(Qt5::${tool} IMPORTED GLOBAL) get_target_property(imported_location Qt6::${tool} IMPORTED_LOCATION) diff --git a/cmake/QtCreatorTranslations.cmake b/cmake/QtCreatorTranslations.cmake index a674f37be6d..a9da1e52476 100644 --- a/cmake/QtCreatorTranslations.cmake +++ b/cmake/QtCreatorTranslations.cmake @@ -95,7 +95,7 @@ function(_create_ts_custom_target name) endfunction() 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 message(WARNING "No Qt translation tools found, skipping translation targets. Add find_package(Qt5 COMPONENTS LinguistTools) to CMake to enable.") return() diff --git a/dist/changes-5.0.0.md b/dist/changes-5.0.0.md index 8bcf9440bc6..df87c466b73 100644 --- a/dist/changes-5.0.0.md +++ b/dist/changes-5.0.0.md @@ -94,6 +94,8 @@ Debugging (QTCREATORBUG-25762) * Fixed that comments in startup commands resulted in message boxes (QTCREATORBUG-25666) +* Removed extra Server Start Script field in Attach to Running Server, + use a custom deploy step instead. ### GDB diff --git a/doc/qtcreator/images/qtcreator-boot2qt-deployment-steps.png b/doc/qtcreator/images/qtcreator-boot2qt-deployment-steps.png new file mode 100644 index 00000000000..a1e6741a68e Binary files /dev/null and b/doc/qtcreator/images/qtcreator-boot2qt-deployment-steps.png differ diff --git a/doc/qtcreator/images/qtcreator-boot2qt-device-configurations.png b/doc/qtcreator/images/qtcreator-boot2qt-device-configurations.png new file mode 100644 index 00000000000..cddc2ea4d2f Binary files /dev/null and b/doc/qtcreator/images/qtcreator-boot2qt-device-configurations.png differ diff --git a/doc/qtcreator/images/qtcreator-boot2qt-flashing-wizard.png b/doc/qtcreator/images/qtcreator-boot2qt-flashing-wizard.png new file mode 100644 index 00000000000..c32ca230cb8 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-boot2qt-flashing-wizard.png differ diff --git a/doc/qtcreator/images/qtcreator-devices-boot2qt.png b/doc/qtcreator/images/qtcreator-devices-boot2qt.png new file mode 100644 index 00000000000..a737732fa46 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-devices-boot2qt.png differ diff --git a/doc/qtcreator/src/android/deploying-android.qdoc b/doc/qtcreator/src/android/deploying-android.qdoc index 91df4b20a1e..32a8354dde5 100644 --- a/doc/qtcreator/src/android/deploying-android.qdoc +++ b/doc/qtcreator/src/android/deploying-android.qdoc @@ -26,7 +26,7 @@ /*! \previouspage creator-deployment.html \page creator-deploying-android.html - \nextpage creator-deployment-embedded-linux.html + \nextpage creator-deployment-b2qt.html \title Deploying Applications to Android Devices diff --git a/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc b/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc index 663e6d576e0..f035845e3bb 100644 --- a/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc +++ b/doc/qtcreator/src/baremetal/creator-baremetal-dev.qdoc @@ -26,7 +26,7 @@ /*! \previouspage creator-developing-android.html \page creator-developing-baremetal.html - \nextpage creator-developing-generic-linux.html + \nextpage creator-developing-b2qt.html \title Connecting Bare Metal Devices diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc index 34ecaa1785a..29f0e534af0 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc @@ -405,8 +405,6 @@ applications. \li Select the \uicontrol {Break at "main"} check box to stop the 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 the \c sysroot to use instead of the default \c sysroot. \li In the \uicontrol {Init commands} field, enter the commands diff --git a/doc/qtcreator/src/howto/creator-external-tools.qdoc b/doc/qtcreator/src/howto/creator-external-tools.qdoc index 74128bed458..a5707b0dc35 100644 --- a/doc/qtcreator/src/howto/creator-external-tools.qdoc +++ b/doc/qtcreator/src/howto/creator-external-tools.qdoc @@ -77,15 +77,12 @@ \uicontrol {Open With} > \uicontrol {Qt Linguist} in the context menu. 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 - QML Scene (Qt Quick 2). The preview tools enable you to load QML documents - for viewing and testing while you are developing an application. + You can test the current QML document while you are developing an application. - To preview the currently active QML file, select \uicontrol Tools > - \uicontrol External > \uicontrol {Qt Quick} > \uicontrol {Qt Quick 1 Preview - (qmlviewer)} or \uicontrol {Qt Quick 2 Preview (qmlscene)}. + To run the currently active QML file, select \uicontrol Tools > + \uicontrol External > \uicontrol {Qt Quick} > \uicontrol {QML Runtime}. \section1 Using External Text Editors diff --git a/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc b/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc new file mode 100644 index 00000000000..5a4943030ee --- /dev/null +++ b/doc/qtcreator/src/linux-mobile/b2qtdev.qdoc @@ -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 +*/ diff --git a/doc/qtcreator/src/linux-mobile/creator-deployment-b2qt.qdoc b/doc/qtcreator/src/linux-mobile/creator-deployment-b2qt.qdoc new file mode 100644 index 00000000000..40af933a85a --- /dev/null +++ b/doc/qtcreator/src/linux-mobile/creator-deployment-b2qt.qdoc @@ -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}. +*/ diff --git a/doc/qtcreator/src/linux-mobile/creator-deployment-embedded-linux.qdoc b/doc/qtcreator/src/linux-mobile/creator-deployment-embedded-linux.qdoc index a7efe0ba1a1..11d7ac33518 100644 --- a/doc/qtcreator/src/linux-mobile/creator-deployment-embedded-linux.qdoc +++ b/doc/qtcreator/src/linux-mobile/creator-deployment-embedded-linux.qdoc @@ -31,7 +31,7 @@ /*! \page creator-deployment-embedded-linux.html - \previouspage creator-deploying-android.html + \previouspage creator-deployment-b2qt.html \if defined(qtdesignstudio) \nextpage creator-connecting-mobile.html \else @@ -104,47 +104,6 @@ support will crash when an SFTP upload is being attempted. This is not a bug 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) \include creator-projects-cmake-deploying.qdocinc cmake deploying embedded \endif diff --git a/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc b/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc index 182501dd732..c67c1157467 100644 --- a/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc +++ b/doc/qtcreator/src/linux-mobile/creator-embedded-platforms.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -77,7 +77,9 @@ {Reference Target Devices and Development Hosts} \li \l{https://doc.qt.io/QtForDeviceCreation/b2qt-installation-guides.html} {Installation Guides} + \li \l{Connecting 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} {Qt Creator Plugin for Qt Application Manager} \li \l{https://doc.qt.io/QtForDeviceCreation/index.html} diff --git a/doc/qtcreator/src/linux-mobile/creator-projects-settings-run-b2qt.qdocinc b/doc/qtcreator/src/linux-mobile/creator-projects-settings-run-b2qt.qdocinc index 5a7edda0f50..167de0044ce 100644 --- a/doc/qtcreator/src/linux-mobile/creator-projects-settings-run-b2qt.qdocinc +++ b/doc/qtcreator/src/linux-mobile/creator-projects-settings-run-b2qt.qdocinc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -41,7 +41,7 @@ host and on the device. 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] */ diff --git a/doc/qtcreator/src/linux-mobile/linuxdev.qdoc b/doc/qtcreator/src/linux-mobile/linuxdev.qdoc index e726841c0a7..392f04dc6df 100644 --- a/doc/qtcreator/src/linux-mobile/linuxdev.qdoc +++ b/doc/qtcreator/src/linux-mobile/linuxdev.qdoc @@ -29,7 +29,7 @@ \previouspage creator-developing-android.html \nextpage studio-advanced.html \else - \previouspage creator-developing-baremetal.html + \previouspage creator-developing-b2qt.html \nextpage creator-developing-ios.html \endif diff --git a/doc/qtcreator/src/overview/creator-only/creator-advanced.qdoc b/doc/qtcreator/src/overview/creator-only/creator-advanced.qdoc index 7da29cd5d77..d383b808cf0 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-advanced.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-advanced.qdoc @@ -78,10 +78,9 @@ \li \l{Using External Tools} You can use external tools directly from \QC. Qt Linguist, - QML preview tools (QML Viewer and QML Scene), the default text - editor for your system, and the \c sort tool are preconfigured for - use. You can change their default configurations and configure new - tools. + QML utilities, the default text editor for your system, and the + \c sort tool are preconfigured for use. You can change their default + configurations and configure new tools. \endlist diff --git a/doc/qtcreator/src/overview/creator-only/creator-deployment-overview.qdoc b/doc/qtcreator/src/overview/creator-only/creator-deployment-overview.qdoc index f1d40a058d8..184a58437c4 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-deployment-overview.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-deployment-overview.qdoc @@ -49,18 +49,25 @@ When you deploy the application to an Android device, \QC copies the application files to the device. In addition, you can determine 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} When you deploy the application to a generic Linux-based device, \QC - copies the application files to the connected device. You can test - and debug the application on the device. + copies the application files to the connected device. You can then + test and debug the application on the device with \QC. \if defined(qtcreator) \li \l{Deploying Applications to QNX Neutrino Devices} When you deploy the application to a QNX Neutrino device, \QC copies - the application files to the connected device. You can test and - debug the application on the device. + the application files to the connected device. You can then test and + debug the application on the device with \QC. \endif \endlist diff --git a/doc/qtcreator/src/overview/creator-only/creator-mobile-targets.qdoc b/doc/qtcreator/src/overview/creator-only/creator-mobile-targets.qdoc index acd109a80bb..bf08dceaff3 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-mobile-targets.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-mobile-targets.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -69,6 +69,11 @@ to debug applications on them with GDB or a hardware debugger. \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} If you have a tool chain for building applications for embedded diff --git a/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc b/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc index 42ebca507d4..a87e833683b 100644 --- a/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc @@ -59,7 +59,7 @@ \if defined(qtdesignstudio) \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 settings of the project in the Projects mode. diff --git a/doc/qtdesignstudio/src/qtdesignstudio-advanced.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-advanced.qdoc index 9f7ef447a8f..1b6222340c3 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-advanced.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-advanced.qdoc @@ -73,10 +73,9 @@ \li \l{Using External Tools} You can use external tools directly from \QC. lupdate and lrelease, - QML preview tools (QML Viewer and QML Scene), the default text - editor for your system, and the \c sort tool are preconfigured for - use. You can change their default configurations and configure new - tools. + QML utilities, the default text editor for your system, and the + \c sort tool are preconfigured for use. You can change their default + configurations and configure new tools. \li \l{Managing Data Collection} \if defined (qtcreator) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/ImageEditorTemplate.template b/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/ImageEditorTemplate.template index d7f931566f2..2bd1a3dacb3 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/ImageEditorTemplate.template +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/PropertyTemplates/ImageEditorTemplate.template @@ -35,8 +35,8 @@ Section { PropertyLabel { text: qsTr("Source size") - disabledState: !backendValues.%2_sourceSize_height.isAvailable - && !backendValues.%2_sourceSize_width.isAvailable + blockedByTemplate: !backendValues.%2_sourceSize_height.isAvailable + && !backendValues.%2_sourceSize_width.isAvailable } SecondColumnLayout { @@ -53,8 +53,9 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } ControlLabel { - text: qsTr("W") - //disabledStateSoft: !backendValues.%2_sourceSize_width.isAvailable + //: The width of the object + text: qsTr("W", "width") + enabled: !backendValues.%2_sourceSize_width.isAvailable } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -72,8 +73,9 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } ControlLabel { - text: qsTr("H") - //disabledStateSoft: !backendValues.%2_sourceSize_height.isAvailable + //: The height of the object + text: qsTr("H", "height") + enabled: !backendValues.%2_sourceSize_height.isAvailable } ExpandingSpacer {} @@ -112,7 +114,7 @@ Section { PropertyLabel { text: qsTr("Asynchronous") tooltip: qsTr("Loads images on the local filesystem asynchronously in a separate thread.") - disabledState: !backendValues.%2_asynchronous.isAvailable + blockedByTemplate: !backendValues.%2_asynchronous.isAvailable } SecondColumnLayout { @@ -130,7 +132,7 @@ Section { PropertyLabel { text: qsTr("Auto transform") tooltip: qsTr("Automatically applies image transformation metadata such as EXIF orientation.") - disabledState: !backendValues.%2_autoTransform.isAvailable + blockedByTemplate: !backendValues.%2_autoTransform.isAvailable } SecondColumnLayout { @@ -148,7 +150,7 @@ Section { PropertyLabel { text: qsTr("Cache") tooltip: qsTr("Caches the image.") - disabledState: !backendValues.%2_cache.isAvailable + blockedByTemplate: !backendValues.%2_cache.isAvailable } SecondColumnLayout { @@ -166,7 +168,7 @@ Section { PropertyLabel { text: qsTr("Mipmap") tooltip: qsTr("Uses mipmap filtering when the image is scaled or transformed.") - disabledState: !backendValues.%2_mipmap.isAvailable + blockedByTemplate: !backendValues.%2_mipmap.isAvailable } SecondColumnLayout { @@ -184,7 +186,7 @@ Section { PropertyLabel { text: qsTr("Mirror") tooltip: qsTr("Inverts the image horizontally.") - disabledState: !backendValues.%2_mirror.isAvailable + blockedByTemplate: !backendValues.%2_mirror.isAvailable } SecondColumnLayout { @@ -202,7 +204,7 @@ Section { PropertyLabel { text: qsTr("Smooth") tooltip: qsTr("Smoothly filters the image when it is scaled or transformed.") - disabledState: !backendValues.%2_smooth.isAvailable + blockedByTemplate: !backendValues.%2_smooth.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AdvancedSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AdvancedSection.qml index cb9c5bce84d..260c2507cdf 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AdvancedSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AdvancedSection.qml @@ -53,14 +53,11 @@ Section { } PropertyLabel { - visible: majorQtQuickVersion > 1 text: qsTr("Smooth") - disabledState: !backendValues.smooth.isAvailable + blockedByTemplate: !backendValues.smooth.isAvailable } SecondColumnLayout { - visible: majorQtQuickVersion > 1 - CheckBox { implicitWidth: StudioTheme.Values.twoControlColumnWidth + StudioTheme.Values.actionIndicatorWidth @@ -73,14 +70,11 @@ Section { } PropertyLabel { - visible: majorQtQuickVersion > 1 text: qsTr("Antialiasing") - disabledState: !backendValues.antialiasing.isAvailable + blockedByTemplate: !backendValues.antialiasing.isAvailable } SecondColumnLayout { - visible: majorQtQuickVersion > 1 - CheckBox { implicitWidth: StudioTheme.Values.twoControlColumnWidth + StudioTheme.Values.actionIndicatorWidth @@ -95,7 +89,7 @@ Section { PropertyLabel { text: qsTr("Focus") tooltip: qsTr("Sets focus on the component within the enclosing focus scope.") - disabledState: !backendValues.focus.isAvailable + blockedByTemplate: !backendValues.focus.isAvailable } SecondColumnLayout { @@ -113,7 +107,7 @@ Section { PropertyLabel { text: qsTr("Focus on tab") tooltip: qsTr("Adds the component to the tab focus chain.") - disabledState: !backendValues.activeFocusOnTab.isAvailable + blockedByTemplate: !backendValues.activeFocusOnTab.isAvailable } SecondColumnLayout { @@ -131,7 +125,7 @@ Section { PropertyLabel { text: qsTr("Baseline offset") tooltip: qsTr("Position of the component's baseline in local coordinates.") - disabledState: !backendValues.baselineOffset.isAvailable + blockedByTemplate: !backendValues.baselineOffset.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnimatedImageSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnimatedImageSpecifics.qml index 5aa93dd2f2e..0ab6f8e4291 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnimatedImageSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnimatedImageSpecifics.qml @@ -46,7 +46,7 @@ Column { SectionLayout { PropertyLabel { text: qsTr("Speed") - disabledState: !backendValues.speed.isAvailable + blockedByTemplate: !backendValues.speed.isAvailable } SecondColumnLayout { @@ -70,7 +70,7 @@ Column { PropertyLabel { text: qsTr("Playing") tooltip: qsTr("Whether the animation is playing or paused.") - disabledState: !backendValues.playing.isAvailable && !backendValues.paused.isAvailable + blockedByTemplate: !backendValues.playing.isAvailable && !backendValues.paused.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/BorderImageSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/BorderImageSpecifics.qml index 1a21114083b..e339bf9d058 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/BorderImageSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/BorderImageSpecifics.qml @@ -52,7 +52,7 @@ Column { PropertyLabel { text: qsTr("Source size") - disabledState: !backendValues.sourceSize.isAvailable + blockedByTemplate: !backendValues.sourceSize.isAvailable } SecondColumnLayout { @@ -68,7 +68,11 @@ Column { 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 } @@ -84,7 +88,11 @@ Column { 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 } @@ -95,7 +103,7 @@ Column { PropertyLabel { text: qsTr("Tile mode H") - disabledState: !backendValues.horizontalTileMode.isAvailable + blockedByTemplate: !backendValues.horizontalTileMode.isAvailable } SecondColumnLayout { @@ -114,7 +122,7 @@ Column { PropertyLabel { text: qsTr("Tile mode V") - disabledState: !backendValues.verticalTileMode.isAvailable + blockedByTemplate: !backendValues.verticalTileMode.isAvailable } SecondColumnLayout { @@ -192,9 +200,9 @@ Column { } 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.") - disabledState: !backendValues.mirror.isAvailable + blockedByTemplate: !backendValues.mirror.isAvailable } SecondColumnLayout { @@ -212,7 +220,7 @@ Column { PropertyLabel { text: qsTr("Smooth") tooltip: qsTr("Specifies whether the image is smoothly filtered when scaled or transformed.") - disabledState: !backendValues.smooth.isAvailable + blockedByTemplate: !backendValues.smooth.isAvailable } SecondColumnLayout { @@ -230,7 +238,7 @@ Column { PropertyLabel { text: qsTr("Cache") tooltip: qsTr("Specifies whether the image should be cached.") - disabledState: !backendValues.cache.isAvailable + blockedByTemplate: !backendValues.cache.isAvailable } SecondColumnLayout { @@ -248,7 +256,7 @@ Column { PropertyLabel { text: qsTr("Asynchronous") 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 { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/AbstractButtonSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/AbstractButtonSection.qml index c5b574e18e8..f5fd2282f01 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/AbstractButtonSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/AbstractButtonSection.qml @@ -66,7 +66,7 @@ Section { PropertyLabel { text: qsTr("Display") tooltip: qsTr("Determines how the icon and text are displayed within the button.") - disabledState: !backendValues.display.isAvailable + blockedByTemplate: !backendValues.display.isAvailable } SecondColumnLayout { @@ -118,7 +118,7 @@ Section { PropertyLabel { text: qsTr("Exclusive") tooltip: qsTr("Whether the button is exclusive.") - disabledState: !backendValues.autoExclusive.isAvailable + blockedByTemplate: !backendValues.autoExclusive.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ButtonSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ButtonSection.qml index 4d9ca7d0e7c..63ed1b4436c 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ButtonSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ButtonSection.qml @@ -51,7 +51,8 @@ Section { PropertyLabel { text: qsTr("Appearance") tooltip: qsTr("Whether the button is flat and/or highlighted.") - disabledState: !backendValues.flat.isAvailable + blockedByTemplate: !backendValues.flat.isAvailable + && !backendValues.highlighted.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ControlSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ControlSection.qml index 80faf2f39e2..681f2357b79 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ControlSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ControlSection.qml @@ -67,6 +67,7 @@ Section { implicitWidth: StudioTheme.Values.twoControlColumnWidth + StudioTheme.Values.actionIndicatorWidth backendValue: backendValues.hoverEnabled + enabled: backendValues.hoverEnabled.isAvailable } ExpandingSpacer {} @@ -75,6 +76,7 @@ Section { PropertyLabel { text: qsTr("Focus policy") tooltip: qsTr("Focus policy of the control.") + blockedByTemplate: !backendValues.focusPolicy.isAvailable } SecondColumnLayout { @@ -85,6 +87,7 @@ Section { backendValue: backendValues.focusPolicy model: [ "TabFocus", "ClickFocus", "StrongFocus", "WheelFocus", "NoFocus" ] scope: "Qt" + enabled: backendValues.focusPolicy.isAvailable } ExpandingSpacer {} @@ -112,6 +115,7 @@ Section { PropertyLabel { text: qsTr("Wheel") tooltip: qsTr("Whether control accepts wheel events.") + blockedByTemplate: !backendValues.wheelEnabled.isAvailable } SecondColumnLayout { @@ -120,6 +124,7 @@ Section { implicitWidth: StudioTheme.Values.twoControlColumnWidth + StudioTheme.Values.actionIndicatorWidth backendValue: backendValues.wheelEnabled + enabled: backendValues.wheelEnabled.isAvailable } ExpandingSpacer {} diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/InsetSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/InsetSection.qml index 9f2da824c79..17e35771fef 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/InsetSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/InsetSection.qml @@ -48,50 +48,48 @@ Section { PropertyLabel { text: qsTr("Vertical") } SecondColumnLayout { - SecondColumnLayout { - SpinBox { - implicitWidth: StudioTheme.Values.twoControlColumnWidth - + StudioTheme.Values.actionIndicatorWidth - maximumValue: 10000 - minimumValue: -10000 - realDragRange: 5000 - decimals: 0 - 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 {} + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + maximumValue: 10000 + minimumValue: -10000 + realDragRange: 5000 + decimals: 0 + backendValue: backendValues.topInset } + + 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") } @@ -114,7 +112,7 @@ Section { icon1: StudioTheme.Constants.paddingEdge rotation: 270 tooltip: qsTr("Left inset for the background.") - //disabledStateSoft: !backendValues.leftPadding.isAvailable + enabled: !backendValues.leftPadding.isAvailable } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -136,7 +134,7 @@ Section { icon1: StudioTheme.Constants.paddingEdge rotation: 90 tooltip: qsTr("Right inset for the background.") - //disabledStateSoft: !backendValues.rightPadding.isAvailable + enabled: !backendValues.rightPadding.isAvailable } ExpandingSpacer {} diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/PageSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/PageSpecifics.qml index fab978e0b0d..e3cac6ca29b 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/PageSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/PageSpecifics.qml @@ -83,7 +83,8 @@ Column { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } ControlLabel { - text: qsTr("W") + //: The width of the object + text: qsTr("W", "width") tooltip: qsTr("Content width used for calculating the total implicit width.") } @@ -102,7 +103,8 @@ Column { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } ControlLabel { - text: qsTr("H") + //: The height of the object + text: qsTr("H", "height") tooltip: qsTr("Content height used for calculating the total implicit height.") } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/PaneSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/PaneSection.qml index dff744b02bc..78dcd1a9b53 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/PaneSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/PaneSection.qml @@ -64,7 +64,8 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } ControlLabel { - text: qsTr("W") + //: The width of the object + text: qsTr("W", "width") tooltip: qsTr("Content width used for calculating the total implicit width.") } @@ -83,7 +84,8 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } ControlLabel { - text: qsTr("H") + //: The height of the object + text: qsTr("H", "height") tooltip: qsTr("Content height used for calculating the total implicit height.") } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ProgressBarSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ProgressBarSpecifics.qml index 104803b72f2..205df61e8bf 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ProgressBarSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ProgressBarSpecifics.qml @@ -111,7 +111,7 @@ Column { PropertyLabel { text: qsTr("Indeterminate") tooltip: qsTr("Whether the progress is indeterminate.") - disabledState: !backendValues.indeterminate.isAvailable + blockedByTemplate: !backendValues.indeterminate.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/RoundButtonSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/RoundButtonSpecifics.qml index 85ddd4fab50..b3d316321cc 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/RoundButtonSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/RoundButtonSpecifics.qml @@ -50,7 +50,8 @@ Column { PropertyLabel { text: qsTr("Appearance") tooltip: qsTr("Whether the button is flat and/or highlighted.") - disabledState: !backendValues.flat.isAvailable + blockedByTemplate: !backendValues.flat.isAvailable + && !backendValues.highlighted.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ScrollViewSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ScrollViewSpecifics.qml index 5de17cb387b..ce01026c80e 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ScrollViewSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ScrollViewSpecifics.qml @@ -61,7 +61,8 @@ Column { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } ControlLabel { - text: qsTr("W") + //: The width of the object + text: qsTr("W", "width") tooltip: qsTr("Content width used for calculating the total implicit width.") } @@ -78,7 +79,8 @@ Column { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } ControlLabel { - text: qsTr("H") + //: The height of the object + text: qsTr("H", "height") tooltip: qsTr("Content height used for calculating the total implicit height.") } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/SliderSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/SliderSpecifics.qml index 4bc16353bc5..f3ff89f91ec 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/SliderSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/SliderSpecifics.qml @@ -70,6 +70,7 @@ Column { implicitWidth: StudioTheme.Values.twoControlColumnWidth + StudioTheme.Values.actionIndicatorWidth backendValue: backendValues.live + enabled: backendValues.live.isAvailable tooltip: qsTr("Whether the slider provides live value updates.") } @@ -136,6 +137,7 @@ Column { PropertyLabel { text: qsTr("Drag threshold") tooltip: qsTr("The threshold (in logical pixels) at which a drag event will be initiated.") + blockedByTemplate: !backendValues.touchDragThreshold.isAvailable } SecondColumnLayout { @@ -146,6 +148,7 @@ Column { maximumValue: 10000 decimals: 0 backendValue: backendValues.touchDragThreshold + enabled: backendValues.touchDragThreshold.isAvailable } ExpandingSpacer {} @@ -154,6 +157,7 @@ Column { PropertyLabel { text: qsTr("Snap mode") tooltip: qsTr("The snap mode of the slider.") + blockedByTemplate: !backendValues.snapMode.isAvailable } SecondColumnLayout { @@ -164,6 +168,7 @@ Column { backendValue: backendValues.snapMode model: [ "NoSnap", "SnapOnRelease", "SnapAlways" ] scope: "RangeSlider" + enabled: backendValues.snapMode.isAvailable } ExpandingSpacer {} diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/TabBarSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/TabBarSpecifics.qml index 4d465955066..ad67f2b0b8c 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/TabBarSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/TabBarSpecifics.qml @@ -85,7 +85,8 @@ Column { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } ControlLabel { - text: qsTr("W") + //: The width of the object + text: qsTr("W", "width") tooltip: qsTr("Content width used for calculating the total implicit width.") } @@ -104,7 +105,8 @@ Column { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } ControlLabel { - text: qsTr("H") + //: The height of the object + text: qsTr("H", "height") tooltip: qsTr("Content height used for calculating the total implicit height.") } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/GeometrySection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/GeometrySection.qml index 275640af7bf..02f8459330d 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/GeometrySection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/GeometrySection.qml @@ -67,7 +67,10 @@ Section { } SectionLayout { - PropertyLabel { text: qsTr("Position") } + PropertyLabel { + text: qsTr("Position") + enabled: xSpinBox.enabled || ySpinBox.enabled + } SecondColumnLayout { SpinBox { @@ -86,6 +89,7 @@ Section { ControlLabel { text: "X" tooltip: xSpinBox.enabled ? "X" : root.disbaledTooltip + enabled: xSpinBox.enabled } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -106,6 +110,7 @@ Section { ControlLabel { text: "Y" tooltip: xSpinBox.enabled ? "Y" : root.disbaledTooltip + enabled: ySpinBox.enabled } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -115,7 +120,10 @@ Section { ExpandingSpacer {} } - PropertyLabel { text: qsTr("Size") } + PropertyLabel { + text: qsTr("Size") + enabled: widthSpinBox.enabled || heightSpinBox.enabled + } SecondColumnLayout { SpinBox { @@ -132,8 +140,10 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } ControlLabel { - text: qsTr("W") + //: The width of the object + text: qsTr("W", "width") tooltip: widthSpinBox.enabled ? qsTr("Width") : root.disbaledTooltip + enabled: widthSpinBox.enabled } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -152,8 +162,10 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } ControlLabel { - text: qsTr("H") + //: The height of the object + text: qsTr("H", "height") tooltip: heightSpinBox.enabled ? qsTr("Height") : root.disbaledTooltip + enabled: heightSpinBox.enabled } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -163,7 +175,10 @@ Section { ExpandingSpacer {} } - PropertyLabel { text: qsTr("Rotation") } + PropertyLabel { + text: qsTr("Rotation") + blockedByTemplate: !backendValues.rotation.isAvailable + } SecondColumnLayout { SpinBox { @@ -178,7 +193,10 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: "°" } + ControlLabel { + text: "°" + enabled: backendValues.rotation.isAvailable + } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -209,7 +227,10 @@ Section { ExpandingSpacer {} } - PropertyLabel { text: qsTr("Scale") } + PropertyLabel { + text: qsTr("Scale") + blockedByTemplate: !backendValues.scale.isAvailable + } SecondColumnLayout { SpinBox { @@ -226,7 +247,10 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: "%" } + ControlLabel { + text: "%" + enabled: backendValues.scale.isAvailable + } ExpandingSpacer {} } @@ -245,7 +269,10 @@ Section { ExpandingSpacer {} } - PropertyLabel { text: qsTr("Origin") } + PropertyLabel { + text: qsTr("Origin") + blockedByTemplate: !backendValues.transformOrigin.isAvailable + } SecondColumnLayout { OriginControl { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/GridViewSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/GridViewSpecifics.qml index 70a18787eb9..314005b384f 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/GridViewSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/GridViewSpecifics.qml @@ -58,7 +58,10 @@ Column { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: qsTr("W") } + ControlLabel { + //: The width of the object + text: qsTr("W", "width") + } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -72,7 +75,10 @@ Column { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: qsTr("H") } + ControlLabel { + //: The height of the object + text: qsTr("H", "height") + } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -132,7 +138,7 @@ Column { PropertyLabel { text: qsTr("Cache") tooltip: qsTr("Cache buffer") - disabledState: !backendValues.cacheBuffer.isAvailable + blockedByTemplate: !backendValues.cacheBuffer.isAvailable } SecondColumnLayout { @@ -152,7 +158,7 @@ Column { PropertyLabel { text: qsTr("Navigation wraps") tooltip: qsTr("Whether the grid wraps key navigation.") - disabledState: !backendValues.keyNavigationWraps.isAvailable + blockedByTemplate: !backendValues.keyNavigationWraps.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/LayerSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/LayerSection.qml index 063a2bbb309..df9b6f00a62 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/LayerSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/LayerSection.qml @@ -164,7 +164,10 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: qsTr("W") } + ControlLabel { + //: The width of the object + text: qsTr("W", "width") + } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -179,7 +182,10 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: qsTr("H") } + ControlLabel { + //: The height of the object + text: qsTr("H", "height") + } ExpandingSpacer {} } @@ -303,7 +309,10 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: qsTr("W") } + ControlLabel { + //: The width of the object + text: qsTr("W", "width") + } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -319,7 +328,10 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: qsTr("H") } + ControlLabel { + //: The height of the object + text: qsTr("H", "height") + } ExpandingSpacer {} } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/LayoutProperties.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/LayoutProperties.qml index 3e5ddc6fb2f..e7a1dcf44f3 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/LayoutProperties.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/LayoutProperties.qml @@ -241,7 +241,10 @@ SectionLayout { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: qsTr("W") } + ControlLabel { + //: The width of the object + text: qsTr("W", "width") + } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -256,7 +259,10 @@ SectionLayout { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: qsTr("H") } + ControlLabel { + //: The height of the object + text: qsTr("H", "height") + } ExpandingSpacer {} } @@ -278,7 +284,10 @@ SectionLayout { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: qsTr("W") } + ControlLabel { + //: The width of the object + text: qsTr("W", "width") + } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -293,7 +302,10 @@ SectionLayout { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: qsTr("H") } + ControlLabel { + //: The height of the object + text: qsTr("H", "height") + } ExpandingSpacer {} } @@ -315,7 +327,10 @@ SectionLayout { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: qsTr("W") } + ControlLabel { + //: The width of the object + text: qsTr("W", "width") + } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -330,7 +345,10 @@ SectionLayout { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: qsTr("H") } + ControlLabel { + //: The height of the object + text: qsTr("H", "height") + } ExpandingSpacer {} } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/ColumnLayoutSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/ColumnLayoutSpecifics.qml index 1caca948bd4..e19db2ffaaf 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/ColumnLayoutSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/ColumnLayoutSpecifics.qml @@ -48,5 +48,23 @@ Section { 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 {} + } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/RowLayoutSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/RowLayoutSpecifics.qml index 1cedc5465a8..d77b36d95d2 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/RowLayoutSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/RowLayoutSpecifics.qml @@ -48,5 +48,23 @@ Section { 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 {} + } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml index d6540e72d3d..26729a547c4 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml @@ -61,7 +61,7 @@ Column { PropertyLabel { text: qsTr("Layout direction") - disabledState: !backendValues.layoutDirection.isAvailable + blockedByTemplate: !backendValues.layoutDirection.isAvailable } SecondColumnLayout { @@ -81,7 +81,7 @@ Column { PropertyLabel { text: qsTr("Snap mode") tooltip: qsTr("Determines how the view scrolling will settle following a drag or flick.") - disabledState: !backendValues.snapMode.isAvailable + blockedByTemplate: !backendValues.snapMode.isAvailable } SecondColumnLayout { @@ -119,7 +119,7 @@ Column { PropertyLabel { text: qsTr("Cache") tooltip: qsTr("Cache buffer.") - disabledState: !backendValues.cacheBuffer.isAvailable + blockedByTemplate: !backendValues.cacheBuffer.isAvailable } SecondColumnLayout { @@ -139,7 +139,7 @@ Column { PropertyLabel { text: qsTr("Navigation wraps") tooltip: qsTr("Whether the grid wraps key navigation.") - disabledState: !backendValues.keyNavigationWraps.isAvailable + blockedByTemplate: !backendValues.keyNavigationWraps.isAvailable } SecondColumnLayout { @@ -166,7 +166,7 @@ Column { PropertyLabel { text: qsTr("Range") tooltip: qsTr("Highlight range.") - disabledState: !backendValues.highlightRangeMode.isAvailable + blockedByTemplate: !backendValues.highlightRangeMode.isAvailable } SecondColumnLayout { @@ -186,7 +186,7 @@ Column { PropertyLabel { text: qsTr("Move duration") tooltip: qsTr("Move animation duration of the highlight delegate.") - disabledState: !backendValues.highlightMoveDuration.isAvailable + blockedByTemplate: !backendValues.highlightMoveDuration.isAvailable } SecondColumnLayout { @@ -206,7 +206,7 @@ Column { PropertyLabel { text: qsTr("Move velocity") tooltip: qsTr("Move animation velocity of the highlight delegate.") - disabledState: !backendValues.highlightMoveVelocity.isAvailable + blockedByTemplate: !backendValues.highlightMoveVelocity.isAvailable } SecondColumnLayout { @@ -226,7 +226,7 @@ Column { PropertyLabel { text: qsTr("Resize duration") tooltip: qsTr("Resize animation duration of the highlight delegate.") - disabledState: !backendValues.highlightResizeDuration.isAvailable + blockedByTemplate: !backendValues.highlightResizeDuration.isAvailable } SecondColumnLayout { @@ -246,7 +246,7 @@ Column { PropertyLabel { text: qsTr("Resize velocity") tooltip: qsTr("Resize animation velocity of the highlight delegate.") - disabledState: !backendValues.highlightResizeVelocity.isAvailable + blockedByTemplate: !backendValues.highlightResizeVelocity.isAvailable } SecondColumnLayout { @@ -266,7 +266,7 @@ Column { PropertyLabel { text: qsTr("Preferred begin") tooltip: qsTr("Preferred highlight begin - must be smaller than Preferred end.") - disabledState: !backendValues.preferredHighlightBegin.isAvailable + blockedByTemplate: !backendValues.preferredHighlightBegin.isAvailable } SecondColumnLayout { @@ -286,7 +286,7 @@ Column { PropertyLabel { text: qsTr("Preferred end") tooltip: qsTr("Preferred highlight end - must be larger than Preferred begin.") - disabledState: !backendValues.preferredHighlightEnd.isAvailable + blockedByTemplate: !backendValues.preferredHighlightEnd.isAvailable } SecondColumnLayout { @@ -306,7 +306,7 @@ Column { PropertyLabel { text: qsTr("Follows current") tooltip: qsTr("Whether the highlight is managed by the view.") - disabledState: !backendValues.highlightFollowsCurrentItem.isAvailable + blockedByTemplate: !backendValues.highlightFollowsCurrentItem.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/MouseAreaSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/MouseAreaSpecifics.qml index b3eb942d4fb..1bdadb90164 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/MouseAreaSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/MouseAreaSpecifics.qml @@ -43,7 +43,7 @@ Column { PropertyLabel { text: qsTr("Enable") tooltip: qsTr("Accepts mouse events.") - disabledState: !backendValues.enabled.isAvailable + blockedByTemplate: !backendValues.enabled.isAvailable } SecondColumnLayout { @@ -71,7 +71,7 @@ Column { PropertyLabel { text: qsTr("Accepted buttons") tooltip: qsTr("Mouse buttons that the mouse area reacts to.") - disabledState: !backendValues.acceptedButtons.isAvailable + blockedByTemplate: !backendValues.acceptedButtons.isAvailable } SecondColumnLayout { @@ -91,7 +91,7 @@ Column { PropertyLabel { text: qsTr("Cursor shape") tooltip: qsTr("Cursor shape for this mouse area.") - disabledState: !backendValues.cursorShape.isAvailable + blockedByTemplate: !backendValues.cursorShape.isAvailable } SecondColumnLayout { @@ -134,7 +134,7 @@ Column { PropertyLabel { text: qsTr("Scroll gesture") tooltip: qsTr("Responds to scroll gestures from non-mouse devices.") - disabledState: !backendValues.scrollGestureEnabled.isAvailable + blockedByTemplate: !backendValues.scrollGestureEnabled.isAvailable } SecondColumnLayout { @@ -152,7 +152,7 @@ Column { PropertyLabel { text: qsTr("Prevent stealing") tooltip: qsTr("Stops mouse events from being stolen from this mouse area.") - disabledState: !backendValues.preventStealing.isAvailable + blockedByTemplate: !backendValues.preventStealing.isAvailable } SecondColumnLayout { @@ -170,7 +170,7 @@ Column { PropertyLabel { text: qsTr("Propagate events") tooltip: qsTr("Automatically propagates composed mouse events to other mouse areas.") - disabledState: !backendValues.propagateComposedEvents.isAvailable + blockedByTemplate: !backendValues.propagateComposedEvents.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml index 29697376016..18ec2bfd33f 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml @@ -58,7 +58,7 @@ Column { PropertyLabel { text: qsTr("Border width") - disabledState: !backendValues.border_width.isAvailable + blockedByTemplate: !backendValues.border_width.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml index 6e51b523b27..99adfbe0645 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml @@ -57,7 +57,7 @@ Column { PropertyLabel { text: qsTr("Layout direction") - disabledState: !backendValues.layoutDirection.isAvailable + blockedByTemplate: !backendValues.layoutDirection.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CharacterSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CharacterSection.qml index d88d50fa1a8..1df4a373d1b 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CharacterSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CharacterSection.qml @@ -162,7 +162,7 @@ Section { PropertyLabel { text: qsTr("Style name") tooltip: qsTr("Font's style.") - disabledState: !styleNameComboBox.enabled + blockedByTemplate: !styleNameComboBox.enabled } SecondColumnLayout { @@ -298,6 +298,7 @@ Section { PropertyLabel { text: qsTr("Letter spacing") tooltip: qsTr("Letter spacing for the font.") + blockedByTemplate: !getBackendValue("letterSpacing").isAvailable } SecondColumnLayout { @@ -318,6 +319,7 @@ Section { PropertyLabel { text: qsTr("Word spacing") tooltip: qsTr("Word spacing for the font.") + blockedByTemplate: !getBackendValue("wordSpacing").isAvailable } SecondColumnLayout { @@ -339,7 +341,7 @@ Section { visible: root.showLineHeight text: qsTr("Line height") tooltip: qsTr("Line height for the text.") - disabledState: !lineHeightSpinBox.enabled + blockedByTemplate: !lineHeightSpinBox.enabled } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ControlLabel.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ControlLabel.qml index ed1dc2d8cf9..62af6420bd8 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ControlLabel.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ControlLabel.qml @@ -49,4 +49,15 @@ T.Label { anchors.fill: parent tooltip: label.text } + + states: [ + State { + name: "disabled" + when: !label.enabled + PropertyChanges { + target: label + color: StudioTheme.Values.themeTextColorDisabled + } + } + ] } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/EditableListView.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/EditableListView.qml index 7f34034246a..e77779e1444 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/EditableListView.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/EditableListView.qml @@ -188,47 +188,30 @@ Item { ListViewComboBox { id: dummyComboBox - - //property int myIndex: index - //property bool empty: dummyComboBox.initialModelData === "" - visible: myRepeater.count === 0 - validator: RegExpValidator { regExp: /(^[a-z_]\w*|^[A-Z]\w*\.{1}([a-z_]\w*\.?)+)/ } - actionIndicatorVisible: false typeFilter: editableListView.typeFilter - //editText: modelData - //initialModelData: modelData implicitWidth: StudioTheme.Values.singleControlColumnWidth width: implicitWidth onFocusChanged: { - //if (itemFilterComboBox.focus) - // myColumn.currentIndex = index - - if (/*dummyComboBox.empty && */dummyComboBox.editText !== "") { - //myRepeater.dirty = false + if (dummyComboBox.editText !== "") editableListView.add(dummyComboBox.editText) - } } onCompressedActivated: { editableListView.activatedReason = reason - if (/*dummyComboBox.empty && */dummyComboBox.editText !== "") { - //myRepeater.dirty = false + if (dummyComboBox.editText !== "") editableListView.add(dummyComboBox.editText) - } else { + else editableListView.replace(dummyComboBox.myIndex, dummyComboBox.editText) - } } onHoverChanged: editableListView.delegateHover = dummyComboBox.hover } - - StudioControls.AbstractButton { id: plusButton buttonIcon: StudioTheme.Constants.plus @@ -241,6 +224,7 @@ Item { myColumn.currentIndex = idx myColumn.currentItem.forceActiveFocus() } + onHoveredChanged: editableListView.delegateHover = plusButton.hovered } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableGeometrySection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableGeometrySection.qml index e95d38d42f5..12698c83707 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableGeometrySection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableGeometrySection.qml @@ -51,7 +51,8 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } ControlLabel { - text: qsTr("W") + //: The width of the object + text: qsTr("W", "width") tooltip: qsTr("Content width used for calculating the total implicit width.") } @@ -68,7 +69,8 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } ControlLabel { - text: qsTr("H") + //: The height of the object + text: qsTr("H", "height") tooltip: qsTr("Content height used for calculating the total implicit height.") } @@ -117,8 +119,8 @@ Section { PropertyLabel { text: qsTr("Origin") - disabledState: (!backendValues.originX.isAvailable - && !backendValues.originY.isAvailable) + blockedByTemplate: !backendValues.originX.isAvailable + && !backendValues.originY.isAvailable } SecondColumnLayout { @@ -133,7 +135,10 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: "X" } + ControlLabel { + text: "X" + enabled: backendValues.originX.isAvailable + } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -148,7 +153,10 @@ Section { Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } - ControlLabel { text: "Y" } + ControlLabel { + text: "Y" + enabled: backendValues.originY.isAvailable + } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -159,7 +167,7 @@ Section { PropertyLabel { text: qsTr("Left margin") - disabledState: !backendValues.leftMargin.isAvailable + blockedByTemplate: !backendValues.leftMargin.isAvailable } SecondColumnLayout { @@ -172,12 +180,13 @@ Section { decimals: 0 enabled: backendValue.isAvailable } + ExpandingSpacer {} } PropertyLabel { text: qsTr("Right margin") - disabledState: !backendValues.rightMargin.isAvailable + blockedByTemplate: !backendValues.rightMargin.isAvailable } SecondColumnLayout { @@ -196,7 +205,7 @@ Section { PropertyLabel { text: qsTr("Top margin") - disabledState: !backendValues.topMargin.isAvailable + blockedByTemplate: !backendValues.topMargin.isAvailable } SecondColumnLayout { @@ -215,7 +224,7 @@ Section { PropertyLabel { text: qsTr("Bottom margin") - disabledState: !backendValues.bottomMargin.isAvailable + blockedByTemplate: !backendValues.bottomMargin.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml index a2ccf7209a3..764917bce1d 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml @@ -54,7 +54,7 @@ Section { PropertyLabel { text: qsTr("Flick direction") - disabledState: !backendValues.flickableDirection.isAvailable + blockedByTemplate: !backendValues.flickableDirection.isAvailable } SecondColumnLayout { @@ -74,7 +74,7 @@ Section { PropertyLabel { text: qsTr("Behavior") 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 { @@ -94,7 +94,7 @@ Section { PropertyLabel { 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.") - disabledState: !backendValues.boundsMovement.isAvailable + blockedByTemplate: !backendValues.boundsMovement.isAvailable } SecondColumnLayout { @@ -132,7 +132,7 @@ Section { PropertyLabel { text: qsTr("Deceleration") tooltip: qsTr("Flick deceleration") - disabledState: !backendValues.flickDeceleration.isAvailable + blockedByTemplate: !backendValues.flickDeceleration.isAvailable } SecondColumnLayout { @@ -152,7 +152,7 @@ Section { PropertyLabel { text: qsTr("Press delay") tooltip: qsTr("Time to delay delivering a press to children of the Flickable in milliseconds.") - disabledState: !backendValues.pressDelay.isAvailable + blockedByTemplate: !backendValues.pressDelay.isAvailable } SecondColumnLayout { @@ -172,7 +172,7 @@ Section { PropertyLabel { text: qsTr("Pixel aligned") tooltip: qsTr("Sets the alignment of contentX and contentY to pixels (true) or subpixels (false).") - disabledState: !backendValues.pixelAligned.isAvailable + blockedByTemplate: !backendValues.pixelAligned.isAvailable } 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" + "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.") - disabledState: !backendValues.synchronousDrag.isAvailable + blockedByTemplate: !backendValues.synchronousDrag.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontExtrasSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontExtrasSection.qml index 913c86952a9..9084df11ab7 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontExtrasSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontExtrasSection.qml @@ -46,7 +46,7 @@ Section { PropertyLabel { text: qsTr("Capitalization") tooltip: qsTr("Capitalization for the text.") - disabledState: !getBackendValue("capitalization").isAvailable + blockedByTemplate: !getBackendValue("capitalization").isAvailable } SecondColumnLayout { @@ -66,7 +66,7 @@ Section { PropertyLabel { visible: root.showStyle text: qsTr("Style") - disabledState: !styleComboBox.enabled + blockedByTemplate: !styleComboBox.enabled } SecondColumnLayout { @@ -101,7 +101,7 @@ Section { PropertyLabel { text: qsTr("Hinting") tooltip: qsTr("Preferred hinting on the text.") - disabledState: !getBackendValue("hintingPreference").isAvailable + blockedByTemplate: !getBackendValue("hintingPreference").isAvailable } SecondColumnLayout { @@ -122,7 +122,7 @@ Section { text: qsTr("Auto kerning") 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.") - disabledState: !getBackendValue("kerning").isAvailable + blockedByTemplate: !getBackendValue("kerning").isAvailable } 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" + "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.") - disabledState: !getBackendValue("preferShaping").isAvailable + blockedByTemplate: !getBackendValue("preferShaping").isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml index 8e688b84866..83f9a7e9c3b 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml @@ -149,7 +149,13 @@ Section { ExpandingSpacer {} } - PropertyLabel { text: qsTr("Emphasis") } + PropertyLabel { + text: qsTr("Emphasis") + blockedByTemplate: !fontSection.boldStyle.isAvailable + && !fontSection.italicStyle.isAvailable + && !fontSection.underlineStyle.isAvailable + && !fontSection.strikeoutStyle.isAvailable + } FontStyleButtons { bold: fontSection.boldStyle @@ -162,7 +168,7 @@ Section { PropertyLabel { text: qsTr("Capitalization") tooltip: qsTr("Capitalization for the text.") - disabledState: !getBackendValue("capitalization").isAvailable + blockedByTemplate: !getBackendValue("capitalization").isAvailable } SecondColumnLayout { @@ -182,6 +188,7 @@ Section { PropertyLabel { text: qsTr("Weight") tooltip: qsTr("Font's weight.") + blockedByTemplate: styleNameComboBox.styleSet } SecondColumnLayout { @@ -201,7 +208,7 @@ Section { PropertyLabel { text: qsTr("Style name") tooltip: qsTr("Font's style.") - disabledState: !styleNameComboBox.enabled + blockedByTemplate: !styleNameComboBox.enabled } SecondColumnLayout { @@ -223,7 +230,7 @@ Section { PropertyLabel { visible: fontSection.showStyle text: qsTr("Style") - disabledState: !styleComboBox.enabled + blockedByTemplate: !styleComboBox.enabled } SecondColumnLayout { @@ -257,7 +264,7 @@ Section { PropertyLabel { text: qsTr("Hinting") tooltip: qsTr("Preferred hinting on the text.") - disabledState: !getBackendValue("hintingPreference").isAvailable + blockedByTemplate: !getBackendValue("hintingPreference").isAvailable } SecondColumnLayout { @@ -277,6 +284,7 @@ Section { PropertyLabel { text: qsTr("Letter spacing") tooltip: qsTr("Letter spacing for the font.") + blockedByTemplate: getBackendValue("letterSpacing").isAvailable } SecondColumnLayout { @@ -297,6 +305,7 @@ Section { PropertyLabel { text: qsTr("Word spacing") tooltip: qsTr("Word spacing for the font.") + blockedByTemplate: !backendValue.isAvailable } SecondColumnLayout { @@ -318,7 +327,7 @@ Section { text: qsTr("Auto kerning") 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.") - disabledState: !getBackendValue("kerning").isAvailable + blockedByTemplate: !getBackendValue("kerning").isAvailable } 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" + "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.") - disabledState: !getBackendValue("preferShaping").isAvailable + blockedByTemplate: !getBackendValue("preferShaping").isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ImageSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ImageSection.qml index f3fe8885497..1dffa44c082 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ImageSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ImageSection.qml @@ -26,7 +26,6 @@ import QtQuick 2.15 import QtQuick.Layouts 1.15 import HelperWidgets 2.0 -import StudioControls 1.0 as StudioControls import StudioTheme 1.0 as StudioTheme Section { @@ -63,7 +62,7 @@ Section { PropertyLabel { text: qsTr("Source size") - disabledState: !backendValues.sourceSize.isAvailable + blockedByTemplate: !backendValues.sourceSize.isAvailable } SecondColumnLayout { @@ -79,7 +78,11 @@ Section { 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 } @@ -95,7 +98,11 @@ Section { 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 } @@ -104,7 +111,6 @@ Section { ExpandingSpacer {} } - PropertyLabel { text: qsTr("Alignment H") } SecondColumnLayout { @@ -138,7 +144,7 @@ Section { PropertyLabel { text: qsTr("Asynchronous") tooltip: qsTr("Loads images on the local filesystem asynchronously in a separate thread.") - disabledState: !backendValues.asynchronous.isAvailable + blockedByTemplate: !backendValues.asynchronous.isAvailable } SecondColumnLayout { @@ -156,7 +162,7 @@ Section { PropertyLabel { text: qsTr("Auto transform") tooltip: qsTr("Automatically applies image transformation metadata such as EXIF orientation.") - disabledState: !backendValues.autoTransform.isAvailable + blockedByTemplate: !backendValues.autoTransform.isAvailable } SecondColumnLayout { @@ -174,7 +180,7 @@ Section { PropertyLabel { text: qsTr("Cache") tooltip: qsTr("Caches the image.") - disabledState: !backendValues.cache.isAvailable + blockedByTemplate: !backendValues.cache.isAvailable } SecondColumnLayout { @@ -192,7 +198,7 @@ Section { PropertyLabel { text: qsTr("Mipmap") tooltip: qsTr("Uses mipmap filtering when the image is scaled or transformed.") - disabledState: !backendValues.mipmap.isAvailable + blockedByTemplate: !backendValues.mipmap.isAvailable } SecondColumnLayout { @@ -210,7 +216,7 @@ Section { PropertyLabel { text: qsTr("Mirror") tooltip: qsTr("Inverts the image horizontally.") - disabledState: !backendValues.mirror.isAvailable + blockedByTemplate: !backendValues.mirror.isAvailable } SecondColumnLayout { @@ -228,7 +234,7 @@ Section { PropertyLabel { text: qsTr("Smooth") tooltip: qsTr("Smoothly filters the image when it is scaled or transformed.") - disabledState: !backendValues.smooth.isAvailable + blockedByTemplate: !backendValues.smooth.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/MultiIconLabel.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/MultiIconLabel.qml index ffc3d0daf45..3a985ae685a 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/MultiIconLabel.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/MultiIconLabel.qml @@ -28,6 +28,7 @@ import QtQuick.Templates 2.15 as T import StudioTheme 1.0 as StudioTheme Rectangle { + id: root property alias tooltip: toolTipArea.tooltip property alias icon0: icon0.text property alias icon1: icon1.text @@ -69,4 +70,15 @@ Rectangle { id: toolTipArea anchors.fill: parent } + + states: [ + State { + name: "disabled" + when: !root.enabled + PropertyChanges { + target: icon1 + color: StudioTheme.Values.themeIconColorDisabled + } + } + ] } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PaddingSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PaddingSection.qml index d44c5a51799..379a1b99937 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PaddingSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PaddingSection.qml @@ -37,7 +37,8 @@ Section { SectionLayout { PropertyLabel { text: qsTr("Vertical") - disabledState: (!backendValues.topPadding.isAvailable && !backendValues.bottomPadding.isAvailable) + blockedByTemplate: !backendValues.topPadding.isAvailable + && !backendValues.bottomPadding.isAvailable } SecondColumnLayout { @@ -57,7 +58,7 @@ Section { icon0: StudioTheme.Constants.paddingFrame icon1: StudioTheme.Constants.paddingEdge 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 } @@ -79,7 +80,7 @@ Section { icon1: StudioTheme.Constants.paddingEdge rotation: 180 tooltip: qsTr("Padding between the content and the bottom edge of the item.") - //disabledStateSoft: !backendValues.bottomPadding.isAvailable + enabled: backendValues.bottomPadding.isAvailable } ExpandingSpacer {} @@ -87,7 +88,8 @@ Section { PropertyLabel { text: qsTr("Horizontal") - disabledState: (!backendValues.leftPadding.isAvailable && !backendValues.rightPadding.isAvailable) + blockedByTemplate: !backendValues.leftPadding.isAvailable + && !backendValues.rightPadding.isAvailable } SecondColumnLayout { @@ -108,7 +110,7 @@ Section { icon1: StudioTheme.Constants.paddingEdge rotation: 270 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 } @@ -130,7 +132,7 @@ Section { icon1: StudioTheme.Constants.paddingEdge rotation: 90 tooltip: qsTr("Padding between the content and the right edge of the item.") - //disabledStateSoft: !backendValues.rightPadding.isAvailable + enabled: backendValues.rightPadding.isAvailable } ExpandingSpacer {} @@ -139,7 +141,7 @@ Section { PropertyLabel { text: qsTr("Global") tooltip: qsTr("Padding between the content and the edges of the items.") - disabledState: !backendValues.padding.isAvailable + blockedByTemplate: !backendValues.padding.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PropertyLabel.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PropertyLabel.qml index 723b06a58b3..5f44cf667e4 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PropertyLabel.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PropertyLabel.qml @@ -33,12 +33,12 @@ T.Label { property alias tooltip: toolTipArea.tooltip - property bool disabledState: false - property bool disabledStateSoft: false + property bool blockedByContext: false + property bool blockedByTemplate: false // MCU width: StudioTheme.Values.propertyLabelWidth color: StudioTheme.Values.themeTextColor - font.pixelSize: StudioTheme.Values.myFontSize // TODO + font.pixelSize: StudioTheme.Values.myFontSize elide: Text.ElideRight horizontalAlignment: Text.AlignRight @@ -50,26 +50,35 @@ T.Label { ToolTipArea { id: toolTipArea anchors.fill: parent - tooltip: ((label.disabledState || label.disabledStateSoft) - ? qsTr("This property is not available in this configuration.") - : label.text) + tooltip: label.blockedByTemplate + ? qsTr("This property is not available in this configuration.") + : label.text } states: [ State { name: "disabled" - when: label.disabledState + when: !label.enabled && !(label.blockedByContext || label.blockedByTemplate) PropertyChanges { target: label color: StudioTheme.Values.themeTextColorDisabled } }, State { - name: "disabledSoft" - when: label.disabledStateSoft + name: "blockedByContext" + when: label.blockedByContext PropertyChanges { 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 } } ] diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml index c739382f199..1d001ec15f5 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml @@ -65,7 +65,7 @@ Section { implicitWidth: StudioTheme.Values.iconAreaWidth // TODO dedicated value implicitHeight: StudioTheme.Values.height // TODO dedicated value - T.Label { + Label { id: richTextEditorIcon anchors.fill: parent text: StudioTheme.Constants.edit @@ -120,7 +120,7 @@ Section { PropertyLabel { visible: root.showVerticalAlignment text: qsTr("Wrap mode") - disabledState: !backendValues.wrapMode.isAvailable + blockedByTemplate: !backendValues.wrapMode.isAvailable } SecondColumnLayout { @@ -141,7 +141,7 @@ Section { PropertyLabel { visible: root.showElide text: qsTr("Elide") - disabledState: !backendValues.elide.isAvailable + blockedByTemplate: !backendValues.elide.isAvailable } SecondColumnLayout { @@ -163,7 +163,7 @@ Section { visible: root.showElide text: qsTr("Max line count") tooltip: qsTr("Limits the number of lines that the text component will show.") - disabledState: !backendValues.maximumLineCount.isAvailable + blockedByTemplate: !backendValues.maximumLineCount.isAvailable } SecondColumnLayout { @@ -202,7 +202,7 @@ Section { PropertyLabel { visible: root.showFormatProperty text: qsTr("Format") - disabledState: !backendValues.textFormat.isAvailable + blockedByTemplate: !backendValues.textFormat.isAvailable } SecondColumnLayout { @@ -223,7 +223,7 @@ Section { PropertyLabel { text: qsTr("Render type") tooltip: qsTr("Overrides the default rendering type for this component.") - disabledState: !backendValues.renderType.isAvailable + blockedByTemplate: !backendValues.renderType.isAvailable } SecondColumnLayout { @@ -244,7 +244,7 @@ Section { visible: root.showFontSizeMode text: qsTr("Size mode") tooltip: qsTr("Specifies how the font size of the displayed text is determined.") - disabledState: !backendValues.fontSizeMode.isAvailable + blockedByTemplate: !backendValues.fontSizeMode.isAvailable } SecondColumnLayout { @@ -266,8 +266,8 @@ Section { PropertyLabel { visible: root.showFontSizeMode text: qsTr("Min size") - disabledState: !backendValues.minimumPixelSize.isAvailable - && !backendValues.minimumPointSize.isAvailable + blockedByTemplate: !backendValues.minimumPixelSize.isAvailable + && !backendValues.minimumPointSize.isAvailable } SecondColumnLayout { @@ -288,7 +288,7 @@ Section { ControlLabel { text: "px" tooltip: qsTr("Minimum font pixel size of scaled text.") - //disabledStateSoft: !backendValues.minimumPixelSize.isAvailable + enabled: backendValues.minimumPixelSize.isAvailable } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -308,7 +308,7 @@ Section { ControlLabel { text: "pt" tooltip: qsTr("Minimum font point size of scaled text.") - //disabledStateSoft: !backendValues.minimumPointSize.isAvailable + enabled: backendValues.minimumPointSize.isAvailable } ExpandingSpacer {} @@ -318,7 +318,7 @@ Section { visible: root.showLineHeight text: qsTr("Line height") tooltip: qsTr("Line height for the text.") - disabledState: !lineHeightSpinBox.enabled + blockedByTemplate: !lineHeightSpinBox.enabled } SecondColumnLayout { @@ -344,7 +344,7 @@ Section { visible: root.showLineHeight text: qsTr("Line height mode") tooltip: qsTr("Determines how the line height is specified.") - disabledState: !backendValues.lineHeightMode.isAvailable + blockedByTemplate: !backendValues.lineHeightMode.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/TextExtrasSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/TextExtrasSection.qml index ce10809261d..234fea36f8a 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/TextExtrasSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/TextExtrasSection.qml @@ -45,7 +45,7 @@ Section { PropertyLabel { visible: root.showWrapMode text: qsTr("Wrap mode") - disabledState: !backendValues.wrapMode.isAvailable + blockedByTemplate: !backendValues.wrapMode.isAvailable } SecondColumnLayout { @@ -67,7 +67,7 @@ Section { PropertyLabel { visible: root.showElide text: qsTr("Elide") - disabledState: !backendValues.elide.isAvailable + blockedByTemplate: !backendValues.elide.isAvailable } SecondColumnLayout { @@ -89,7 +89,7 @@ Section { PropertyLabel { visible: root.showFormatProperty text: qsTr("Format") - disabledState: !backendValues.textFormat.isAvailable + blockedByTemplate: !backendValues.textFormat.isAvailable } SecondColumnLayout { @@ -111,7 +111,7 @@ Section { PropertyLabel { text: qsTr("Render type") tooltip: qsTr("Overrides the default rendering type for this component.") - disabledState: !backendValues.renderType.isAvailable + blockedByTemplate: !backendValues.renderType.isAvailable } SecondColumnLayout { @@ -132,7 +132,7 @@ Section { visible: root.showLineHeight text: qsTr("Line height mode") tooltip: qsTr("Determines how the line height is specified.") - disabledState: !backendValues.lineHeightMode.isAvailable + blockedByTemplate: !backendValues.lineHeightMode.isAvailable } SecondColumnLayout { @@ -155,7 +155,7 @@ Section { visible: root.showFontSizeMode text: qsTr("Size mode") tooltip: qsTr("Specifies how the font size of the displayed text is determined.") - disabledState: !backendValues.fontSizeMode.isAvailable + blockedByTemplate: !backendValues.fontSizeMode.isAvailable } SecondColumnLayout { @@ -178,8 +178,8 @@ Section { PropertyLabel { visible: root.showFontSizeMode text: qsTr("Min size") - disabledState: !backendValues.minimumPixelSize.isAvailable - && !backendValues.minimumPointSize.isAvailable + blockedByTemplate: !backendValues.minimumPixelSize.isAvailable + && !backendValues.minimumPointSize.isAvailable } SecondColumnLayout { @@ -200,7 +200,7 @@ Section { ControlLabel { text: "px" tooltip: qsTr("Minimum font pixel size of scaled text.") - //disabledStateSoft: !backendValues.minimumPixelSize.isAvailable + enabled: backendValues.minimumPixelSize.isAvailable } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -220,7 +220,7 @@ Section { ControlLabel { text: "pt" tooltip: qsTr("Minimum font point size of scaled text.") - //disabledStateSoft: !backendValues.minimumPointSize.isAvailable + enabled: backendValues.minimumPointSize.isAvailable } ExpandingSpacer {} @@ -230,7 +230,7 @@ Section { visible: root.showElide text: qsTr("Max line count") tooltip: qsTr("Limits the number of lines that the text component will show.") - disabledState: !backendValues.maximumLineCount.isAvailable + blockedByTemplate: !backendValues.maximumLineCount.isAvailable } SecondColumnLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml index c3e91a6584c..38034918fb5 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml @@ -220,6 +220,7 @@ QtObject { property string themeTextColorDisabled: Theme.color(Theme.DStextColorDisabled) property string themeTextSelectionColor: Theme.color(Theme.DStextSelectionColor) property string themeTextSelectedTextColor: Theme.color(Theme.DStextSelectedTextColor) + property string themeTextColorDisabledMCU: "black" // TODO property string themePlaceholderTextColor: Theme.color(Theme.DSplaceholderTextColor) property string themePlaceholderTextColorInteraction: Theme.color(Theme.DSplaceholderTextColorInteraction) diff --git a/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json index d5642f0a987..764998e6f80 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json @@ -3,7 +3,7 @@ "supportedProjectTypes": [ "QmlProjectManager.QmlProject" ], "id": "QA.QtQuickUi", "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", "trDisplayCategory": "Other Project", "icon": "qtquickuiprototype.png", diff --git a/share/share.qbs b/share/share.qbs index 0e9fe5a5cf8..a2114dad2d2 100644 --- a/share/share.qbs +++ b/share/share.qbs @@ -57,8 +57,7 @@ Product { var list = [ "lrelease.xml", "lupdate.xml", - "qmlscene.xml", - "qmlviewer.xml", + "qml.xml", ] if (qbs.targetOS.contains("windows")) list.push("notepad_win.xml"); diff --git a/src/libs/languageserverprotocol/icontent.h b/src/libs/languageserverprotocol/icontent.h index ea19b25a92d..a19d9cc48c3 100644 --- a/src/libs/languageserverprotocol/icontent.h +++ b/src/libs/languageserverprotocol/icontent.h @@ -51,18 +51,16 @@ public: explicit MessageId(const QString &id) : variant(id) {} explicit MessageId(const QJsonValue &value) { - if (value.isUndefined()) - return; - QTC_CHECK(value.isDouble() || value.isString()); if (value.isDouble()) *this = MessageId(value.toInt()); else if (value.isString()) *this = MessageId(value.toString()); + else + m_valid = false; } operator QJsonValue() const { - QTC_CHECK(Utils::holds_alternative(*this) || Utils::holds_alternative(*this)); if (auto id = Utils::get_if(this)) return *id; if (auto id = Utils::get_if(this)) @@ -70,7 +68,7 @@ public: return QJsonValue(); } - bool isValid() const { return true; } + bool isValid() const { return m_valid; } QString toString() const { @@ -80,6 +78,9 @@ public: return QString::number(*id); return {}; } + +private: + bool m_valid = true; }; struct ResponseHandler diff --git a/src/libs/languageserverprotocol/workspace.h b/src/libs/languageserverprotocol/workspace.h index 3b0b247b88b..0a745a984fd 100644 --- a/src/libs/languageserverprotocol/workspace.h +++ b/src/libs/languageserverprotocol/workspace.h @@ -188,6 +188,8 @@ public: QString query() const { return typedValue(queryKey); } void setQuery(const QString &query) { insert(queryKey, query); } + void setLimit(int limit) { insert("limit", limit); } // clangd extension + bool isValid() const override { return contains(queryKey); } }; diff --git a/src/libs/qlitehtml b/src/libs/qlitehtml index 44e15759b74..6af5648d120 160000 --- a/src/libs/qlitehtml +++ b/src/libs/qlitehtml @@ -1 +1 @@ -Subproject commit 44e15759b7400901bfdc6b69ffb1256c82cc1699 +Subproject commit 6af5648d1208ed5760d74bd060c74ffa2bcfef6b diff --git a/src/libs/utils/environmentdialog.cpp b/src/libs/utils/environmentdialog.cpp index 123a571646b..7a8b8f588fa 100644 --- a/src/libs/utils/environmentdialog.cpp +++ b/src/libs/utils/environmentdialog.cpp @@ -46,6 +46,8 @@ Utils::optional EnvironmentDialog::getEnvironmentItems( tr("Edit Environment"), tr("Enter one environment variable per line.\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" "To clear a variable, put its name on a line with nothing else on it.\n" "To disable a variable, prefix the line with \"#\".")); diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp index 95e935272c3..ca397b0c0d4 100644 --- a/src/libs/utils/fileutils.cpp +++ b/src/libs/utils/fileutils.cpp @@ -939,6 +939,26 @@ bool FilePath::isReadableDir() const 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 { if (needsDevice()) { @@ -1244,12 +1264,6 @@ bool FilePath::endsWith(const QString &s) const 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 /// \note returns a empty FilePath if FilePath is not a child of parent /// That is, this never returns a path starting with "../" diff --git a/src/libs/utils/fileutils.h b/src/libs/utils/fileutils.h index 20219dec280..3939b5e243b 100644 --- a/src/libs/utils/fileutils.h +++ b/src/libs/utils/fileutils.h @@ -77,6 +77,8 @@ public: std::function isReadableDir; std::function isWritableDir; std::function isWritableFile; + std::function isFile; + std::function isDir; std::function ensureWritableDir; std::function ensureExistingFile; std::function createDir; @@ -149,6 +151,8 @@ public: bool isReadableDir() const; bool isRelativePath() const; bool isAbsolutePath() const { return !isRelativePath(); } + bool isFile() const; + bool isDir() const; bool createDir() const; QList dirEntries(const QStringList &nameFilters, @@ -177,7 +181,6 @@ public: bool startsWith(const QString &s) const; bool endsWith(const QString &s) const; - bool isDir() const; bool isNewerThan(const QDateTime &timeStamp) const; QDateTime lastModified() const; QFile::Permissions permissions() const; diff --git a/src/libs/utils/hostosinfo.cpp b/src/libs/utils/hostosinfo.cpp index c5f313d5ce7..78ed7f22867 100644 --- a/src/libs/utils/hostosinfo.cpp +++ b/src/libs/utils/hostosinfo.cpp @@ -35,6 +35,10 @@ #include #endif +#ifdef Q_OS_MACOS +#include +#endif + using namespace Utils; Qt::CaseSensitivity HostOsInfo::m_overrideFileNameCaseSensitivity = Qt::CaseSensitive; @@ -70,6 +74,17 @@ HostOsInfo::HostArchitecture HostOsInfo::hostArchitecture() #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) { m_useOverrideFileNameCaseSensitivity = true; diff --git a/src/libs/utils/hostosinfo.h b/src/libs/utils/hostosinfo.h index 541419e432e..db2d77074b4 100644 --- a/src/libs/utils/hostosinfo.h +++ b/src/libs/utils/hostosinfo.h @@ -73,6 +73,8 @@ public: #endif } + static bool isRunningUnderRosetta(); + static QString withExecutableSuffix(const QString &executable) { return OsSpecificAspects::withExecutableSuffix(hostOs(), executable); diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index cb7e15385e2..3f658ea4812 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -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)); return false; } - const QFileInfo fi(expandedPath); + const FilePath filePath = FilePath::fromString(expandedPath); // Check if existing switch (d->m_acceptingKind) { case PathChooser::ExistingDirectory: - if (!fi.exists()) { + if (!filePath.exists()) { 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; } - if (!fi.isDir()) { + if (!filePath.isDir()) { 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; } break; case PathChooser::File: - if (!fi.exists()) { + if (!filePath.exists()) { 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; } - if (!fi.isFile()) { + if (!filePath.isFile()) { 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; } break; case PathChooser::SaveFile: - if (!fi.absoluteDir().exists()) { + if (!filePath.parentDir().exists()) { 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; } - if (fi.exists() && fi.isDir()) { + if (filePath.exists() && filePath.isDir()) { 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; } break; case PathChooser::ExistingCommand: - if (!fi.exists()) { + if (!filePath.exists()) { 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; } - if (!fi.isFile() || !fi.isExecutable()) { + if (!filePath.isExecutableFile()) { 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; } break; case PathChooser::Directory: - if (fi.exists() && !fi.isDir()) { + if (filePath.isDir()) { 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; } break; case PathChooser::Command: - if (fi.exists() && !fi.isExecutable()) { + if (filePath.exists() && !filePath.isExecutableFile()) { if (errorMessage) - *errorMessage = tr("Cannot execute \"%1\".").arg(QDir::toNativeSeparators(expandedPath)); + *errorMessage = tr("Cannot execute \"%1\".").arg(filePath.toUserOutput()); return false; } break; @@ -601,7 +601,7 @@ bool PathChooser::validatePath(FancyLineEdit *edit, QString *errorMessage) const } if (errorMessage) - *errorMessage = tr("Full path: \"%1\"").arg(QDir::toNativeSeparators(expandedPath)); + *errorMessage = tr("Full path: \"%1\"").arg(filePath.toUserOutput()); return true; } diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index e82a7109ad6..53bc79cd1f7 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -461,6 +461,8 @@ QString AndroidManager::androidNameForApiLevel(int x) return QLatin1String("Android 10"); case 30: return QLatin1String("Android 11"); + case 31: + return QLatin1String("Android 12"); default: return tr("Unknown Android version. API Level: %1").arg(x); } diff --git a/src/plugins/android/androidsdkmanager.cpp b/src/plugins/android/androidsdkmanager.cpp index c62dcbd2c85..18bed57f2d4 100644 --- a/src/plugins/android/androidsdkmanager.cpp +++ b/src/plugins/android/androidsdkmanager.cpp @@ -84,6 +84,8 @@ int platformNameToApiLevel(const QString &platformName) apiLevel = 29; else if (apiLevelStr == 'R') apiLevel = 30; + else if (apiLevelStr == 'S') + apiLevel = 31; } } return apiLevel; diff --git a/src/plugins/autotest/gtest/gtestoutputreader.cpp b/src/plugins/autotest/gtest/gtestoutputreader.cpp index 8dfa0c0ef41..997e7d2ddc2 100644 --- a/src/plugins/autotest/gtest/gtestoutputreader.cpp +++ b/src/plugins/autotest/gtest/gtestoutputreader.cpp @@ -179,7 +179,7 @@ void GTestOutputReader::processOutputLine(const QByteArray &outputLine) testResult->setResult(type); testResult->setLine(match.captured(3).toInt()); const Utils::FilePath file = constructSourceFilePath(m_buildDir, match.captured(2)); - if (!file.isEmpty()) + if (file.exists()) testResult->setFileName(file); testResult->setDescription(match.captured(4)); reportResult(testResult); @@ -247,7 +247,7 @@ void GTestOutputReader::handleDescriptionAndReportResult(TestResultPtr testResul testResult->setResult(ResultType::MessageLocation); testResult->setLine(innerMatch.captured(2).toInt()); const Utils::FilePath file = constructSourceFilePath(m_buildDir, innerMatch.captured(1)); - if (!file.isEmpty()) + if (file.exists()) testResult->setFileName(file); resultDescription << output; } diff --git a/src/plugins/autotest/testoutputreader.cpp b/src/plugins/autotest/testoutputreader.cpp index 403f086de5f..ada972d094a 100644 --- a/src/plugins/autotest/testoutputreader.cpp +++ b/src/plugins/autotest/testoutputreader.cpp @@ -39,11 +39,10 @@ namespace Autotest { Utils::FilePath TestOutputReader::constructSourceFilePath(const Utils::FilePath &path, - const QString &filePath) + const QString &file) { - if (!filePath.isEmpty() && filePath.at(0) != '.') - return Utils::FilePath::fromFileInfo(QFileInfo(filePath)); - return (path / filePath).canonicalPath(); + const Utils::FilePath filePath = path.resolvePath(file); + return filePath.exists() ? filePath : Utils::FilePath(); } TestOutputReader::TestOutputReader(const QFutureInterface &futureInterface, @@ -177,9 +176,8 @@ void TestOutputReader::checkForSanitizerOutput(const QByteArray &line) if (m_sanitizerOutputMode == SanitizerOutputMode::Ubsan) { const Utils::FilePath path = constructSourceFilePath(m_buildDir, match.captured(1)); // path may be empty if not existing - so, provide at least what we have - m_sanitizerResult->setFileName(path.isEmpty() - ? Utils::FilePath::fromString(match.captured(1)) - : path); + m_sanitizerResult->setFileName( + path.exists() ? path : Utils::FilePath::fromString(match.captured(1))); m_sanitizerResult->setLine(match.captured(2).toInt()); } } diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index ae1e29a8eb8..c180710a340 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -540,8 +540,10 @@ public: void closeTempDocuments() { - for (const Utils::FilePath &fp : qAsConst(openedFiles)) - q->closeExtraFile(fp); + for (const Utils::FilePath &fp : qAsConst(openedFiles)) { + if (!q->documentForFilePath(fp)) + q->closeExtraFile(fp); + } openedFiles.clear(); } @@ -690,7 +692,6 @@ public: void sendGotoImplementationRequest(const Utils::Link &link); void handleGotoImplementationResult(const GotoImplementationRequest::Response &response); void handleDocumentInfoResults(); - void closeTempDocuments(); void handleDeclDefSwitchReplies(); diff --git a/src/plugins/clangcodemodel/clanggloballocatorfilters.cpp b/src/plugins/clangcodemodel/clanggloballocatorfilters.cpp index 004b10a087d..e979c8928c2 100644 --- a/src/plugins/clangcodemodel/clanggloballocatorfilters.cpp +++ b/src/plugins/clangcodemodel/clanggloballocatorfilters.cpp @@ -43,6 +43,8 @@ namespace ClangCodeModel { namespace Internal { +const int MaxResultCount = 10000; + class CppLocatorFilter : public CppTools::CppLocatorFilter { public: @@ -67,6 +69,7 @@ public: setDefaultShortcutString({}); setEnabled(false); setHidden(true); + setMaxResultCount(MaxResultCount); } }; @@ -94,6 +97,7 @@ public: setDefaultShortcutString({}); setEnabled(false); setHidden(true); + setMaxResultCount(MaxResultCount); } }; @@ -121,6 +125,7 @@ public: setDefaultShortcutString({}); setEnabled(false); setHidden(true); + setMaxResultCount(MaxResultCount); } }; diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 3905ae5f6a5..816dc09650b 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -120,7 +120,11 @@ static clang::format::FormatStyle qtcStyle() style.ExperimentalAutoDetectBinPacking = false; style.FixNamespaceComments = true; style.ForEachMacros = {"forever", "foreach", "Q_FOREACH", "BOOST_FOREACH"}; +#if LLVM_VERSION_MAJOR >= 12 + style.IncludeStyle.IncludeCategories = {{"^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(); addAspect(); @@ -939,27 +955,33 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) } } - if (isIos(k)) { - QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(k); - if (qt && qt->qtVersion().majorVersion >= 6) { - // TODO it would be better if we could set - // CMAKE_SYSTEM_NAME=iOS and CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=YES - // and build with "cmake --build . -- -arch " instead of setting the architecture - // and sysroot in the CMake configuration, but that currently doesn't work with Qt/CMake - // https://gitlab.kitware.com/cmake/cmake/-/issues/21276 - const Id deviceType = DeviceTypeKitAspect::deviceTypeId(k); - // TODO the architectures are probably not correct with Apple Silicon in the mix... - const QString architecture = deviceType == Ios::Constants::IOS_DEVICE_TYPE - ? QLatin1String("arm64") - : QLatin1String("x86_64"); - const QString sysroot = deviceType == Ios::Constants::IOS_DEVICE_TYPE - ? QLatin1String("iphoneos") - : QLatin1String("iphonesimulator"); - initialArgs.append(CMAKE_QT6_TOOLCHAIN_FILE_ARG); - initialArgs.append("-DCMAKE_OSX_ARCHITECTURES:STRING=" + architecture); - initialArgs.append("-DCMAKE_OSX_SYSROOT:STRING=" + sysroot); - initialArgs.append("%{" + QLatin1String(DEVELOPMENT_TEAM_FLAG) + "}"); - initialArgs.append("%{" + QLatin1String(PROVISIONING_PROFILE_FLAG) + "}"); + const IDevice::ConstPtr device = DeviceKitAspect::device(k); + if (device->osType() == Utils::OsTypeMac) { + if (isIos(k)) { + QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(k); + if (qt && qt->qtVersion().majorVersion >= 6) { + // TODO it would be better if we could set + // CMAKE_SYSTEM_NAME=iOS and CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=YES + // and build with "cmake --build . -- -arch " instead of setting the architecture + // and sysroot in the CMake configuration, but that currently doesn't work with Qt/CMake + // https://gitlab.kitware.com/cmake/cmake/-/issues/21276 + const Id deviceType = DeviceTypeKitAspect::deviceTypeId(k); + // TODO the architectures are probably not correct with Apple Silicon in the mix... + const QString architecture = deviceType == Ios::Constants::IOS_DEVICE_TYPE + ? QLatin1String("arm64") + : QLatin1String("x86_64"); + const QString sysroot = deviceType == Ios::Constants::IOS_DEVICE_TYPE + ? QLatin1String("iphoneos") + : QLatin1String("iphonesimulator"); + initialArgs.append(CMAKE_QT6_TOOLCHAIN_FILE_ARG); + initialArgs.append("-DCMAKE_OSX_ARCHITECTURES:STRING=" + architecture); + 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) + "}"); } } diff --git a/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp b/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp index 7e30f661fb2..3aa957bbe5b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp @@ -203,9 +203,9 @@ QString CMakeConfigItem::expandedValue(const Utils::MacroExpander *expander) con return expander ? expander->expand(QString::fromUtf8(value)) : QString::fromUtf8(value); } -std::function 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) @@ -393,7 +393,7 @@ QList CMakeConfigItem::itemsFromFile(const Utils::FilePath &cac } } - Utils::sort(result, CMakeConfigItem::sortOperator()); + Utils::sort(result, &CMakeConfigItem::less); return result; diff --git a/src/plugins/cmakeprojectmanager/cmakeconfigitem.h b/src/plugins/cmakeprojectmanager/cmakeconfigitem.h index 7da405a48d8..73d31983d32 100644 --- a/src/plugins/cmakeprojectmanager/cmakeconfigitem.h +++ b/src/plugins/cmakeprojectmanager/cmakeconfigitem.h @@ -62,7 +62,7 @@ public: QString expandedValue(const ProjectExplorer::Kit *k) const; QString expandedValue(const Utils::MacroExpander *expander) const; - static std::function sortOperator(); + static bool less(const CMakeConfigItem &a, const CMakeConfigItem &b); static CMakeConfigItem fromString(const QString &s); static QList itemsFromArguments(const QStringList &list); static QList itemsFromFile(const Utils::FilePath &input, QString *errorMessage); diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index 925c240942c..1a279e93adc 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -1094,7 +1095,7 @@ Tasks CMakeConfigurationKitAspect::validate(const Kit *k) const if (!version || !version->isValid()) { addWarning(tr("CMake configuration has a path to a qmake binary set, " "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 " "that does not match the qmake binary path " "configured in the Qt version.")); diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index 42beff4b932..348b1de7627 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -64,6 +65,8 @@ CMakeToolManager::CMakeToolManager() QTC_ASSERT(!m_instance, return); m_instance = this; + qRegisterMetaType(); + d = new CMakeToolManagerPrivate; connect(ICore::instance(), &ICore::saveSettingsRequested, this, &CMakeToolManager::saveCMakeTools); @@ -177,6 +180,25 @@ void CMakeToolManager::updateDocumentation() 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) { const Id id = Id::fromString(cmakePath.toUserOutput()); diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.h b/src/plugins/cmakeprojectmanager/cmaketoolmanager.h index 2f71ddf34c4..9497192873d 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.h +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.h @@ -63,7 +63,11 @@ public: static void updateDocumentation(); 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: void cmakeAdded (const Utils::Id &id); @@ -81,3 +85,5 @@ private: }; } // namespace CMakeProjectManager + +Q_DECLARE_METATYPE(QString *) diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabasetests.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdatabasetests.cpp index 42ba0e08871..9b97a1988d3 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdatabasetests.cpp +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabasetests.cpp @@ -98,9 +98,8 @@ void CompilationDatabaseTests::testProject_data() void CompilationDatabaseTests::addTestRow(const QByteArray &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 diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 5213756975a..ce178bb2fbd 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1751,9 +1751,6 @@ bool EditorManagerPrivate::closeEditors(const QList &editors, CloseFla emit m_instance->editorsClosed(Utils::toList(acceptedEditors)); - foreach (IEditor *editor, acceptedEditors) - delete editor; - if (focusView) { activateView(focusView); } else { @@ -1761,6 +1758,9 @@ bool EditorManagerPrivate::closeEditors(const QList &editors, CloseFla setCurrentEditor(currentView->currentEditor()); } + foreach (IEditor *editor, acceptedEditors) + delete editor; + if (!EditorManager::currentEditor()) { emit m_instance->currentEditorChanged(nullptr); updateActions(); diff --git a/src/plugins/coreplugin/find/currentdocumentfind.cpp b/src/plugins/coreplugin/find/currentdocumentfind.cpp index 7cbe94783f6..7fe84aac158 100644 --- a/src/plugins/coreplugin/find/currentdocumentfind.cpp +++ b/src/plugins/coreplugin/find/currentdocumentfind.cpp @@ -165,8 +165,12 @@ void CurrentDocumentFind::updateCandidateFindFilter(QWidget *old, QWidget *now) if (!impl) 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; + } if (m_candidateWidget) disconnect(Aggregation::Aggregate::parentAggregate(m_candidateWidget), &Aggregation::Aggregate::changed, this, &CurrentDocumentFind::candidateAggregationChanged); diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index a6bf33491a0..c8bb751ef59 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -492,7 +492,7 @@ static void drawPrimitiveTweakedForDarkTheme(QStyle::PrimitiveElement element, QPen outline(indicatorColor, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin); painter->setPen(outline); QColor fill(frameColor); - fill.setAlphaF(0.8); + fill.setAlphaF(0.8f); painter->setBrush(fill); const double o = 3.5; 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)) { QColor highlight = option->palette.highlight().color(); - highlight.setAlphaF(0.4); + highlight.setAlphaF(0.4f); painter->setPen(QPen(highlight.lighter(), 1)); - highlight.setAlphaF(0.3); + highlight.setAlphaF(0.3f); painter->setBrush(highlight); painter->setRenderHint(QPainter::Antialiasing); const QRectF rect = option->rect; @@ -743,10 +743,10 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption painter->setPen(Qt::NoPen); QColor dark = StyleHelper::borderColor(); - dark.setAlphaF(0.4); + dark.setAlphaF(0.4f); QColor light = StyleHelper::baseColor(); - light.setAlphaF(0.4); + light.setAlphaF(0.4f); painter->fillPath(path, light); painter->save(); @@ -908,7 +908,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt case CE_SizeGrip: { painter->save(); QColor dark = Qt::white; - dark.setAlphaF(0.1); + dark.setAlphaF(0.1f); int x, y, w, h; option->rect.getRect(&x, &y, &w, &h); int sw = qMin(h, w); diff --git a/src/plugins/cppeditor/cppquickfixsettings.cpp b/src/plugins/cppeditor/cppquickfixsettings.cpp index 6d016d6e203..d9fbecb1512 100644 --- a/src/plugins/cppeditor/cppquickfixsettings.cpp +++ b/src/plugins/cppeditor/cppquickfixsettings.cpp @@ -334,7 +334,7 @@ auto removeAndExtractTemplate(QString type) QString templateParameter; int counter = 0; int start = 0; - int templateStart; + int templateStart = 0; for (int i = 0; i < type.length(); ++i) { auto c = type[i]; if (c == '<') { diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 1ffc4f09435..b7bacb678c4 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -1665,8 +1665,8 @@ bool BreakHandler::contextMenuEvent(const ItemViewEvent &ev) : locationsEnabled ? tr("Disable Location") : tr("Enable Location"), !selectedLocations.isEmpty() && handlesIndividualLocations, [this, selectedLocations, locationsEnabled] { - for (const SubBreakpoint &sbp : selectedLocations) - requestSubBreakpointEnabling(sbp, !locationsEnabled); + for (SubBreakpointItem * const sbp : selectedLocations) + requestSubBreakpointEnabling(QPointer(sbp), !locationsEnabled); } ); diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index 24e4b754be6..f00aca55722 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -85,8 +85,6 @@ public: QCheckBox *runInTerminalCheckBox; QCheckBox *useTargetExtendedRemoteCheckBox; PathChooser *debuginfoPathChooser; - QLabel *serverStartScriptLabel; - PathChooser *serverStartScriptPathChooser; QLabel *sysRootLabel; PathChooser *sysRootPathChooser; QLabel *serverInitCommandsLabel; @@ -129,7 +127,6 @@ public: bool breakAtMain = false; bool runInTerminal = false; bool useTargetExtendedRemote = false; - FilePath serverStartScript; FilePath sysRoot; QString serverInitCommands; QString serverResetCommands; @@ -144,7 +141,6 @@ bool StartApplicationParameters::equals(const StartApplicationParameters &rhs) c && runnable.workingDirectory == rhs.runnable.workingDirectory && breakAtMain == rhs.breakAtMain && runInTerminal == rhs.runInTerminal - && serverStartScript == rhs.serverStartScript && sysRoot == rhs.sysRoot && serverInitCommands == rhs.serverInitCommands && serverResetCommands == rhs.serverResetCommands @@ -184,7 +180,6 @@ void StartApplicationParameters::toSettings(QSettings *settings) const settings->setValue("LastExternalBreakAtMain", breakAtMain); settings->setValue("LastExternalRunInTerminal", runInTerminal); settings->setValue("LastExternalUseTargetExtended", useTargetExtendedRemote); - settings->setValue("LastServerStartScript", serverStartScript.toVariant()); settings->setValue("LastServerInitCommands", serverInitCommands); settings->setValue("LastServerResetCommands", serverResetCommands); settings->setValue("LastDebugInfoLocation", debugInfoLocation); @@ -202,7 +197,6 @@ void StartApplicationParameters::fromSettings(const QSettings *settings) breakAtMain = settings->value("LastExternalBreakAtMain").toBool(); runInTerminal = settings->value("LastExternalRunInTerminal").toBool(); useTargetExtendedRemote = settings->value("LastExternalUseTargetExtended").toBool(); - serverStartScript = FilePath::fromVariant(settings->value("LastServerStartScript")); serverInitCommands = settings->value("LastServerInitCommands").toString(); serverResetCommands = settings->value("LastServerResetCommands").toString(); debugInfoLocation = settings->value("LastDebugInfoLocation").toString(); @@ -260,17 +254,6 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent) 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->setExpectedKind(PathChooser::Directory); 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("Break at \"&main\":"), d->breakAtMainCheckBox); 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->serverInitCommandsLabel, d->serverInitCommandsTextEdit); formLayout->addRow(d->serverResetCommandsLabel, d->serverResetCommandsTextEdit); @@ -418,8 +400,6 @@ void StartApplicationDialog::run(bool attachRemote) dialog.setHistory(history); dialog.setParameters(history.back()); if (!attachRemote) { - dialog.d->serverStartScriptPathChooser->setVisible(false); - dialog.d->serverStartScriptLabel->setVisible(false); dialog.d->serverInitCommandsTextEdit->setVisible(false); dialog.d->serverInitCommandsLabel->setVisible(false); dialog.d->serverResetCommandsTextEdit->setVisible(false); @@ -465,7 +445,6 @@ void StartApplicationDialog::run(bool attachRemote) debugger->setBreakOnMain(newParameters.breakAtMain); debugger->setDebugInfoLocation(newParameters.debugInfoLocation); debugger->setInferior(inferior); - debugger->setServerStartScript(newParameters.serverStartScript); // Note: This requires inferior. debugger->setCommandsAfterConnect(newParameters.serverInitCommands); debugger->setCommandsForReset(newParameters.serverResetCommands); debugger->setUseTerminal(newParameters.runInTerminal); @@ -505,7 +484,6 @@ StartApplicationParameters StartApplicationDialog::parameters() const result.serverPort = d->serverPortSpinBox->value(); result.serverAddress = d->channelOverrideEdit->text(); result.runnable.executable = d->localExecutablePathChooser->filePath(); - result.serverStartScript = d->serverStartScriptPathChooser->filePath(); result.sysRoot = d->sysRootPathChooser->filePath(); result.serverInitCommands = d->serverInitCommandsTextEdit->toPlainText(); result.serverResetCommands = d->serverResetCommandsTextEdit->toPlainText(); @@ -525,7 +503,6 @@ void StartApplicationDialog::setParameters(const StartApplicationParameters &p) d->serverPortSpinBox->setValue(p.serverPort); d->channelOverrideEdit->setText(p.serverAddress); d->localExecutablePathChooser->setFilePath(p.runnable.executable); - d->serverStartScriptPathChooser->setFilePath(p.serverStartScript); d->sysRootPathChooser->setFilePath(p.sysRoot); d->serverInitCommandsTextEdit->setPlainText(p.serverInitCommands); d->serverResetCommandsTextEdit->setPlainText(p.serverResetCommands); diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp index 588445daad2..5b83add671f 100644 --- a/src/plugins/debugger/debuggeritem.cpp +++ b/src/plugins/debugger/debuggeritem.cpp @@ -53,11 +53,14 @@ using namespace Debugger::Internal; using namespace ProjectExplorer; using namespace Utils; +namespace Debugger { + const char DEBUGGER_INFORMATION_COMMAND[] = "Binary"; const char DEBUGGER_INFORMATION_DISPLAYNAME[] = "DisplayName"; const char DEBUGGER_INFORMATION_ID[] = "Id"; 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_ABIS[] = "Abis"; 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 //! \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 QtcProcess proc; @@ -93,8 +96,6 @@ static QString extractGdbTargetAbiStringFromGdbOutput(const QString &gdbOutput) } -namespace Debugger { - // -------------------------------------------------------------------------- // DebuggerItem // -------------------------------------------------------------------------- @@ -113,6 +114,7 @@ DebuggerItem::DebuggerItem(const QVariantMap &data) m_workingDirectory = FilePath::fromVariant(data.value(DEBUGGER_INFORMATION_WORKINGDIRECTORY)); m_unexpandedDisplayName = data.value(DEBUGGER_INFORMATION_DISPLAYNAME).toString(); 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_engineType = DebuggerEngineType(data.value(DEBUGGER_INFORMATION_ENGINETYPE, static_cast(NoEngineType)).toInt()); @@ -149,7 +151,7 @@ static bool isUVisionExecutable(const QFileInfo &fileInfo) 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 // 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 gdbSupportsConfigurationFlag = (version >= 70700); if (gdbSupportsConfigurationFlag || unableToFindAVersion) { - const auto gdbConfiguration = getConfigurationOfGdbCommand(m_command, sysEnv); - const auto gdbTargetAbiString = + const QString gdbConfiguration = getGdbConfiguration(m_command, sysEnv); + const QString gdbTargetAbiString = extractGdbTargetAbiStringFromGdbOutput(gdbConfiguration); if (!gdbTargetAbiString.isEmpty()) { m_abis.append(Abi::abiFromTargetTriplet(gdbTargetAbiString)); @@ -298,11 +300,11 @@ QDateTime DebuggerItem::lastModified() const QIcon DebuggerItem::decoration() const { if (m_engineType == NoEngineType) - return Utils::Icons::CRITICAL.icon(); + return Icons::CRITICAL.icon(); if (!m_command.toFileInfo().isExecutable()) - return Utils::Icons::WARNING.icon(); + return Icons::WARNING.icon(); if (!m_workingDirectory.isEmpty() && !m_workingDirectory.isDir()) - return Utils::Icons::WARNING.icon(); + return Icons::WARNING.icon(); return QIcon(); } @@ -318,6 +320,7 @@ bool DebuggerItem::operator==(const DebuggerItem &other) const return m_id == other.m_id && m_unexpandedDisplayName == other.m_unexpandedDisplayName && m_isAutoDetected == other.m_isAutoDetected + && m_detectionSource == other.m_detectionSource && m_command == other.m_command && 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_ENGINETYPE, int(m_engineType)); 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_ABIS, abiNames()); data.insert(DEBUGGER_INFORMATION_LASTMODIFIED, m_lastModified); diff --git a/src/plugins/debugger/debuggeritem.h b/src/plugins/debugger/debuggeritem.h index fb1760f8f1f..5ae9c9a9f23 100644 --- a/src/plugins/debugger/debuggeritem.h +++ b/src/plugins/debugger/debuggeritem.h @@ -103,6 +103,9 @@ public: Utils::FilePath workingDirectory() const { return m_workingDirectory; } void setWorkingDirectory(const Utils::FilePath &workingPath) { m_workingDirectory = workingPath; } + QString detectionSource() const { return m_detectionSource; } + void setDetectionSource(const QString &source) { m_detectionSource = source; } + private: DebuggerItem(const QVariant &id); void initMacroExpander(); @@ -116,6 +119,7 @@ private: QString m_version; ProjectExplorer::Abis m_abis; QDateTime m_lastModified; + QString m_detectionSource; friend class Internal::DebuggerConfigWidget; friend class Internal::DebuggerItemConfigWidget; diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index 222e6e2a192..33a04cf7c41 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -92,7 +92,7 @@ public: QVariant registerDebugger(const DebuggerItem &item); void readDebuggers(const FilePath &fileName, bool isSystem); void autoDetectCdbDebuggers(); - void autoDetectGdbOrLldbDebuggers(const FilePath &deviceRoot); + void autoDetectGdbOrLldbDebuggers(const FilePath &deviceRoot, const QString &detectionSource); void autoDetectUvscDebuggers(); QString uniqueDisplayName(const QString &base); @@ -556,7 +556,6 @@ void DebuggerConfigWidget::addDebugger() { DebuggerItem item; item.createId(); - item.setAutoDetected(false); item.setEngineType(NoEngineType); item.setUnexpandedDisplayName(d->uniqueDisplayName(tr("New Debugger"))); item.setAutoDetected(false); @@ -715,7 +714,8 @@ static Utils::FilePaths searchGdbPathsFromRegistry() 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", "gdb.exe", "lldb", "lldb.exe", "lldb-[1-9]*", @@ -784,14 +784,17 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePath &de } DebuggerItem item; 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.reinitializeFromFile(); if (item.engineType() == NoEngineType) continue; //: %1: Debugger engine type (GDB, LLDB, CDB...), %2: Path - item.setUnexpandedDisplayName(tr("System %1 at %2") - .arg(item.engineTypeName()).arg(command.toUserOutput())); - item.setAutoDetected(true); + const QString name = detectionSource.isEmpty() ? tr("System %1 at %2") : tr("Detected %1 at %2"); + item.setUnexpandedDisplayName(name.arg(item.engineTypeName()).arg(command.toUserOutput())); m_model->addDebugger(item); } } @@ -942,7 +945,7 @@ void DebuggerItemManagerPrivate::restoreDebuggers() // Auto detect current. autoDetectCdbDebuggers(); - autoDetectGdbOrLldbDebuggers({}); + autoDetectGdbOrLldbDebuggers({}, {}); 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 diff --git a/src/plugins/debugger/debuggeritemmanager.h b/src/plugins/debugger/debuggeritemmanager.h index 1278da2b672..221ecf72bdb 100644 --- a/src/plugins/debugger/debuggeritemmanager.h +++ b/src/plugins/debugger/debuggeritemmanager.h @@ -52,7 +52,8 @@ public: static QVariant registerDebugger(const DebuggerItem &item); 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 *findById(const QVariant &id); diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp index 90ea0ac89e4..12a085f905d 100644 --- a/src/plugins/debugger/debuggerkitinformation.cpp +++ b/src/plugins/debugger/debuggerkitinformation.cpp @@ -185,9 +185,12 @@ void DebuggerKitAspect::setup(Kit *k) // This improves the situation a bit if a cross-compilation tool chain has the // same ABI as the host. if (level == DebuggerItem::MatchesPerfectly + && !item.command().needsDevice() && systemEnvironment.path().contains(item.command().parentDir())) { level = DebuggerItem::MatchesPerfectlyInPath; } + if (!item.detectionSource().isEmpty() && item.detectionSource() == k->autoDetectionSource()) + level = DebuggerItem::MatchLevel(level + 2); } else if (rawId.type() == QVariant::String) { // New structure. if (item.id() == rawId) { diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 5fc046f8a96..e9a6c2d22ba 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1746,9 +1746,10 @@ void DebuggerPlugin::getEnginesState(QByteArray *json) const *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() diff --git a/src/plugins/debugger/debuggerplugin.h b/src/plugins/debugger/debuggerplugin.h index 1d22225dc2c..8ef79ed48fd 100644 --- a/src/plugins/debugger/debuggerplugin.h +++ b/src/plugins/debugger/debuggerplugin.h @@ -59,7 +59,7 @@ private: Q_SLOT void getEnginesState(QByteArray *json) const; // Called from DockerDevice - Q_SLOT void autoDetectDebuggersForDevice(const Utils::FilePath &deviceRoot); + Q_SLOT void autoDetectDebuggersForDevice(const Utils::FilePath &deviceRoot, const QString &detectionId); QVector createTestObjects() const override; }; diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 837c71f9062..e3fcefe3bf7 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -95,98 +95,6 @@ DebuggerEngine *createQmlEngine(); DebuggerEngine *createLldbEngine(); 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 m_runTool; - CommandLine m_command; - Utils::QtcProcess m_proc; -}; - class CoreUnpacker final : public RunWorker { public: @@ -421,16 +329,6 @@ void DebuggerRunTool::setCommandsForReset(const QString &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) { m_runParameters.debugInfoLocation = debugInfoLocation; diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 421f6f2c26b..7b05e6f9efa 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -216,7 +216,11 @@ void LldbEngine::setupEngine() if (QFileInfo(runParameters().debugger.workingDirectory).isDir()) m_lldbProc.setWorkingDirectory(runParameters().debugger.workingDirectory); - m_lldbProc.setCommand(CommandLine(lldbCmd)); + if (HostOsInfo::isRunningUnderRosetta()) + m_lldbProc.setCommand(CommandLine("/usr/bin/arch", {"-arm64", lldbCmd.toString()})); + else + m_lldbProc.setCommand(CommandLine(lldbCmd)); + m_lldbProc.start(); if (!m_lldbProc.waitForStarted()) { diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 42359391480..67333f75229 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -299,6 +299,7 @@ public: void tryCreateLocalFileAccess(); + void stopCurrentContainer(); void fetchSystemEnviroment(); DockerDevice *q; @@ -351,9 +352,10 @@ public: m_pathsLineEdit->setToolTip(tr("Paths in this semi-colon separated list will be " "mapped one-to-one into the Docker container.")); m_pathsLineEdit->setText(data.mounts.join(';')); + m_pathsLineEdit->setPlaceholderText(tr("List project source directories here")); - connect(m_pathsLineEdit, &QLineEdit::textChanged, this, [&data](const QString &text) { - data.mounts = text.split(';'); + connect(m_pathsLineEdit, &QLineEdit::textChanged, this, [dockerDevice](const QString &text) { + dockerDevice->setMounts(text.split(';', Qt::SkipEmptyParts)); }); auto logView = new QTextBrowser; @@ -508,7 +510,7 @@ QList KitDetectorPrivate::autoDetectQtVersions() const continue; qtVersions.append(qtVersion); QtVersionManager::addVersion(qtVersion); - emit q->logOutput(tr("Found Qt: %1").arg(qtVersion->qmakeCommand().toUserOutput())); + emit q->logOutput(tr("Found Qt: %1").arg(qtVersion->qmakeFilePath().toUserOutput())); } if (qtVersions.isEmpty()) emit q->logOutput(tr("No Qt installation found.")); @@ -543,19 +545,15 @@ void KitDetectorPrivate::autoDetectCMake() return; emit q->logOutput('\n' + tr("Searching CMake binary...")); + const FilePath deviceRoot = m_device->mapToGlobalPath({}); QString error; - const QStringList candidates = {"cmake"}; - for (const QString &candidate : candidates) { - const FilePath cmake = m_device->searchExecutableInPath(candidate); - if (!cmake.isEmpty()) { - emit q->logOutput(tr("Found CMake binary: %1").arg(cmake.toUserOutput())); - const bool res = QMetaObject::invokeMethod(cmakeManager, - "registerCMakeByPath", - Q_ARG(Utils::FilePath, cmake), - Q_ARG(QString, m_sharedId)); - QTC_CHECK(res); - } - } + const bool res = QMetaObject::invokeMethod(cmakeManager, + "autoDetectCMakeForDevice", + Q_ARG(Utils::FilePath, deviceRoot), + Q_ARG(QString, m_sharedId), + Q_ARG(QString *, &error)); + QTC_CHECK(res); + emit q->logOutput(error); } void KitDetectorPrivate::autoDetectDebugger() @@ -568,7 +566,8 @@ void KitDetectorPrivate::autoDetectDebugger() const FilePath deviceRoot = m_device->mapToGlobalPath({}); const bool res = QMetaObject::invokeMethod(debuggerPlugin, "autoDetectDebuggersForDevice", - Q_ARG(Utils::FilePath, deviceRoot)); + Q_ARG(Utils::FilePath, deviceRoot), + Q_ARG(QString, m_sharedId)); QTC_CHECK(res); } @@ -615,6 +614,20 @@ void DockerDevice::tryCreateLocalFileAccess() const d->tryCreateLocalFileAccess(); } +void DockerDevicePrivate::stopCurrentContainer() +{ + if (m_container.isEmpty()) + return; + + QtcProcess proc; + proc.setCommand({"docker", {"container", "stop", m_container}}); + + m_container.clear(); + m_mergedDir.clear(); + + proc.runBlocking(); +} + void DockerDevicePrivate::tryCreateLocalFileAccess() { if (!m_container.isEmpty()) @@ -639,8 +652,10 @@ void DockerDevicePrivate::tryCreateLocalFileAccess() dockerRun.addArgs({"-u", QString("%1:%2").arg(getuid()).arg(getgid())}); #endif - for (const QString &mount : qAsConst(m_data.mounts)) - dockerRun.addArgs({"-v", mount + ':' + mount}); + for (const QString &mount : qAsConst(m_data.mounts)) { + if (!mount.isEmpty()) + dockerRun.addArgs({"-v", mount + ':' + mount}); + } dockerRun.addArg(m_data.imageId); dockerRun.addArg("/bin/sh"); @@ -710,6 +725,12 @@ bool DockerDevice::hasLocalFileAccess() const return !d->m_mergedDir.isEmpty(); } +void DockerDevice::setMounts(const QStringList &mounts) const +{ + d->m_data.mounts = mounts; + d->stopCurrentContainer(); // Force re-start with new mounts. +} + FilePath DockerDevice::mapToLocalAccess(const FilePath &filePath) const { QTC_ASSERT(!d->m_mergedDir.isEmpty(), return {}); @@ -901,6 +922,38 @@ bool DockerDevice::isWritableDirectory(const FilePath &filePath) const return exitCode == 0; } +bool DockerDevice::isFile(const FilePath &filePath) const +{ + QTC_ASSERT(handlesFile(filePath), return false); + tryCreateLocalFileAccess(); + if (hasLocalFileAccess()) { + const FilePath localAccess = mapToLocalAccess(filePath); + const bool res = localAccess.isFile(); + LOG("IsFile? " << filePath.toUserOutput() << localAccess.toUserOutput() << res); + return res; + } + const QString path = filePath.path(); + const CommandLine cmd("test", {"-f", path}); + const int exitCode = d->runSynchronously(cmd); + return exitCode == 0; +} + +bool DockerDevice::isDirectory(const FilePath &filePath) const +{ + QTC_ASSERT(handlesFile(filePath), return false); + tryCreateLocalFileAccess(); + if (hasLocalFileAccess()) { + const FilePath localAccess = mapToLocalAccess(filePath); + const bool res = localAccess.isDir(); + LOG("IsDirectory? " << filePath.toUserOutput() << localAccess.toUserOutput() << res); + return res; + } + const QString path = filePath.path(); + const CommandLine cmd("test", {"-d", path}); + const int exitCode = d->runSynchronously(cmd); + return exitCode == 0; +} + bool DockerDevice::createDirectory(const FilePath &filePath) const { QTC_ASSERT(handlesFile(filePath), return false); diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index 0dd441bfd95..35ba3f1c87f 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -81,6 +81,8 @@ public: bool isWritableFile(const Utils::FilePath &filePath) const override; bool isReadableDirectory(const Utils::FilePath &filePath) const override; bool isWritableDirectory(const Utils::FilePath &filePath) const override; + bool isFile(const Utils::FilePath &filePath) const override; + bool isDirectory(const Utils::FilePath &filePath) const override; bool createDirectory(const Utils::FilePath &filePath) const override; bool exists(const Utils::FilePath &filePath) const override; bool ensureExistingFile(const Utils::FilePath &filePath) const override; @@ -105,6 +107,7 @@ public: void tryCreateLocalFileAccess() const; bool hasLocalFileAccess() const; + void setMounts(const QStringList &mounts) const; Utils::FilePath mapToLocalAccess(const Utils::FilePath &filePath) const; Utils::FilePath mapFromLocalAccess(const Utils::FilePath &filePath) const; diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index aaf8d3caba5..9a42f38ef9e 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -1195,7 +1195,7 @@ void Client::sendPostponedDocumentUpdates() emit documentUpdated(update.document); if (currentWidget && currentWidget->textDocument() == update.document) - cursorPositionChanged(currentWidget); + requestDocumentHighlights(currentWidget); m_tokentSupport.updateSemanticTokens(update.document); } diff --git a/src/plugins/languageclient/languageclientcompletionassist.cpp b/src/plugins/languageclient/languageclientcompletionassist.cpp index 612ad19402a..3826f151cc0 100644 --- a/src/plugins/languageclient/languageclientcompletionassist.cpp +++ b/src/plugins/languageclient/languageclientcompletionassist.cpp @@ -188,7 +188,7 @@ QString LanguageClientCompletionItem::detail() const bool LanguageClientCompletionItem::isSnippet() const { - return m_item.insertTextFormat().value_or(CompletionItem::PlainText); + return m_item.insertTextFormat() == CompletionItem::Snippet; } bool LanguageClientCompletionItem::isValid() const diff --git a/src/plugins/languageclient/languageclientfunctionhint.cpp b/src/plugins/languageclient/languageclientfunctionhint.cpp index 32c0ff0a637..c650c3cdbf0 100644 --- a/src/plugins/languageclient/languageclientfunctionhint.cpp +++ b/src/plugins/languageclient/languageclientfunctionhint.cpp @@ -57,9 +57,28 @@ private: QString FunctionHintProposalModel::text(int index) const { + using Parameters = QList; if (index < 0 || m_sigis.signatures().size() <= index) return {}; - return m_sigis.signatures().at(index).label(); + const SignatureInformation signature = m_sigis.signatures().at(index); + QString label = signature.label(); + if (index != m_sigis.activeSignature().value_or(-1)) + return label; + + const int parametersIndex = m_sigis.activeParameter().value_or(-1); + if (parametersIndex < 0) + return label; + + const QList parameters = Utils::transform(signature.parameters().value_or(Parameters()), + &ParameterInformation::label); + if (parameters.size() <= parametersIndex) + return label; + + const QString ¶meterText = parameters.at(parametersIndex); + const int start = label.indexOf(parameterText); + const int end = start + parameterText.length(); + return label.mid(0, start).toHtmlEscaped() + "" + parameterText.toHtmlEscaped() + "" + + label.mid(end).toHtmlEscaped(); } class FunctionHintProcessor : public IAssistProcessor diff --git a/src/plugins/languageclient/languageclientoutline.cpp b/src/plugins/languageclient/languageclientoutline.cpp index a9c3bf5b8b6..98edfcfd4df 100644 --- a/src/plugins/languageclient/languageclientoutline.cpp +++ b/src/plugins/languageclient/languageclientoutline.cpp @@ -153,8 +153,8 @@ LanguageClientOutlineWidget::LanguageClientOutlineWidget(Client *client, &DocumentSymbolCache::gotSymbols, this, &LanguageClientOutlineWidget::handleResponse); - connect(editor->textDocument(), &TextEditor::TextDocument::contentsChanged, this, [this]() { - if (m_client) + connect(client, &Client::documentUpdated, this, [this](TextEditor::TextDocument *document) { + if (m_client && m_uri == DocumentUri::fromFilePath(document->filePath())) m_client->documentSymbolCache()->requestSymbols(m_uri); }); diff --git a/src/plugins/languageclient/locatorfilter.cpp b/src/plugins/languageclient/locatorfilter.cpp index b3abe0fc798..ce4fd5c9b5d 100644 --- a/src/plugins/languageclient/locatorfilter.cpp +++ b/src/plugins/languageclient/locatorfilter.cpp @@ -230,6 +230,8 @@ void WorkspaceLocatorFilter::prepareSearch(const QString &entry, WorkspaceSymbolParams params; params.setQuery(entry); + if (m_maxResultCount > 0) + params.setLimit(m_maxResultCount); QMutexLocker locker(&m_mutex); for (auto client : qAsConst(clients)) { diff --git a/src/plugins/languageclient/locatorfilter.h b/src/plugins/languageclient/locatorfilter.h index 58da2ddf9c2..6ef079ec45f 100644 --- a/src/plugins/languageclient/locatorfilter.h +++ b/src/plugins/languageclient/locatorfilter.h @@ -97,6 +97,8 @@ signals: protected: explicit WorkspaceLocatorFilter(const QVector &filter); + void setMaxResultCount(qint64 limit) { m_maxResultCount = limit; } + private: void prepareSearch(const QString &entry, const QVector &clients, bool force); void handleResponse(Client *client, @@ -106,6 +108,7 @@ private: QMap m_pendingRequests; QVector m_results; QVector m_filterKinds; + qint64 m_maxResultCount = 0; }; class LANGUAGECLIENT_EXPORT WorkspaceClassLocatorFilter : public WorkspaceLocatorFilter diff --git a/src/plugins/languageclient/lspinspector.cpp b/src/plugins/languageclient/lspinspector.cpp index bb2784ed220..ef112c1c5ec 100644 --- a/src/plugins/languageclient/lspinspector.cpp +++ b/src/plugins/languageclient/lspinspector.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -111,7 +112,7 @@ class MessageDetailWidget : public QGroupBox public: MessageDetailWidget(); - void setMessage(const BaseMessage &message); + void setMessage(const LspLogMessage &message); void clear(); private: @@ -206,24 +207,13 @@ public: private: void currentMessageChanged(const QModelIndex &index); - void selectMatchingMessage(LspLogMessage::MessageSender sender, const QJsonValue &id); + void selectMatchingMessage(const LspLogMessage &message); }; static QVariant messageData(const LspLogMessage &message, int, int role) { - if (role == Qt::DisplayRole) { - QString result = message.time.toString("hh:mm:ss.zzz") + '\n'; - if (message.message.mimeType == JsonRpcMessageHandler::jsonRpcMimeType()) { - QString error; - auto json = JsonRpcMessageHandler::toJsonObject(message.message.content, - message.message.codec, - error); - result += json.value(QString{methodKey}).toString(json.value(QString{idKey}).toString()); - } else { - result += message.message.codec->toUnicode(message.message.content); - } - return result; - } + if (role == Qt::DisplayRole) + return message.displayText(); if (role == Qt::TextAlignmentRole) return message.sender == LspLogMessage::ClientMessage ? Qt::AlignLeft : Qt::AlignRight; return {}; @@ -266,42 +256,33 @@ void LspLogWidget::currentMessageChanged(const QModelIndex &index) m_messages->clearSelection(); if (!index.isValid()) return; - LspLogMessage selectedMessage = m_model.itemAt(index.row())->itemData; - BaseMessage message = selectedMessage.message; - if (selectedMessage.sender == LspLogMessage::ClientMessage) + LspLogMessage message = m_model.itemAt(index.row())->itemData; + if (message.sender == LspLogMessage::ClientMessage) m_clientDetails->setMessage(message); else m_serverDetails->setMessage(message); - if (message.mimeType == JsonRpcMessageHandler::jsonRpcMimeType()) { - QString error; - QJsonValue id = JsonRpcMessageHandler::toJsonObject(message.content, message.codec, error) - .value(idKey); - if (!id.isUndefined()) { - selectMatchingMessage(selectedMessage.sender == LspLogMessage::ClientMessage - ? LspLogMessage::ServerMessage - : LspLogMessage::ClientMessage, - id); - } - } + selectMatchingMessage(message); } static bool matches(LspLogMessage::MessageSender sender, - const QJsonValue &id, + const MessageId &id, const LspLogMessage &message) { if (message.sender != sender) return false; if (message.message.mimeType != JsonRpcMessageHandler::jsonRpcMimeType()) return false; - QString error; - auto json = JsonRpcMessageHandler::toJsonObject(message.message.content, - message.message.codec, - error); - return json.value(QString{idKey}) == id; + return message.id() == id; } -void LspLogWidget::selectMatchingMessage(LspLogMessage::MessageSender sender, const QJsonValue &id) +void LspLogWidget::selectMatchingMessage(const LspLogMessage &message) { + MessageId id = message.id(); + if (!id.isValid()) + return; + LspLogMessage::MessageSender sender = message.sender == LspLogMessage::ServerMessage + ? LspLogMessage::ClientMessage + : LspLogMessage::ServerMessage; LspLogMessage *matchingMessage = m_model.findData( [&](const LspLogMessage &message) { return matches(sender, id, message); }); if (!matchingMessage) @@ -311,9 +292,9 @@ void LspLogWidget::selectMatchingMessage(LspLogMessage::MessageSender sender, co m_messages->selectionModel()->select(index, QItemSelectionModel::Select); if (matchingMessage->sender == LspLogMessage::ServerMessage) - m_serverDetails->setMessage(matchingMessage->message); + m_serverDetails->setMessage(*matchingMessage); else - m_clientDetails->setMessage(matchingMessage->message); + m_clientDetails->setMessage(*matchingMessage); } void LspLogWidget::addMessage(const LspLogMessage &message) @@ -508,23 +489,18 @@ MessageDetailWidget::MessageDetailWidget() layout->addRow("MIME Type:", m_mimeType); } -void MessageDetailWidget::setMessage(const BaseMessage &message) +void MessageDetailWidget::setMessage(const LspLogMessage &message) { - m_contentLength->setText(QString::number(message.contentLength)); - m_mimeType->setText(QString::fromLatin1(message.mimeType)); + m_contentLength->setText(QString::number(message.message.contentLength)); + m_mimeType->setText(QString::fromLatin1(message.message.mimeType)); QWidget *newContentWidget = nullptr; - if (message.mimeType == JsonRpcMessageHandler::jsonRpcMimeType()) { - QString error; - auto json = JsonRpcMessageHandler::toJsonObject(message.content, message.codec, error); - if (json.isEmpty()) - newContentWidget = new QLabel(error); - else - newContentWidget = createJsonTreeView("content", json); + if (message.message.mimeType == JsonRpcMessageHandler::jsonRpcMimeType()) { + newContentWidget = createJsonTreeView("content", message.json()); } else { auto edit = new QPlainTextEdit(); edit->setReadOnly(true); - edit->setPlainText(message.codec->toUnicode(message.content)); + edit->setPlainText(message.message.codec->toUnicode(message.message.content)); newContentWidget = edit; } auto formLayout = static_cast(layout()); @@ -542,4 +518,46 @@ void MessageDetailWidget::clear() formLayout->removeRow(2); } +LspLogMessage::LspLogMessage() = default; + +LspLogMessage::LspLogMessage(MessageSender sender, + const QTime &time, + const LanguageServerProtocol::BaseMessage &message) + : sender(sender) + , time(time) + , message(message) +{} + +MessageId LspLogMessage::id() const +{ + if (!m_id.has_value()) + m_id = MessageId(json().value(idKey)); + return *m_id; +} + +QString LspLogMessage::displayText() const +{ + if (!m_displayText.has_value()) { + m_displayText = time.toString("hh:mm:ss.zzz") + '\n'; + if (message.mimeType == JsonRpcMessageHandler::jsonRpcMimeType()) + m_displayText->append(json().value(QString{methodKey}).toString(id().toString())); + else + m_displayText->append(message.codec->toUnicode(message.content)); + } + return *m_displayText; +} + +QJsonObject &LspLogMessage::json() const +{ + if (!m_json.has_value()) { + if (message.mimeType == JsonRpcMessageHandler::jsonRpcMimeType()) { + QString error; + m_json = JsonRpcMessageHandler::toJsonObject(message.content, message.codec, error); + } else { + m_json = QJsonObject(); + } + } + return *m_json; +} + } // namespace LanguageClient diff --git a/src/plugins/languageclient/lspinspector.h b/src/plugins/languageclient/lspinspector.h index aa4f6702719..45ad8d206b0 100644 --- a/src/plugins/languageclient/lspinspector.h +++ b/src/plugins/languageclient/lspinspector.h @@ -37,11 +37,26 @@ namespace LanguageClient { -struct LspLogMessage +class LspLogMessage { +public: enum MessageSender { ClientMessage, ServerMessage } sender; + + LspLogMessage(); + LspLogMessage(MessageSender sender, + const QTime &time, + const LanguageServerProtocol::BaseMessage &message); QTime time; LanguageServerProtocol::BaseMessage message; + + LanguageServerProtocol::MessageId id() const; + QString displayText() const; + QJsonObject &json() const; + +private: + mutable Utils::optional m_id; + mutable Utils::optional m_displayText; + mutable Utils::optional m_json; }; struct Capabilities diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index ba4acf1f519..10134096d9c 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -1403,8 +1403,10 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary() QFETCH(QStringList, abis); const Utils::FilePath fp = Utils::FilePath::fromString(file); - if (!fp.exists()) + const QString dataTag = QString::fromLocal8Bit(QTest::currentDataTag()); + if (!fp.exists() && dataTag != "no file" && dataTag != "non existing file") QSKIP("binary file not present"); + const Abis result = Abi::abisOfBinary(fp); QCOMPARE(result.count(), abis.count()); for (int i = 0; i < abis.count(); ++i) diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index 5ac3ddc91ef..bccc42db8af 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -186,7 +186,7 @@ QList DesktopDevice::directoryEntries(const FilePath &filePath, { QTC_CHECK(!filePath.needsDevice()); const QDir dir(filePath.path()); - const QFileInfoList entryInfoList = dir.entryInfoList(nameFilters, filters); + const QFileInfoList entryInfoList = dir.entryInfoList(nameFilters, filters, sort); return Utils::transform(entryInfoList, &FilePath::fromFileInfo); } @@ -225,6 +225,18 @@ bool DesktopDevice::isWritableDirectory(const FilePath &filePath) const return filePath.isWritableDir(); } +bool DesktopDevice::isFile(const FilePath &filePath) const +{ + QTC_ASSERT(handlesFile(filePath), return false); + return filePath.isFile(); +} + +bool DesktopDevice::isDirectory(const FilePath &filePath) const +{ + QTC_ASSERT(handlesFile(filePath), return false); + return filePath.isDir(); +} + bool DesktopDevice::createDirectory(const FilePath &filePath) const { QTC_ASSERT(handlesFile(filePath), return false); diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.h b/src/plugins/projectexplorer/devicesupport/desktopdevice.h index 39bc8176640..e8a41339c82 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.h +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.h @@ -66,6 +66,8 @@ public: bool isWritableFile(const Utils::FilePath &filePath) const override; bool isReadableDirectory(const Utils::FilePath &filePath) const override; bool isWritableDirectory(const Utils::FilePath &filePath) const override; + bool isFile(const Utils::FilePath &filePath) const override; + bool isDirectory(const Utils::FilePath &filePath) const override; bool ensureExistingFile(const Utils::FilePath &filePath) const override; bool createDirectory(const Utils::FilePath &filePath) const override; bool exists(const Utils::FilePath &filePath) const override; diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index 85bb517f90e..41ca11cd90e 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -410,6 +410,18 @@ DeviceManager::DeviceManager(bool isInstance) : d(std::make_uniqueisWritableFile(filePath); }; + deviceHooks.isFile = [](const FilePath &filePath) { + auto device = DeviceManager::deviceForPath(filePath); + QTC_ASSERT(device, return false); + return device->isFile(filePath); + }; + + deviceHooks.isDir = [](const FilePath &filePath) { + auto device = DeviceManager::deviceForPath(filePath); + QTC_ASSERT(device, return false); + return device->isDirectory(filePath); + }; + deviceHooks.ensureWritableDir = [](const FilePath &filePath) { auto device = DeviceManager::deviceForPath(filePath); QTC_ASSERT(device, return false); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 82e0058f37c..6999d714ca3 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -126,7 +126,7 @@ const char TimeoutKey[] = "Timeout"; const char HostKeyCheckingKey[] = "HostKeyChecking"; const char DebugServerKey[] = "DebugServerKey"; -const char QmlsceneKey[] = "QmlsceneKey"; +const char QmlRuntimeKey[] = "QmlsceneKey"; using AuthType = QSsh::SshConnectionParameters::AuthenticationType; const AuthType DefaultAuthType = QSsh::SshConnectionParameters::AuthenticationTypeAll; @@ -153,7 +153,7 @@ public: QSsh::SshConnectionParameters sshParameters; Utils::PortList freePorts; QString debugServerPath; - QString qmlsceneCommand; + QString qmlRunCommand; bool emptyCommandAllowed = false; QList deviceIcons; @@ -253,6 +253,20 @@ bool IDevice::isWritableDirectory(const FilePath &filePath) const return false; } +bool IDevice::isFile(const FilePath &filePath) const +{ + Q_UNUSED(filePath); + QTC_CHECK(false); + return false; +} + +bool IDevice::isDirectory(const FilePath &filePath) const +{ + Q_UNUSED(filePath); + QTC_CHECK(false); + return false; +} + bool IDevice::ensureWritableDirectory(const FilePath &filePath) const { if (isWritableDirectory(filePath)) @@ -357,6 +371,7 @@ QByteArray IDevice::fileContents(const FilePath &filePath, qint64 limit, qint64 { Q_UNUSED(filePath); Q_UNUSED(limit); + Q_UNUSED(offset); QTC_CHECK(false); return {}; } @@ -595,7 +610,7 @@ void IDevice::fromMap(const QVariantMap &map) d->version = map.value(QLatin1String(VersionKey), 0).toInt(); d->debugServerPath = map.value(QLatin1String(DebugServerKey)).toString(); - d->qmlsceneCommand = map.value(QLatin1String(QmlsceneKey)).toString(); + d->qmlRunCommand = map.value(QLatin1String(QmlRuntimeKey)).toString(); d->extraData = map.value(ExtraDataKey).toMap(); } @@ -626,7 +641,7 @@ QVariantMap IDevice::toMap() const map.insert(QLatin1String(VersionKey), d->version); map.insert(QLatin1String(DebugServerKey), d->debugServerPath); - map.insert(QLatin1String(QmlsceneKey), d->qmlsceneCommand); + map.insert(QLatin1String(QmlRuntimeKey), d->qmlRunCommand); map.insert(ExtraDataKey, d->extraData); return map; @@ -709,14 +724,14 @@ void IDevice::setDebugServerPath(const QString &path) d->debugServerPath = path; } -QString IDevice::qmlsceneCommand() const +QString IDevice::qmlRunCommand() const { - return d->qmlsceneCommand; + return d->qmlRunCommand; } -void IDevice::setQmlsceneCommand(const QString &path) +void IDevice::setQmlRunCommand(const QString &path) { - d->qmlsceneCommand = path; + d->qmlRunCommand = path; } void IDevice::setExtraData(Utils::Id kind, const QVariant &data) diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index 4bb77e4b00c..b6c75e07cb9 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -214,8 +214,8 @@ public: QString debugServerPath() const; void setDebugServerPath(const QString &path); - QString qmlsceneCommand() const; - void setQmlsceneCommand(const QString &path); + QString qmlRunCommand() const; + void setQmlRunCommand(const QString &path); void setExtraData(Utils::Id kind, const QVariant &data); QVariant extraData(Utils::Id kind) const; @@ -241,6 +241,8 @@ public: virtual bool isWritableFile(const Utils::FilePath &filePath) const; virtual bool isReadableDirectory(const Utils::FilePath &filePath) const; virtual bool isWritableDirectory(const Utils::FilePath &filePath) const; + virtual bool isFile(const Utils::FilePath &filePath) const; + virtual bool isDirectory(const Utils::FilePath &filePath) const; virtual bool ensureWritableDirectory(const Utils::FilePath &filePath) const; virtual bool ensureExistingFile(const Utils::FilePath &filePath) const; virtual bool createDirectory(const Utils::FilePath &filePath) const; diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index eabe4c2e181..a69011df64d 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -32,9 +32,12 @@ #include "taskhub.h" #include "taskmodel.h" +#include + #include #include #include +#include #include #include @@ -312,6 +315,10 @@ TaskWindow::TaskWindow() : d(std::make_unique()) d->m_filter = new Internal::TaskFilterModel(d->m_model); d->m_listview = new Internal::TaskView; + auto agg = new Aggregation::Aggregate; + agg->add(d->m_listview); + agg->add(new Core::ItemViewFind(d->m_listview, TaskModel::Description)); + d->m_listview->setModel(d->m_filter); d->m_listview->setFrameStyle(QFrame::NoFrame); d->m_listview->setWindowTitle(displayName()); diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 98df39036a9..ab53717e80c 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -44,6 +44,7 @@ using namespace Utils; static const char ID_KEY[] = "ProjectExplorer.ToolChain.Id"; static const char DISPLAY_NAME_KEY[] = "ProjectExplorer.ToolChain.DisplayName"; static const char AUTODETECT_KEY[] = "ProjectExplorer.ToolChain.Autodetect"; +static const char DETECTION_SOURCE_KEY[] = "ProjectExplorer.ToolChain.DetectionSource"; static const char LANGUAGE_KEY_V1[] = "ProjectExplorer.ToolChain.Language"; // For QtCreator <= 4.2 static const char LANGUAGE_KEY_V2[] = "ProjectExplorer.ToolChain.LanguageV2"; // For QtCreator > 4.2 @@ -82,6 +83,7 @@ public: Utils::Id m_typeId; Utils::Id m_language; Detection m_detection = ToolChain::UninitializedDetection; + QString m_detectionSource; ToolChain::MacrosCache m_predefinedMacrosCache; ToolChain::HeaderPathsCache m_headerPathsCache; @@ -173,6 +175,11 @@ ToolChain::Detection ToolChain::detection() const return d->m_detection; } +QString ToolChain::detectionSource() const +{ + return d->m_detectionSource; +} + QByteArray ToolChain::id() const { return d->m_id; @@ -252,6 +259,7 @@ QVariantMap ToolChain::toMap() const result.insert(QLatin1String(ID_KEY), idToSave); result.insert(QLatin1String(DISPLAY_NAME_KEY), displayName()); result.insert(QLatin1String(AUTODETECT_KEY), isAutoDetected()); + result.insert(QLatin1String(DETECTION_SOURCE_KEY), d->m_detectionSource); // int oldLanguageId = -1; if (language() == ProjectExplorer::Constants::C_LANGUAGE_ID) @@ -282,6 +290,11 @@ void ToolChain::setDetection(ToolChain::Detection de) d->m_detection = de; } +void ToolChain::setDetectionSource(const QString &source) +{ + d->m_detectionSource = source; +} + QString ToolChain::typeDisplayName() const { return d->m_typeDisplayName; @@ -353,6 +366,7 @@ bool ToolChain::fromMap(const QVariantMap &data) const bool autoDetect = data.value(QLatin1String(AUTODETECT_KEY), false).toBool(); d->m_detection = autoDetect ? AutoDetection : ManualDetection; + d->m_detectionSource = data.value(DETECTION_SOURCE_KEY).toString(); if (data.contains(LANGUAGE_KEY_V2)) { // remove hack to trim language id in 4.4: This is to fix up broken language diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index 2c2a3c68b72..b3ad1484c58 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -100,6 +100,7 @@ public: bool isAutoDetected() const; Detection detection() const; + QString detectionSource() const; QByteArray id() const; @@ -165,6 +166,7 @@ public: void setLanguage(Utils::Id language); void setDetection(Detection d); + void setDetectionSource(const QString &source); static Utils::LanguageVersion cxxLanguageVersion(const QByteArray &cplusplusMacroValue); static Utils::LanguageVersion languageVersion(const Utils::Id &language, const Macros ¯os); diff --git a/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp b/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp index 96527ad3007..08e41558e82 100644 --- a/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp +++ b/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp @@ -181,7 +181,7 @@ void QbsProfileManager::addProfileFromKit(const ProjectExplorer::Kit *k) data = provider->properties(k, data); } if (const QtSupport::BaseQtVersion * const qt = QtSupport::QtKitAspect::qtVersion(k)) - data.insert("moduleProviders.Qt.qmakeFilePaths", qt->qmakeCommand().toString()); + data.insert("moduleProviders.Qt.qmakeFilePaths", qt->qmakeFilePath().toString()); if (QbsSettings::qbsVersion() < QVersionNumber({1, 20})) { const QString keyPrefix = "profiles." + name + "."; diff --git a/src/plugins/qmakeprojectmanager/externaleditors.cpp b/src/plugins/qmakeprojectmanager/externaleditors.cpp index 453ee727863..538740e0804 100644 --- a/src/plugins/qmakeprojectmanager/externaleditors.cpp +++ b/src/plugins/qmakeprojectmanager/externaleditors.cpp @@ -66,14 +66,14 @@ static inline QString msgAppNotFound(const QString &id) static QString linguistBinary(const QtSupport::BaseQtVersion *qtVersion) { if (qtVersion) - return qtVersion->linguistCommand().toString(); + return qtVersion->linguistFilePath().toString(); return QLatin1String(Utils::HostOsInfo::isMacHost() ? "Linguist" : "linguist"); } static QString designerBinary(const QtSupport::BaseQtVersion *qtVersion) { if (qtVersion) - return qtVersion->designerCommand().toString(); + return qtVersion->designerFilePath().toString(); return QLatin1String(Utils::HostOsInfo::isMacHost() ? "Designer" : "designer"); } diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index b84aa0036bf..11a17c186ab 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -547,8 +547,8 @@ QmakeBuildConfiguration::MakefileState QmakeBuildConfiguration::compareToImportF return MakefileIncompatible; } - if (version->qmakeCommand() != parse.qmakePath()) { - qCDebug(logs) << "**Different Qt versions, buildconfiguration:" << version->qmakeCommand().toString() + if (version->qmakeFilePath() != parse.qmakePath()) { + qCDebug(logs) << "**Different Qt versions, buildconfiguration:" << version->qmakeFilePath().toString() << " Makefile:"<< parse.qmakePath().toString(); return MakefileForWrongProject; } diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 83377bc987e..82a403bfd0d 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -831,7 +831,7 @@ QtSupport::ProFileReader *QmakeBuildSystem::createProFileReader(const QmakeProFi m_qmakeSysroot = SysRootKitAspect::sysRoot(k).toString(); if (qtVersion && qtVersion->isValid()) { - m_qmakeGlobals->qmake_abslocation = QDir::cleanPath(qtVersion->qmakeCommand().toString()); + m_qmakeGlobals->qmake_abslocation = QDir::cleanPath(qtVersion->qmakeFilePath().toString()); qtVersion->applyProperties(m_qmakeGlobals.get()); } m_qmakeGlobals->setDirectories(rootProFile()->sourceDir().toString(), diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index d24f190de7d..94adb3279df 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -51,6 +51,8 @@ #include #include +#include + #include #include #include @@ -102,7 +104,7 @@ QMakeStep::QMakeStep(BuildStepList *bsl, Id id) BaseQtVersion *qtVersion = QtKitAspect::qtVersion(target()->kit()); if (!qtVersion) return tr("qmake: No Qt version set. Cannot run qmake."); - const QString program = qtVersion->qmakeCommand().fileName(); + const QString program = qtVersion->qmakeFilePath().fileName(); return tr("qmake: %1 %2").arg(program, project()->projectFilePath().fileName()); }; setSummaryUpdater(updateSummary); @@ -213,7 +215,7 @@ bool QMakeStep::init() else workingDirectory = qmakeBc->buildDirectory(); - m_qmakeCommand = CommandLine{qtVersion->qmakeCommand(), allArguments(qtVersion), CommandLine::Raw}; + m_qmakeCommand = CommandLine{qtVersion->qmakeFilePath(), allArguments(qtVersion), CommandLine::Raw}; m_runMakeQmake = (qtVersion->qtVersion() >= QtVersionNumber(5, 0 ,0)); // The Makefile is used by qmake and make on the build device, from that @@ -431,7 +433,7 @@ QString QMakeStep::makeArguments(const QString &makefile) const QString QMakeStep::effectiveQMakeCall() const { BaseQtVersion *qtVersion = QtKitAspect::qtVersion(kit()); - QString qmake = qtVersion ? qtVersion->qmakeCommand().toUserOutput() : QString(); + QString qmake = qtVersion ? qtVersion->qmakeFilePath().toUserOutput() : QString(); if (qmake.isEmpty()) qmake = tr(""); QString make = makeCommand().toUserOutput(); @@ -609,6 +611,13 @@ void QMakeStep::separateDebugInfoChanged() askForRebuild(tr("Separate Debug Information")); } +static bool isIos(const Kit *k) +{ + const Id deviceType = DeviceTypeKitAspect::deviceTypeId(k); + return deviceType == Ios::Constants::IOS_DEVICE_TYPE + || deviceType == Ios::Constants::IOS_SIMULATOR_TYPE; +} + void QMakeStep::abisChanged() { m_selectedAbis.clear(); @@ -618,20 +627,42 @@ void QMakeStep::abisChanged() m_selectedAbis << item->text(); } - if (isAndroidKit()) { - const QString prefix = "ANDROID_ABIS="; - QStringList args = m_extraArgs; - for (auto it = args.begin(); it != args.end(); ++it) { - if (it->startsWith(prefix)) { - args.erase(it); - break; + if (BaseQtVersion *qtVersion = QtKitAspect::qtVersion(target()->kit())) { + if (qtVersion->hasAbi(Abi::LinuxOS, Abi::AndroidLinuxFlavor)) { + const QString prefix = "ANDROID_ABIS="; + QStringList args = m_extraArgs; + for (auto it = args.begin(); it != args.end(); ++it) { + if (it->startsWith(prefix)) { + args.erase(it); + break; + } } - } - if (!m_selectedAbis.isEmpty()) - args << prefix + '"' + m_selectedAbis.join(' ') + '"'; - setExtraArguments(args); + if (!m_selectedAbis.isEmpty()) + args << prefix + '"' + m_selectedAbis.join(' ') + '"'; + setExtraArguments(args); - buildSystem()->setProperty(Android::Constants::ANDROID_ABIS, m_selectedAbis); + buildSystem()->setProperty(Android::Constants::ANDROID_ABIS, m_selectedAbis); + } else if (qtVersion->hasAbi(Abi::DarwinOS) && !isIos(target()->kit())) { + const QString prefix = "QMAKE_APPLE_DEVICE_ARCHS="; + QStringList args = m_extraArgs; + for (auto it = args.begin(); it != args.end(); ++it) { + if (it->startsWith(prefix)) { + args.erase(it); + break; + } + } + QStringList archs; + for (const QString &selectedAbi : qAsConst(m_selectedAbis)) { + const auto abi = Abi::abiFromTargetTriplet(selectedAbi); + if (abi.architecture() == Abi::X86Architecture) + archs << "x86_64"; + else if (abi.architecture() == Abi::ArmArchitecture) + archs << "arm64"; + } + if (!archs.isEmpty()) + args << prefix + '"' + archs.join(' ') + '"'; + setExtraArguments(args); + } } updateAbiWidgets(); @@ -668,18 +699,6 @@ void QMakeStep::askForRebuild(const QString &title) question->show(); } -bool QMakeStep::isAndroidKit() const -{ - BaseQtVersion *qtVersion = QtKitAspect::qtVersion(target()->kit()); - if (!qtVersion) - return false; - - const Abis abis = qtVersion->qtAbis(); - return Utils::anyOf(abis, [](const Abi &abi) { - return abi.osFlavor() == Abi::OSFlavor::AndroidLinuxFlavor; - }); -} - void QMakeStep::updateAbiWidgets() { if (!abisLabel) @@ -698,15 +717,23 @@ void QMakeStep::updateAbiWidgets() abisListWidget->clear(); QStringList selectedAbis = m_selectedAbis; - if (selectedAbis.isEmpty() && isAndroidKit()) { - // Prefer ARM for Android, prefer 32bit. - for (const Abi &abi : abis) { - if (abi.param() == ProjectExplorer::Constants::ANDROID_ABI_ARMEABI_V7A) - selectedAbis.append(abi.param()); - } - if (selectedAbis.isEmpty()) { + if (selectedAbis.isEmpty()) { + if (qtVersion->hasAbi(Abi::LinuxOS, Abi::AndroidLinuxFlavor)) { + // Prefer ARM for Android, prefer 32bit. for (const Abi &abi : abis) { - if (abi.param() == ProjectExplorer::Constants::ANDROID_ABI_ARM64_V8A) + if (abi.param() == ProjectExplorer::Constants::ANDROID_ABI_ARMEABI_V7A) + selectedAbis.append(abi.param()); + } + if (selectedAbis.isEmpty()) { + for (const Abi &abi : abis) { + if (abi.param() == ProjectExplorer::Constants::ANDROID_ABI_ARM64_V8A) + selectedAbis.append(abi.param()); + } + } + } else if (qtVersion->hasAbi(Abi::DarwinOS) && !isIos(target()->kit()) && HostOsInfo::isRunningUnderRosetta()) { + // Automatically select arm64 when running under Rosetta + for (const Abi &abi : abis) { + if (abi.architecture() == Abi::ArmArchitecture) selectedAbis.append(abi.param()); } } @@ -788,14 +815,6 @@ QMakeStepConfig::OsType QMakeStepConfig::osTypeFor(const Abi &targetAbi, const B QStringList QMakeStepConfig::toArguments() const { QStringList arguments; - if (archConfig == X86) - arguments << "CONFIG+=x86"; - else if (archConfig == X86_64) - arguments << "CONFIG+=x86_64"; - else if (archConfig == PowerPC) - arguments << "CONFIG+=ppc"; - else if (archConfig == PowerPC64) - arguments << "CONFIG+=ppc64"; // TODO: make that depend on the actual Qt version that is used if (osType == IphoneSimulator) diff --git a/src/plugins/qmakeprojectmanager/qmakestep.h b/src/plugins/qmakeprojectmanager/qmakestep.h index b439108436d..aecaaef04bd 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.h +++ b/src/plugins/qmakeprojectmanager/qmakestep.h @@ -185,7 +185,6 @@ private: void updateAbiWidgets(); void updateEffectiveQMakeCall(); - bool isAndroidKit() const; Utils::CommandLine m_qmakeCommand; Utils::CommandLine m_makeCommand; diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp index 3327fefcb44..2d1ef6f554d 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp @@ -169,13 +169,13 @@ private: // functions QColor highlightBrushColor() const { QColor color = Theme::getColor(Theme::Color::DSnavigatorDropIndicatorBackground); - color.setAlphaF(0.7); + color.setAlphaF(0.7f); return color; } QColor highlightLineColor() const { QColor color = Theme::getColor(Theme::Color::DSnavigatorDropIndicatorOutline); - color.setAlphaF(0.7); + color.setAlphaF(0.7f); return color; } diff --git a/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp b/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp index 290edf309bd..f2cef3ead30 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp @@ -631,7 +631,7 @@ void AlignDistribute::distributeSpacing(Dimension dimension, QTC_ASSERT(!modelNode.isRootNode(), continue); if (QmlItemNode::isValidQmlItemNode(modelNode)) { QmlItemNode qmlItemNode(modelNode); - qreal parentPos; + qreal parentPos = 0; QByteArray propertyName; switch (dimension) { case Dimension::X: { diff --git a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp index 7051164bb1a..25d1203590a 100644 --- a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp +++ b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp @@ -573,7 +573,7 @@ QString PuppetCreator::qmakeCommand() const { QtSupport::BaseQtVersion *currentQtVersion = QtSupport::QtKitAspect::qtVersion(m_target->kit()); if (currentQtVersion) - return currentQtVersion->qmakeCommand().toString(); + return currentQtVersion->qmakeFilePath().toString(); return QString(); } diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h b/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h index 902e0ec56fd..9564897a59d 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h @@ -589,7 +589,7 @@ public: friend bool operator==(const ImportView &first, const ImportView &second) { return first.name == second.name - && first.version == second.version & first.sourceId == second.sourceId; + && first.version == second.version && first.sourceId == second.sourceId; } public: diff --git a/src/plugins/qmldesigner/generateresource.cpp b/src/plugins/qmldesigner/generateresource.cpp index fdef3228eaa..ccf39af0cb6 100644 --- a/src/plugins/qmldesigner/generateresource.cpp +++ b/src/plugins/qmldesigner/generateresource.cpp @@ -185,7 +185,7 @@ void GenerateResource::generateMenuEntry() QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitAspect::qtVersion( currentProject->activeTarget()->kit()); - FilePath rccBinary = qtVersion->rccCommand(); + FilePath rccBinary = qtVersion->rccFilePath(); Utils::QtcProcess rccProcess; rccProcess.setWorkingDirectory(projectPath); @@ -362,7 +362,7 @@ void GenerateResource::generateMenuEntry() QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitAspect::qtVersion( currentProject->activeTarget()->kit()); - FilePath rccBinary = qtVersion->rccCommand(); + FilePath rccBinary = qtVersion->rccFilePath(); QtcProcess rccProcess; rccProcess.setWorkingDirectory(projectPath); diff --git a/src/plugins/qmldesigner/settingspage.cpp b/src/plugins/qmldesigner/settingspage.cpp index 569cdb74d72..93a6fd566be 100644 --- a/src/plugins/qmldesigner/settingspage.cpp +++ b/src/plugins/qmldesigner/settingspage.cpp @@ -270,7 +270,7 @@ void SettingsPageWidget::apply() DesignerSettingsKey::ENABLE_TIMELINEVIEW }; - for (const QByteArray &key : restartNecessaryKeys) { + for (const char * const key : restartNecessaryKeys) { if (currentSettings.value(key) != newSettings.value(key)) { QMessageBox::information(Core::ICore::dialogParent(), tr("Restart Required"), tr("The made changes will take effect after a " diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp index c3092bf1cbb..341043dcf9c 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.cpp +++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp @@ -156,7 +156,7 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject( projectInfo.qmlDumpPath.clear(); const QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(activeKit); if (version && projectInfo.tryQmlDump) { - projectInfo.qmlDumpPath = version->qmlplugindumpCommand().toString(); + projectInfo.qmlDumpPath = version->qmlplugindumpFilePath().toString(); projectInfo.qmlDumpHasRelocatableFlag = version->hasQmlDumpWithRelocatableFlag(); } diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index 77481cdbaea..bc830a28327 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -373,9 +373,9 @@ Tasks QmlProject::projectIssues(const Kit *k) const if (dev->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { if (version->type() == QtSupport::Constants::DESKTOPQT) { - if (version->qmlsceneCommand().isEmpty()) { + if (version->qmlRuntimeFilePath().isEmpty()) { result.append(createProjectTask(Task::TaskType::Error, - tr("Qt version has no qmlscene command."))); + tr("Qt version has no QML utility."))); } } else { // Non-desktop Qt on a desktop device? We don't support that. @@ -383,8 +383,8 @@ Tasks QmlProject::projectIssues(const Kit *k) const tr("Non-desktop Qt is used with a desktop device."))); } } else { - // If not a desktop device, don't check the Qt version for qmlscene. - // The device is responsible for providing it and we assume qmlscene can be found + // If not a desktop device, don't check the Qt version for qml runtime binary. + // The device is responsible for providing it and we assume qml runtime can be found // in $PATH if it's not explicitly given. } diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 94e6237b1d7..c9929d0158c 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -76,7 +76,7 @@ private: bool isEnabled() const final; QString mainScript() const; - FilePath qmlScenePath() const; + FilePath qmlRuntimeFilePath() const; QString commandLineArguments() const; StringAspect *m_qmlViewerAspect = nullptr; @@ -97,7 +97,7 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id) argumentAspect->setSettingsKey(Constants::QML_VIEWER_ARGUMENTS_KEY); setCommandLineGetter([this] { - return CommandLine(qmlScenePath(), commandLineArguments(), CommandLine::Raw); + return CommandLine(qmlRuntimeFilePath(), commandLineArguments(), CommandLine::Raw); }); m_qmlMainFileAspect = addAspect(target); @@ -141,7 +141,7 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id) r.workingDirectory = bs->targetDirectory().toString(); }); - setDisplayName(tr("QML Scene", "QMLRunConfiguration display name.")); + setDisplayName(tr("QML Utility", "QMLRunConfiguration display name.")); update(); } @@ -150,18 +150,18 @@ QString QmlProjectRunConfiguration::disabledReason() const if (mainScript().isEmpty()) return tr("No script file to execute."); - const FilePath viewer = qmlScenePath(); + const FilePath viewer = qmlRuntimeFilePath(); if (DeviceTypeKitAspect::deviceTypeId(kit()) == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE && !viewer.exists()) { - return tr("No qmlscene found."); + return tr("No QML utility found."); } if (viewer.isEmpty()) - return tr("No qmlscene binary specified for target device."); + return tr("No QML utility specified for target device."); return RunConfiguration::disabledReason(); } -FilePath QmlProjectRunConfiguration::qmlScenePath() const +FilePath QmlProjectRunConfiguration::qmlRuntimeFilePath() const { const QString qmlViewer = m_qmlViewerAspect->value(); if (!qmlViewer.isEmpty()) @@ -169,23 +169,23 @@ FilePath QmlProjectRunConfiguration::qmlScenePath() const Kit *kit = target()->kit(); BaseQtVersion *version = QtKitAspect::qtVersion(kit); - if (!version) // No Qt version in Kit. Don't try to run qmlscene. + if (!version) // No Qt version in Kit. Don't try to run QML runtime. return {}; const Id deviceType = DeviceTypeKitAspect::deviceTypeId(kit); if (deviceType == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { // If not given explicitly by Qt Version, try to pick it from $PATH. const bool isDesktop = version->type() == QtSupport::Constants::DESKTOPQT; - return isDesktop ? version->qmlsceneCommand() : FilePath::fromString("qmlscene"); + return isDesktop ? version->qmlRuntimeFilePath() : FilePath::fromString("qmlscene"); } IDevice::ConstPtr dev = DeviceKitAspect::device(kit); - if (dev.isNull()) // No device set. We don't know where to run qmlscene. + if (dev.isNull()) // No device set. We don't know where a QML utility is. return {}; - const QString qmlscene = dev->qmlsceneCommand(); + const QString qmlRuntime = dev->qmlRunCommand(); // If not given explicitly by device, try to pick it from $PATH. - return FilePath::fromString(qmlscene.isEmpty() ? QString("qmlscene") : qmlscene); + return FilePath::fromString(qmlRuntime.isEmpty() ? QString("qmlscene") : qmlRuntime); } QString QmlProjectRunConfiguration::commandLineArguments() const @@ -237,10 +237,10 @@ QString QmlProjectRunConfiguration::mainScript() const // QmlProjectRunConfigurationFactory QmlProjectRunConfigurationFactory::QmlProjectRunConfigurationFactory() - : FixedRunConfigurationFactory(QmlProjectRunConfiguration::tr("QML Scene"), false) + : FixedRunConfigurationFactory(QmlProjectRunConfiguration::tr("QML Runtime"), false) { registerRunConfiguration - ("QmlProjectManager.QmlRunConfiguration.QmlScene"); + ("QmlProjectManager.QmlRunConfiguration.Qml"); addSupportedProjectType(QmlProjectManager::Constants::QML_PROJECT_ID); } diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 0ba9d049672..b82e0e5783e 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -235,13 +235,13 @@ public: FilePath m_qmakeCommand; - FilePath m_rccCommand; - FilePath m_uicCommand; - FilePath m_designerCommand; - FilePath m_linguistCommand; - FilePath m_qscxmlcCommand; - FilePath m_qmlsceneCommand; - FilePath m_qmlplugindumpCommand; + FilePath m_rccPath; + FilePath m_uicPath; + FilePath m_designerPath; + FilePath m_linguistPath; + FilePath m_qscxmlcPath; + FilePath m_qmlRuntimePath; + FilePath m_qmlplugindumpPath; MacroExpanderWrapper m_expander; }; @@ -346,12 +346,12 @@ BaseQtVersion::~BaseQtVersion() QString BaseQtVersion::defaultUnexpandedDisplayName() const { QString location; - if (qmakeCommand().isEmpty()) { + if (qmakeFilePath().isEmpty()) { location = QCoreApplication::translate("QtVersion", ""); } else { // Deduce a description from '/foo/qt-folder/[qtbase]/bin/qmake' -> '/foo/qt-folder'. // '/usr' indicates System Qt 4.X on Linux. - QDir dir = qmakeCommand().toFileInfo().absoluteDir(); + QDir dir = qmakeFilePath().toFileInfo().absoluteDir(); do { const QString dirName = dir.dirName(); if (dirName == "usr") { // System-installed Qt. @@ -755,7 +755,7 @@ void BaseQtVersion::fromMap(const QVariantMap &map) updateDefaultDisplayName(); // Clear the cached qmlscene command, it might not match the restored path anymore. - d->m_qmlsceneCommand.clear(); + d->m_qmlRuntimePath.clear(); } QVariantMap BaseQtVersion::toMap() const @@ -769,7 +769,7 @@ QVariantMap BaseQtVersion::toMap() const if (!d->m_overrideFeatures.isEmpty()) result.insert(QTVERSION_OVERRIDE_FEATURES, Utils::Id::toStringList(d->m_overrideFeatures)); - result.insert(QTVERSIONQMAKEPATH, qmakeCommand().toVariant()); + result.insert(QTVERSIONQMAKEPATH, qmakeFilePath().toVariant()); return result; } @@ -780,7 +780,7 @@ bool BaseQtVersion::isValid() const d->updateVersionInfo(); d->updateMkspec(); - return !qmakeCommand().isEmpty() && d->m_data.installed && !binPath().isEmpty() + return !qmakeFilePath().isEmpty() && d->m_data.installed && !binPath().isEmpty() && !d->m_mkspecFullPath.isEmpty() && d->m_qmakeIsExecutable; } @@ -795,7 +795,7 @@ QString BaseQtVersion::invalidReason() const { if (displayName().isEmpty()) return QCoreApplication::translate("QtVersion", "Qt version has no name"); - if (qmakeCommand().isEmpty()) + if (qmakeFilePath().isEmpty()) return QCoreApplication::translate("QtVersion", "No qmake path set"); if (!d->m_qmakeIsExecutable) return QCoreApplication::translate("QtVersion", "qmake does not exist or is not executable"); @@ -821,7 +821,7 @@ QStringList BaseQtVersion::warningReason() const return ret; } -FilePath BaseQtVersion::qmakeCommand() const +FilePath BaseQtVersion::qmakeFilePath() const { return d->m_qmakeCommand; } @@ -840,6 +840,20 @@ Abis BaseQtVersion::detectQtAbis() const return qtAbisFromLibrary(d->qtCorePaths()); } +bool BaseQtVersion::hasAbi(ProjectExplorer::Abi::OS os, ProjectExplorer::Abi::OSFlavor flavor) const +{ + const Abis abis = qtAbis(); + return Utils::anyOf(abis, [&](const Abi &abi) { + if (abi.os() != os) + return false; + + if (flavor == Abi::UnknownFlavor) + return true; + + return abi.osFlavor() == flavor; + }); +} + bool BaseQtVersion::equals(BaseQtVersion *other) { if (d->m_qmakeCommand != other->d->m_qmakeCommand) @@ -991,60 +1005,65 @@ FilePath BaseQtVersion::qtPackageSourcePath() const return d->m_data.qtSources; } -FilePath BaseQtVersion::designerCommand() const +FilePath BaseQtVersion::designerFilePath() const { if (!isValid()) return {}; - if (d->m_designerCommand.isEmpty()) - d->m_designerCommand = d->findHostBinary(Designer); - return d->m_designerCommand; + if (d->m_designerPath.isEmpty()) + d->m_designerPath = d->findHostBinary(Designer); + return d->m_designerPath; } -FilePath BaseQtVersion::linguistCommand() const +FilePath BaseQtVersion::linguistFilePath() const { if (!isValid()) return {}; - if (d->m_linguistCommand.isEmpty()) - d->m_linguistCommand = d->findHostBinary(Linguist); - return d->m_linguistCommand; + if (d->m_linguistPath.isEmpty()) + d->m_linguistPath = d->findHostBinary(Linguist); + return d->m_linguistPath; } -FilePath BaseQtVersion::qscxmlcCommand() const +FilePath BaseQtVersion::qscxmlcFilePath() const { if (!isValid()) return {}; - if (d->m_qscxmlcCommand.isEmpty()) - d->m_qscxmlcCommand = d->findHostBinary(QScxmlc); - return d->m_qscxmlcCommand; + if (d->m_qscxmlcPath.isEmpty()) + d->m_qscxmlcPath = d->findHostBinary(QScxmlc); + return d->m_qscxmlcPath; } -FilePath BaseQtVersion::qmlsceneCommand() const +FilePath BaseQtVersion::qmlRuntimeFilePath() const { if (!isValid()) return {}; - if (!d->m_qmlsceneCommand.isEmpty()) - return d->m_qmlsceneCommand; + if (!d->m_qmlRuntimePath.isEmpty()) + return d->m_qmlRuntimePath; - const FilePath path = binPath() / HostOsInfo::withExecutableSuffix("qmlscene"); - d->m_qmlsceneCommand = path.isExecutableFile() ? path : FilePath(); + FilePath path = binPath(); + if (qtVersion() >= QtVersionNumber(6, 2, 0)) + path = path / HostOsInfo::withExecutableSuffix("qml"); + else + path = path / HostOsInfo::withExecutableSuffix("qmlscene"); - return d->m_qmlsceneCommand; + d->m_qmlRuntimePath = path.isExecutableFile() ? path : FilePath(); + + return d->m_qmlRuntimePath; } -FilePath BaseQtVersion::qmlplugindumpCommand() const +FilePath BaseQtVersion::qmlplugindumpFilePath() const { if (!isValid()) return {}; - if (!d->m_qmlplugindumpCommand.isEmpty()) - return d->m_qmlplugindumpCommand; + if (!d->m_qmlplugindumpPath.isEmpty()) + return d->m_qmlplugindumpPath; const FilePath path = binPath() / HostOsInfo::withExecutableSuffix("qmlplugindump"); - d->m_qmlplugindumpCommand = path.isExecutableFile() ? path : FilePath(); + d->m_qmlplugindumpPath = path.isExecutableFile() ? path : FilePath(); - return d->m_qmlplugindumpCommand; + return d->m_qmlplugindumpPath; } FilePath BaseQtVersionPrivate::findHostBinary(HostBinaries binary) const @@ -1119,24 +1138,24 @@ FilePath BaseQtVersionPrivate::findHostBinary(HostBinaries binary) const return {}; } -FilePath BaseQtVersion::rccCommand() const +FilePath BaseQtVersion::rccFilePath() const { if (!isValid()) return {}; - if (!d->m_rccCommand.isEmpty()) - return d->m_rccCommand; - d->m_rccCommand = d->findHostBinary(Rcc); - return d->m_rccCommand; + if (!d->m_rccPath.isEmpty()) + return d->m_rccPath; + d->m_rccPath = d->findHostBinary(Rcc); + return d->m_rccPath; } -FilePath BaseQtVersion::uicCommand() const +FilePath BaseQtVersion::uicFilePath() const { if (!isValid()) return {}; - if (!d->m_uicCommand.isEmpty()) - return d->m_uicCommand; - d->m_uicCommand = d->findHostBinary(Uic); - return d->m_uicCommand; + if (!d->m_uicPath.isEmpty()) + return d->m_uicPath; + d->m_uicPath = d->findHostBinary(Uic); + return d->m_uicPath; } void BaseQtVersionPrivate::updateMkspec() @@ -1178,7 +1197,7 @@ void BaseQtVersion::ensureMkSpecParsed() const QMakeVfs vfs; QMakeGlobals option; applyProperties(&option); - Environment env = Environment::systemEnvironment(); // FIXME: Use build device + Environment env = d->m_qmakeCommand.deviceEnvironment(); setupQmakeRunEnvironment(env); option.environment = env.toProcessEnvironment(); ProMessageHandler msgHandler(true); @@ -1709,7 +1728,7 @@ void BaseQtVersion::addToEnvironment(const Kit *k, Environment &env) const Environment BaseQtVersion::qmakeRunEnvironment() const { - Environment env = Environment::systemEnvironment(); // FIXME: Use build environment + Environment env = d->m_qmakeCommand.deviceEnvironment(); setupQmakeRunEnvironment(env); return env; } @@ -1737,7 +1756,7 @@ Tasks BaseQtVersion::reportIssuesImpl(const QString &proFile, const QString &bui results.append(BuildSystemTask(Task::Error, msg)); } - FilePath qmake = qmakeCommand(); + FilePath qmake = qmakeFilePath(); if (!qmake.isExecutableFile()) { //: %1: Path to qmake executable const QString msg = QCoreApplication::translate("QmakeProjectManager::QtVersion", @@ -1813,6 +1832,15 @@ bool BaseQtVersionPrivate::queryQMakeVariables(const FilePath &binary, const Env QByteArray output; output = runQmakeQuery(binary, env, error); + if (!output.startsWith('Q')) { // Is it always "QT_SYSROOT="? + // Some setups pass error messages via stdout, fooling the logic below. + // Example with docker/qemu/arm "OCI runtime exec failed: exec failed: container_linux.go:367: + // starting container process caused: exec: "/bin/qmake": stat /bin/qmake: no such file or directory" + // Since we have a rough idea on what the output looks like we can work around this. + *error = QString::fromUtf8(output); + return false; + } + if (output.isNull() && !error->isEmpty()) { // Note: Don't rerun if we were able to execute the binary before. @@ -2291,7 +2319,8 @@ BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath (const FilePath &qmakePath, bool isAutoDetected, const QString &autoDetectionSource, QString *error) { QHash versionInfo; - if (!BaseQtVersionPrivate::queryQMakeVariables(qmakePath, Environment::systemEnvironment(), &versionInfo, error)) + const Environment env = qmakePath.deviceEnvironment(); + if (!BaseQtVersionPrivate::queryQMakeVariables(qmakePath, env, &versionInfo, error)) return nullptr; FilePath mkspec = BaseQtVersionPrivate::mkspecFromVersionInfo(versionInfo, qmakePath); diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index 9ea9af4b1d9..b722b2fcb86 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -119,6 +119,7 @@ public: virtual QString toHtml(bool verbose) const; ProjectExplorer::Abis qtAbis() const; + bool hasAbi(ProjectExplorer::Abi::OS, ProjectExplorer::Abi::OSFlavor flavor = ProjectExplorer::Abi::UnknownFlavor) const; void applyProperties(QMakeGlobals *qmakeGlobals) const; virtual void addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const; @@ -131,14 +132,14 @@ public: bool isInQtSourceDirectory(const Utils::FilePath &filePath) const; bool isQtSubProject(const Utils::FilePath &filePath) const; - Utils::FilePath rccCommand() const; + Utils::FilePath rccFilePath() const; // used by UiCodeModelSupport - Utils::FilePath uicCommand() const; - Utils::FilePath designerCommand() const; - Utils::FilePath linguistCommand() const; - Utils::FilePath qscxmlcCommand() const; - Utils::FilePath qmlsceneCommand() const; - Utils::FilePath qmlplugindumpCommand() const; + Utils::FilePath uicFilePath() const; + Utils::FilePath designerFilePath() const; + Utils::FilePath linguistFilePath() const; + Utils::FilePath qscxmlcFilePath() const; + Utils::FilePath qmlRuntimeFilePath() const; + Utils::FilePath qmlplugindumpFilePath() const; QString qtVersionString() const; QtVersionNumber qtVersion() const; @@ -150,7 +151,7 @@ public: bool hasDemos() const; // former local functions - Utils::FilePath qmakeCommand() const; + Utils::FilePath qmakeFilePath() const; /// @returns the name of the mkspec QString mkspec() const; diff --git a/src/plugins/qtsupport/qscxmlcgenerator.cpp b/src/plugins/qtsupport/qscxmlcgenerator.cpp index 98be1fd99e8..2705250b8e9 100644 --- a/src/plugins/qtsupport/qscxmlcgenerator.cpp +++ b/src/plugins/qtsupport/qscxmlcgenerator.cpp @@ -84,7 +84,7 @@ Utils::FilePath QScxmlcGenerator::command() const if (!version) return Utils::FilePath(); - return version->qscxmlcCommand(); + return version->qscxmlcFilePath(); } QStringList QScxmlcGenerator::arguments() const diff --git a/src/plugins/qtsupport/qtkitinformation.cpp b/src/plugins/qtsupport/qtkitinformation.cpp index 9cd3b949468..b66efe72bfd 100644 --- a/src/plugins/qtsupport/qtkitinformation.cpp +++ b/src/plugins/qtsupport/qtkitinformation.cpp @@ -320,7 +320,7 @@ void QtKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const expander->registerVariable("Qt:qmakeExecutable", tr("Path to the qmake executable"), [kit]() -> QString { BaseQtVersion *version = qtVersion(kit); - return version ? version->qmakeCommand().path() : QString(); + return version ? version->qmakeFilePath().path() : QString(); }); } diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index f6d03ff19c6..ebc9a441746 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -112,7 +112,7 @@ public: if (column == 0) return m_version->displayName(); if (column == 1) - return m_version->qmakeCommand().toUserOutput(); + return m_version->qmakeFilePath().toUserOutput(); } if (role == Qt::FontRole && m_changed) { @@ -128,7 +128,7 @@ public: const QString row = "%1:%2"; return QString("" + row.arg(tr("Qt Version"), m_version->qtVersionString()) - + row.arg(tr("Location of qmake"), m_version->qmakeCommand().toUserOutput()) + + row.arg(tr("Location of qmake"), m_version->qmakeFilePath().toUserOutput()) + "
"); } @@ -619,7 +619,7 @@ void QtOptionsPageWidget::addQtDir() auto checkAlreadyExists = [qtVersion](TreeItem *parent) { for (int i = 0; i < parent->childCount(); ++i) { auto item = static_cast(parent->childAt(i)); - if (item->version()->qmakeCommand() == qtVersion) { + if (item->version()->qmakeFilePath() == qtVersion) { return std::make_pair(true, item->version()->displayName()); } } @@ -672,7 +672,7 @@ void QtOptionsPageWidget::removeQtDir() void QtOptionsPageWidget::editPath() { BaseQtVersion *current = currentVersion(); - QString dir = currentVersion()->qmakeCommand().toFileInfo().absolutePath(); + QString dir = currentVersion()->qmakeFilePath().toFileInfo().absolutePath(); FilePath qtVersion = FilePath::fromString( QFileDialog::getOpenFileName(this, tr("Select a qmake Executable"), @@ -770,7 +770,7 @@ void QtOptionsPageWidget::updateWidgets() BaseQtVersion *version = currentVersion(); if (version) { m_versionUi.nameEdit->setText(version->unexpandedDisplayName()); - m_versionUi.qmakePath->setText(version->qmakeCommand().toUserOutput()); + m_versionUi.qmakePath->setText(version->qmakeFilePath().toUserOutput()); m_configurationWidget = version->createConfigurationWidget(); if (m_configurationWidget) { m_versionUi.formLayout->addRow(m_configurationWidget); diff --git a/src/plugins/qtsupport/qtprojectimporter.cpp b/src/plugins/qtsupport/qtprojectimporter.cpp index 4ee36992938..2ed2a6ac6bb 100644 --- a/src/plugins/qtsupport/qtprojectimporter.cpp +++ b/src/plugins/qtsupport/qtprojectimporter.cpp @@ -55,7 +55,7 @@ QtProjectImporter::QtVersionData QtProjectImporter::findOrCreateQtVersion(const Utils::FilePath &qmakePath) const { QtVersionData result; - result.qt = QtVersionManager::version(Utils::equal(&BaseQtVersion::qmakeCommand, qmakePath)); + result.qt = QtVersionManager::version(Utils::equal(&BaseQtVersion::qmakeFilePath, qmakePath)); if (result.qt) { // Check if version is a temporary qt const int qtId = result.qt->uniqueId(); diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index f7fc7b94d55..7996bebf8bb 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -265,7 +265,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) if (log().isDebugEnabled()) { qCDebug(log) << "======= Existing Qt versions ======="; for (BaseQtVersion *version : qAsConst(m_versions)) { - qCDebug(log) << version->qmakeCommand().toString() << "id:"<uniqueId(); + qCDebug(log) << version->qmakeFilePath().toString() << "id:"<uniqueId(); qCDebug(log) << " autodetection source:"<< version->autodetectionSource(); qCDebug(log) << ""; } @@ -341,7 +341,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) if (log().isDebugEnabled()) { qCDebug(log) << "======= Before removing outdated sdk versions ======="; for (BaseQtVersion *version : qAsConst(m_versions)) { - qCDebug(log) << version->qmakeCommand().toString() << "id:"<uniqueId(); + qCDebug(log) << version->qmakeFilePath().toString() << "id:"<uniqueId(); qCDebug(log) << " autodetection source:"<< version->autodetectionSource(); qCDebug(log) << ""; } @@ -360,7 +360,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) if (log().isDebugEnabled()) { qCDebug(log)<< "======= End result ======="; for (BaseQtVersion *version : qAsConst(m_versions)) { - qCDebug(log) << version->qmakeCommand().toString() << "id:" << version->uniqueId(); + qCDebug(log) << version->qmakeFilePath().toString() << "id:" << version->uniqueId(); qCDebug(log) << " autodetection source:"<< version->autodetectionSource(); qCDebug(log) << ""; } @@ -443,7 +443,7 @@ static void findSystemQt() continue; const auto isSameQmake = [qmakePath](const BaseQtVersion *version) { return Environment::systemEnvironment(). - isSameExecutable(qmakePath.toString(), version->qmakeCommand().toString()); + isSameExecutable(qmakePath.toString(), version->qmakeFilePath().toString()); }; if (contains(m_versions, isSameQmake)) continue; diff --git a/src/plugins/qtsupport/qtversions.cpp b/src/plugins/qtsupport/qtversions.cpp index 1426a61c630..98e028125e2 100644 --- a/src/plugins/qtsupport/qtversions.cpp +++ b/src/plugins/qtsupport/qtversions.cpp @@ -62,8 +62,8 @@ QStringList DesktopQtVersion::warningReason() const { QStringList ret = BaseQtVersion::warningReason(); if (qtVersion() >= QtVersionNumber(5, 0, 0)) { - if (qmlsceneCommand().isEmpty()) - ret << QCoreApplication::translate("QtVersion", "No qmlscene installed."); + if (qmlRuntimeFilePath().isEmpty()) + ret << QCoreApplication::translate("QtVersion", "No QML utility installed."); } return ret; } diff --git a/src/plugins/qtsupport/uicgenerator.cpp b/src/plugins/qtsupport/uicgenerator.cpp index 454dcad35fb..d7a9c90ef57 100644 --- a/src/plugins/qtsupport/uicgenerator.cpp +++ b/src/plugins/qtsupport/uicgenerator.cpp @@ -62,7 +62,7 @@ Utils::FilePath UicGenerator::command() const if (!version) return Utils::FilePath(); - return version->uicCommand(); + return version->uicFilePath(); } QStringList UicGenerator::arguments() const diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index b98a5783056..188abfe20ad 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -854,8 +854,16 @@ TextEditorWidgetPrivate::TextEditorWidgetPrivate(TextEditorWidget *parent) TextEditorWidgetPrivate::~TextEditorWidgetPrivate() { - QObject::disconnect(m_document.data(), &TextDocument::markRemoved, - this, &TextEditorWidgetPrivate::markRemoved); + QTextDocument *doc = m_document->document(); + QTC_CHECK(doc); + auto documentLayout = qobject_cast(doc->documentLayout()); + QTC_CHECK(documentLayout); + QTC_CHECK(m_document.data()); + documentLayout->disconnect(this); + documentLayout->disconnect(m_extraArea); + doc->disconnect(this); + m_document.data()->disconnect(this); + q->disconnect(documentLayout); q->disconnect(this); delete m_toolBarWidget; delete m_highlightScrollBarController; diff --git a/src/plugins/texteditor/textmark.cpp b/src/plugins/texteditor/textmark.cpp index 110f451eed9..43aaf3e54b5 100644 --- a/src/plugins/texteditor/textmark.cpp +++ b/src/plugins/texteditor/textmark.cpp @@ -504,7 +504,7 @@ AnnotationColors &AnnotationColors::getAnnotationColors(const QColor &markColor, : highClipHsl(backgroundLightness + 0.5); colors.rectColor = markColor; - colors.rectColor.setAlphaF(0.15); + colors.rectColor.setAlphaF(0.15f); colors.textColor.setHslF(markColor.hslHueF(), markColor.hslSaturationF(), diff --git a/src/plugins/webassembly/webassemblytoolchain.cpp b/src/plugins/webassembly/webassemblytoolchain.cpp index d0020cb6fde..c7755db21eb 100644 --- a/src/plugins/webassembly/webassemblytoolchain.cpp +++ b/src/plugins/webassembly/webassemblytoolchain.cpp @@ -162,6 +162,7 @@ QList WebAssemblyToolChainFactory::autoDetect( const IDevice::Ptr &device) { Q_UNUSED(alreadyKnown) + Q_UNUSED(device) const FilePath sdk = WebAssemblyEmSdk::registeredEmSdk(); if (!WebAssemblyEmSdk::isValid(sdk)) diff --git a/src/share/qtcreator/data.pro b/src/share/qtcreator/data.pro index fc96289f3a4..cd973905e97 100644 --- a/src/share/qtcreator/data.pro +++ b/src/share/qtcreator/data.pro @@ -9,8 +9,7 @@ STATIC_INSTALL_BASE = $$INSTALL_DATA_PATH STATIC_FILES = \ $$PWD/externaltools/lrelease.xml \ $$PWD/externaltools/lupdate.xml \ - $$PWD/externaltools/qmlviewer.xml \ - $$PWD/externaltools/qmlscene.xml + $$PWD/externaltools/qml.xml unix { osx:STATIC_FILES += $$PWD/externaltools/vi_mac.xml else:STATIC_FILES += $$PWD/externaltools/vi.xml diff --git a/src/share/qtcreator/externaltools/CMakeLists.txt b/src/share/qtcreator/externaltools/CMakeLists.txt index dcd107ef354..5059fdcb00f 100644 --- a/src/share/qtcreator/externaltools/CMakeLists.txt +++ b/src/share/qtcreator/externaltools/CMakeLists.txt @@ -1,6 +1,6 @@ set(EXT_TOOLS_DIR "${IDE_DATA_PATH}/externaltools") -set(tools lrelease.xml lupdate.xml qmlscene.xml qmlviewer.xml) +set(tools lrelease.xml lupdate.xml qmlscene.xml qml.xml) if (WIN32) list(APPEND tools notepad_win.xml) diff --git a/src/share/qtcreator/externaltools/qmlviewer.xml b/src/share/qtcreator/externaltools/qml.xml similarity index 85% rename from src/share/qtcreator/externaltools/qmlviewer.xml rename to src/share/qtcreator/externaltools/qml.xml index 32a362d6b84..cffaf93ed70 100644 --- a/src/share/qtcreator/externaltools/qmlviewer.xml +++ b/src/share/qtcreator/externaltools/qml.xml @@ -26,14 +26,14 @@ ****************************************************************************/ --> - - Runs the current QML file with qmlviewer - Qt Quick 1 Preview (qmlviewer) + + Runs the current QML file with QML utility. + QML utility Qt Quick 1 - %{CurrentDocument:Project:QT_INSTALL_BINS}/qmlviewer - qmlviewer + %{CurrentProject:QT_INSTALL_BINS}/qml + qml %{CurrentDocument:FilePath} %{CurrentDocument:Path} QT_LOGGING_TO_CONSOLE%3D1 diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py index 0419a4c7589..40982c5ccca 100644 --- a/tests/system/shared/qtcreator.py +++ b/tests/system/shared/qtcreator.py @@ -102,7 +102,7 @@ def waitForCleanShutdown(timeOut=10): shutdownDone = (str(appCtxt)=="") if platform.system() in ('Windows','Microsoft'): # cleaning helper for running on the build machines - checkForStillRunningQmlExecutable(['qmlviewer.exe', 'qmlscene.exe']) + checkForStillRunningQmlExecutable(['qmlscene.exe', 'qml.exe']) endtime = datetime.utcnow() + timedelta(seconds=timeOut) while not shutdownDone: # following work-around because os.kill() works for win not until python 2.7 diff --git a/tests/system/suite_debugger/tst_qml_locals/test.py b/tests/system/suite_debugger/tst_qml_locals/test.py index 5f89fc8942f..f3da6dee80d 100644 --- a/tests/system/suite_debugger/tst_qml_locals/test.py +++ b/tests/system/suite_debugger/tst_qml_locals/test.py @@ -52,7 +52,7 @@ def main(): "Verifying Run and Debug are enabled (Qt5 is available).") and test.compare(target, Targets.getStringForTarget(Targets.getDefaultKit()), "Verifying selected Target is Qt5.") - and test.compare(exe, "QML Scene", "Verifying selected executable is QML Scene.")): + and test.compare(exe, "QML Utility", "Verifying selected executable is QML Utility.")): earlyExit("Something went wrong opening Qml project - probably missing Qt5.") return switchViewTo(ViewConstants.PROJECTS) diff --git a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py index 1b2613cda83..766205ded70 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py @@ -56,7 +56,7 @@ def main(): __closeSubprocessByPushingStop__(True) appOutput = logApplicationOutput() test.verify(_exactlyOne_(map(lambda ver: ver in appOutput, available)), - "Does Creator use qmlscene from a checked kit?") + "Does Qt Creator use QML binary from a checked kit?") test.verify(projectName + ".qml:" not in appOutput, "Does the Application Output indicate QML errors?") invokeMenuItem("File", "Close All Projects and Editors")