Merge remote-tracking branch 'origin/4.11'
Conflicts: share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp Change-Id: I8ea57eba526ab830608fd928c28771c5441749f8
20
dist/changes-4.11.0.md
vendored
@@ -18,6 +18,11 @@ you can check out from the public Git repository. For example:
|
||||
* Made update notification less intrusive and more informative (QTCREATORBUG-22817)
|
||||
* Made wizards remember user choices (QTCREATORBUG-16657)
|
||||
|
||||
## Help
|
||||
|
||||
* Fixed that removing Qt version only unregistered its documentation after
|
||||
restart (QTCREATORBUG-16631)
|
||||
|
||||
## Editing
|
||||
|
||||
* Added option to change line ending style via editor tool bar
|
||||
@@ -90,6 +95,7 @@ you can check out from the public Git repository. For example:
|
||||
* Fixed handling of boolean semantics (`OFF`, `NO`, `FALSE`, and so on)
|
||||
* Fixed `Build` > `Run CMake` (QTCREATORBUG-19704)
|
||||
* Fixed registering `CMake.app` from official installer on macOS
|
||||
* Fixed code model issues when using precompiled headers (QTCREATORBUG-22888)
|
||||
|
||||
### Qbs
|
||||
|
||||
@@ -106,6 +112,12 @@ you can check out from the public Git repository. For example:
|
||||
* Added option to remove directories directly from project tree (QTCREATORBUG-16575)
|
||||
* Added support for Framework paths (QTCREATORBUG-20099)
|
||||
|
||||
## Debugging
|
||||
|
||||
### CDB
|
||||
|
||||
* Fixed assigning negative values to variables (QTCREATORBUG-17269)
|
||||
|
||||
## Analyzer
|
||||
|
||||
* Added viewer for Chrome trace report files
|
||||
@@ -148,6 +160,10 @@ you can check out from the public Git repository. For example:
|
||||
* Added settings per project (QTCREATORBUG-16704)
|
||||
* Added option to run tests after successful build
|
||||
|
||||
### Boost
|
||||
|
||||
* Fixed running multiple tests (QTCREATORBUG-23091)
|
||||
|
||||
## Platforms
|
||||
|
||||
### Windows
|
||||
@@ -184,6 +200,7 @@ you can check out from the public Git repository. For example:
|
||||
* Fixed that it was not possible to add custom deployment steps (QTCREATORBUG-22977)
|
||||
|
||||
## Credits for these changes go to:
|
||||
|
||||
Aleksei German
|
||||
Alessandro Portale
|
||||
Andre Hartmann
|
||||
@@ -211,6 +228,9 @@ Miikka Heikkinen
|
||||
Milian Wolff
|
||||
Nikolai Kosjar
|
||||
Orgad Shaneh
|
||||
Pasi Keränen
|
||||
Richard Weickelt
|
||||
Robert Löhning
|
||||
Sergey Levin
|
||||
Sona Kurazyan
|
||||
Tasuku Suzuki
|
||||
|
||||
BIN
doc/images/icons/download-icon.png
Normal file
|
After Width: | Height: | Size: 119 B |
BIN
doc/images/qtcreator-android-build-steps.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 14 KiB |
BIN
doc/images/qtcreator-android-cmake-settings.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 20 KiB |
BIN
doc/images/qtcreator-git-commit-actions.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 141 KiB |
BIN
doc/images/studio-easing-curve-editor.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
doc/images/studio-edit-keyframe.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2018 The Qt Company Ltd.
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -66,10 +66,10 @@
|
||||
\note Android SDK Tools have issues with JDK versions later than 8.
|
||||
|
||||
\li \l{http://www.gradle.org}{Gradle} for building application packages
|
||||
for Android devices (APK). Gradle is delivered with Qt 5.9, and
|
||||
later. Because Gradle scripts are not delivered with Android SDK
|
||||
Tools since version 26.0.0, they are delivered with Qt 5.9 and
|
||||
5.6.3.
|
||||
(APK) and app bundles (AAB) for Android devices. Gradle is delivered
|
||||
with Qt 5.9, and later. Because Gradle scripts are not delivered
|
||||
with Android SDK tools since version 26.0.0, they are delivered
|
||||
with Qt 5.9 and 5.6.3.
|
||||
|
||||
\note Using Ant to build APKs is no longer supported.
|
||||
|
||||
@@ -77,6 +77,9 @@
|
||||
by the \l{http://developer.android.com/tools/sdk/ndk/index.html}
|
||||
{Android NDK} from Google.
|
||||
|
||||
\note To develop with Qt 5.14.0 or later, you need Android NDK r20
|
||||
or later.
|
||||
|
||||
\li \l{http://developer.android.com/sdk/index.html}{Android SDK Tools}
|
||||
|
||||
The following Android SDK packages and tools are required for
|
||||
@@ -167,7 +170,7 @@
|
||||
|
||||
\li In the \uicontrol {JDK location} field, add the path to the JDK.
|
||||
|
||||
You can use the \inlineimage download.png
|
||||
Select the \inlineimage icons/download-icon.png
|
||||
(\uicontrol Download) button to go to the site where you can
|
||||
download the JDK. \QC checks the JDK installation and reports
|
||||
errors.
|
||||
@@ -175,9 +178,8 @@
|
||||
\li In the \uicontrol {Android Settings} group, add paths to the Android
|
||||
NDK and SDK.
|
||||
|
||||
You can use the \inlineimage download.png
|
||||
(\uicontrol Download) buttons to go to the sites where you can download
|
||||
the Android NDK and SDK.
|
||||
Select \inlineimage icons/download-icon.png
|
||||
to go to the sites where you can download the Android NDK and SDK.
|
||||
|
||||
The SDK Manager checks the Android NDK and SDK installations,
|
||||
reports errors, and offers to install the necessary packages.
|
||||
@@ -192,7 +194,8 @@
|
||||
|
||||
\li Select \uicontrol File > \uicontrol {New File or Project} > \uicontrol Application >
|
||||
\uicontrol {Qt Quick Application} > \uicontrol Choose, and
|
||||
follow the instructions of the wizard. For more information, see
|
||||
follow the instructions of the wizard to create a project. For more
|
||||
information, see
|
||||
\if defined(qtcreator)
|
||||
\l{Creating Qt Quick Projects}.
|
||||
\else
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2018 The Qt Company Ltd.
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -32,9 +32,19 @@
|
||||
|
||||
\title Deploying Applications to Android Devices
|
||||
|
||||
On Android, applications are distributed in a specially structured type of
|
||||
ZIP package called an APK. \QC supports the following methods of deployment
|
||||
for Android applications:
|
||||
On Android, applications are distributed in specially structured types of
|
||||
ZIP packages called Application Packages (APK) or Android App Bundles (AAB).
|
||||
APK files can be downloaded to and executed on a device, whereas AAB is
|
||||
intended to be interpreted by the Google Play store and is used to generate
|
||||
APK files.
|
||||
|
||||
\l{Qt for Android} has binaries for armv7a, arm64-v8a, x86, and x86-64.
|
||||
To support several different ABIs in your application, build an AAB that
|
||||
contains binaries for each of the ABIs. The Google Play store uses the
|
||||
AAB to generate optimized APK packages for the devices issuing the download
|
||||
request and automatically signs them with your publisher key.
|
||||
|
||||
\QC supports the following methods of deployment for Android applications:
|
||||
|
||||
\list
|
||||
|
||||
@@ -44,6 +54,9 @@
|
||||
The Ministro tool downloads the necessary Qt libraries from a
|
||||
repository of your choice.
|
||||
|
||||
\li Since Qt 5.14.0, as an app bundle (AAB), intended for distribution
|
||||
in the Google Play store.
|
||||
|
||||
\endlist
|
||||
|
||||
To specify settings for application packages, select \uicontrol Projects >
|
||||
@@ -137,6 +150,23 @@
|
||||
the \uicontrol {Compile Output} pane. To view additional information, select the
|
||||
\uicontrol {Verbose output} check box.
|
||||
|
||||
\section3 Building AABs
|
||||
|
||||
For testing the application locally, use the APK format, because
|
||||
the package can be uploaded directly to the device and run. For
|
||||
distribution to the Google Play store, create an AAB by selecting
|
||||
the \uicontrol {Build .aab (Android App Bundle)} check box.
|
||||
|
||||
When building with CMake, you can select the ABIs to build the application
|
||||
for in the \uicontrol CMake settings:
|
||||
|
||||
\image qtcreator-android-cmake-settings.png "CMake settings for building AABs"
|
||||
|
||||
When building with qmake, you can select the ABIs in the \uicontrol ABIs
|
||||
field in the \uicontrol {Build Steps}:
|
||||
|
||||
\image qtcreator-android-build-steps.png "Android Build Steps"
|
||||
|
||||
\section3 Selecting API Level
|
||||
|
||||
In the \uicontrol {Android build SDK} field, you can select the API level to use
|
||||
|
||||
@@ -398,7 +398,7 @@
|
||||
entry.
|
||||
|
||||
You can enable tooltips in the main editor displaying this information.
|
||||
For more information, see \l{Showing Tooltips in Debug Mode}.
|
||||
For more information, see \l{See the value of variables in tooltips while debugging}.
|
||||
|
||||
//! [debugger-qt-basic-objects]
|
||||
*/
|
||||
|
||||
@@ -32,12 +32,41 @@
|
||||
/*!
|
||||
\contentspage index.html
|
||||
\previouspage creator-faq.html
|
||||
\page creator-tips.html
|
||||
\page creator-how-tos.html
|
||||
\nextpage creator-known-issues.html
|
||||
|
||||
\title Tips and Tricks
|
||||
\title How-tos
|
||||
|
||||
\section1 Switching Between Modes
|
||||
How do I:
|
||||
|
||||
\list
|
||||
\li \l {Switch between modes}
|
||||
\li \l {Move between open files}
|
||||
\li \l {Switch to Edit mode}
|
||||
\li \l {Find a specific setting}
|
||||
\li \l {Open output panes}
|
||||
\li \l {Find keyboard shortcuts}
|
||||
\li \l {Run \QC from the command line}
|
||||
\li \l {Show and hide sidebars}
|
||||
\li \l {Move to symbols}
|
||||
\li \l {Inspect signal-slot connections while debugging}
|
||||
\li \l {Display low-level data in the debugger}
|
||||
\li \l {See the value of variables in tooltips while debugging}
|
||||
\li \l {Quickly locate files using the keyboard}
|
||||
\li \l {Perform calculations}
|
||||
\li \l {Jump to a function in QML code}
|
||||
\li \l {Add a license header template for C++ code}
|
||||
\li \l {Paste text from my clipboard history}
|
||||
\li \l {Sort lines alphabetically}
|
||||
\li \l {Enclose selected code in curly braces, parentheses, or double quotes}
|
||||
\li \l {Select the enclosing block in C++}
|
||||
\li \l {Add my own code snippets to the auto-complete menu}
|
||||
\li \l {Quickly write down notes somewhere}
|
||||
\li \l {Configure the amount of recent files shown}
|
||||
\li \l {Search and replace across files using a regular expression}
|
||||
\endlist
|
||||
|
||||
\section1 Switch between modes
|
||||
|
||||
\QC uses different modes for different purposes. You can quickly
|
||||
switch between these modes with the following keyboard shortcuts:
|
||||
@@ -55,7 +84,7 @@
|
||||
|
||||
For more information about \QC modes, see \l {Selecting Modes}.
|
||||
|
||||
\section1 Moving Between Open Files
|
||||
\section1 Move between open files
|
||||
|
||||
To quickly move between currently open files, press
|
||||
\key Ctrl+Tab.
|
||||
@@ -66,7 +95,7 @@
|
||||
to jump to a symbol in the same file, you can jump back to your original
|
||||
location in that file by pressing \key {Alt+Left}.
|
||||
|
||||
\section1 Moving To the Edit Mode
|
||||
\section1 Switch to Edit mode
|
||||
|
||||
To move to the \uicontrol Edit mode and currently active file, press
|
||||
\key Esc.
|
||||
@@ -81,12 +110,12 @@
|
||||
|
||||
\endlist
|
||||
|
||||
\section1 Using the Filter in Options Dialog
|
||||
\section1 Find a specific setting
|
||||
|
||||
To find specific settings you require in \uicontrol{Tools} > \uicontrol{Options}
|
||||
use the filter located at the top left of the \uicontrol Options dialog box.
|
||||
|
||||
\section1 Opening Output Panes
|
||||
\section1 Open output panes
|
||||
|
||||
The output panes provide a list of errors and warnings encountered during
|
||||
a build, detailed output from the compiler, status of a program when it is
|
||||
@@ -112,7 +141,7 @@
|
||||
|
||||
For more information about output panes, see \l{Viewing Output}.
|
||||
|
||||
\section1 Using Keyboard Shortcuts
|
||||
\section1 Find keyboard shortcuts
|
||||
|
||||
\QC provides \l{Keyboard Shortcuts}{many useful keyboard shortcuts}.
|
||||
You can see the keyboard shortcut for a menu command in the menu
|
||||
@@ -121,7 +150,7 @@
|
||||
To customize, import or export keyboard shortcuts, select \uicontrol Tools >
|
||||
\uicontrol Options > \uicontrol Environment > \uicontrol Keyboard.
|
||||
|
||||
\section1 Running \QC From Command Line
|
||||
\section1 Run \QC from the command line
|
||||
|
||||
You can launch \QC from command line using the name of an
|
||||
existing session or \c .pro file by giving the name as the command
|
||||
@@ -132,7 +161,7 @@
|
||||
|
||||
For more information, see \l{Using Command Line Options}.
|
||||
|
||||
\section1 Showing and Hiding Sidebars
|
||||
\section1 Show and hide sidebars
|
||||
|
||||
You can toggle the left and right sidebar in some \QC modes.
|
||||
|
||||
@@ -147,7 +176,7 @@
|
||||
For more information on using the sidebars, see
|
||||
\l {Browsing Project Contents}.
|
||||
|
||||
\section1 Moving To Symbols
|
||||
\section1 Move to symbols
|
||||
|
||||
To move straight to a symbol used in a project, select the symbol in the
|
||||
\uicontrol Editor toolbar drop-down menu. For more information on the editor
|
||||
@@ -163,7 +192,7 @@
|
||||
cursor on the symbol and press \key {F2}. For more information, see
|
||||
\l{Moving to Symbol Definition or Declaration}.
|
||||
|
||||
\section1 Displaying Signals and Slots
|
||||
\section1 Inspect signal-slot connections while debugging
|
||||
|
||||
If an instance of a class is derived from QObject, and you would like to
|
||||
find all other objects connected to one of your object's slots using
|
||||
@@ -177,7 +206,7 @@
|
||||
For more information about the \uicontrol{Locals} view, see
|
||||
\l{Local Variables and Function Parameters}.
|
||||
|
||||
\section1 Displaying Low Level Data
|
||||
\section1 Display low-level data in the debugger
|
||||
|
||||
If special debugging of Qt objects fails due to data corruption within the
|
||||
debugged objects, you can switch off the debugging helpers. When debugging
|
||||
@@ -193,7 +222,7 @@
|
||||
|
||||
\endlist
|
||||
|
||||
\section1 Showing Tooltips in Debug Mode
|
||||
\section1 See the value of variables in tooltips while debugging
|
||||
|
||||
To inspect the value of variables from the editor, you can turn
|
||||
on tooltips. Tooltips are hidden by default for performance reasons.
|
||||
@@ -218,7 +247,7 @@
|
||||
select \uicontrol {Close Editor Tooltips} in the context menu in the
|
||||
\uicontrol {Locals} view.
|
||||
|
||||
\section1 Locating Files
|
||||
\section1 Quickly locate files using the keyboard
|
||||
|
||||
The \uicontrol Locator provides one of the easiest ways in \QC to browse
|
||||
through projects, files, classes, functions, documentation and file systems.
|
||||
@@ -230,7 +259,20 @@
|
||||
|
||||
For more information, see \l{Creating Locator Filters}.
|
||||
|
||||
\section1 Adding a License Header Template for C++ Code
|
||||
\section1 Perform calculations
|
||||
|
||||
Open the \uicontrol Locator with \key {Ctrl+K} and type =, followed by a space.
|
||||
You can now do basic calculations, with options to copy the results to the clipboard
|
||||
by navigating through the entries and pressing \key {Enter}.
|
||||
|
||||
For more information, see \l{Executing JavaScript}.
|
||||
|
||||
\section1 Jump to a function in QML code
|
||||
|
||||
Open the \uicontrol Locator with \key {Ctrl+K} and type m, followed by a space.
|
||||
You can now go directly to any QML method in the file.
|
||||
|
||||
\section1 Add a license header template for C++ code
|
||||
|
||||
A file containing a license header for C++ can be specified under
|
||||
\uicontrol{Tools > Options > C++ > License Template}. It may contain special
|
||||
@@ -250,16 +292,85 @@
|
||||
|
||||
\endlist
|
||||
|
||||
\section1 Pasting from Clipboard History
|
||||
\section1 Paste text from my clipboard history
|
||||
|
||||
\QC stores copied text in clipboard history. To retrieve clips from the
|
||||
history, press \key {Ctrl+Shift+V} until the clip appears.
|
||||
The number of clips in the history is fixed to 10.
|
||||
|
||||
\section1 Sorting Lines Alphabetically
|
||||
\section1 Sort lines alphabetically
|
||||
|
||||
To sort selected lines alphabetically, select \uicontrol Edit >
|
||||
\uicontrol Advanced > \uicontrol {Sort Selected Lines} or press
|
||||
\key {Alt+Shift+S} (or \key Ctrl+Shift+S on \macos).
|
||||
|
||||
\section1 Enclose selected code in curly braces, parentheses, or double quotes
|
||||
|
||||
Press \key {Shift} and then the opening character.
|
||||
|
||||
\list
|
||||
\li Curly braces: \key {Shift+\{}
|
||||
\li Parentheses: \key {Shift+(}
|
||||
\li Double quotes: \key {Shift+"}
|
||||
\endlist
|
||||
|
||||
\section1 Select the enclosing block in C++
|
||||
|
||||
Press \key {Ctrl+U}.
|
||||
|
||||
\section1 Add my own code snippets to the auto-complete menu
|
||||
|
||||
You can add, modify, and remove snippets in the snippet editor.
|
||||
To open the editor, select \uicontrol Tools > \uicontrol Options
|
||||
> \uicontrol {Text Editor} > \uicontrol Snippets.
|
||||
|
||||
For more information, see \l {Adding and Editing Snippets}.
|
||||
|
||||
\section1 Quickly write down notes somewhere
|
||||
|
||||
Select \uicontrol File > \uicontrol {New File or Project} >
|
||||
\uicontrol {Files and Classes} > \uicontrol General > \uicontrol {Scratch Buffer}.
|
||||
Alternatively, \key {Ctrl+N} can be used to open this dialog, which is
|
||||
fully navigable via keyboard by using the up and down arrow keys and the
|
||||
tab key.
|
||||
|
||||
This creates a new empty text file and saves it to the temporary directory
|
||||
on your machine. You can use it to write down notes without having to worry
|
||||
about deleting the file afterwards. The operating system will eventually
|
||||
remove the file automatically. If you want to keep the file, you can easily
|
||||
save it as a new file somewhere else. If you accidentally close the file,
|
||||
you can find it in the \uicontrol File > \uicontrol {Recent Files} menu.
|
||||
|
||||
\section1 Configure the amount of recent files shown
|
||||
|
||||
Select \uicontrol Tools > \uicontrol Options, and change the value of the
|
||||
list under \uicontrol Environment > \uicontrol System
|
||||
> \uicontrol {Maximum number of entries in "Recent Files"}.
|
||||
|
||||
\section1 Search and replace across files using a regular expression
|
||||
|
||||
As an example, say you want to replace equality checks (\c {foo == bar})
|
||||
with a function (\c {foo.equals(bar)}):
|
||||
|
||||
\list 1
|
||||
\li Ensure that any work you have done is committed to version control,
|
||||
as the changes cannot be undone.
|
||||
\li Press \key {Ctrl+Shift+F} to bring up the \uicontrol {Advanced Find}
|
||||
form.
|
||||
\li Change the scope to whatever is appropriate for your search.
|
||||
\li Under the \uicontrol {Search for} text field, select
|
||||
the \uicontrol {Use regular expressions} check box.
|
||||
\li Enter the following text in the \uicontrol {Search for} text field:
|
||||
\badcode
|
||||
if \((.*) == (.*)\)
|
||||
\endcode
|
||||
\li Press \uicontrol {Search & Replace} to see a list of search results.
|
||||
\li In the \uicontrol {Replace with} text field, enter the following text:
|
||||
\badcode
|
||||
if (\1.strictlyEquals(\2))
|
||||
\endcode
|
||||
\li Press \uicontrol Replace to replace all instances of the text.
|
||||
\endlist
|
||||
|
||||
For more information, see \l {Advanced Search}.
|
||||
*/
|
||||
@@ -27,13 +27,13 @@
|
||||
\contentspage index.html
|
||||
\previouspage creator-help.html
|
||||
\page creator-faq.html
|
||||
\nextpage creator-tips.html
|
||||
\nextpage creator-how-tos.html
|
||||
|
||||
\title FAQ
|
||||
|
||||
This section contains answers to some frequently asked questions about \QC.
|
||||
You might also find answers to your questions in the
|
||||
\l{Known Issues} and \l{Tips and Tricks} sections, or the Troubleshooting
|
||||
\l{Known Issues} and \l{How-tos} sections, or the Troubleshooting
|
||||
sections for a special area, such as
|
||||
\l{Troubleshooting Debugger}{debugging}.
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
\section1 Useful Features
|
||||
|
||||
For a list of useful \QC features described in other parts of the
|
||||
documentation, see \l{Tips and Tricks}.
|
||||
documentation, see \l{How-tos}.
|
||||
\endif
|
||||
|
||||
\section1 Changing Languages
|
||||
@@ -404,6 +404,9 @@
|
||||
\if defined(qtdesignstudio)
|
||||
\li \uicontrol {Asset Importer Error} - Errors and warnings encountered
|
||||
while importing assets from a design tool.
|
||||
\else
|
||||
\li \uicontrol Autotests - Errors and warnings encountered while running
|
||||
tests.
|
||||
\endif
|
||||
|
||||
\li \uicontrol {Build System} - Errors and warnings encountered during a
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
Contains answers to some frequently asked questions about \QC.
|
||||
|
||||
\li \l{Tips and Tricks}
|
||||
\li \l{How-tos}
|
||||
|
||||
Lists useful \QC features.
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
/*!
|
||||
\contentspage index.html
|
||||
\previouspage creator-tips.html
|
||||
\previouspage creator-how-tos.html
|
||||
\page creator-known-issues.html
|
||||
\nextpage creator-glossary.html
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
configuration. qmake is installed and configured when you install Qt.
|
||||
To use one of the other supported build systems, you need to set it up.
|
||||
|
||||
\l {CMake Manual}{CMake} is an alternative to qmake for automating the
|
||||
\l {Build with CMake}{CMake} is an alternative to qmake for automating the
|
||||
generation of build configurations. For more information, see
|
||||
\l {Setting Up CMake}.
|
||||
|
||||
|
||||
@@ -63,8 +63,9 @@
|
||||
Windows applications on Windows. MinGW is
|
||||
distributed together with \QC and Qt installers for Windows.
|
||||
|
||||
\li Linux ICC (Intel C++ Compiler) is a group of C and C++ compilers
|
||||
for Linux.
|
||||
\li ICC (Intel C++ Compiler) is a group of C and C++ compilers.
|
||||
Only the GCC-compatible variant, available for Linux and \macos,
|
||||
is currently supported by \QC.
|
||||
|
||||
\li Clang is a C, C++, Objective C, and Objective C++ front-end for the
|
||||
LLVM compiler for Windows, Linux, and \macos.
|
||||
@@ -87,7 +88,8 @@
|
||||
\li \l{https://www.iar.com/iar-embedded-workbench/}{IAREW} is a group of
|
||||
C and C++ bare-metal compilers from the various IAR Embedded Workbench
|
||||
development environments.
|
||||
\note Currently supported architectures are \c 8051, \c AVR, and \c ARM.
|
||||
\note Currently supported architectures are \c 8051, \c AVR, \c ARM,
|
||||
\c STM8, and \c MSP430.
|
||||
|
||||
\li \l{https://www.keil.com}{KEIL} is a group of C and C++ bare-metal
|
||||
compilers from the various KEIL development environments.
|
||||
@@ -95,7 +97,7 @@
|
||||
|
||||
\li \l{https://sdcc.sourceforge.net}{SDCC} is a retargetable, optimizing
|
||||
C bare-metal compiler for various architectures.
|
||||
\note Currently supported architecture is \c 8051.
|
||||
\note Currently supported architectures are \c 8051 and \c STM8.
|
||||
|
||||
\endlist
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@
|
||||
\list
|
||||
\li \l{Using the Help Mode}
|
||||
\li \l{FAQ}
|
||||
\li \l{Tips and Tricks}
|
||||
\li \l{How-tos}
|
||||
\li \l{Known Issues}
|
||||
\li \l{Glossary}
|
||||
\li \l{Technical Support}
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
\list
|
||||
\li \l{Using the Help Mode}
|
||||
\li \l{FAQ}
|
||||
\li \l{Tips and Tricks}
|
||||
\li \l{How-tos}
|
||||
\li \l{Known Issues}
|
||||
\li \l{Glossary}
|
||||
\endlist
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
The main view of the application displays an SVG bubble image that moves
|
||||
around the screen when you tilt the device.
|
||||
|
||||
To use \l{accelbubble/Bluebubble.svg}{Bluebubble.svg} in your project,
|
||||
To use \e {Bluebubble.svg} in your project,
|
||||
copy it to the project directory (same subdirectory as the QML file).
|
||||
The image appears in \uicontrol Resources. You can also use any other
|
||||
image or a QML type, instead.
|
||||
@@ -140,9 +140,8 @@
|
||||
|
||||
\QC creates a reference to the Bubble type in \e Page1Form.ui.qml.
|
||||
|
||||
To check your code, you can compare \e Page1Form.ui.qml with the
|
||||
\l{accelbubble/Page1Form.ui.qml}{Page1Form.ui.qml} example file and
|
||||
\e Bubble.qml with the \l{accelbubble/Bubble.qml}{Bubble.qml} example file.
|
||||
To check your code, you can compare your \e Page1Form.ui.qml and
|
||||
\e {Bubble.qml} with the corresponding example files.
|
||||
|
||||
The UI is now ready and you can switch to editing the \e Bubble.qml and
|
||||
\e main.qml files in the \uicontrol {Text Editor}, as described in the
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
\l {Setting Up CMake}{CMake}, or \l {Setting Up Qbs}{Qbs}.
|
||||
|
||||
\li In the \uicontrol {Qt Quick Controls Style} field, select one of
|
||||
the predefined \l{Styling Qt Quick Controls 2}{UI styles} to use,
|
||||
the predefined \l{Styling Qt Quick Controls}{UI styles} to use,
|
||||
and then select \uicontrol Next.
|
||||
|
||||
\li Select \l{glossary-buildandrun-kit}{kits} for the platforms that
|
||||
|
||||
@@ -188,9 +188,9 @@
|
||||
|
||||
\endlist
|
||||
|
||||
To check your code, you can view \e Page1Form.ui.qml in the
|
||||
\uicontrol {Text Editor} and compare it with the \l{transitions/Page1Form.ui.qml}
|
||||
{Page1Form.ui.qml} example file.
|
||||
To check your code, you can view your \e {Page1Form.ui.qml} file in the
|
||||
\uicontrol {Text Editor} and compare it with the \e {Page1Form.ui.qml}
|
||||
example file.
|
||||
|
||||
The new project wizard adds boilerplate code to the \e Page1.qml file to
|
||||
create menu items and push buttons. Modify the boilerplate code by removing
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
\l {Setting Up CMake}{CMake}, or \l {Setting Up Qbs}{Qbs}.
|
||||
|
||||
\li In the \uicontrol {Qt Quick Controls Style} field, select one of
|
||||
the predefined \l{Styling Qt Quick Controls 2}{UI styles} to use,
|
||||
the predefined \l{Styling Qt Quick Controls}{UI styles} to use,
|
||||
and then select \uicontrol Next.
|
||||
|
||||
\li Select the \uicontrol {Use Qt Virtual Keyboard} check box to add
|
||||
|
||||
@@ -458,7 +458,7 @@
|
||||
user interfaces for \l{glossary-device}{devices}.
|
||||
|
||||
Qt Quick Controls 2 achieve improved efficiency by employing a simplified
|
||||
\l {Styling Qt Quick Controls 2}{styling architecture} when compared to
|
||||
\l {Styling Qt Quick Controls}{styling architecture} when compared to
|
||||
Qt Quick Controls, on which the module is based. The visual editor reads the
|
||||
\c qtquickcontrols2.conf file that specifies the preferred style and some
|
||||
style-specific arguments. To change the style, select another style from
|
||||
|
||||
@@ -199,12 +199,15 @@
|
||||
To remove all the changes you recorded for a property, right-click the
|
||||
property name on the timeline and select \uicontrol {Remove Property}.
|
||||
|
||||
Keyframes a marked on the timeline by using markers of different colors and
|
||||
Keyframes are marked on the timeline by using markers of different colors and
|
||||
shapes, depending on whether they are active or inactive or whether you have
|
||||
applied easing curves to them, for example.
|
||||
|
||||
To edit the value of the selected keyframe, select
|
||||
\uicontrol {Edit Value for Keyframe} in the context menu.
|
||||
To edit the value of a keyframe, double-click a keyframe marker or select
|
||||
\uicontrol {Edit Keyframe} in the context menu. In the \uicontrol Frame
|
||||
field, you can set the frame and the value:
|
||||
|
||||
\image studio-edit-keyframe.png "Edit Keyframe dialog"
|
||||
|
||||
You can copy the keyframes from the keyframe track for an item and
|
||||
paste them to the keyframe track of another item. To copy all
|
||||
@@ -241,13 +244,14 @@
|
||||
components can appear to pick up speed, slow down, or bounce back at the
|
||||
end of the animation. By default, the animations you specify on the
|
||||
timeline are \e linear, which means that they move from the beginning to
|
||||
the end at a constant speed. You can use the \e {curve picker} to edit the
|
||||
easing curve between two keyframes. You can also use the more advanced
|
||||
\e {curve editor} to edit the curves for the whole animation.
|
||||
the end at a constant speed. You can use the \uicontrol {Easing Curve Editor}
|
||||
to edit the easing curve between two keyframes. You can also use the more
|
||||
advanced \uicontrol {Curve Editor (C)} to edit the curves for the whole
|
||||
animation.
|
||||
|
||||
\section2 Attaching Easing Curves to Keyframes
|
||||
|
||||
\image studio-curve-picker.png
|
||||
\image studio-easing-curve-editor.png "Easing Curve Editor"
|
||||
|
||||
You can use the preset curves or modify them by dragging the curve handlers
|
||||
around. You can add points to the curve and drag them and the point handlers
|
||||
@@ -255,22 +259,21 @@
|
||||
custom curve. For more information about easing curve types, see the
|
||||
documentation for \l [QML] {PropertyAnimation}{easing curves}.
|
||||
|
||||
To zoom into and out of the easing curve picker, use the mouse roller. To
|
||||
To zoom into and out of the easing curve editor, use the mouse roller. To
|
||||
reset the zoom factor, right-click in the picker and select
|
||||
\uicontrol {Reset Zoom}.
|
||||
|
||||
To attach easing curves to keyframes:
|
||||
|
||||
\list 1
|
||||
\li Select a keyframe on the timeline.
|
||||
\li Select \uicontrol {Curve Picker (C)} on the toolbar, or press
|
||||
\key C to open the curve picker.
|
||||
\li Right-click a keyframe on the timeline and select
|
||||
\uicontrol {Easing Curve Editor} in the context menu.
|
||||
\li Select an easing curve in the \uicontrol Presets tab.
|
||||
\li In the \uicontrol {Duration (ms)} field, select the duration of the
|
||||
easing function in milliseconds.
|
||||
\li Select \uicontrol Preview to preview the curve.
|
||||
\li Select \uicontrol OK to attach the easing curve to the keyframe
|
||||
and to close the curve picker.
|
||||
and to close the easing curve editor.
|
||||
\endlist
|
||||
|
||||
When you attach easing curves to keyframes, the shape of the keyframe
|
||||
@@ -283,8 +286,8 @@
|
||||
To customize easing curves:
|
||||
|
||||
\list 1
|
||||
\li In the curve picker, select an easing curve in the
|
||||
\uicontrol Presets tab.
|
||||
\li In the \uicontrol {Easing Curve Editor}, select an easing curve in
|
||||
the \uicontrol Presets tab.
|
||||
\li Drag the curve handlers to modify the curve.
|
||||
\li Right-click in the editor, and select \uicontrol {Add Point} to add
|
||||
points to the curve.
|
||||
@@ -297,7 +300,7 @@
|
||||
\uicontrol Custom tab.
|
||||
\endlist
|
||||
|
||||
To paste easing curve definitions to the curve picker as text, select
|
||||
To paste easing curve definitions to the easing curve editor as text, select
|
||||
the \uicontrol Text tab.
|
||||
|
||||
\section1 Editing Animation Curves
|
||||
@@ -307,9 +310,9 @@
|
||||
modify the curve. You can modify the appearance of the curve in the style
|
||||
editor.
|
||||
|
||||
You can also edit easing curves that you added with the curve picker.
|
||||
You can also edit easing curves that you added with the easing curve editor.
|
||||
|
||||
\image studio-curve-editor.png
|
||||
\image studio-curve-editor.png "Curve Editor"
|
||||
|
||||
To edit animation curves:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2018 The Qt Company Ltd.
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -224,6 +224,13 @@
|
||||
branch is shown in bold and underlined in the list of branches in the
|
||||
\uicontrol {Git Branches} sidebar view.
|
||||
|
||||
\image qtcreator-vcs-gitbranch.png "Git Branches sidebar view"
|
||||
|
||||
Old entries and tags are filtered out of the list of branches
|
||||
by default. To include them, select \inlineimage filtericon.png
|
||||
(\uicontrol {Filter Tree}), and then select
|
||||
\uicontrol {Include Old Entries} and \uicontrol {Include Tags}.
|
||||
|
||||
If you checked out a specific commit, the list of branches displays a
|
||||
\e {Detached HEAD} entry.
|
||||
|
||||
@@ -233,8 +240,6 @@
|
||||
To refresh the list of branches, click \inlineimage reload_gray.png
|
||||
(\uicontrol Refresh).
|
||||
|
||||
\image qtcreator-vcs-gitbranch.png "Git Branches sidebar view"
|
||||
|
||||
The following operations are supported in the context-menu for a branch:
|
||||
|
||||
\table
|
||||
@@ -249,7 +254,8 @@
|
||||
\li Remove a local branch. You cannot delete remote branches.
|
||||
\row
|
||||
\li \uicontrol Rename
|
||||
\li Rename a local branch. You cannot rename remote branches.
|
||||
\li Rename a local branch or a tag. You cannot rename remote
|
||||
branches.
|
||||
\row
|
||||
\li \uicontrol{Checkout}
|
||||
\li Check out the selected branch and make it current. You can stash
|
||||
@@ -302,12 +308,12 @@
|
||||
\li Description
|
||||
\row
|
||||
\li \uicontrol{Fetch}
|
||||
\li Fetches all the branches and changes information from a
|
||||
\li Fetch all the branches and changes information from a
|
||||
specific remote repository, or from all remotes if applied
|
||||
to \uicontrol {Remote Branches}.
|
||||
\row
|
||||
\li \uicontrol{Manage Remotes}
|
||||
\li Opens the \uicontrol Remotes dialog.
|
||||
\li Open the \uicontrol Remotes dialog.
|
||||
\endtable
|
||||
|
||||
\section3 Configuring Merge Tools
|
||||
@@ -357,11 +363,33 @@
|
||||
|
||||
To browse a directory or the commit history and to apply actions on the
|
||||
commits, select \uicontrol Tools > \uicontrol Git >
|
||||
\uicontrol {Actions on Commits}. You can checkout, revert, or cherry-pick
|
||||
commits or view them in the diff editor.
|
||||
\uicontrol {Actions on Commits}.
|
||||
|
||||
\image creator-git-commit-actions.png "Select a Git Commit dialog"
|
||||
|
||||
You can apply the following actions on commits:
|
||||
|
||||
\table
|
||||
\header
|
||||
\li Menu Item
|
||||
\li Description
|
||||
\row
|
||||
\li \uicontrol Archive
|
||||
\li Package the commit as a ZIP or tarball.
|
||||
\row
|
||||
\li \uicontrol Checkout
|
||||
\li Check out the change in a headless state.
|
||||
\row
|
||||
\li \uicontrol {Cherry Pick}
|
||||
\li Cherry-pick the selected change to the local repository.
|
||||
\row
|
||||
\li \uicontrol Revert
|
||||
\li Revert back to the state of the last commit.
|
||||
\row
|
||||
\li \uicontrol Show
|
||||
\li Show the commit in the diff editor.
|
||||
\endtable
|
||||
|
||||
\section1 Initializing Git Repositories
|
||||
|
||||
To start controlling a project directory that is currently not under
|
||||
|
||||
@@ -56,6 +56,19 @@ if [ ! -d "$designerDestDir" ]; then
|
||||
done
|
||||
fi
|
||||
|
||||
# collect 3d assetimporter plugins
|
||||
assetimporterDestDir="$app_path/Contents/PlugIns/assetimporters"
|
||||
assetimporterSrcDir="$plugin_src/assetimporters"
|
||||
if [ -d "$assetimporterSrcDir" ]; then
|
||||
if [ ! -d "$assetimporterDestDir" ]; then
|
||||
echo "- Copying 3d assetimporter plugins"
|
||||
mkdir -p "$assetimporterDestDir"
|
||||
for plugin in "$assetimporterSrcDir"/*.dylib; do
|
||||
cp "$plugin" "$assetimporterDestDir"/ || exit 1
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
# copy Qt Quick 1 imports
|
||||
importsDir="$app_path/Contents/Imports/qtquick1"
|
||||
if [ -d "$quick1_src" ]; then
|
||||
|
||||
@@ -39,7 +39,7 @@ class ValuesChangedCommand
|
||||
friend bool operator ==(const ValuesChangedCommand &first, const ValuesChangedCommand &second);
|
||||
|
||||
public:
|
||||
enum TransactionOption { Start, End, None };
|
||||
enum TransactionOption { Start = 1, End = 2, None = 0 };
|
||||
ValuesChangedCommand();
|
||||
explicit ValuesChangedCommand(const QVector<PropertyValueContainer> &valueChangeVector);
|
||||
|
||||
|
||||
@@ -74,12 +74,29 @@ TypeName PropertyValueContainer::dynamicTypeName() const
|
||||
return m_dynamicTypeName;
|
||||
}
|
||||
|
||||
// The reflection flag indicates that a property change notification
|
||||
// is reflected. This means that the notification is the reaction to a
|
||||
// property change original done by the puppet itself.
|
||||
// In the Qt5InformationNodeInstanceServer such notification are
|
||||
// therefore ignored.
|
||||
|
||||
void PropertyValueContainer::setReflectionFlag(bool b)
|
||||
{
|
||||
m_isReflected = b;
|
||||
}
|
||||
|
||||
bool PropertyValueContainer::isReflected() const
|
||||
{
|
||||
return m_isReflected;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const PropertyValueContainer &container)
|
||||
{
|
||||
out << container.instanceId();
|
||||
out << container.name();
|
||||
out << container.value();
|
||||
out << container.dynamicTypeName();
|
||||
out << container.isReflected();
|
||||
|
||||
return out;
|
||||
}
|
||||
@@ -90,6 +107,7 @@ QDataStream &operator>>(QDataStream &in, PropertyValueContainer &container)
|
||||
in >> container.m_name;
|
||||
in >> container.m_value;
|
||||
in >> container.m_dynamicTypeName;
|
||||
in >> container.m_isReflected;
|
||||
|
||||
return in;
|
||||
}
|
||||
@@ -99,7 +117,8 @@ bool operator ==(const PropertyValueContainer &first, const PropertyValueContain
|
||||
return first.m_instanceId == second.m_instanceId
|
||||
&& first.m_name == second.m_name
|
||||
&& first.m_value == second.m_value
|
||||
&& first.m_dynamicTypeName == second.m_dynamicTypeName;
|
||||
&& first.m_dynamicTypeName == second.m_dynamicTypeName
|
||||
&& first.m_isReflected == second.m_isReflected;
|
||||
}
|
||||
|
||||
bool operator <(const PropertyValueContainer &first, const PropertyValueContainer &second)
|
||||
|
||||
@@ -50,12 +50,15 @@ public:
|
||||
QVariant value() const;
|
||||
bool isDynamic() const;
|
||||
TypeName dynamicTypeName() const;
|
||||
void setReflectionFlag(bool b);
|
||||
bool isReflected() const;
|
||||
|
||||
private:
|
||||
qint32 m_instanceId;
|
||||
PropertyName m_name;
|
||||
QVariant m_value;
|
||||
TypeName m_dynamicTypeName;
|
||||
bool m_isReflected = false;
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const PropertyValueContainer &container);
|
||||
|
||||
@@ -30,12 +30,12 @@ import MouseArea3D 1.0
|
||||
Model {
|
||||
id: arrow
|
||||
rotationOrder: Node.XYZr
|
||||
source: "meshes/Arrow.mesh"
|
||||
source: "meshes/arrow.mesh"
|
||||
|
||||
property View3D view3D
|
||||
property alias color: material.emissiveColor
|
||||
property Node targetNode: null
|
||||
property bool isDragging: false
|
||||
property bool dragging: false
|
||||
|
||||
readonly property bool hovering: mouseAreaYZ.hovering || mouseAreaXZ.hovering
|
||||
|
||||
@@ -43,10 +43,11 @@ Model {
|
||||
property var _targetStartPos
|
||||
|
||||
signal positionCommit()
|
||||
signal positionMove()
|
||||
|
||||
materials: DefaultMaterial {
|
||||
id: material
|
||||
emissiveColor: mouseAreaFront.hovering ? "white" : Qt.rgba(1.0, 0.0, 0.0, 1.0)
|
||||
emissiveColor: "white"
|
||||
lighting: DefaultMaterial.NoLighting
|
||||
}
|
||||
|
||||
@@ -59,7 +60,7 @@ Model {
|
||||
_pointerPosPressed = mouseArea.mapPositionToScene(maskedPosition);
|
||||
var sp = targetNode.scenePosition;
|
||||
_targetStartPos = Qt.vector3d(sp.x, sp.y, sp.z);
|
||||
isDragging = true;
|
||||
dragging = true;
|
||||
}
|
||||
|
||||
function posInParent(mouseArea, pointerPosition)
|
||||
@@ -85,6 +86,7 @@ Model {
|
||||
return;
|
||||
|
||||
targetNode.position = posInParent(mouseArea, pointerPosition);
|
||||
arrow.positionMove();
|
||||
}
|
||||
|
||||
function handleReleased(mouseArea, pointerPosition)
|
||||
@@ -93,7 +95,7 @@ Model {
|
||||
return;
|
||||
|
||||
targetNode.position = posInParent(mouseArea, pointerPosition);
|
||||
isDragging = false;
|
||||
dragging = false;
|
||||
arrow.positionCommit();
|
||||
}
|
||||
|
||||
@@ -104,7 +106,7 @@ Model {
|
||||
y: -1.5
|
||||
width: 12
|
||||
height: 3
|
||||
rotation: Qt.vector3d(0, 90, 0)
|
||||
rotation: Qt.vector3d(0, 0, 90)
|
||||
grabsMouse: targetNode
|
||||
onPressed: arrow.handlePressed(mouseAreaYZ, pointerPosition)
|
||||
onDragged: arrow.handleDragged(mouseAreaYZ, pointerPosition)
|
||||
@@ -118,12 +120,11 @@ Model {
|
||||
y: -1.5
|
||||
width: 12
|
||||
height: 3
|
||||
rotation: Qt.vector3d(90, 90, 0)
|
||||
rotation: Qt.vector3d(0, 90, 90)
|
||||
grabsMouse: targetNode
|
||||
onPressed: arrow.handlePressed(mouseAreaXZ, pointerPosition)
|
||||
onDragged: arrow.handleDragged(mouseAreaXZ, pointerPosition)
|
||||
onReleased: arrow.handleReleased(mouseAreaXZ, pointerPosition)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -39,11 +39,17 @@ Node {
|
||||
|
||||
onSceneTransformChanged: updateScale()
|
||||
onAutoScaleChanged: updateScale()
|
||||
|
||||
Connections {
|
||||
target: view3D.camera
|
||||
onSceneTransformChanged: updateScale()
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: designStudioNativeCameraControlHelper
|
||||
onOverlayUpdateNeeded: updateScale()
|
||||
}
|
||||
|
||||
function getScale(baseScale)
|
||||
{
|
||||
return Qt.vector3d(baseScale.x * relativeScale, baseScale.y * relativeScale,
|
||||
|
||||
41
share/qtcreator/qml/qmlpuppet/mockfiles/CameraGizmo.qml
Normal file
@@ -0,0 +1,41 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick3D 1.0
|
||||
|
||||
IconGizmo {
|
||||
id: cameraGizmo
|
||||
|
||||
iconSource: "qrc:///qtquickplugin/mockfiles/images/camera-pick-icon.png"
|
||||
gizmoModel.source: "#Cube"
|
||||
gizmoModel.materials: [
|
||||
DefaultMaterial {
|
||||
id: defaultMaterial
|
||||
emissiveColor: "blue"
|
||||
lighting: DefaultMaterial.NoLighting
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -44,23 +44,65 @@ Window {
|
||||
|
||||
property Node selectedNode: null
|
||||
|
||||
property var lightGizmos: []
|
||||
property var cameraGizmos: []
|
||||
|
||||
signal objectClicked(var object)
|
||||
signal commitObjectPosition(var object)
|
||||
signal moveObjectPosition(var object)
|
||||
|
||||
function selectObject(object) {
|
||||
selectedNode = object;
|
||||
}
|
||||
|
||||
function emitObjectClicked(object) {
|
||||
selectObject(object);
|
||||
objectClicked(object);
|
||||
}
|
||||
|
||||
function addLightGizmo(obj)
|
||||
{
|
||||
var component = Qt.createComponent("LightGizmo.qml");
|
||||
if (component.status === Component.Ready) {
|
||||
var gizmo = component.createObject(overlayScene,
|
||||
{"view3D": overlayView, "targetNode": obj});
|
||||
lightGizmos[lightGizmos.length] = gizmo;
|
||||
gizmo.selected.connect(emitObjectClicked);
|
||||
}
|
||||
}
|
||||
|
||||
function addCameraGizmo(obj)
|
||||
{
|
||||
var component = Qt.createComponent("CameraGizmo.qml");
|
||||
if (component.status === Component.Ready) {
|
||||
var gizmo = component.createObject(overlayScene,
|
||||
{"view3D": overlayView, "targetNode": obj});
|
||||
cameraGizmos[cameraGizmos.length] = gizmo;
|
||||
gizmo.selected.connect(emitObjectClicked);
|
||||
}
|
||||
}
|
||||
|
||||
// Work-around the fact that the projection matrix for the camera is not calculated until
|
||||
// the first frame is rendered, so any initial calls to mapFrom3DScene() will fail.
|
||||
Component.onCompleted: designStudioNativeCameraControlHelper.requestOverlayUpdate();
|
||||
|
||||
onWidthChanged: designStudioNativeCameraControlHelper.requestOverlayUpdate();
|
||||
onHeightChanged: designStudioNativeCameraControlHelper.requestOverlayUpdate();
|
||||
|
||||
Node {
|
||||
id: overlayScene
|
||||
|
||||
Camera {
|
||||
id: overlayCamera
|
||||
projectionMode: usePerspectiveCheckbox.checked ? Camera.Perspective
|
||||
: Camera.Orthographic
|
||||
clipFar: editCamera.clipFar
|
||||
position: editCamera.position
|
||||
rotation: editCamera.rotation
|
||||
PerspectiveCamera {
|
||||
id: overlayPerspectiveCamera
|
||||
clipFar: editPerspectiveCamera.clipFar
|
||||
position: editPerspectiveCamera.position
|
||||
rotation: editPerspectiveCamera.rotation
|
||||
}
|
||||
|
||||
OrthographicCamera {
|
||||
id: overlayOrthoCamera
|
||||
position: editOrthoCamera.position
|
||||
rotation: editOrthoCamera.rotation
|
||||
}
|
||||
|
||||
MoveGizmo {
|
||||
@@ -70,14 +112,12 @@ Window {
|
||||
targetNode: viewWindow.selectedNode
|
||||
position: viewWindow.selectedNode ? viewWindow.selectedNode.scenePosition
|
||||
: Qt.vector3d(0, 0, 0)
|
||||
rotation: globalControl.checked || !viewWindow.selectedNode
|
||||
? Qt.vector3d(0, 0, 0)
|
||||
: viewWindow.selectedNode.sceneRotation
|
||||
|
||||
globalOrientation: globalControl.checked
|
||||
visible: selectedNode
|
||||
view3D: overlayView
|
||||
|
||||
onPositionCommit: viewWindow.commitObjectPosition(selectedNode)
|
||||
onPositionMove: viewWindow.moveObjectPosition(selectedNode)
|
||||
}
|
||||
|
||||
AutoScaleHelper {
|
||||
@@ -97,15 +137,14 @@ Window {
|
||||
onTapped: {
|
||||
var pickResult = editView.pick(eventPoint.scenePosition.x,
|
||||
eventPoint.scenePosition.y);
|
||||
viewWindow.objectClicked(pickResult.objectHit);
|
||||
selectObject(pickResult.objectHit);
|
||||
emitObjectClicked(pickResult.objectHit);
|
||||
}
|
||||
}
|
||||
|
||||
View3D {
|
||||
id: editView
|
||||
anchors.fill: parent
|
||||
camera: editCamera
|
||||
camera: usePerspective ? editPerspectiveCamera : editOrthoCamera
|
||||
|
||||
Node {
|
||||
id: mainSceneHelpers
|
||||
@@ -119,15 +158,21 @@ Window {
|
||||
PointLight {
|
||||
id: pointLight
|
||||
visible: showEditLight
|
||||
position: editCamera.position
|
||||
position: usePerspective ? editPerspectiveCamera.position
|
||||
: editOrthoCamera.position
|
||||
}
|
||||
|
||||
Camera {
|
||||
id: editCamera
|
||||
PerspectiveCamera {
|
||||
id: editPerspectiveCamera
|
||||
y: 200
|
||||
z: -300
|
||||
clipFar: 100000
|
||||
projectionMode: usePerspective ? Camera.Perspective : Camera.Orthographic
|
||||
}
|
||||
|
||||
OrthographicCamera {
|
||||
id: editOrthoCamera
|
||||
y: 200
|
||||
z: -300
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -135,7 +180,7 @@ Window {
|
||||
View3D {
|
||||
id: overlayView
|
||||
anchors.fill: parent
|
||||
camera: overlayCamera
|
||||
camera: usePerspective ? overlayPerspectiveCamera : overlayOrthoCamera
|
||||
scene: overlayScene
|
||||
}
|
||||
|
||||
@@ -145,7 +190,7 @@ Window {
|
||||
targetView: overlayView
|
||||
offsetX: 0
|
||||
offsetY: 45
|
||||
visible: moveGizmo.isDragging
|
||||
visible: moveGizmo.dragging
|
||||
|
||||
Rectangle {
|
||||
color: "white"
|
||||
@@ -204,7 +249,7 @@ Window {
|
||||
CheckBox {
|
||||
id: globalControl
|
||||
checked: true
|
||||
text: qsTr("Use global orientation")
|
||||
text: qsTr("Use Global Orientation")
|
||||
onCheckedChanged: cameraControl.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
|
||||
81
share/qtcreator/qml/qmlpuppet/mockfiles/IconGizmo.qml
Normal file
@@ -0,0 +1,81 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick3D 1.0
|
||||
|
||||
Node {
|
||||
id: iconGizmo
|
||||
|
||||
property View3D view3D
|
||||
property bool highlightOnHover: true
|
||||
property Node targetNode: null
|
||||
|
||||
property alias gizmoModel: gizmoModel
|
||||
property alias iconSource: iconImage.source
|
||||
|
||||
signal positionCommit()
|
||||
signal selected(Node node)
|
||||
|
||||
position: targetNode ? targetNode.scenePosition : Qt.vector3d(0, 0, 0)
|
||||
rotation: targetNode ? targetNode.sceneRotation : Qt.vector3d(0, 0, 0)
|
||||
visible: targetNode ? targetNode.visible : false
|
||||
|
||||
Model {
|
||||
id: gizmoModel
|
||||
scale: Qt.vector3d(0.05, 0.05, 0.05)
|
||||
visible: iconGizmo.visible
|
||||
}
|
||||
Overlay2D {
|
||||
id: gizmoLabel
|
||||
targetNode: gizmoModel
|
||||
targetView: view3D
|
||||
offsetX: 0
|
||||
offsetY: 0
|
||||
visible: iconGizmo.visible && !isBehindCamera
|
||||
parent: view3D
|
||||
|
||||
Rectangle {
|
||||
width: 24
|
||||
height: 24
|
||||
x: -width / 2
|
||||
y: -height
|
||||
color: "transparent"
|
||||
border.color: "#7777ff"
|
||||
border.width: highlightOnHover && iconMouseArea.containsMouse ? 2 : 0
|
||||
radius: 5
|
||||
Image {
|
||||
id: iconImage
|
||||
anchors.fill: parent
|
||||
MouseArea {
|
||||
id: iconMouseArea
|
||||
anchors.fill: parent
|
||||
onClicked: selected(targetNode)
|
||||
hoverEnabled: highlightOnHover
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
41
share/qtcreator/qml/qmlpuppet/mockfiles/LightGizmo.qml
Normal file
@@ -0,0 +1,41 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick3D 1.0
|
||||
|
||||
IconGizmo {
|
||||
id: lightGizmo
|
||||
|
||||
iconSource: "qrc:///qtquickplugin/mockfiles/images/light-pick-icon.png"
|
||||
gizmoModel.source: "#Sphere"
|
||||
gizmoModel.materials: [
|
||||
DefaultMaterial {
|
||||
id: defaultMaterial
|
||||
emissiveColor: "yellow"
|
||||
lighting: DefaultMaterial.NoLighting
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -25,56 +25,131 @@
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick3D 1.0
|
||||
import MouseArea3D 1.0
|
||||
|
||||
Node {
|
||||
id: arrows
|
||||
id: moveGizmo
|
||||
|
||||
property View3D view3D
|
||||
property bool highlightOnHover: false
|
||||
property Node targetNode: null
|
||||
readonly property bool isDragging: arrowX.isDragging || arrowY.isDragging || arrowZ.isDragging
|
||||
|
||||
scale: Qt.vector3d(5, 5, 5)
|
||||
|
||||
property alias arrowX: arrowX
|
||||
property alias arrowY: arrowY
|
||||
property alias arrowZ: arrowZ
|
||||
property bool globalOrientation: true
|
||||
readonly property bool dragging: arrowX.dragging || arrowY.dragging || arrowZ.dragging
|
||||
|| centerMouseArea.dragging
|
||||
|
||||
signal positionCommit()
|
||||
signal positionMove()
|
||||
|
||||
Node {
|
||||
rotation: globalOrientation || !targetNode ? Qt.vector3d(0, 0, 0) : targetNode.sceneRotation
|
||||
|
||||
Arrow {
|
||||
id: arrowX
|
||||
objectName: "Arrow X"
|
||||
rotation: Qt.vector3d(0, -90, 0)
|
||||
targetNode: arrows.targetNode
|
||||
color: highlightOnHover && hovering ? Qt.lighter(Qt.rgba(1, 0, 0, 1))
|
||||
rotation: Qt.vector3d(0, 0, -90)
|
||||
targetNode: moveGizmo.targetNode
|
||||
color: highlightOnHover && (hovering || dragging) ? Qt.lighter(Qt.rgba(1, 0, 0, 1))
|
||||
: Qt.rgba(1, 0, 0, 1)
|
||||
view3D: arrows.view3D
|
||||
view3D: moveGizmo.view3D
|
||||
|
||||
onPositionCommit: arrows.positionCommit()
|
||||
onPositionCommit: moveGizmo.positionCommit()
|
||||
onPositionMove: moveGizmo.positionMove()
|
||||
}
|
||||
|
||||
Arrow {
|
||||
id: arrowY
|
||||
objectName: "Arrow Y"
|
||||
rotation: Qt.vector3d(90, 0, 0)
|
||||
targetNode: arrows.targetNode
|
||||
color: highlightOnHover && hovering ? Qt.lighter(Qt.rgba(0, 0, 1, 1))
|
||||
rotation: Qt.vector3d(0, 0, 0)
|
||||
targetNode: moveGizmo.targetNode
|
||||
color: highlightOnHover && (hovering || dragging) ? Qt.lighter(Qt.rgba(0, 0, 1, 1))
|
||||
: Qt.rgba(0, 0, 1, 1)
|
||||
view3D: arrows.view3D
|
||||
view3D: moveGizmo.view3D
|
||||
|
||||
onPositionCommit: arrows.positionCommit()
|
||||
onPositionCommit: moveGizmo.positionCommit()
|
||||
onPositionMove: moveGizmo.positionMove()
|
||||
}
|
||||
|
||||
Arrow {
|
||||
id: arrowZ
|
||||
objectName: "Arrow Z"
|
||||
rotation: Qt.vector3d(0, 180, 0)
|
||||
targetNode: arrows.targetNode
|
||||
color: highlightOnHover && hovering ? Qt.lighter(Qt.rgba(0, 0.6, 0, 1))
|
||||
rotation: Qt.vector3d(90, 0, 0)
|
||||
targetNode: moveGizmo.targetNode
|
||||
color: highlightOnHover && (hovering || dragging) ? Qt.lighter(Qt.rgba(0, 0.6, 0, 1))
|
||||
: Qt.rgba(0, 0.6, 0, 1)
|
||||
view3D: arrows.view3D
|
||||
view3D: moveGizmo.view3D
|
||||
|
||||
onPositionCommit: arrows.positionCommit()
|
||||
onPositionCommit: moveGizmo.positionCommit()
|
||||
onPositionMove: moveGizmo.positionMove()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Model {
|
||||
id: centerBall
|
||||
|
||||
source: "#Sphere"
|
||||
scale: Qt.vector3d(0.024, 0.024, 0.024)
|
||||
materials: DefaultMaterial {
|
||||
id: material
|
||||
emissiveColor: highlightOnHover
|
||||
&& (centerMouseArea.hovering || centerMouseArea.dragging)
|
||||
? Qt.lighter(Qt.rgba(0.5, 0.5, 0.5, 1))
|
||||
: Qt.rgba(0.5, 0.5, 0.5, 1)
|
||||
lighting: DefaultMaterial.NoLighting
|
||||
}
|
||||
|
||||
MouseArea3D {
|
||||
id: centerMouseArea
|
||||
view3D: moveGizmo.view3D
|
||||
x: -60
|
||||
y: -60
|
||||
width: 120
|
||||
height: 120
|
||||
rotation: view3D.camera.rotation
|
||||
grabsMouse: moveGizmo.targetNode
|
||||
priority: 1
|
||||
|
||||
property var _pointerPosPressed
|
||||
property var _targetStartPos
|
||||
|
||||
function posInParent(pointerPosition)
|
||||
{
|
||||
var scenePointerPos = mapPositionToScene(pointerPosition);
|
||||
var sceneRelativeDistance = Qt.vector3d(
|
||||
scenePointerPos.x - _pointerPosPressed.x,
|
||||
scenePointerPos.y - _pointerPosPressed.y,
|
||||
scenePointerPos.z - _pointerPosPressed.z);
|
||||
|
||||
var newScenePos = Qt.vector3d(
|
||||
_targetStartPos.x + sceneRelativeDistance.x,
|
||||
_targetStartPos.y + sceneRelativeDistance.y,
|
||||
_targetStartPos.z + sceneRelativeDistance.z);
|
||||
|
||||
return moveGizmo.targetNode.parent.mapPositionFromScene(newScenePos);
|
||||
}
|
||||
|
||||
onPressed: {
|
||||
if (!moveGizmo.targetNode)
|
||||
return;
|
||||
|
||||
_pointerPosPressed = mapPositionToScene(pointerPosition);
|
||||
var sp = moveGizmo.targetNode.scenePosition;
|
||||
_targetStartPos = Qt.vector3d(sp.x, sp.y, sp.z);
|
||||
}
|
||||
onDragged: {
|
||||
if (!moveGizmo.targetNode)
|
||||
return;
|
||||
|
||||
moveGizmo.targetNode.position = posInParent(pointerPosition);
|
||||
moveGizmo.positionMove();
|
||||
}
|
||||
onReleased: {
|
||||
if (!moveGizmo.targetNode)
|
||||
return;
|
||||
|
||||
moveGizmo.targetNode.position = posInParent(pointerPosition);
|
||||
moveGizmo.positionCommit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ Item {
|
||||
property real offsetX: 0
|
||||
property real offsetY: 0
|
||||
|
||||
property bool isBehindCamera
|
||||
|
||||
onTargetNodeChanged: updateOverlay()
|
||||
|
||||
Connections {
|
||||
@@ -46,13 +48,20 @@ Item {
|
||||
onSceneTransformChanged: updateOverlay()
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: designStudioNativeCameraControlHelper
|
||||
onOverlayUpdateNeeded: updateOverlay()
|
||||
}
|
||||
|
||||
function updateOverlay()
|
||||
{
|
||||
var scenePos = targetNode.scenePosition;
|
||||
var scenePos = targetNode ? targetNode.scenePosition : Qt.vector3d(0, 0, 0);
|
||||
var scenePosWithOffset = Qt.vector3d(scenePos.x + offsetX, scenePos.y + offsetY, scenePos.z);
|
||||
var viewPos = targetView.mapFrom3DScene(scenePosWithOffset);
|
||||
var viewPos = targetView ? targetView.mapFrom3DScene(scenePosWithOffset)
|
||||
: Qt.vector3d(0, 0, 0);
|
||||
root.x = viewPos.x;
|
||||
root.y = viewPos.y;
|
||||
root.z = 100000 - viewPos.z; // flip left-handed to right-handed
|
||||
|
||||
isBehindCamera = viewPos.z <= 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 206 B |
|
After Width: | Height: | Size: 279 B |
|
After Width: | Height: | Size: 348 B |
|
After Width: | Height: | Size: 525 B |
BIN
share/qtcreator/qml/qmlpuppet/mockfiles/meshes/arrow.mesh
Normal file
@@ -30,10 +30,14 @@ namespace Internal {
|
||||
CameraControlHelper::CameraControlHelper()
|
||||
: QObject()
|
||||
{
|
||||
m_timer.setInterval(16);
|
||||
m_timer.setSingleShot(false);
|
||||
QObject::connect(&m_timer, &QTimer::timeout,
|
||||
m_inputUpdateTimer.setInterval(16);
|
||||
QObject::connect(&m_inputUpdateTimer, &QTimer::timeout,
|
||||
this, &CameraControlHelper::handleUpdateTimer);
|
||||
|
||||
m_overlayUpdateTimer.setInterval(16);
|
||||
m_overlayUpdateTimer.setSingleShot(true);
|
||||
QObject::connect(&m_overlayUpdateTimer, &QTimer::timeout,
|
||||
this, &CameraControlHelper::overlayUpdateNeeded);
|
||||
}
|
||||
|
||||
bool CameraControlHelper::enabled()
|
||||
@@ -49,11 +53,17 @@ void CameraControlHelper::handleUpdateTimer()
|
||||
void CameraControlHelper::setEnabled(bool enabled)
|
||||
{
|
||||
if (enabled)
|
||||
m_timer.start();
|
||||
m_inputUpdateTimer.start();
|
||||
else
|
||||
m_timer.stop();
|
||||
m_inputUpdateTimer.stop();
|
||||
m_enabled = enabled;
|
||||
}
|
||||
|
||||
void CameraControlHelper::requestOverlayUpdate()
|
||||
{
|
||||
if (!m_overlayUpdateTimer.isActive())
|
||||
m_overlayUpdateTimer.start();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,16 +41,20 @@ public:
|
||||
bool enabled();
|
||||
void setEnabled(bool enabled);
|
||||
|
||||
Q_INVOKABLE void requestOverlayUpdate();
|
||||
|
||||
public slots:
|
||||
void handleUpdateTimer();
|
||||
|
||||
signals:
|
||||
void updateInputs();
|
||||
void enabledChanged(bool enabled);
|
||||
void overlayUpdateNeeded();
|
||||
|
||||
private:
|
||||
bool m_enabled = false;
|
||||
QTimer m_timer;
|
||||
QTimer m_inputUpdateTimer;
|
||||
QTimer m_overlayUpdateTimer;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -80,6 +80,11 @@ qreal MouseArea3D::height() const
|
||||
return m_height;
|
||||
}
|
||||
|
||||
int MouseArea3D::priority() const
|
||||
{
|
||||
return m_priority;
|
||||
}
|
||||
|
||||
void MouseArea3D::setView3D(QQuick3DViewport *view3D)
|
||||
{
|
||||
if (m_view3D == view3D)
|
||||
@@ -134,6 +139,15 @@ void MouseArea3D::setHeight(qreal height)
|
||||
emit heightChanged(height);
|
||||
}
|
||||
|
||||
void MouseArea3D::setPriority(int level)
|
||||
{
|
||||
if (m_priority == level)
|
||||
return;
|
||||
|
||||
m_priority = level;
|
||||
emit priorityChanged(level);
|
||||
}
|
||||
|
||||
void MouseArea3D::componentComplete()
|
||||
{
|
||||
if (!m_view3D) {
|
||||
@@ -193,51 +207,94 @@ QVector3D MouseArea3D::getMousePosInPlane(const QPointF &mousePosInView) const
|
||||
|
||||
bool MouseArea3D::eventFilter(QObject *, QEvent *event)
|
||||
{
|
||||
switch (event->type()) {
|
||||
case QEvent::HoverMove: {
|
||||
if (m_grabsMouse && s_mouseGrab && s_mouseGrab != this)
|
||||
break;
|
||||
if (m_grabsMouse && s_mouseGrab && s_mouseGrab != this
|
||||
&& (m_priority <= s_mouseGrab->m_priority || s_mouseGrab->m_dragging)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto mouseOnTopOfMouseArea = [this](const QVector3D &mousePosInPlane) -> bool {
|
||||
return !qFuzzyCompare(mousePosInPlane.z(), -1)
|
||||
&& mousePosInPlane.x() >= float(m_x)
|
||||
&& mousePosInPlane.x() <= float(m_x + m_width)
|
||||
&& mousePosInPlane.y() >= float(m_y)
|
||||
&& mousePosInPlane.y() <= float(m_y + m_height);
|
||||
};
|
||||
|
||||
switch (event->type()) {
|
||||
case QEvent::MouseButtonPress: {
|
||||
auto const mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
if (mouseEvent->button() == Qt::LeftButton) {
|
||||
m_mousePosInPlane = getMousePosInPlane(mouseEvent->pos());
|
||||
if (mouseOnTopOfMouseArea(m_mousePosInPlane)) {
|
||||
setDragging(true);
|
||||
emit pressed(m_mousePosInPlane);
|
||||
if (m_grabsMouse) {
|
||||
if (s_mouseGrab && s_mouseGrab != this) {
|
||||
s_mouseGrab->setDragging(false);
|
||||
s_mouseGrab->setHovering(false);
|
||||
}
|
||||
s_mouseGrab = this;
|
||||
setHovering(true);
|
||||
}
|
||||
event->accept();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case QEvent::MouseButtonRelease: {
|
||||
auto const mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
if (mouseEvent->button() == Qt::LeftButton) {
|
||||
if (m_dragging) {
|
||||
QVector3D mousePosInPlane = getMousePosInPlane(mouseEvent->pos());
|
||||
if (qFuzzyCompare(mousePosInPlane.z(), -1))
|
||||
mousePosInPlane = m_mousePosInPlane;
|
||||
setDragging(false);
|
||||
emit released(mousePosInPlane);
|
||||
if (m_grabsMouse) {
|
||||
if (s_mouseGrab && s_mouseGrab != this) {
|
||||
s_mouseGrab->setDragging(false);
|
||||
s_mouseGrab->setHovering(false);
|
||||
}
|
||||
if (mouseOnTopOfMouseArea(mousePosInPlane)) {
|
||||
s_mouseGrab = this;
|
||||
setHovering(true);
|
||||
} else {
|
||||
s_mouseGrab = nullptr;
|
||||
setHovering(false);
|
||||
}
|
||||
}
|
||||
event->accept();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case QEvent::MouseMove:
|
||||
case QEvent::HoverMove: {
|
||||
auto const mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
const QVector3D mousePosInPlane = getMousePosInPlane(mouseEvent->pos());
|
||||
if (qFuzzyCompare(mousePosInPlane.z(), -1))
|
||||
break;
|
||||
const bool hasMouse = mouseOnTopOfMouseArea(mousePosInPlane);
|
||||
|
||||
const bool mouseOnTopOfMouseArea =
|
||||
mousePosInPlane.x() >= float(m_x) &&
|
||||
mousePosInPlane.x() <= float(m_x + m_width) &&
|
||||
mousePosInPlane.y() >= float(m_y) &&
|
||||
mousePosInPlane.y() <= float(m_y + m_height);
|
||||
setHovering(hasMouse);
|
||||
|
||||
const bool buttonPressed = QGuiApplication::mouseButtons().testFlag(Qt::LeftButton);
|
||||
if (m_grabsMouse) {
|
||||
if (m_hovering && s_mouseGrab && s_mouseGrab != this)
|
||||
s_mouseGrab->setHovering(false);
|
||||
|
||||
// The filter will detect a mouse press on the view, but not a mouse release, since the
|
||||
// former is not accepted by the view, which means that the release will end up being
|
||||
// sent elsewhere. So we need this extra logic inside HoverMove, rather than in
|
||||
// MouseButtonRelease, which would otherwise be more elegant.
|
||||
|
||||
if (m_hovering != mouseOnTopOfMouseArea) {
|
||||
m_hovering = mouseOnTopOfMouseArea;
|
||||
emit hoveringChanged();
|
||||
if (m_hovering || m_dragging)
|
||||
s_mouseGrab = this;
|
||||
else if (s_mouseGrab == this)
|
||||
s_mouseGrab = nullptr;
|
||||
}
|
||||
|
||||
if (!m_dragging && m_hovering && buttonPressed) {
|
||||
m_dragging = true;
|
||||
emit pressed(mousePosInPlane);
|
||||
emit draggingChanged();
|
||||
} else if (m_dragging && !buttonPressed) {
|
||||
m_dragging = false;
|
||||
emit released(mousePosInPlane);
|
||||
emit draggingChanged();
|
||||
}
|
||||
|
||||
if (m_grabsMouse)
|
||||
s_mouseGrab = m_hovering || m_dragging ? this : nullptr;
|
||||
|
||||
if (m_dragging)
|
||||
if (m_dragging && !qFuzzyCompare(mousePosInPlane.z(), -1)) {
|
||||
m_mousePosInPlane = mousePosInPlane;
|
||||
emit dragged(mousePosInPlane);
|
||||
}
|
||||
|
||||
break; }
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -245,6 +302,24 @@ bool MouseArea3D::eventFilter(QObject *, QEvent *event)
|
||||
return false;
|
||||
}
|
||||
|
||||
void MouseArea3D::setDragging(bool enable)
|
||||
{
|
||||
if (m_dragging == enable)
|
||||
return;
|
||||
|
||||
m_dragging = enable;
|
||||
emit draggingChanged();
|
||||
}
|
||||
|
||||
void MouseArea3D::setHovering(bool enable)
|
||||
{
|
||||
if (m_hovering == enable)
|
||||
return;
|
||||
|
||||
m_hovering = enable;
|
||||
emit hoveringChanged();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ class MouseArea3D : public QQuick3DNode
|
||||
Q_PROPERTY(qreal height READ height WRITE setHeight NOTIFY heightChanged)
|
||||
Q_PROPERTY(bool hovering READ hovering NOTIFY hoveringChanged)
|
||||
Q_PROPERTY(bool dragging READ dragging NOTIFY draggingChanged)
|
||||
Q_PROPERTY(int priority READ priority WRITE setPriority NOTIFY priorityChanged)
|
||||
|
||||
Q_INTERFACES(QQmlParserStatus)
|
||||
|
||||
@@ -60,6 +61,7 @@ public:
|
||||
qreal y() const;
|
||||
qreal width() const;
|
||||
qreal height() const;
|
||||
int priority() const;
|
||||
|
||||
bool hovering() const;
|
||||
bool dragging() const;
|
||||
@@ -73,6 +75,7 @@ public slots:
|
||||
void setY(qreal y);
|
||||
void setWidth(qreal width);
|
||||
void setHeight(qreal height);
|
||||
void setPriority(int level);
|
||||
|
||||
Q_INVOKABLE QVector3D rayIntersectsPlane(const QVector3D &rayPos0,
|
||||
const QVector3D &rayPos1,
|
||||
@@ -86,6 +89,7 @@ signals:
|
||||
void yChanged(qreal y);
|
||||
void widthChanged(qreal width);
|
||||
void heightChanged(qreal height);
|
||||
void priorityChanged(int level);
|
||||
|
||||
void hoveringChanged();
|
||||
void draggingChanged();
|
||||
@@ -100,6 +104,9 @@ protected:
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
|
||||
private:
|
||||
void setDragging(bool enable);
|
||||
void setHovering(bool enable);
|
||||
|
||||
Q_DISABLE_COPY(MouseArea3D)
|
||||
QQuick3DViewport *m_view3D = nullptr;
|
||||
|
||||
@@ -107,6 +114,7 @@ private:
|
||||
qreal m_y;
|
||||
qreal m_width;
|
||||
qreal m_height;
|
||||
int m_priority = 0;
|
||||
|
||||
bool m_hovering = false;
|
||||
bool m_dragging = false;
|
||||
@@ -115,6 +123,7 @@ private:
|
||||
|
||||
static MouseArea3D *s_mouseGrab;
|
||||
bool m_grabsMouse;
|
||||
QVector3D m_mousePosInPlane;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -396,6 +396,11 @@ void ObjectNodeInstance::setHideInEditor(bool)
|
||||
{
|
||||
}
|
||||
|
||||
void ObjectNodeInstance::setModifiedFlag(bool b)
|
||||
{
|
||||
m_isModified = b;
|
||||
}
|
||||
|
||||
QVariant ObjectNodeInstance::convertEnumToValue(const QVariant &value, const PropertyName &name)
|
||||
{
|
||||
Q_ASSERT(value.canConvert<Enumeration>());
|
||||
@@ -420,6 +425,9 @@ void ObjectNodeInstance::setPropertyVariant(const PropertyName &name, const QVar
|
||||
if (ignoredProperties().contains(name))
|
||||
return;
|
||||
|
||||
if (m_isModified)
|
||||
return;
|
||||
|
||||
QQmlProperty property(object(), QString::fromUtf8(name), context());
|
||||
|
||||
if (!property.isValid())
|
||||
|
||||
@@ -195,6 +195,8 @@ public:
|
||||
|
||||
void virtual setHideInEditor(bool b);
|
||||
|
||||
void setModifiedFlag(bool b);
|
||||
|
||||
protected:
|
||||
explicit ObjectNodeInstance(QObject *object);
|
||||
void doResetProperty(const PropertyName &propertyName);
|
||||
@@ -220,6 +222,7 @@ private:
|
||||
qint32 m_instanceId;
|
||||
bool m_deleteHeldInstance;
|
||||
bool m_isInLayoutable;
|
||||
bool m_isModified = false;
|
||||
static QHash<EnumerationName, QVariant> m_enumationValueHash;
|
||||
};
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
#include "tokencommand.h"
|
||||
#include "removesharedmemorycommand.h"
|
||||
#include "changeselectioncommand.h"
|
||||
#include "objectnodeinstance.h"
|
||||
|
||||
#include "dummycontextobject.h"
|
||||
#include "../editor3d/cameracontrolhelper.h"
|
||||
@@ -98,6 +99,10 @@ QObject *Qt5InformationNodeInstanceServer::createEditView3D(QQmlEngine *engine)
|
||||
QObject::connect(window, SIGNAL(objectClicked(QVariant)), this, SLOT(objectClicked(QVariant)));
|
||||
QObject::connect(window, SIGNAL(commitObjectPosition(QVariant)),
|
||||
this, SLOT(handleObjectPositionCommit(QVariant)));
|
||||
QObject::connect(window, SIGNAL(moveObjectPosition(QVariant)),
|
||||
this, SLOT(handleObjectPositionMove(QVariant)));
|
||||
QObject::connect(&m_moveTimer, &QTimer::timeout,
|
||||
this, &Qt5InformationNodeInstanceServer::handleObjectPositionMoveTimeout);
|
||||
|
||||
//For macOS we have to use the 4.1 core profile
|
||||
QSurfaceFormat surfaceFormat = window->requestedFormat();
|
||||
@@ -149,21 +154,62 @@ Qt5InformationNodeInstanceServer::vectorToPropertyValue(
|
||||
return result;
|
||||
}
|
||||
|
||||
void Qt5InformationNodeInstanceServer::modifyVariantValue(
|
||||
const QVariant &node,
|
||||
const PropertyName &propertyName,
|
||||
ValuesModifiedCommand::TransactionOption option)
|
||||
{
|
||||
PropertyName targetPopertyName;
|
||||
|
||||
// Position is a special case, because the position can be 'position.x 'or simply 'x'.
|
||||
// We prefer 'x'.
|
||||
if (propertyName != "position")
|
||||
targetPopertyName = propertyName;
|
||||
|
||||
auto *obj = node.value<QObject *>();
|
||||
|
||||
if (obj) {
|
||||
ServerNodeInstance instance = instanceForObject(obj);
|
||||
|
||||
if (option == ValuesModifiedCommand::TransactionOption::Start)
|
||||
instance.setModifiedFlag(true);
|
||||
else if (option == ValuesModifiedCommand::TransactionOption::End)
|
||||
instance.setModifiedFlag(false);
|
||||
|
||||
// We do have to split position into position.x, position.y, position.z
|
||||
ValuesModifiedCommand command = createValuesModifiedCommand(vectorToPropertyValue(
|
||||
instance,
|
||||
targetPopertyName,
|
||||
obj->property(propertyName)));
|
||||
|
||||
command.transactionOption = option;
|
||||
|
||||
nodeInstanceClient()->valuesModified(command);
|
||||
}
|
||||
}
|
||||
|
||||
void Qt5InformationNodeInstanceServer::handleObjectPositionCommit(const QVariant &object)
|
||||
{
|
||||
auto *obj = object.value<QObject *>();
|
||||
if (obj) {
|
||||
/* We do have to split position into position.x, position.y, position.z */
|
||||
nodeInstanceClient()->valuesModified(createValuesModifiedCommand(vectorToPropertyValue(
|
||||
instanceForObject(obj),
|
||||
"position",
|
||||
obj->property("position"))));
|
||||
modifyVariantValue(object, "position", ValuesModifiedCommand::TransactionOption::End);
|
||||
m_movedNode = {};
|
||||
m_moveTimer.stop();
|
||||
}
|
||||
|
||||
void Qt5InformationNodeInstanceServer::handleObjectPositionMove(const QVariant &object)
|
||||
{
|
||||
if (m_movedNode.isNull()) {
|
||||
modifyVariantValue(object, "position", ValuesModifiedCommand::TransactionOption::Start);
|
||||
} else {
|
||||
if (!m_moveTimer.isActive())
|
||||
m_moveTimer.start();
|
||||
}
|
||||
m_movedNode = object;
|
||||
}
|
||||
|
||||
Qt5InformationNodeInstanceServer::Qt5InformationNodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient) :
|
||||
Qt5NodeInstanceServer(nodeInstanceClient)
|
||||
{
|
||||
m_moveTimer.setInterval(100);
|
||||
}
|
||||
|
||||
void Qt5InformationNodeInstanceServer::sendTokenBack()
|
||||
@@ -236,6 +282,11 @@ void Qt5InformationNodeInstanceServer::modifyProperties(
|
||||
nodeInstanceClient()->valuesModified(createValuesModifiedCommand(properties));
|
||||
}
|
||||
|
||||
void Qt5InformationNodeInstanceServer::handleObjectPositionMoveTimeout()
|
||||
{
|
||||
modifyVariantValue(m_movedNode, "position", ValuesModifiedCommand::TransactionOption::None);
|
||||
}
|
||||
|
||||
QObject *Qt5InformationNodeInstanceServer::findRootNodeOf3DViewport(
|
||||
const QList<ServerNodeInstance> &instanceList) const
|
||||
{
|
||||
@@ -252,6 +303,19 @@ QObject *Qt5InformationNodeInstanceServer::findRootNodeOf3DViewport(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Qt5InformationNodeInstanceServer::findCamerasAndLights(
|
||||
const QList<ServerNodeInstance> &instanceList,
|
||||
QObjectList &cameras, QObjectList &lights) const
|
||||
{
|
||||
QObjectList objList;
|
||||
for (const ServerNodeInstance &instance : instanceList) {
|
||||
if (instance.isSubclassOf("QQuick3DCamera"))
|
||||
cameras << instance.internalObject();
|
||||
else if (instance.isSubclassOf("QQuick3DAbstractLight"))
|
||||
lights << instance.internalObject();
|
||||
}
|
||||
}
|
||||
|
||||
void Qt5InformationNodeInstanceServer::setup3DEditView(const QList<ServerNodeInstance> &instanceList)
|
||||
{
|
||||
ServerNodeInstance root = rootNodeInstance();
|
||||
@@ -279,6 +343,19 @@ void Qt5InformationNodeInstanceServer::setup3DEditView(const QList<ServerNodeIns
|
||||
parentProperty.write(objectToVariant(m_editView3D));
|
||||
QQmlProperty completeSceneProperty(m_editView3D, "showLight", context());
|
||||
completeSceneProperty.write(showCustomLight);
|
||||
|
||||
// Create camera and light gizmos
|
||||
QObjectList cameras;
|
||||
QObjectList lights;
|
||||
findCamerasAndLights(instanceList, cameras, lights);
|
||||
for (auto &obj : qAsConst(cameras)) {
|
||||
QMetaObject::invokeMethod(m_editView3D, "addCameraGizmo",
|
||||
Q_ARG(QVariant, objectToVariant(obj)));
|
||||
}
|
||||
for (auto &obj : qAsConst(lights)) {
|
||||
QMetaObject::invokeMethod(m_editView3D, "addLightGizmo",
|
||||
Q_ARG(QVariant, objectToVariant(obj)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -471,4 +548,21 @@ void Qt5InformationNodeInstanceServer::changeSelection(const ChangeSelectionComm
|
||||
}
|
||||
}
|
||||
|
||||
void Qt5InformationNodeInstanceServer::changePropertyValues(const ChangeValuesCommand &command)
|
||||
{
|
||||
bool hasDynamicProperties = false;
|
||||
const QVector<PropertyValueContainer> values = command.valueChanges();
|
||||
for (const PropertyValueContainer &container : values) {
|
||||
if (!container.isReflected()) {
|
||||
hasDynamicProperties |= container.isDynamic();
|
||||
setInstancePropertyVariant(container);
|
||||
}
|
||||
}
|
||||
|
||||
if (hasDynamicProperties)
|
||||
refreshBindings();
|
||||
|
||||
startRenderTimer();
|
||||
}
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
|
||||
#include "qt5nodeinstanceserver.h"
|
||||
#include "tokencommand.h"
|
||||
#include "valueschangedcommand.h"
|
||||
|
||||
#include <QTimer>
|
||||
#include <QVariant>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
@@ -43,10 +47,12 @@ public:
|
||||
void token(const TokenCommand &command) override;
|
||||
void removeSharedMemory(const RemoveSharedMemoryCommand &command) override;
|
||||
void changeSelection(const ChangeSelectionCommand &command) override;
|
||||
void changePropertyValues(const ChangeValuesCommand &command) override;
|
||||
|
||||
private slots:
|
||||
void objectClicked(const QVariant &object);
|
||||
void handleObjectPositionCommit(const QVariant &object);
|
||||
void handleObjectPositionMove(const QVariant &object);
|
||||
|
||||
protected:
|
||||
void collectItemChangesAndSendChangeCommands() override;
|
||||
@@ -58,17 +64,25 @@ protected:
|
||||
void modifyProperties(const QVector<InstancePropertyValueTriple> &properties);
|
||||
|
||||
private:
|
||||
void handleObjectPositionMoveTimeout();
|
||||
QObject *createEditView3D(QQmlEngine *engine);
|
||||
void setup3DEditView(const QList<ServerNodeInstance> &instanceList);
|
||||
QObject *findRootNodeOf3DViewport(const QList<ServerNodeInstance> &instanceList) const;
|
||||
void findCamerasAndLights( const QList<ServerNodeInstance> &instanceList,
|
||||
QObjectList &cameras, QObjectList &lights) const;
|
||||
QVector<InstancePropertyValueTriple> vectorToPropertyValue(const ServerNodeInstance &instance,
|
||||
const PropertyName &propertyName,
|
||||
const QVariant &variant);
|
||||
void modifyVariantValue(const QVariant &node,
|
||||
const PropertyName &propertyName,
|
||||
ValuesModifiedCommand::TransactionOption option);
|
||||
|
||||
QObject *m_editView3D = nullptr;
|
||||
QSet<ServerNodeInstance> m_parentChangedSet;
|
||||
QList<ServerNodeInstance> m_completedComponentList;
|
||||
QList<TokenCommand> m_tokenList;
|
||||
QTimer m_moveTimer;
|
||||
QVariant m_movedNode;
|
||||
};
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
@@ -129,6 +129,11 @@ bool ServerNodeInstance::isSubclassOf(QObject *object, const QByteArray &superTy
|
||||
return Internal::QmlPrivateGate::isSubclassOf(object, superTypeName);
|
||||
}
|
||||
|
||||
void ServerNodeInstance::setModifiedFlag(bool b)
|
||||
{
|
||||
m_nodeInstance->setModifiedFlag(b);
|
||||
}
|
||||
|
||||
void ServerNodeInstance::setNodeSource(const QString &source)
|
||||
{
|
||||
m_nodeInstance->setNodeSource(source);
|
||||
|
||||
@@ -165,6 +165,8 @@ public:
|
||||
|
||||
static bool isSubclassOf(QObject *object, const QByteArray &superTypeName);
|
||||
|
||||
void setModifiedFlag(bool b);
|
||||
|
||||
private: // functions
|
||||
ServerNodeInstance(const QSharedPointer<Internal::ObjectNodeInstance> &abstractInstance);
|
||||
|
||||
|
||||
@@ -11,7 +11,14 @@
|
||||
<file>mockfiles/Arrow.qml</file>
|
||||
<file>mockfiles/AutoScaleHelper.qml</file>
|
||||
<file>mockfiles/MoveGizmo.qml</file>
|
||||
<file>mockfiles/CameraGizmo.qml</file>
|
||||
<file>mockfiles/LightGizmo.qml</file>
|
||||
<file>mockfiles/IconGizmo.qml</file>
|
||||
<file>mockfiles/Overlay2D.qml</file>
|
||||
<file>mockfiles/meshes/Arrow.mesh</file>
|
||||
<file>mockfiles/meshes/arrow.mesh</file>
|
||||
<file>mockfiles/images/camera-pick-icon.png</file>
|
||||
<file>mockfiles/images/camera-pick-icon@2x.png</file>
|
||||
<file>mockfiles/images/light-pick-icon.png</file>
|
||||
<file>mockfiles/images/light-pick-icon@2x.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -295,6 +295,315 @@ Rectangle {
|
||||
backendValueRightMargin: backendValues.Layout_rightMargin
|
||||
backendValueMargins: backendValues.Layout_margins
|
||||
}
|
||||
|
||||
Section {
|
||||
visible: !anchorBackend.isInLayout
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
caption: qsTr("Align")
|
||||
|
||||
ColumnLayout {
|
||||
width: parent.width
|
||||
enabled: alignDistribute.multiSelection &&
|
||||
!alignDistribute.selectionHasAnchors &&
|
||||
alignDistribute.selectionExclusivlyItems &&
|
||||
!alignDistribute.selectionContainsRootItem
|
||||
|
||||
AlignDistribute {
|
||||
id: alignDistribute
|
||||
modelNodeBackendProperty: modelNodeBackend
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Align objects")
|
||||
width: 120
|
||||
}
|
||||
RowLayout {
|
||||
Row {
|
||||
spacing: -StudioTheme.Values.border
|
||||
AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.alignLeft
|
||||
tooltip: qsTr("Align objects to left edge")
|
||||
onClicked: alignDistribute.alignObjects(AlignDistribute.Left,
|
||||
alignToComboBox.currentEnum,
|
||||
keyObjectComboBox.currentText)
|
||||
}
|
||||
AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.alignCenterHorizontal
|
||||
tooltip: qsTr("Align objects horizontal center")
|
||||
onClicked: alignDistribute.alignObjects(AlignDistribute.CenterH,
|
||||
alignToComboBox.currentEnum,
|
||||
keyObjectComboBox.currentText)
|
||||
}
|
||||
AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.alignRight
|
||||
tooltip: qsTr("Align objects to right edge")
|
||||
onClicked: alignDistribute.alignObjects(AlignDistribute.Right,
|
||||
alignToComboBox.currentEnum,
|
||||
keyObjectComboBox.currentText)
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
spacing: -StudioTheme.Values.border
|
||||
AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.alignTop
|
||||
tooltip: qsTr("Align objects to top edge")
|
||||
onClicked: alignDistribute.alignObjects(AlignDistribute.Top,
|
||||
alignToComboBox.currentEnum,
|
||||
keyObjectComboBox.currentText)
|
||||
}
|
||||
AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.alignCenterVertical
|
||||
tooltip: qsTr("Align objects vertical center")
|
||||
onClicked: alignDistribute.alignObjects(AlignDistribute.CenterV,
|
||||
alignToComboBox.currentEnum,
|
||||
keyObjectComboBox.currentText)
|
||||
}
|
||||
AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.alignBottom
|
||||
tooltip: qsTr("Align objects to bottom edge")
|
||||
onClicked: alignDistribute.alignObjects(AlignDistribute.Bottom,
|
||||
alignToComboBox.currentEnum,
|
||||
keyObjectComboBox.currentText)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Distribute objects")
|
||||
width: 120
|
||||
}
|
||||
RowLayout {
|
||||
Row {
|
||||
spacing: -StudioTheme.Values.border
|
||||
AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.distributeLeft
|
||||
tooltip: qsTr("Distribute objects left edge")
|
||||
onClicked: alignDistribute.distributeObjects(AlignDistribute.Left,
|
||||
alignToComboBox.currentEnum,
|
||||
keyObjectComboBox.currentText)
|
||||
}
|
||||
AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.distributeCenterHorizontal
|
||||
tooltip: qsTr("Distribute objects horizontal center")
|
||||
onClicked: alignDistribute.distributeObjects(AlignDistribute.CenterH,
|
||||
alignToComboBox.currentEnum,
|
||||
keyObjectComboBox.currentText)
|
||||
}
|
||||
AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.distributeRight
|
||||
tooltip: qsTr("Distribute objects right edge")
|
||||
onClicked: alignDistribute.distributeObjects(AlignDistribute.Right,
|
||||
alignToComboBox.currentEnum,
|
||||
keyObjectComboBox.currentText)
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
spacing: -StudioTheme.Values.border
|
||||
AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.distributeTop
|
||||
tooltip: qsTr("Distribute objects top edge")
|
||||
onClicked: alignDistribute.distributeObjects(AlignDistribute.Top,
|
||||
alignToComboBox.currentEnum,
|
||||
keyObjectComboBox.currentText)
|
||||
}
|
||||
AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.distributeCenterVertical
|
||||
tooltip: qsTr("Distribute objects vertical center")
|
||||
onClicked: alignDistribute.distributeObjects(AlignDistribute.CenterV,
|
||||
alignToComboBox.currentEnum,
|
||||
keyObjectComboBox.currentText)
|
||||
}
|
||||
AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.distributeBottom
|
||||
tooltip: qsTr("Distribute objects bottom edge")
|
||||
onClicked: alignDistribute.distributeObjects(AlignDistribute.Bottom,
|
||||
alignToComboBox.currentEnum,
|
||||
keyObjectComboBox.currentText)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Distribute spacing")
|
||||
width: 120
|
||||
}
|
||||
RowLayout {
|
||||
Row {
|
||||
spacing: -StudioTheme.Values.border
|
||||
AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.distributeSpacingHorizontal
|
||||
tooltip: qsTr("Distribute spacing horizontal")
|
||||
onClicked: alignDistribute.distributeSpacing(AlignDistribute.X,
|
||||
alignToComboBox.currentEnum,
|
||||
keyObjectComboBox.currentText,
|
||||
distanceSpinBox.realValue,
|
||||
buttonRow.getDistributeDirection())
|
||||
}
|
||||
AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.distributeSpacingVertical
|
||||
tooltip: qsTr("Distribute spacing vertical")
|
||||
onClicked: alignDistribute.distributeSpacing(AlignDistribute.Y,
|
||||
alignToComboBox.currentEnum,
|
||||
keyObjectComboBox.currentText,
|
||||
distanceSpinBox.realValue,
|
||||
buttonRow.getDistributeDirection())
|
||||
}
|
||||
}
|
||||
|
||||
StudioControls.ButtonRow {
|
||||
id: buttonRow
|
||||
actionIndicatorVisible: false
|
||||
|
||||
StudioControls.ButtonGroup {
|
||||
id: group
|
||||
}
|
||||
|
||||
function getDistributeDirection()
|
||||
{
|
||||
if (buttonLeftToRight.checked)
|
||||
return AlignDistribute.TopLeft
|
||||
else if (buttonCenter.checked)
|
||||
return AlignDistribute.Center
|
||||
else if (buttonRightToLeft.checked)
|
||||
return AlignDistribute.BottomRight
|
||||
else
|
||||
return AlignDistribute.None
|
||||
}
|
||||
|
||||
AbstractButton {
|
||||
id: buttonNone
|
||||
checked: true // default state
|
||||
buttonIcon: StudioTheme.Constants.distributeOriginNone
|
||||
checkable: true
|
||||
StudioControls.ButtonGroup.group: group
|
||||
}
|
||||
AbstractButton {
|
||||
id: buttonLeftToRight
|
||||
buttonIcon: StudioTheme.Constants.distributeOriginTopLeft
|
||||
checkable: true
|
||||
StudioControls.ButtonGroup.group: group
|
||||
}
|
||||
AbstractButton {
|
||||
id: buttonCenter
|
||||
buttonIcon: StudioTheme.Constants.distributeOriginCenter
|
||||
checkable: true
|
||||
StudioControls.ButtonGroup.group: group
|
||||
}
|
||||
AbstractButton {
|
||||
id: buttonRightToLeft
|
||||
buttonIcon: StudioTheme.Constants.distributeOriginBottomRight
|
||||
checkable: true
|
||||
StudioControls.ButtonGroup.group: group
|
||||
}
|
||||
|
||||
StudioControls.RealSpinBox {
|
||||
id: distanceSpinBox
|
||||
width: 64
|
||||
actionIndicatorVisible: false
|
||||
realFrom: -1000
|
||||
realTo: 1000
|
||||
enabled: !buttonNone.checked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SectionLayout {
|
||||
columns: 2
|
||||
|
||||
ItemFilterModel {
|
||||
id: itemFilterModel
|
||||
modelNodeBackendProperty: modelNodeBackend
|
||||
selectionOnly: true
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Align to")
|
||||
}
|
||||
ComboBox {
|
||||
id: alignToComboBox
|
||||
Layout.fillWidth: true
|
||||
property int currentEnum: alignTargets.get(alignToComboBox.currentIndex).value
|
||||
textRole: "text"
|
||||
model: ListModel {
|
||||
id: alignTargets
|
||||
ListElement { text: "Selection"; value: AlignDistribute.Selection }
|
||||
ListElement { text: "Root"; value: AlignDistribute.Root }
|
||||
ListElement { text: "Key object"; value: AlignDistribute.KeyObject }
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Key object")
|
||||
}
|
||||
ComboBox {
|
||||
id: keyObjectComboBox
|
||||
enabled: alignToComboBox.currentIndex === 2
|
||||
model: itemFilterModel.itemModel
|
||||
Layout.fillWidth: true
|
||||
property string lastSelectedItem: ""
|
||||
onCompressedActivated: lastSelectedItem = keyObjectComboBox.currentText
|
||||
onModelChanged: {
|
||||
var idx = model.indexOf(keyObjectComboBox.lastSelectedItem)
|
||||
if (idx !== -1)
|
||||
keyObjectComboBox.currentIndex = idx
|
||||
else
|
||||
lastSelectedItem = "" // TODO
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SectionLayout {
|
||||
columns: 1
|
||||
Layout.topMargin: 30
|
||||
visible: alignDistribute.multiSelection &&
|
||||
(alignDistribute.selectionHasAnchors ||
|
||||
!alignDistribute.selectionExclusivlyItems ||
|
||||
alignDistribute.selectionContainsRootItem)
|
||||
|
||||
Text {
|
||||
id: warningTitle
|
||||
font.family: StudioTheme.Constants.font.family
|
||||
font.pixelSize: StudioTheme.Values.myFontSize
|
||||
font.weight: Font.Bold
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
text: qsTr("Warning")
|
||||
}
|
||||
Text {
|
||||
id: warningRoot
|
||||
visible: alignDistribute.selectionContainsRootItem
|
||||
Layout.fillWidth: true
|
||||
font.family: StudioTheme.Constants.font.family
|
||||
font.pixelSize: StudioTheme.Values.myFontSize
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
wrapMode: Text.WordWrap
|
||||
text: qsTr("- The selection contains the root item.")
|
||||
}
|
||||
Text {
|
||||
id: warningNonVisual
|
||||
visible: !alignDistribute.selectionExclusivlyItems
|
||||
Layout.fillWidth: true
|
||||
font.family: StudioTheme.Constants.font.family
|
||||
font.pixelSize: StudioTheme.Values.myFontSize
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
wrapMode: Text.WordWrap
|
||||
text: qsTr("- The selection contains a non visual item.")
|
||||
}
|
||||
Text {
|
||||
id: warningAnchors
|
||||
visible: alignDistribute.selectionHasAnchors
|
||||
Layout.fillWidth: true
|
||||
font.family: StudioTheme.Constants.font.family
|
||||
font.pixelSize: StudioTheme.Values.myFontSize
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
wrapMode: Text.WordWrap
|
||||
text: qsTr("- An item in the selection uses anchors.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
import QtQuick 2.1
|
||||
import HelperWidgets 2.0
|
||||
import StudioControls 1.0 as StudioControls
|
||||
import StudioTheme 1.0 as StudioTheme
|
||||
import QtQuick.Layouts 1.0
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
|
||||
@@ -145,8 +146,7 @@ RowLayout {
|
||||
}
|
||||
|
||||
StudioControls.AbstractButton {
|
||||
buttonIcon: "..."
|
||||
iconFont: StudioTheme.Constants.font.family
|
||||
buttonIcon: StudioTheme.Constants.addFile
|
||||
iconColor: urlChooser.textColor
|
||||
onClicked: {
|
||||
fileModel.openFileDialog()
|
||||
|
||||
@@ -38,29 +38,50 @@ QtObject {
|
||||
|
||||
readonly property string actionIcon: "\u0021"
|
||||
readonly property string actionIconBinding: "\u0022"
|
||||
readonly property string anchorBaseline: "\u0023"
|
||||
readonly property string anchorBottom: "\u0024"
|
||||
readonly property string anchorFill: "\u0025"
|
||||
readonly property string anchorLeft: "\u0026"
|
||||
readonly property string anchorRight: "\u0027"
|
||||
readonly property string anchorTop: "\u0028"
|
||||
readonly property string centerHorizontal: "\u002A"
|
||||
readonly property string centerVertical: "\u0029"
|
||||
readonly property string closeCross: "\u002B"
|
||||
readonly property string fontStyleBold: "\u002C"
|
||||
readonly property string fontStyleItalic: "\u002D"
|
||||
readonly property string fontStyleStrikethrough: "\u002E"
|
||||
readonly property string fontStyleUnderline: "\u002F"
|
||||
readonly property string textAlignBottom: "\u0030"
|
||||
readonly property string textAlignCenter: "\u0031"
|
||||
readonly property string textAlignLeft: "\u0032"
|
||||
readonly property string textAlignMiddle: "\u0033"
|
||||
readonly property string textAlignRight: "\u0034"
|
||||
readonly property string textAlignTop: "\u0035"
|
||||
readonly property string tickIcon: "\u0036"
|
||||
readonly property string triState: "\u0037"
|
||||
readonly property string upDownIcon: "\u0038"
|
||||
readonly property string upDownSquare2: "\u0039"
|
||||
readonly property string addFile: "\u0023"
|
||||
readonly property string alignBottom: "\u0024"
|
||||
readonly property string alignCenterHorizontal: "\u0025"
|
||||
readonly property string alignCenterVertical: "\u0026"
|
||||
readonly property string alignLeft: "\u0027"
|
||||
readonly property string alignRight: "\u0028"
|
||||
readonly property string alignTo: "\u0029"
|
||||
readonly property string alignTop: "\u002A"
|
||||
readonly property string anchorBaseline: "\u002B"
|
||||
readonly property string anchorBottom: "\u002C"
|
||||
readonly property string anchorFill: "\u002D"
|
||||
readonly property string anchorLeft: "\u002E"
|
||||
readonly property string anchorRight: "\u002F"
|
||||
readonly property string anchorTop: "\u0030"
|
||||
readonly property string centerHorizontal: "\u0031"
|
||||
readonly property string centerVertical: "\u0032"
|
||||
readonly property string closeCross: "\u0033"
|
||||
readonly property string distributeBottom: "\u0034"
|
||||
readonly property string distributeCenterHorizontal: "\u0035"
|
||||
readonly property string distributeCenterVertical: "\u0036"
|
||||
readonly property string distributeLeft: "\u0037"
|
||||
readonly property string distributeOriginBottomRight: "\u0038"
|
||||
readonly property string distributeOriginCenter: "\u0039"
|
||||
readonly property string distributeOriginNone: "\u003A"
|
||||
readonly property string distributeOriginTopLeft: "\u003B"
|
||||
readonly property string distributeRight: "\u003C"
|
||||
readonly property string distributeSpacingHorizontal: "\u003D"
|
||||
readonly property string distributeSpacingVertical: "\u003E"
|
||||
readonly property string distributeTop: "\u003F"
|
||||
readonly property string fontStyleBold: "\u0040"
|
||||
readonly property string fontStyleItalic: "\u0041"
|
||||
readonly property string fontStyleStrikethrough: "\u0042"
|
||||
readonly property string fontStyleUnderline: "\u0043"
|
||||
readonly property string testIcon: "\u0044"
|
||||
readonly property string textAlignBottom: "\u0045"
|
||||
readonly property string textAlignCenter: "\u0046"
|
||||
readonly property string textAlignLeft: "\u0047"
|
||||
readonly property string textAlignMiddle: "\u0048"
|
||||
readonly property string textAlignRight: "\u0049"
|
||||
readonly property string textAlignTop: "\u004A"
|
||||
readonly property string tickIcon: "\u004B"
|
||||
readonly property string triState: "\u004C"
|
||||
readonly property string upDownIcon: "\u004D"
|
||||
readonly property string upDownSquare2: "\u004E"
|
||||
|
||||
readonly property font iconFont: Qt.font({
|
||||
"family": controlIcons.name,
|
||||
|
||||
@@ -12,5 +12,8 @@ add_qtc_library(ExtensionSystem
|
||||
pluginmanager.cpp pluginmanager.h pluginmanager_p.h
|
||||
pluginspec.cpp pluginspec.h pluginspec_p.h
|
||||
pluginview.cpp pluginview.h
|
||||
EXPLICIT_MOC
|
||||
pluginmanager.h
|
||||
pluginmanager_p.h
|
||||
SKIP_AUTOMOC pluginmanager.cpp
|
||||
)
|
||||
|
||||
@@ -338,9 +338,7 @@ bool BuildableHelperLibrary::buildHelper(const BuildHelperArguments &arguments,
|
||||
log->append(QCoreApplication::translate("ProjectExplorer::BuildableHelperLibrary",
|
||||
"Running %1 %2 ...\n")
|
||||
.arg(makeFullPath.toUserOutput(), arguments.makeArguments.join(QLatin1Char(' '))));
|
||||
if (!runBuildProcess(proc, makeFullPath, arguments.makeArguments, 120, false, log, errorMessage))
|
||||
return false;
|
||||
return true;
|
||||
return runBuildProcess(proc, makeFullPath, arguments.makeArguments, 120, false, log, errorMessage);
|
||||
}
|
||||
|
||||
bool BuildableHelperLibrary::getHelperFileInfoFor(const QStringList &validBinaryFilenames,
|
||||
|
||||
@@ -110,6 +110,14 @@ bool DetailsButton::event(QEvent *e)
|
||||
return false;
|
||||
}
|
||||
|
||||
void DetailsButton::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::EnabledChange) {
|
||||
m_checkedPixmap = QPixmap();
|
||||
m_uncheckedPixmap = QPixmap();
|
||||
}
|
||||
}
|
||||
|
||||
void DetailsButton::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
QWidget::paintEvent(e);
|
||||
|
||||
@@ -71,6 +71,7 @@ public:
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *e) override;
|
||||
bool event(QEvent *e) override;
|
||||
void changeEvent(QEvent *e) override;
|
||||
|
||||
private:
|
||||
QPixmap cacheRendering(const QSize &size, bool checked);
|
||||
|
||||
@@ -229,6 +229,16 @@ void DetailsWidget::setUseCheckBox(bool b)
|
||||
d->updateControls();
|
||||
}
|
||||
|
||||
void DetailsWidget::setCheckable(bool b)
|
||||
{
|
||||
d->m_summaryCheckBox->setEnabled(b);
|
||||
}
|
||||
|
||||
void DetailsWidget::setExpandable(bool b)
|
||||
{
|
||||
d->m_detailsButton->setEnabled(b);
|
||||
}
|
||||
|
||||
void DetailsWidget::setChecked(bool b)
|
||||
{
|
||||
d->m_summaryCheckBox->setChecked(b);
|
||||
|
||||
@@ -78,6 +78,8 @@ public:
|
||||
|
||||
bool useCheckBox();
|
||||
void setUseCheckBox(bool b);
|
||||
void setCheckable(bool b);
|
||||
void setExpandable(bool b);
|
||||
void setIcon(const QIcon &icon);
|
||||
|
||||
static QPixmap createBackground(const QSize &size, int topHeight, QWidget *widget);
|
||||
|
||||
@@ -236,16 +236,12 @@ static int cleanupSemanticsScore(const QString &text1, const QString &text2)
|
||||
|
||||
static bool isWhitespace(const QChar &c)
|
||||
{
|
||||
if (c == ' ' || c == '\t')
|
||||
return true;
|
||||
return false;
|
||||
return c == ' ' || c == '\t';
|
||||
}
|
||||
|
||||
static bool isNewLine(const QChar &c)
|
||||
{
|
||||
if (c == '\n')
|
||||
return true;
|
||||
return false;
|
||||
return c == '\n';
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -719,9 +715,7 @@ static bool diffWithWhitespaceExpandedInEqualities(const QList<Diff> &leftInput,
|
||||
return false;
|
||||
*rightOutput = decodeExpandedWhitespace(rightDiffList,
|
||||
commonRightCodeMap, &ok);
|
||||
if (!ok)
|
||||
return false;
|
||||
return true;
|
||||
return ok;
|
||||
}
|
||||
|
||||
static void appendWithEqualitiesSquashed(const QList<Diff> &leftInput,
|
||||
|
||||
@@ -225,17 +225,13 @@ bool JsonSchema::typeMatches(const QString &expected, const QString &actual)
|
||||
|
||||
bool JsonSchema::isCheckableType(const QString &s)
|
||||
{
|
||||
if (s == QLatin1String("string")
|
||||
return s == QLatin1String("string")
|
||||
|| s == QLatin1String("number")
|
||||
|| s == QLatin1String("integer")
|
||||
|| s == QLatin1String("boolean")
|
||||
|| s == QLatin1String("object")
|
||||
|| s == QLatin1String("array")
|
||||
|| s == QLatin1String("null")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|| s == QLatin1String("null");
|
||||
}
|
||||
|
||||
QStringList JsonSchema::validTypes() const
|
||||
|
||||
@@ -102,22 +102,14 @@ QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &title,
|
||||
}
|
||||
|
||||
QTCREATOR_UTILS_EXPORT FileDeletedPromptAnswer
|
||||
fileDeletedPrompt(const QString &fileName, bool triggerExternally, QWidget *parent)
|
||||
fileDeletedPrompt(const QString &fileName, QWidget *parent)
|
||||
{
|
||||
const QString title = QCoreApplication::translate("Utils::fileDeletedPrompt",
|
||||
"File Has Been Removed");
|
||||
QString msg;
|
||||
if (triggerExternally) {
|
||||
msg = QCoreApplication::translate("Utils::fileDeletedPrompt",
|
||||
QString msg = QCoreApplication::translate("Utils::fileDeletedPrompt",
|
||||
"The file %1 has been removed from disk. "
|
||||
"Do you want to save it under a different name, or close "
|
||||
"the editor?").arg(QDir::toNativeSeparators(fileName));
|
||||
} else {
|
||||
msg = QCoreApplication::translate("Utils::fileDeletedPrompt",
|
||||
"The file %1 has been removed from disk. "
|
||||
"Do you want to save it under a different name, or close "
|
||||
"the editor?").arg(QDir::toNativeSeparators(fileName));
|
||||
}
|
||||
QMessageBox box(QMessageBox::Question, title, msg, QMessageBox::NoButton, parent);
|
||||
QPushButton *close =
|
||||
box.addButton(QCoreApplication::translate("Utils::fileDeletedPrompt", "&Close"),
|
||||
|
||||
@@ -62,7 +62,6 @@ enum FileDeletedPromptAnswer {
|
||||
};
|
||||
|
||||
QTCREATOR_UTILS_EXPORT FileDeletedPromptAnswer fileDeletedPrompt(const QString &fileName,
|
||||
bool triggerExternally,
|
||||
QWidget *parent);
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
@@ -80,7 +80,7 @@ void QdbMessageTracker::handleWatchMessage(const QJsonDocument &document)
|
||||
}
|
||||
|
||||
m_messageCache.append(message);
|
||||
showMessage(tr("Qdb message: %1").arg(message), true);
|
||||
showMessage(tr("QDB message: %1").arg(message), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ void QdbWatcher::handleWatchError(QLocalSocket::LocalSocketError error)
|
||||
|
||||
if (m_retried) {
|
||||
stop();
|
||||
emit watcherError(tr("Could not connect to QDB host server even after trying to start it"));
|
||||
emit watcherError(tr("Could not connect to QDB host server even after trying to start it."));
|
||||
return;
|
||||
}
|
||||
retry();
|
||||
@@ -142,7 +142,7 @@ void QdbWatcher::forkHostServer()
|
||||
return;
|
||||
}
|
||||
if (QProcess::startDetached(qdbFilePath.toString(), {"server"}))
|
||||
showMessage(tr("QDB host server started"), false);
|
||||
showMessage(tr("QDB host server started."), false);
|
||||
else
|
||||
showMessage(tr("Could not start QDB host server in %1").arg(qdbFilePath.toString()), true);
|
||||
}
|
||||
@@ -153,7 +153,7 @@ void QdbWatcher::retry()
|
||||
{
|
||||
QMutexLocker lock(&s_startMutex);
|
||||
if (!s_startedServer) {
|
||||
showMessage(tr("Starting QDB host server"), false);
|
||||
showMessage(tr("Starting QDB host server."), false);
|
||||
forkHostServer();
|
||||
s_startedServer = true;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
Runnable r;
|
||||
r.setCommandLine(command);
|
||||
m_appRunner.start(r, device);
|
||||
showMessage(QdbDevice::tr("Starting command '%1' on device '%2'.")
|
||||
showMessage(QdbDevice::tr("Starting command \"%1\" on device \"%2\".")
|
||||
.arg(command.toUserOutput(), m_deviceName));
|
||||
}
|
||||
|
||||
@@ -112,18 +112,18 @@ private:
|
||||
if (!success) {
|
||||
QString errorString;
|
||||
if (!m_error.isEmpty()) {
|
||||
errorString = QdbDevice::tr("Command failed on device '%1': %2")
|
||||
errorString = QdbDevice::tr("Command failed on device \"%1\": %2")
|
||||
.arg(m_deviceName, m_error);
|
||||
} else {
|
||||
errorString = QdbDevice::tr("Command failed on device '%1'.").arg(m_deviceName);
|
||||
errorString = QdbDevice::tr("Command failed on device \"%1\".").arg(m_deviceName);
|
||||
}
|
||||
showMessage(errorString, true);
|
||||
if (!m_stdout.isEmpty())
|
||||
showMessage(QdbDevice::tr("stdout was: '%1'").arg(m_stdout));
|
||||
showMessage(QdbDevice::tr("stdout was: \"%1\"").arg(m_stdout));
|
||||
if (!m_stderr.isEmpty())
|
||||
showMessage(QdbDevice::tr("stderr was: '%1'").arg(m_stderr));
|
||||
showMessage(QdbDevice::tr("stderr was: \"%1\"").arg(m_stderr));
|
||||
} else {
|
||||
showMessage(QdbDevice::tr("Commands on device '%1' finished successfully.")
|
||||
showMessage(QdbDevice::tr("Commands on device \"%1\" finished successfully.")
|
||||
.arg(m_deviceName));
|
||||
}
|
||||
deleteLater();
|
||||
|
||||
@@ -77,7 +77,7 @@ void QdbMakeDefaultAppService::handleProcessFinished(const QString &error)
|
||||
QByteArray processOutput = d->processRunner->readAllStandardOutput();
|
||||
|
||||
if (d->makeDefault)
|
||||
emit progressMessage(tr("Application made as the default one."));
|
||||
emit progressMessage(tr("Application set as the default one."));
|
||||
else
|
||||
emit progressMessage(tr("Reset the default application."));
|
||||
|
||||
|
||||
@@ -495,12 +495,13 @@ void ClangTool::startTool(ClangTool::FileSelection fileSelection,
|
||||
});
|
||||
|
||||
m_perspective.select();
|
||||
|
||||
m_diagnosticModel->clear();
|
||||
|
||||
setToolBusy(true);
|
||||
m_diagnosticFilterModel->setProject(project);
|
||||
m_applyFixitsButton->setEnabled(false);
|
||||
m_running = true;
|
||||
|
||||
setToolBusy(true);
|
||||
handleStateUpdate();
|
||||
updateRunActions();
|
||||
|
||||
|
||||
@@ -227,6 +227,7 @@ ClangToolRunWorker::ClangToolRunWorker(RunControl *runControl,
|
||||
const FileInfos &fileInfos,
|
||||
bool preventBuild)
|
||||
: RunWorker(runControl)
|
||||
, m_runSettings(runSettings)
|
||||
, m_diagnosticConfig(diagnosticConfig)
|
||||
, m_fileInfos(fileInfos)
|
||||
, m_temporaryDir("clangtools-XXXXXX")
|
||||
@@ -305,7 +306,7 @@ void ClangToolRunWorker::start()
|
||||
// Create log dir
|
||||
if (!m_temporaryDir.isValid()) {
|
||||
const QString errorMessage
|
||||
= tr("%1: Failed to create temporary dir, stop.").arg(toolName);
|
||||
= tr("%1: Failed to create temporary directory. Stopped.").arg(toolName);
|
||||
appendMessage(errorMessage, Utils::ErrorMessageFormat);
|
||||
TaskHub::addTask(Task::Error, errorMessage, Debugger::Constants::ANALYZERTASK_ID);
|
||||
TaskHub::requestPopup();
|
||||
@@ -390,7 +391,7 @@ void ClangToolRunWorker::analyzeNextFile()
|
||||
|
||||
const QString executable = runner->executable();
|
||||
if (!isFileExecutable(executable)) {
|
||||
const QString errorMessage = tr("%1: Invalid executable \"%2\", stop.")
|
||||
const QString errorMessage = tr("%1: Invalid executable \"%2\". Stopped.")
|
||||
.arg(runner->name(), executable);
|
||||
TaskHub::addTask(Task::Error, errorMessage, Debugger::Constants::ANALYZERTASK_ID);
|
||||
TaskHub::requestPopup();
|
||||
|
||||
@@ -101,10 +101,10 @@ QDebug operator<<(QDebug debug, const Diagnostic &d)
|
||||
|
||||
void ClangToolsDiagnosticModel::addDiagnostics(const Diagnostics &diagnostics)
|
||||
{
|
||||
const auto onFixitStatusChanged = [this](FixitStatus newStatus) {
|
||||
const auto onFixitStatusChanged = [this](FixitStatus oldStatus, FixitStatus newStatus) {
|
||||
if (newStatus == FixitStatus::Scheduled)
|
||||
++m_fixItsToApplyCount;
|
||||
else
|
||||
else if (oldStatus == FixitStatus::Scheduled)
|
||||
--m_fixItsToApplyCount;
|
||||
emit fixItsToApplyCountChanged(m_fixItsToApplyCount);
|
||||
};
|
||||
@@ -463,7 +463,7 @@ void DiagnosticItem::setFixItStatus(const FixitStatus &status)
|
||||
m_fixitStatus = status;
|
||||
update();
|
||||
if (m_onFixitStatusChanged && status != oldStatus)
|
||||
m_onFixitStatusChanged(status);
|
||||
m_onFixitStatusChanged(oldStatus, status);
|
||||
}
|
||||
|
||||
void DiagnosticItem::setFixitOperations(const ReplacementOperations &replacements)
|
||||
|
||||
@@ -71,8 +71,9 @@ private:
|
||||
class DiagnosticItem : public Utils::TreeItem
|
||||
{
|
||||
public:
|
||||
using OnFixitStatusChanged = std::function<void(FixitStatus newStatus)>;
|
||||
DiagnosticItem(const Diagnostic &diag, const OnFixitStatusChanged &onFixitStatusChanged,
|
||||
using OnFixitStatusChanged = std::function<void(FixitStatus oldStatus, FixitStatus newStatus)>;
|
||||
DiagnosticItem(const Diagnostic &diag,
|
||||
const OnFixitStatusChanged &onFixitStatusChanged,
|
||||
ClangToolsDiagnosticModel *parent);
|
||||
~DiagnosticItem() override;
|
||||
|
||||
|
||||
@@ -283,7 +283,7 @@ bool DiagnosticView::eventFilter(QObject *watched, QEvent *event)
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return QObject::eventFilter(watched, event);
|
||||
return QAbstractItemView::eventFilter(watched, event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ void ClangToolsProjectSettings::load()
|
||||
// Load map
|
||||
QVariantMap map = m_project->namedSettings(SETTINGS_KEY_MAIN).toMap();
|
||||
|
||||
bool write;
|
||||
bool write = false;
|
||||
if (map.isEmpty()) {
|
||||
if (!m_project->namedSettings(SETTINGS_KEY_SELECTED_DIRS).isNull()) {
|
||||
map = convertToMapFromVersionBefore410(m_project);
|
||||
|
||||
@@ -333,11 +333,7 @@ bool ParserTreeItem::canFetchMore(QStandardItem *item) const
|
||||
|
||||
int storedChildren = item->rowCount();
|
||||
int internalChildren = d->symbolInformations.count();
|
||||
|
||||
if (storedChildren < internalChildren)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return storedChildren < internalChildren;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -45,10 +45,7 @@ bool CMakeAutoCompleter::isInComment(const QTextCursor &cursor) const
|
||||
// NOTE: This doesn't handle '#' inside quotes, nor multi-line comments
|
||||
QTextCursor moved = cursor;
|
||||
moved.movePosition(QTextCursor::StartOfLine, QTextCursor::KeepAnchor);
|
||||
if (moved.selectedText().contains(QLatin1Char('#')))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
return moved.selectedText().contains(QLatin1Char('#'));
|
||||
}
|
||||
|
||||
bool CMakeAutoCompleter::isInString(const QTextCursor &cursor) const
|
||||
|
||||
@@ -151,7 +151,6 @@ void CMakeBuildSystem::handleTreeScanningFinished()
|
||||
qDeleteAll(m_allFiles);
|
||||
m_allFiles = Utils::transform(m_treeScanner.release(), [](const FileNode *fn) { return fn; });
|
||||
|
||||
m_combinedScanAndParseResult = m_combinedScanAndParseResult && true;
|
||||
m_waitingForScan = false;
|
||||
|
||||
combineScanAndParse();
|
||||
@@ -165,7 +164,6 @@ void CMakeBuildSystem::handleParsingSuccess(CMakeBuildConfiguration *bc)
|
||||
QTC_ASSERT(m_waitingForParse, return );
|
||||
|
||||
m_waitingForParse = false;
|
||||
m_combinedScanAndParseResult = m_combinedScanAndParseResult && true;
|
||||
|
||||
combineScanAndParse();
|
||||
}
|
||||
|
||||
@@ -215,12 +215,12 @@ void CMakeProcess::handleProcessFinished(int code, QProcess::ExitStatus status)
|
||||
QString msg;
|
||||
if (status != QProcess::NormalExit) {
|
||||
if (m_processWasCanceled) {
|
||||
msg = tr("*** cmake process was canceled by the user.");
|
||||
msg = tr("CMake process was canceled by the user.");
|
||||
} else {
|
||||
msg = tr("*** cmake process crashed.");
|
||||
msg = tr("CMake process crashed.");
|
||||
}
|
||||
} else if (code != 0) {
|
||||
msg = tr("*** cmake process exited with exit code %1.").arg(code);
|
||||
msg = tr("CMake process exited with exit code %1.").arg(code);
|
||||
}
|
||||
|
||||
if (!msg.isEmpty()) {
|
||||
|
||||
@@ -88,7 +88,7 @@ void noAutoAdditionNotify(const QStringList &filePaths, const ProjectExplorer::P
|
||||
"\nCopy the path to the source files to the clipboard?"),
|
||||
"Remember My Choice", &checkValue, QDialogButtonBox::Yes | QDialogButtonBox::No,
|
||||
QDialogButtonBox::Yes);
|
||||
if (true == checkValue) {
|
||||
if (checkValue) {
|
||||
if (QDialogButtonBox::Yes == reply)
|
||||
settings->setAfterAddFileSetting(AfterAddFileAction::COPY_FILE_PATH);
|
||||
else if (QDialogButtonBox::No == reply)
|
||||
|
||||
@@ -57,7 +57,7 @@ static void reportFileApiSetupFailure()
|
||||
{
|
||||
Core::MessageManager::write(QCoreApplication::translate(
|
||||
"CMakeProjectManager::Internal",
|
||||
"Failed to set up cmake fileapi support. Creator can not extract project information."));
|
||||
"Failed to set up CMake file API support. Qt Creator can not extract project information."));
|
||||
}
|
||||
|
||||
static std::pair<int, int> cmakeVersion(const QJsonObject &obj)
|
||||
@@ -112,7 +112,7 @@ static ReplyFileContents readReplyFile(const QFileInfo &fi, QString &errorMessag
|
||||
{
|
||||
const QJsonDocument document = readJsonFile(fi.filePath());
|
||||
static const QString msg = QCoreApplication::translate("CMakeProjectManager::Internal",
|
||||
"Invalid reply file created by cmake.");
|
||||
"Invalid reply file created by CMake.");
|
||||
|
||||
ReplyFileContents result;
|
||||
if (document.isNull() || document.isEmpty() || !document.isObject()) {
|
||||
@@ -175,7 +175,7 @@ static CMakeConfig readCacheFile(const QString &cacheFile, QString &errorMessage
|
||||
|
||||
if (!checkJsonObject(root, "cache", 2)) {
|
||||
errorMessage = QCoreApplication::translate("CMakeProjectManager::Internal",
|
||||
"Invalid cache file generated by cmake.");
|
||||
"Invalid cache file generated by CMake.");
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ std::vector<CMakeFileInfo> readCMakeFilesFile(const QString &cmakeFilesFile, QSt
|
||||
|
||||
if (!checkJsonObject(root, "cmakeFiles", 1)) {
|
||||
errorMessage = QCoreApplication::translate("CMakeProjectManager::Internal",
|
||||
"Invalid cmakeFiles file generated by cmake.");
|
||||
"Invalid cmakeFiles file generated by CMake.");
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ std::vector<Directory> extractDirectories(const QJsonArray &directories, QString
|
||||
if (directories.isEmpty()) {
|
||||
errorMessage = QCoreApplication::translate(
|
||||
"CMakeProjectManager::Internal",
|
||||
"Invalid codemodel file generated by cmake: No directories.");
|
||||
"Invalid codemodel file generated by CMake: No directories.");
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ std::vector<Directory> extractDirectories(const QJsonArray &directories, QString
|
||||
if (obj.isEmpty()) {
|
||||
errorMessage = QCoreApplication::translate(
|
||||
"CMakeProjectManager::Internal",
|
||||
"Invalid codemodel file generated by cmake: Empty directory object.");
|
||||
"Invalid codemodel file generated by CMake: Empty directory object.");
|
||||
continue;
|
||||
}
|
||||
Directory dir;
|
||||
@@ -284,7 +284,7 @@ static std::vector<Project> extractProjects(const QJsonArray &projects, QString
|
||||
if (projects.isEmpty()) {
|
||||
errorMessage = QCoreApplication::translate(
|
||||
"CMakeProjectManager::Internal",
|
||||
"Invalid codemodel file generated by cmake: No projects.");
|
||||
"Invalid codemodel file generated by CMake: No projects.");
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ static std::vector<Project> extractProjects(const QJsonArray &projects, QString
|
||||
if (obj.isEmpty()) {
|
||||
errorMessage = QCoreApplication::translate(
|
||||
"CMakeProjectManager::Internal",
|
||||
"Invalid codemodel file generated by cmake: Empty project object.");
|
||||
"Invalid codemodel file generated by CMake: Empty project object.");
|
||||
continue;
|
||||
}
|
||||
Project project;
|
||||
@@ -309,7 +309,7 @@ static std::vector<Project> extractProjects(const QJsonArray &projects, QString
|
||||
if (project.name.isEmpty() || project.directories.empty()) {
|
||||
errorMessage = QCoreApplication::translate(
|
||||
"CMakeProjectManager::Internal",
|
||||
"Invalid codemodel file generated by cmake: Broken project data.");
|
||||
"Invalid codemodel file generated by CMake: Broken project data.");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ static std::vector<Target> extractTargets(const QJsonArray &targets, QString &er
|
||||
if (targets.isEmpty()) {
|
||||
errorMessage
|
||||
= QCoreApplication::translate("CMakeProjectManager::Internal",
|
||||
"Invalid codemodel file generated by cmake: No targets.");
|
||||
"Invalid codemodel file generated by CMake: No targets.");
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -333,7 +333,7 @@ static std::vector<Target> extractTargets(const QJsonArray &targets, QString &er
|
||||
if (obj.isEmpty()) {
|
||||
errorMessage = QCoreApplication::translate(
|
||||
"CMakeProjectManager::Internal",
|
||||
"Invalid codemodel file generated by cmake: Empty target object.");
|
||||
"Invalid codemodel file generated by CMake: Empty target object.");
|
||||
continue;
|
||||
}
|
||||
Target target;
|
||||
@@ -347,7 +347,7 @@ static std::vector<Target> extractTargets(const QJsonArray &targets, QString &er
|
||||
|| target.directory == -1 || target.project == -1) {
|
||||
errorMessage = QCoreApplication::translate(
|
||||
"CMakeProjectManager::Internal",
|
||||
"Invalid codemodel file generated by cmake: Broken target data.");
|
||||
"Invalid codemodel file generated by CMake: Broken target data.");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ static std::vector<Configuration> extractConfigurations(const QJsonArray &config
|
||||
if (configs.isEmpty()) {
|
||||
errorMessage = QCoreApplication::translate(
|
||||
"CMakeProjectManager::Internal",
|
||||
"Invalid codemodel file generated by cmake: No configurations.");
|
||||
"Invalid codemodel file generated by CMake: No configurations.");
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ static std::vector<Configuration> extractConfigurations(const QJsonArray &config
|
||||
if (obj.isEmpty()) {
|
||||
errorMessage = QCoreApplication::translate(
|
||||
"CMakeProjectManager::Internal",
|
||||
"Invalid codemodel file generated by cmake: Empty configuration object.");
|
||||
"Invalid codemodel file generated by CMake: Empty configuration object.");
|
||||
continue;
|
||||
}
|
||||
Configuration config;
|
||||
@@ -471,8 +471,8 @@ static std::vector<Configuration> extractConfigurations(const QJsonArray &config
|
||||
if (!validateIndexes(config)) {
|
||||
errorMessage
|
||||
= QCoreApplication::translate("CMakeProjectManager::Internal",
|
||||
"Invalid codemodel file generated by cmake: Broken "
|
||||
"indexes in directories/projects/targets.");
|
||||
"Invalid codemodel file generated by CMake: Broken "
|
||||
"indexes in directories, projects, or targets.");
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -489,7 +489,7 @@ static std::vector<Configuration> readCodemodelFile(const QString &codemodelFile
|
||||
|
||||
if (!checkJsonObject(root, "codemodel", 2)) {
|
||||
errorMessage = QCoreApplication::translate("CMakeProjectManager::Internal",
|
||||
"Invalid codemodel file generated by cmake.");
|
||||
"Invalid codemodel file generated by CMake.");
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -787,7 +787,7 @@ TargetDetails readTargetFile(const QString &targetFile, QString &errorMessage)
|
||||
if (errorMessage.isEmpty() && !validateTargetDetails(result)) {
|
||||
errorMessage = QCoreApplication::translate(
|
||||
"CMakeProjectManager::Internal",
|
||||
"Invalid target file generated by cmake: Broken indexes in target details.");
|
||||
"Invalid target file generated by CMake: Broken indexes in target details.");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <projectexplorer/headerpath.h>
|
||||
#include <projectexplorer/projectmacro.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/optional.h>
|
||||
|
||||
@@ -155,14 +156,16 @@ void filteredFlags(const QString &fileName,
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((flag.startsWith("-I") || flag.startsWith("-isystem") || flag.startsWith("/I"))
|
||||
&& flag != "-I" && flag != "-isystem" && flag != "/I") {
|
||||
bool userInclude = flag.startsWith("-I");
|
||||
const QString pathStr = updatedPathFlag(flag.mid(userInclude ? 2 : 8),
|
||||
workingDir);
|
||||
headerPaths.append({pathStr, userInclude
|
||||
? HeaderPathType::User
|
||||
: HeaderPathType::System});
|
||||
const QStringList userIncludeFlags{"-I", "/I"};
|
||||
const QStringList systemIncludeFlags{"-isystem", "-imsvc", "/imsvc"};
|
||||
const QStringList allIncludeFlags = QStringList(userIncludeFlags) << systemIncludeFlags;
|
||||
const QString includeOpt = Utils::findOrDefault(allIncludeFlags, [flag](const QString &opt) {
|
||||
return flag.startsWith(opt) && flag != opt;
|
||||
});
|
||||
if (!includeOpt.isEmpty()) {
|
||||
const QString pathStr = updatedPathFlag(flag.mid(includeOpt.length()), workingDir);
|
||||
headerPaths.append({pathStr, userIncludeFlags.contains(includeOpt)
|
||||
? HeaderPathType::User : HeaderPathType::System});
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -174,8 +177,12 @@ void filteredFlags(const QString &fileName,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (flag == "-I" || flag == "-isystem" || flag == "/I") {
|
||||
includePathType = (flag != "-isystem") ? HeaderPathType::User : HeaderPathType::System;
|
||||
if (userIncludeFlags.contains(flag)) {
|
||||
includePathType = HeaderPathType::User;
|
||||
continue;
|
||||
}
|
||||
if (systemIncludeFlags.contains(flag)) {
|
||||
includePathType = HeaderPathType::System;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -1199,7 +1199,6 @@ void DocumentManager::checkForReload()
|
||||
if (previousDeletedAnswer != FileDeletedCloseAll) {
|
||||
previousDeletedAnswer =
|
||||
fileDeletedPrompt(document->filePath().toString(),
|
||||
trigger == IDocument::TriggerExternal,
|
||||
ICore::dialogParent());
|
||||
}
|
||||
switch (previousDeletedAnswer) {
|
||||
|
||||
@@ -2427,9 +2427,7 @@ IEditor *EditorManager::currentEditor()
|
||||
bool EditorManager::closeAllEditors(bool askAboutModifiedEditors)
|
||||
{
|
||||
DocumentModelPrivate::removeAllSuspendedEntries();
|
||||
if (closeDocuments(DocumentModel::openedDocuments(), askAboutModifiedEditors))
|
||||
return true;
|
||||
return false;
|
||||
return closeDocuments(DocumentModel::openedDocuments(), askAboutModifiedEditors);
|
||||
}
|
||||
|
||||
void EditorManager::closeOtherDocuments(IDocument *document)
|
||||
|
||||
@@ -131,6 +131,7 @@ MainWindow::MainWindow()
|
||||
QCoreApplication::setApplicationName(QLatin1String(Constants::IDE_CASED_ID));
|
||||
QCoreApplication::setApplicationVersion(QLatin1String(Constants::IDE_VERSION_LONG));
|
||||
QCoreApplication::setOrganizationName(QLatin1String(Constants::IDE_SETTINGSVARIANT_STR));
|
||||
QGuiApplication::setApplicationDisplayName(QLatin1String(Constants::IDE_DISPLAY_NAME));
|
||||
QString baseName = QApplication::style()->objectName();
|
||||
// Sometimes we get the standard windows 95 style as a fallback
|
||||
if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost()
|
||||
|
||||
@@ -273,10 +273,7 @@ void ManhattanStyle::polish(QWidget *widget)
|
||||
widget->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, true);
|
||||
if (qobject_cast<QToolButton*>(widget)) {
|
||||
widget->setAttribute(Qt::WA_Hover);
|
||||
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2);
|
||||
} else if (qobject_cast<QLineEdit*>(widget)) {
|
||||
if (qobject_cast<QToolButton*>(widget) || qobject_cast<QLineEdit*>(widget)) {
|
||||
widget->setAttribute(Qt::WA_Hover);
|
||||
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2);
|
||||
} else if (qobject_cast<QLabel*>(widget)) {
|
||||
@@ -303,13 +300,12 @@ void ManhattanStyle::unpolish(QWidget *widget)
|
||||
QProxyStyle::unpolish(widget);
|
||||
if (panelWidget(widget)) {
|
||||
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, false);
|
||||
if (qobject_cast<QTabBar*>(widget))
|
||||
widget->setAttribute(Qt::WA_Hover, false);
|
||||
else if (qobject_cast<QToolBar*>(widget))
|
||||
widget->setAttribute(Qt::WA_Hover, false);
|
||||
else if (qobject_cast<QComboBox*>(widget))
|
||||
if (qobject_cast<QTabBar*>(widget)
|
||||
|| qobject_cast<QToolBar*>(widget)
|
||||
|| qobject_cast<QComboBox*>(widget)) {
|
||||
widget->setAttribute(Qt::WA_Hover, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ManhattanStyle::polish(QPalette &pal)
|
||||
|
||||
@@ -88,10 +88,7 @@ bool isPreviousLineCppStyleComment(const QTextCursor &cursor)
|
||||
return false;
|
||||
|
||||
const QString text = actual.text().trimmed();
|
||||
if (text.startsWith(QLatin1String("///")) || text.startsWith(QLatin1String("//!")))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return text.startsWith(QLatin1String("///")) || text.startsWith(QLatin1String("//!"));
|
||||
}
|
||||
|
||||
/// Check if next line is a CppStyle Doxygen Comment
|
||||
@@ -106,10 +103,7 @@ bool isNextLineCppStyleComment(const QTextCursor &cursor)
|
||||
return false;
|
||||
|
||||
const QString text = actual.text().trimmed();
|
||||
if (text.startsWith(QLatin1String("///")) || text.startsWith(QLatin1String("//!")))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return text.startsWith(QLatin1String("///")) || text.startsWith(QLatin1String("//!"));
|
||||
}
|
||||
|
||||
bool isCppStyleContinuation(const QTextCursor& cursor)
|
||||
|
||||
@@ -442,9 +442,7 @@ static bool canReplaceSpecifier(TranslationUnit *translationUnit, SpecifierAST *
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (specifier->asAttributeSpecifier())
|
||||
return false;
|
||||
return true;
|
||||
return !specifier->asAttributeSpecifier();
|
||||
}
|
||||
|
||||
static SpecifierAST *findFirstReplaceableSpecifier(TranslationUnit *translationUnit, SpecifierListAST *list)
|
||||
|
||||