Merge remote-tracking branch 'origin/7.0'
Conflicts: src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.cpp Change-Id: Icda34067bb89d066a3e7eb47f8cca1d62dc3ae0d
@@ -83,6 +83,10 @@ foreach(tool qmake lrelease lupdate moc rcc qhelpgenerator)
|
|||||||
if (TARGET Qt6::${tool} AND NOT TARGET Qt5::${tool})
|
if (TARGET Qt6::${tool} AND NOT TARGET Qt5::${tool})
|
||||||
add_executable(Qt5::${tool} IMPORTED GLOBAL)
|
add_executable(Qt5::${tool} IMPORTED GLOBAL)
|
||||||
get_target_property(imported_location Qt6::${tool} IMPORTED_LOCATION)
|
get_target_property(imported_location Qt6::${tool} IMPORTED_LOCATION)
|
||||||
|
# handle separate tools for each configuration
|
||||||
|
if (NOT imported_location)
|
||||||
|
get_target_property(imported_location Qt6::${tool} IMPORTED_LOCATION_RELEASE)
|
||||||
|
endif()
|
||||||
set_target_properties(Qt5::${tool} PROPERTIES IMPORTED_LOCATION "${imported_location}")
|
set_target_properties(Qt5::${tool} PROPERTIES IMPORTED_LOCATION "${imported_location}")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
@@ -228,8 +228,8 @@ function(add_qtc_library name)
|
|||||||
CXX_EXTENSIONS OFF
|
CXX_EXTENSIONS OFF
|
||||||
CXX_VISIBILITY_PRESET hidden
|
CXX_VISIBILITY_PRESET hidden
|
||||||
VISIBILITY_INLINES_HIDDEN ON
|
VISIBILITY_INLINES_HIDDEN ON
|
||||||
BUILD_RPATH "${_LIB_RPATH}"
|
BUILD_RPATH "${_LIB_RPATH};${CMAKE_BUILD_RPATH}"
|
||||||
INSTALL_RPATH "${_LIB_RPATH}"
|
INSTALL_RPATH "${_LIB_RPATH};${CMAKE_INSTALL_RPATH}"
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${_output_binary_dir}/${_DESTINATION}"
|
RUNTIME_OUTPUT_DIRECTORY "${_output_binary_dir}/${_DESTINATION}"
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${_output_binary_dir}/${IDE_LIBRARY_PATH}"
|
LIBRARY_OUTPUT_DIRECTORY "${_output_binary_dir}/${IDE_LIBRARY_PATH}"
|
||||||
ARCHIVE_OUTPUT_DIRECTORY "${_output_binary_dir}/${IDE_LIBRARY_ARCHIVE_PATH}"
|
ARCHIVE_OUTPUT_DIRECTORY "${_output_binary_dir}/${IDE_LIBRARY_ARCHIVE_PATH}"
|
||||||
@@ -478,8 +478,8 @@ function(add_qtc_plugin target_name)
|
|||||||
VISIBILITY_INLINES_HIDDEN ON
|
VISIBILITY_INLINES_HIDDEN ON
|
||||||
_arg_DEPENDS "${_arg_PLUGIN_DEPENDS}"
|
_arg_DEPENDS "${_arg_PLUGIN_DEPENDS}"
|
||||||
_arg_VERSION "${_arg_VERSION}"
|
_arg_VERSION "${_arg_VERSION}"
|
||||||
BUILD_RPATH "${_PLUGIN_RPATH}"
|
BUILD_RPATH "${_PLUGIN_RPATH};${CMAKE_BUILD_RPATH}"
|
||||||
INSTALL_RPATH "${_PLUGIN_RPATH}"
|
INSTALL_RPATH "${_PLUGIN_RPATH};${CMAKE_INSTALL_RPATH}"
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${_output_binary_dir}/${plugin_dir}"
|
LIBRARY_OUTPUT_DIRECTORY "${_output_binary_dir}/${plugin_dir}"
|
||||||
ARCHIVE_OUTPUT_DIRECTORY "${_output_binary_dir}/${plugin_dir}"
|
ARCHIVE_OUTPUT_DIRECTORY "${_output_binary_dir}/${plugin_dir}"
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${_output_binary_dir}/${plugin_dir}"
|
RUNTIME_OUTPUT_DIRECTORY "${_output_binary_dir}/${plugin_dir}"
|
||||||
@@ -654,6 +654,8 @@ function(add_qtc_executable name)
|
|||||||
file(RELATIVE_PATH relative_plugins_path "/${_EXECUTABLE_PATH}" "/${IDE_PLUGIN_PATH}")
|
file(RELATIVE_PATH relative_plugins_path "/${_EXECUTABLE_PATH}" "/${IDE_PLUGIN_PATH}")
|
||||||
set(install_rpath "${install_rpath};${_RPATH_BASE}/${relative_qt_path};${_RPATH_BASE}/${relative_plugins_path}")
|
set(install_rpath "${install_rpath};${_RPATH_BASE}/${relative_qt_path};${_RPATH_BASE}/${relative_plugins_path}")
|
||||||
endif()
|
endif()
|
||||||
|
set(build_rpath "${build_rpath};${CMAKE_BUILD_RPATH}")
|
||||||
|
set(install_rpath "${install_rpath};${CMAKE_INSTALL_RPATH}")
|
||||||
|
|
||||||
qtc_output_binary_dir(_output_binary_dir)
|
qtc_output_binary_dir(_output_binary_dir)
|
||||||
set_target_properties("${name}" PROPERTIES
|
set_target_properties("${name}" PROPERTIES
|
||||||
@@ -811,8 +813,8 @@ function(add_qtc_test name)
|
|||||||
LINK_DEPENDS_NO_SHARED ON
|
LINK_DEPENDS_NO_SHARED ON
|
||||||
CXX_VISIBILITY_PRESET hidden
|
CXX_VISIBILITY_PRESET hidden
|
||||||
VISIBILITY_INLINES_HIDDEN ON
|
VISIBILITY_INLINES_HIDDEN ON
|
||||||
BUILD_RPATH "${_RPATH_BASE}/${_RPATH}"
|
BUILD_RPATH "${_RPATH_BASE}/${_RPATH};${CMAKE_BUILD_RPATH}"
|
||||||
INSTALL_RPATH "${_RPATH_BASE}/${_RPATH}"
|
INSTALL_RPATH "${_RPATH_BASE}/${_RPATH};${CMAKE_INSTALL_RPATH}"
|
||||||
)
|
)
|
||||||
if (NOT _arg_SKIP_PCH)
|
if (NOT _arg_SKIP_PCH)
|
||||||
enable_pch(${name})
|
enable_pch(${name})
|
||||||
|
@@ -80,7 +80,7 @@ else ()
|
|||||||
set(_IDE_LIBRARY_ARCHIVE_PATH "${_IDE_LIBRARY_PATH}")
|
set(_IDE_LIBRARY_ARCHIVE_PATH "${_IDE_LIBRARY_PATH}")
|
||||||
|
|
||||||
set(_IDE_HEADER_INSTALL_PATH "include/qtcreator")
|
set(_IDE_HEADER_INSTALL_PATH "include/qtcreator")
|
||||||
set(_IDE_CMAKE_INSTALL_PATH "lib/cmake")
|
set(_IDE_CMAKE_INSTALL_PATH "${_IDE_LIBRARY_BASE_PATH}/cmake")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
file(RELATIVE_PATH _PLUGIN_TO_LIB "/${_IDE_PLUGIN_PATH}" "/${_IDE_LIBRARY_PATH}")
|
file(RELATIVE_PATH _PLUGIN_TO_LIB "/${_IDE_PLUGIN_PATH}" "/${_IDE_LIBRARY_PATH}")
|
||||||
|
228
dist/changes-7.0.0.md
vendored
Normal file
@@ -0,0 +1,228 @@
|
|||||||
|
Qt Creator 7
|
||||||
|
============
|
||||||
|
|
||||||
|
Qt Creator version 7 contains bug fixes and new features.
|
||||||
|
|
||||||
|
The most important changes are listed in this document. For a complete list of
|
||||||
|
changes, see the Git log for the Qt Creator sources that you can check out from
|
||||||
|
the public Git repository. For example:
|
||||||
|
|
||||||
|
git clone git://code.qt.io/qt-creator/qt-creator.git
|
||||||
|
git log --cherry-pick --pretty=oneline origin/6.0..v7.0.0
|
||||||
|
|
||||||
|
General
|
||||||
|
-------
|
||||||
|
|
||||||
|
* Gave `Welcome` a fresh look
|
||||||
|
* Split `New File or Project` into `New File` and `New Project`
|
||||||
|
* Added optional notification of new Qt releases available in the online
|
||||||
|
installer (QTCREATORBUG-26708)
|
||||||
|
* Added `Show in File System View` to more context menus, like `Show in
|
||||||
|
Explorer/Finder`
|
||||||
|
* Added `Tools > Debug Qt Creator > Show Logs` for viewing Qt Creator debug logs
|
||||||
|
* Moved C++ code model and language client inspectors to `Tools > Debug Qt
|
||||||
|
Creator`
|
||||||
|
|
||||||
|
Editing
|
||||||
|
-------
|
||||||
|
|
||||||
|
* Added action for selecting all search results in a document
|
||||||
|
* Added support for choosing external editor as default editor
|
||||||
|
(QTCREATORBUG-13880)
|
||||||
|
* Fixed copy action in text editing macros (QTCREATORBUG-26363)
|
||||||
|
|
||||||
|
### C++
|
||||||
|
|
||||||
|
* Switched to Clangd by default (QTCREATORBUG-22917)
|
||||||
|
* Fixed that compilation errors appeared below code model errors in `Issues`
|
||||||
|
pane (QTCREATORBUG-23655)
|
||||||
|
* Fixed that duplication files did not adapt header guard (QTCREATORBUG-26654)
|
||||||
|
* Fixed highlighting and indentation of raw string literals (QTCREATORBUG-26211)
|
||||||
|
* Fixed performance issue in global indexer (QTCREATORBUG-26841)
|
||||||
|
* clang-format
|
||||||
|
* Moved settings to `Code Style` editor
|
||||||
|
* Added synchronization between `clang-format` settings and custom code style
|
||||||
|
* Clangd
|
||||||
|
* Added memory usage inspector to language client inspector
|
||||||
|
* Added highlighting of `Q_PROPERTY` declarations
|
||||||
|
* Improved display of diagnostic messages
|
||||||
|
* Fixed access type categorization for functions
|
||||||
|
|
||||||
|
### QML
|
||||||
|
|
||||||
|
* Updated parser to latest Qt version
|
||||||
|
* Fixed that application directory was not searched for QML modules
|
||||||
|
(QTCREATORBUG-24987)
|
||||||
|
|
||||||
|
### Python
|
||||||
|
|
||||||
|
* Added Python specific language server settings
|
||||||
|
|
||||||
|
### Language Server Protocol
|
||||||
|
|
||||||
|
* Removed support for outdated semantic highlighting protocol proposal
|
||||||
|
(QTCREATORBUG-26624)
|
||||||
|
* Fixed that outdated diagnostic could be shown (QTCREATORBUG-26585)
|
||||||
|
* Fixed issue with re-highlighting (QTCREATORBUG-26624)
|
||||||
|
|
||||||
|
### FakeVim
|
||||||
|
|
||||||
|
* Added support for backslashes in substitute command (QTCREATORBUG-26955)
|
||||||
|
|
||||||
|
Projects
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Added option to override GCC target triple (QTCREATORBUG-26913)
|
||||||
|
* Added multiple selection to `Issues` pane (QTCREATORBUG-25547,
|
||||||
|
QTCREATORBUG-26720)
|
||||||
|
* Improved automatic (re-)detection of toolchains (QTCREATORBUG-26460)
|
||||||
|
* Fixed unnecessary toolchain calls at startup
|
||||||
|
|
||||||
|
### CMake
|
||||||
|
|
||||||
|
* Removed grouping of CMake cache variables (QTCREATORBUG-26218)
|
||||||
|
* Made it possible to stop CMake with button in build configuration
|
||||||
|
* Renamed `Initial Parameters` to `Initial Configuration` and moved into tabbed
|
||||||
|
view with `Current Configuration`
|
||||||
|
* Added field for passing additional CMake options to kit, initial, and current
|
||||||
|
configuration (QTCREATORBUG-26826)
|
||||||
|
* Added button for editing kit CMake configuration directly from build
|
||||||
|
configuration
|
||||||
|
* Added hint for mismatches between kit, initial, and current configuration
|
||||||
|
* Added context menu actions for resolving mismatches between kit, initial and
|
||||||
|
current configuration
|
||||||
|
* Added `Help` to context menu for variable names
|
||||||
|
|
||||||
|
### Generic
|
||||||
|
|
||||||
|
* Added support for precompiled headers (QTCREATORBUG-26532)
|
||||||
|
|
||||||
|
### Autotools
|
||||||
|
|
||||||
|
* Fixed parsing of `SUBDIRS`
|
||||||
|
|
||||||
|
Debugging
|
||||||
|
---------
|
||||||
|
|
||||||
|
* Added debugging helper for `std::variant`, `boost::container::devector`, and
|
||||||
|
`boost::small_vector`
|
||||||
|
* Added debugging helper for `QStringView` (QTCREATORBUG-20918)
|
||||||
|
* Added `Char Code Integer`, `Hexadecimal Float`, and `Normalized, with
|
||||||
|
Power-of-Two Exponent` display formats (QTCREATORBUG-22849,
|
||||||
|
QTCREATORBUG-26793)
|
||||||
|
* Added shortcut for disabling and enabling breakpoints (QTCREATORBUG-26788)
|
||||||
|
|
||||||
|
Analyzer
|
||||||
|
--------
|
||||||
|
|
||||||
|
### QML
|
||||||
|
|
||||||
|
* Added support for profiling QtQuick3D (QTBUG-98146)
|
||||||
|
|
||||||
|
Version Control Systems
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
### Git
|
||||||
|
|
||||||
|
* Added support for filtering log by author
|
||||||
|
* Added handling of `HOMEDRIVE` and `HOMEPATH` on Windows
|
||||||
|
* Fixed that conflicts with deleted files could not be resolved
|
||||||
|
(QTCREATORBUG-26994)
|
||||||
|
|
||||||
|
Test Integration
|
||||||
|
----------------
|
||||||
|
|
||||||
|
### QTest
|
||||||
|
|
||||||
|
* Added option for maximum number of warnings (QTCREATORBUG-26637)
|
||||||
|
|
||||||
|
### Qt Quick
|
||||||
|
|
||||||
|
* Added option for setup code to wizard (QTCREATORBUG-26741)
|
||||||
|
|
||||||
|
Platforms
|
||||||
|
---------
|
||||||
|
|
||||||
|
### macOS
|
||||||
|
|
||||||
|
* Fixed that macOS dark mode was not used for dark themes (QTCREATORBUG-22477)
|
||||||
|
* Fixed that user applications inherited access permissions from Qt Creator
|
||||||
|
(QTCREATORBUG-26743)
|
||||||
|
|
||||||
|
### Android
|
||||||
|
|
||||||
|
* Added option for default NDK (QTCREATORBUG-21755, QTCREATORBUG-22389,
|
||||||
|
QTCREATORBUG-24248, QTCREATORBUG-26281)
|
||||||
|
* Fixed that `Include prebuilt OpenSSL libraries` could add it to the wrong
|
||||||
|
`.pro` file (QTCREATORBUG-24255)
|
||||||
|
* Fixed debugging of devices with upper case identifier with LLDB
|
||||||
|
(QTCREATORBUG-26709)
|
||||||
|
* Fixed detection of available NDK platforms for recent NDKs
|
||||||
|
(QTCREATORBUG-26772)
|
||||||
|
|
||||||
|
### Remote Linux
|
||||||
|
|
||||||
|
* Fixed UI state after stopping remote applications (QTCREATORBUG-26848)
|
||||||
|
|
||||||
|
### WebAssembly
|
||||||
|
|
||||||
|
* Improved browser selection (QTCREATORBUG-25028, QTCREATORBUG-26559)
|
||||||
|
* Fixed running CMake-based Qt Quick applications with Qt 6.2
|
||||||
|
(QTCREATORBUG-26562)
|
||||||
|
|
||||||
|
### MCU
|
||||||
|
|
||||||
|
* Added support for Renesas Flash Programmer (UL-5082)
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
* Added experimental support for macOS hosts
|
||||||
|
|
||||||
|
Credits for these changes go to:
|
||||||
|
--------------------------------
|
||||||
|
Aaron Barany
|
||||||
|
Alessandro Portale
|
||||||
|
Alexander Drozdov
|
||||||
|
Allan Sandfeld Jensen
|
||||||
|
André Pönitz
|
||||||
|
Anton Alimoff
|
||||||
|
Artem Sokolovskii
|
||||||
|
Assam Boudjelthia
|
||||||
|
Christiaan Janssen
|
||||||
|
Christian Kandeler
|
||||||
|
Christian Stenger
|
||||||
|
Cristian Adam
|
||||||
|
Cristián Maureira-Fredes
|
||||||
|
David Schulz
|
||||||
|
Eike Ziller
|
||||||
|
Fawzi Mohamed
|
||||||
|
Henning Gruendl
|
||||||
|
Huixiong Cao
|
||||||
|
Janne Koskinen
|
||||||
|
Jaroslaw Kobus
|
||||||
|
Jean-Michaël Celerier
|
||||||
|
Jere Tuliniemi
|
||||||
|
Joerg Kreuzberger
|
||||||
|
Kai Köhne
|
||||||
|
Katarina Behrens
|
||||||
|
Knud Dollereder
|
||||||
|
Leena Miettinen
|
||||||
|
Mahmoud Badri
|
||||||
|
Marco Bubke
|
||||||
|
Maximilian Goldstein
|
||||||
|
Miikka Heikkinen
|
||||||
|
Morten Johan Sørvig
|
||||||
|
Orgad Shaneh
|
||||||
|
Petar Perisin
|
||||||
|
Piotr Mikolajczyk
|
||||||
|
Robert Löhning
|
||||||
|
Samuel Ghinet
|
||||||
|
Tasuku Suzuki
|
||||||
|
Thomas Hartmann
|
||||||
|
Tim Jenssen
|
||||||
|
Tony Leinonen
|
||||||
|
Topi Reinio
|
||||||
|
Tor Arne Vestbø
|
||||||
|
Ulf Hermann
|
||||||
|
Ville Nummela
|
||||||
|
XutaxKamay
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 9.8 KiB |
BIN
doc/qtcreator/images/qtcreator-android-sdk-manager-arguments.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 10 KiB |
BIN
doc/qtcreator/images/qtcreator-autotests-project-qt-test.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
After Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.4 KiB |
BIN
doc/qtcreator/images/qtcreator-compilers-target-triple.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 22 KiB |
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2021 The Qt Company Ltd.
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -113,8 +113,11 @@
|
|||||||
The locked items were installed by the SDK Manager,
|
The locked items were installed by the SDK Manager,
|
||||||
and can only be modified from the \uicontrol {SDK Manager} tab.
|
and can only be modified from the \uicontrol {SDK Manager} tab.
|
||||||
For more information, see \l{Managing Android NDK Packages}.
|
For more information, see \l{Managing Android NDK Packages}.
|
||||||
\li In the \uicontrol {Android OpenSSL} group, set the path to the
|
\li Select the \uicontrol {Automatically create kits for Android tool chains}
|
||||||
prebuilt OpenSSL libraries.
|
check box to allow \QC to create the kits for you. \QC displays a
|
||||||
|
warning if it cannot find a suitable Qt version.
|
||||||
|
\li Optionally, in the \uicontrol {Android OpenSSL Settings} group, set
|
||||||
|
the path to the prebuilt OpenSSL libraries.
|
||||||
|
|
||||||
For Qt applications that require OpenSSL support, \QC allows to
|
For Qt applications that require OpenSSL support, \QC allows to
|
||||||
quickly add the \l {Android OpenSSL support} to your project.
|
quickly add the \l {Android OpenSSL support} to your project.
|
||||||
@@ -122,9 +125,6 @@
|
|||||||
\li Select \uicontrol {Download OpenSSL} to download the OpenSSL
|
\li Select \uicontrol {Download OpenSSL} to download the OpenSSL
|
||||||
repository to the selected path. If the automatic download fails,
|
repository to the selected path. If the automatic download fails,
|
||||||
the download web page opens for manual download.
|
the download web page opens for manual download.
|
||||||
\li Select the \uicontrol {Automatically create kits for Android tool chains}
|
|
||||||
check box to allow \QC to create the kits for you. \QC displays a
|
|
||||||
warning if it cannot find a suitable Qt version.
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section2 Manual Setup
|
\section2 Manual Setup
|
||||||
@@ -185,6 +185,9 @@
|
|||||||
To manually download NDKs, select \inlineimage icons/online.png
|
To manually download NDKs, select \inlineimage icons/online.png
|
||||||
.
|
.
|
||||||
|
|
||||||
|
To use the selected NDK version for all Qt versions by default, select
|
||||||
|
\uicontrol {Make Default}.
|
||||||
|
|
||||||
To add custom NDK paths manually to the global list of NDKs, select
|
To add custom NDK paths manually to the global list of NDKs, select
|
||||||
\uicontrol Add. This creates custom tool chains and debuggers associated
|
\uicontrol Add. This creates custom tool chains and debuggers associated
|
||||||
to that NDK. However, you have to manually create a kit that uses the
|
to that NDK. However, you have to manually create a kit that uses the
|
||||||
@@ -206,8 +209,12 @@
|
|||||||
|
|
||||||
\image qtcreator-android-sdk-manager.png "Android SDK Manager"
|
\image qtcreator-android-sdk-manager.png "Android SDK Manager"
|
||||||
|
|
||||||
To filter the packages, select \uicontrol Available, \uicontrol Installed,
|
You can show packages for the release channel you select in
|
||||||
or \uicontrol All in \uicontrol {Show Packages}.
|
\uicontrol {Show Packages} > \uicontrol Channel. Common channel IDs include
|
||||||
|
\uicontrol Stable, \uicontrol Beta, \uicontrol Dev, and \uicontrol Canary.
|
||||||
|
To show and update also obsolete packages, select
|
||||||
|
\uicontrol {Include obsolete}. To filter packages, select
|
||||||
|
\uicontrol Available, \uicontrol Installed, or \uicontrol All.
|
||||||
|
|
||||||
To update the installed Android SDK packages, select
|
To update the installed Android SDK packages, select
|
||||||
\uicontrol {Update Installed}. Select the packages to update, and then
|
\uicontrol {Update Installed}. Select the packages to update, and then
|
||||||
@@ -218,6 +225,8 @@
|
|||||||
\uicontrol {SDK Manager arguments} field. The available arguments are listed
|
\uicontrol {SDK Manager arguments} field. The available arguments are listed
|
||||||
and described in \uicontrol {Available arguments}.
|
and described in \uicontrol {Available arguments}.
|
||||||
|
|
||||||
|
\image qtcreator-android-sdk-manager-arguments.png "Android SDK Manager Arguments dialog"
|
||||||
|
|
||||||
\section1 Managing Android Virtual Devices (AVD)
|
\section1 Managing Android Virtual Devices (AVD)
|
||||||
|
|
||||||
The available AVDs are listed in \uicontrol Tools > \uicontrol Options
|
The available AVDs are listed in \uicontrol Tools > \uicontrol Options
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2021 The Qt Company Ltd.
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -128,8 +128,8 @@
|
|||||||
\section2 Specifying Settings for Packages
|
\section2 Specifying Settings for Packages
|
||||||
|
|
||||||
To specify settings for the \c androiddeployqt tool, select
|
To specify settings for the \c androiddeployqt tool, select
|
||||||
\uicontrol Projects > \uicontrol Build > \uicontrol {Build Android APK} >
|
\uicontrol Projects > \uicontrol {Build & Run} > \uicontrol Build >
|
||||||
\uicontrol Details.
|
\uicontrol {Build Android APK} > \uicontrol Details.
|
||||||
|
|
||||||
\image qtcreator-android-build-apk-step.png "Build Android APK step"
|
\image qtcreator-android-build-apk-step.png "Build Android APK step"
|
||||||
|
|
||||||
@@ -166,9 +166,9 @@
|
|||||||
distribution to the Google Play store, create an AAB by selecting
|
distribution to the Google Play store, create an AAB by selecting
|
||||||
the \uicontrol {Build Android App Bundle (*.aab)} check box.
|
the \uicontrol {Build Android App Bundle (*.aab)} check box.
|
||||||
|
|
||||||
When building with CMake, you can view the selected ABIs in the
|
When building with CMake, you can view the selected ABIs in
|
||||||
\uicontrol {Initial CMake parameters} field in the \uicontrol CMake section.
|
\uicontrol {Initial Configuration} in the \uicontrol CMake section.
|
||||||
You can set additional ABIs as values of the ANDROID_ABI key:
|
You can set additional ABIs as values of the \c ANDROID_ABI key:
|
||||||
|
|
||||||
\image qtcreator-android-cmake-settings.png "CMake settings for building AABs"
|
\image qtcreator-android-cmake-settings.png "CMake settings for building AABs"
|
||||||
|
|
||||||
|
@@ -41,15 +41,16 @@
|
|||||||
|
|
||||||
You can view and edit the actual values of the variables that are passed
|
You can view and edit the actual values of the variables that are passed
|
||||||
to CMake. Variable names are listed in the \uicontrol Key column and their
|
to CMake. Variable names are listed in the \uicontrol Key column and their
|
||||||
current values in the \uicontrol Value column. For more information
|
current values in the \uicontrol Value column. For more information about
|
||||||
about the available variables, see \l{CMake: cmake-variables(7)}.
|
the available variables, select \uicontrol Help in the context menu or see
|
||||||
For more information about Qt-specific variables, see
|
\l{CMake: cmake-variables(7)}. For more information about Qt-specific
|
||||||
\l{CMake Variable Reference}.
|
variables, see \l{CMake Variable Reference}.
|
||||||
|
|
||||||
You can specify additional CMake options, such as \c {--find-debug},
|
You can specify additional CMake options, such as \c {--find-debug},
|
||||||
\c {--preset}, \c {--trace-expand}, or \c {--warn-uninitialized}, in
|
\c {--preset}, \c {--trace-expand}, or \c {--warn-uninitialized}, in
|
||||||
\uicontrol {Additional CMake options}. For more information about
|
\uicontrol {Additional CMake options}. For more information about
|
||||||
the available options, see \l{CMake: cmake(1)}.
|
the available options, click the link in the field name or see
|
||||||
|
\l{CMake: cmake(1)}.
|
||||||
|
|
||||||
After successfully running CMake, you can view and modify the current
|
After successfully running CMake, you can view and modify the current
|
||||||
configuration in \uicontrol {Current Configuration}.
|
configuration in \uicontrol {Current Configuration}.
|
||||||
@@ -97,7 +98,10 @@
|
|||||||
select \uicontrol Copy in the context menu.
|
select \uicontrol Copy in the context menu.
|
||||||
|
|
||||||
To modify the value of a variable, double-click it, or select it,
|
To modify the value of a variable, double-click it, or select it,
|
||||||
and then select \uicontrol Edit.
|
and then select \uicontrol Edit. If the initial, current, and kit
|
||||||
|
configuration get out of sync, select \uicontrol {Apply Kit Value} or
|
||||||
|
\uicontrol {Apply Initial Configuration Value} in the context menu in
|
||||||
|
\uicontrol {Initial Configuration} or \uicontrol {Current Configuration}.
|
||||||
|
|
||||||
You can apply actions to multiple variables at a time. To clear
|
You can apply actions to multiple variables at a time. To clear
|
||||||
the selection, select \uicontrol {Clear Selection}.
|
the selection, select \uicontrol {Clear Selection}.
|
||||||
@@ -194,8 +198,9 @@
|
|||||||
\image qtcreator-cmake-generator.png "CMake Generator dialog"
|
\image qtcreator-cmake-generator.png "CMake Generator dialog"
|
||||||
\li In \uicontrol Generator, select \uicontrol Ninja.
|
\li In \uicontrol Generator, select \uicontrol Ninja.
|
||||||
\li Select \uicontrol OK to save your changes and close the dialog.
|
\li Select \uicontrol OK to save your changes and close the dialog.
|
||||||
\li Close the \uicontrol {Kit CMake Configuration} dialog to return to
|
\li Select \uicontrol Close to close the
|
||||||
\uicontrol {Build Settings}.
|
\uicontrol {Kit CMake Configuration} dialog
|
||||||
|
and return to \uicontrol {Build Settings}.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\note To make sure that old build artifacts don't get in the way
|
\note To make sure that old build artifacts don't get in the way
|
||||||
|
@@ -72,6 +72,26 @@
|
|||||||
\QC requires CMake's \l{https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html}
|
\QC requires CMake's \l{https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html}
|
||||||
{file-based API}, and therefore you'll need CMake version 3.14, or later.
|
{file-based API}, and therefore you'll need CMake version 3.14, or later.
|
||||||
|
|
||||||
|
For systems with older versions of CMake, only workarounds are available:
|
||||||
|
\list
|
||||||
|
|
||||||
|
\li For CMake version 3.5 or later it is possible to generate a
|
||||||
|
\l{https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html}{compilation database}
|
||||||
|
and open that in \QC, as described in \l{Using Compilation Databases}.
|
||||||
|
|
||||||
|
\li Create an ad-hoc project file for a qmake build using
|
||||||
|
\c{qmake -project} and \l{Opening Projects}{open} that in \QC.
|
||||||
|
Be aware that this is typically
|
||||||
|
not compilable without further manual changes.
|
||||||
|
|
||||||
|
\li Manually create an ad-hoc project file for a
|
||||||
|
\l{Setting Up a Generic Project}{generic project} and
|
||||||
|
open that in \QC. Be aware this is typically
|
||||||
|
not compilable without further manual changes.
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
|
||||||
To view and specify settings for CMake:
|
To view and specify settings for CMake:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
@@ -149,11 +149,9 @@
|
|||||||
|
|
||||||
\section1 Configuring clangd
|
\section1 Configuring clangd
|
||||||
|
|
||||||
You can use the experimental clangd support instead of libclang to receive
|
The clangd \e index provides exact and complete results for services such
|
||||||
exact and complete results for services such as finding references,
|
as finding references, following symbols under cursor, and using the
|
||||||
following symbols under cursor, and using the locator, even for complex
|
locator, even for complex constructs. When you \l{Opening Projects}
|
||||||
constructs that the built-in code model cannot handle correctly. These
|
|
||||||
improvements are based on clangd's \e index. When you \l{Opening Projects}
|
|
||||||
{open a project}, clangd scans the source files to generate the index. For
|
{open a project}, clangd scans the source files to generate the index. For
|
||||||
large projects, this can take a while, but the index is persistent and
|
large projects, this can take a while, but the index is persistent and
|
||||||
re-scanning is incremental, so nothing is lost by closing and re-starting
|
re-scanning is incremental, so nothing is lost by closing and re-starting
|
||||||
@@ -171,8 +169,7 @@
|
|||||||
{Outline} view is backed by clangd's document symbol support, which
|
{Outline} view is backed by clangd's document symbol support, which
|
||||||
makes the results more reliable than before.
|
makes the results more reliable than before.
|
||||||
|
|
||||||
To use clangd for the current project instead of the built-in code model or
|
To specify settings for clangd:
|
||||||
Clang:
|
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol C++ >
|
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol C++ >
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2021 The Qt Company Ltd.
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -78,7 +78,8 @@
|
|||||||
\li In \uicontrol Handler, double-click the editor name to display a
|
\li In \uicontrol Handler, double-click the editor name to display a
|
||||||
context-menu where you can select another editor to open the file
|
context-menu where you can select another editor to open the file
|
||||||
in by default. The menu is available only if alternative suitable
|
in by default. The menu is available only if alternative suitable
|
||||||
editors are available.
|
editors are available. Select \uicontrol {System Editor} to use
|
||||||
|
the system's default editor for files of this type by default.
|
||||||
|
|
||||||
\li In \uicontrol Patterns, add the filename extension for the type of files
|
\li In \uicontrol Patterns, add the filename extension for the type of files
|
||||||
that you want to identify as having this MIME type.
|
that you want to identify as having this MIME type.
|
||||||
|
@@ -101,6 +101,10 @@
|
|||||||
\externalpage http://developer.android.com/guide/components/fundamentals.html
|
\externalpage http://developer.android.com/guide/components/fundamentals.html
|
||||||
\title Android Application Fundamentals
|
\title Android Application Fundamentals
|
||||||
*/
|
*/
|
||||||
|
/*!
|
||||||
|
\externalpage https://doc.qt.io/qt/qtquicktest-index.html#executing-c-before-qml-tests
|
||||||
|
\title Executing C++ Before QML Tests
|
||||||
|
*/
|
||||||
/*!
|
/*!
|
||||||
\externalpage https://doc.qt.io/qt/qtqml-cppintegration-overview.html
|
\externalpage https://doc.qt.io/qt/qtqml-cppintegration-overview.html
|
||||||
\title Overview - QML and C++ Integration
|
\title Overview - QML and C++ Integration
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2021 The Qt Company Ltd.
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -97,6 +97,8 @@
|
|||||||
\li For a Qt test, select the \uicontrol {GUI Application} check
|
\li For a Qt test, select the \uicontrol {GUI Application} check
|
||||||
box to create a Qt application.
|
box to create a Qt application.
|
||||||
|
|
||||||
|
\image qtcreator-autotests-project-qt-test.png "Autotest project wizard - Qt Test"
|
||||||
|
|
||||||
\li In the \uicontrol {Test case name} field, enter a name for
|
\li In the \uicontrol {Test case name} field, enter a name for
|
||||||
the test case.
|
the test case.
|
||||||
|
|
||||||
@@ -104,6 +106,14 @@
|
|||||||
check box to add the include statement for QApplication to
|
check box to add the include statement for QApplication to
|
||||||
the main.cpp file of the project.
|
the main.cpp file of the project.
|
||||||
|
|
||||||
|
\li For a Qt Quick test, select the
|
||||||
|
\uicontrol {Generate setup code} check box to execute C++
|
||||||
|
code before any of the QML tests are run. The testing
|
||||||
|
framework will call slots and invokable functions, as
|
||||||
|
described in \l{Executing C++ Before QML Tests}.
|
||||||
|
|
||||||
|
\image qtcreator-autotests-project-qtquick-test.png "Autotest project wizard - Qt Quick Test"
|
||||||
|
|
||||||
\li Select the \uicontrol {Generate initialization and cleanup
|
\li Select the \uicontrol {Generate initialization and cleanup
|
||||||
code} checkbox to add functions to your test that are
|
code} checkbox to add functions to your test that are
|
||||||
executed by the testing framework to initialize and clean
|
executed by the testing framework to initialize and clean
|
||||||
|
@@ -0,0 +1,230 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of the Qt Creator documentation.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU Free Documentation License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Free
|
||||||
|
** Documentation License version 1.3 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file included in the packaging of
|
||||||
|
** this file. Please review the following information to ensure
|
||||||
|
** the GNU Free Documentation License version 1.3 requirements
|
||||||
|
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\previouspage creator-project-creating.html
|
||||||
|
\page creator-file-creating.html
|
||||||
|
\nextpage creator-project-opening.html
|
||||||
|
|
||||||
|
\title Creating Files
|
||||||
|
|
||||||
|
You can use wizard templates to add individual files to your
|
||||||
|
\l{Creating Projects}{projects}.
|
||||||
|
The following table lists the wizard templates for creating files.
|
||||||
|
|
||||||
|
\table
|
||||||
|
\header
|
||||||
|
\li Category
|
||||||
|
\li Wizard Template
|
||||||
|
\li Purpose
|
||||||
|
\row
|
||||||
|
\li {1,3} C/C++
|
||||||
|
\li C++ Class
|
||||||
|
\li C++ header and source file for a new class that you can add to
|
||||||
|
a C++ project.
|
||||||
|
\row
|
||||||
|
\li C/C++ Source File
|
||||||
|
\li C++ source file that you can add to a C++ project.
|
||||||
|
\row
|
||||||
|
\li C/C++ Header File
|
||||||
|
\li C++ header file that you can add to a C++ project.
|
||||||
|
\row
|
||||||
|
\li {1,3} Modeling
|
||||||
|
\li State Chart
|
||||||
|
\li State Chart XML (SCXML) file that contains boilerplate
|
||||||
|
code for state machines. You can use the classes in the
|
||||||
|
\l {Qt SCXML} module to embed state machines created from
|
||||||
|
the files in Qt applications.
|
||||||
|
\row
|
||||||
|
\li Model
|
||||||
|
\li Universal Modeling Language (UML) style model with a structured
|
||||||
|
diagram. However, the model editor uses a variant of UML and
|
||||||
|
provides only a subset of properties for specifying the
|
||||||
|
appearance of model elements. For more information, see
|
||||||
|
\l {Modeling}.
|
||||||
|
\row
|
||||||
|
\li Scratch Model
|
||||||
|
\li Scratch model using a temporary file.
|
||||||
|
\row
|
||||||
|
\li {1,7} Qt
|
||||||
|
\li Qt Item Model
|
||||||
|
\li Source and header files that you can use to create classes
|
||||||
|
derived from QAbstractItemModel, QAbstractTableModel, or
|
||||||
|
QAbstractListModel.
|
||||||
|
\row
|
||||||
|
\li \QD Form Class
|
||||||
|
\li \QD form and a matching class for implementing a UI based
|
||||||
|
on Qt widgets.
|
||||||
|
\row
|
||||||
|
\li \QD Form
|
||||||
|
\li \QD form for Qt widget based projects. This is useful
|
||||||
|
if you already have an existing class for the UI logic.
|
||||||
|
\row
|
||||||
|
\li Qt Resource File
|
||||||
|
\li Resource file for storing binary files in the application
|
||||||
|
executable.
|
||||||
|
\row
|
||||||
|
\li QML File (Qt Quick 2)
|
||||||
|
\li QML file that imports Qt Quick 2.0 for use in Qt Quick projects.
|
||||||
|
\row
|
||||||
|
\li Qt Quick UI File
|
||||||
|
\li \l{UI Files}{UI file} (\e .ui.qml) and the corresponding
|
||||||
|
implementation file (\e .qml) for use in Qt Quick projects.
|
||||||
|
\row
|
||||||
|
\li JS File
|
||||||
|
\li JavaScript file that you can use to write the application logic
|
||||||
|
in Qt Quick projects.
|
||||||
|
\row
|
||||||
|
\li {1,4} GLSL
|
||||||
|
\li Fragment Shader (OpenGL/ES 2.0)
|
||||||
|
\li Fragment shader that generates the final pixel colors for
|
||||||
|
triangles, points, and lines rendered with OpenGL. You can use
|
||||||
|
it in both Qt Quick projects and Qt widget based projects.
|
||||||
|
\row
|
||||||
|
\li Vertex Shader (OpenGL/ES 2.0)
|
||||||
|
\li Vertex shader that transforms the positions, normals, and
|
||||||
|
texture coordinates of triangles, points, and lines rendered
|
||||||
|
with OpenGL. You can use it in both Qt Quick projects and Qt
|
||||||
|
widget based projects.
|
||||||
|
\row
|
||||||
|
\li Fragment Shader (Desktop OpenGL)
|
||||||
|
\li Fragment shader for use in both Qt Quick projects and Qt
|
||||||
|
widget based projects.
|
||||||
|
\row
|
||||||
|
\li Vertex Shader (Desktop OpenGL)
|
||||||
|
\li Vertex shader for use in both Qt Quick projects and Qt
|
||||||
|
widget based projects.
|
||||||
|
\row
|
||||||
|
\li {1,2} General
|
||||||
|
\li Empty File
|
||||||
|
\li Empty file that you can save with any filename extensio.
|
||||||
|
\row
|
||||||
|
\li Scratch Buffer
|
||||||
|
\li Scratch buffer that uses temporary files. You can
|
||||||
|
create this type of files for temporarily storing information
|
||||||
|
that you do not intend to save
|
||||||
|
\row
|
||||||
|
\li Java
|
||||||
|
\li Java File
|
||||||
|
\li Java class files that you can use to create Java classes.
|
||||||
|
\row
|
||||||
|
\li {1,2} Python
|
||||||
|
\li Python Class
|
||||||
|
\li Python class file.
|
||||||
|
\row
|
||||||
|
\li Python File
|
||||||
|
\li Python script file using UTF-8 encoding.
|
||||||
|
\row
|
||||||
|
\li {1,2} Nim (experimental)
|
||||||
|
\li Nim Script File
|
||||||
|
\li Empty Nim script file using UTF-8 encoding.
|
||||||
|
\row
|
||||||
|
\li Nim File
|
||||||
|
\li Empty Nim source file using UTF-8 encoding.
|
||||||
|
\endtable
|
||||||
|
|
||||||
|
\section1 Creating C++ Classes
|
||||||
|
|
||||||
|
The \uicontrol {C++ Class Wizard} allows you to create a C++ header and source
|
||||||
|
file for a new class that you can add to a C++ project. Specify the class
|
||||||
|
name, base class, and header and source files for the class.
|
||||||
|
|
||||||
|
The wizard supports namespaces. To use a namespace, enter a qualified
|
||||||
|
class name in the \uicontrol {Class name} field. For example:
|
||||||
|
\c MyNamespace::MySubNamespace::MyClass. The wizard suggests
|
||||||
|
existing namespaces and class names as you type.
|
||||||
|
|
||||||
|
\image qtcreator-cpp-class-wizard.png "Enter Class Name dialog"
|
||||||
|
|
||||||
|
The names of the header and source file are based on the class name. To
|
||||||
|
change the default suffix of a file, select \uicontrol Tools > \uicontrol Options >
|
||||||
|
\uicontrol {C++} > \uicontrol {File Naming}.
|
||||||
|
|
||||||
|
\image qtcreator-options-cpp-files.png "File Naming tab in Options"
|
||||||
|
|
||||||
|
In the \uicontrol {License template} field, you can use
|
||||||
|
\l{Using Variables in Wizards}{predefined wizard variables} to specify the
|
||||||
|
path and filename of the license to use in the source and header files.
|
||||||
|
|
||||||
|
You can create your own project and class wizards. For more information,
|
||||||
|
see \l{Adding New Custom Wizards}.
|
||||||
|
|
||||||
|
\section1 Creating Resource Files
|
||||||
|
|
||||||
|
\QC supports the \l{The Qt Resource System}{Qt Resource System}, which is a
|
||||||
|
platform-independent mechanism for storing files in the application's
|
||||||
|
executable.
|
||||||
|
|
||||||
|
\image qtcreator-add-resource-wizard.png "New File dialog"
|
||||||
|
|
||||||
|
The wizard creates a resource collection file (.qrc) that you can manage in
|
||||||
|
the resource editor.
|
||||||
|
|
||||||
|
\image qtcreator-add-resource.png "Editing resource files"
|
||||||
|
|
||||||
|
Select \uicontrol {Add Files} to locate and add individual
|
||||||
|
files.
|
||||||
|
|
||||||
|
To list the folders and files in ascending alphabetic order in the source
|
||||||
|
tree, select \uicontrol {Sort Alphabetically} in the context menu.
|
||||||
|
|
||||||
|
By default, resources are accessible in the application under the same file
|
||||||
|
name as they have in the source tree, with a \c{:/} prefix, or by a URL with
|
||||||
|
a \c qrc scheme. To specify a path prefix for all files in the \c .qrc file,
|
||||||
|
select \uicontrol {Add Prefix} and enter the prefix in the \uicontrol Prefix
|
||||||
|
field.
|
||||||
|
|
||||||
|
Some resources need to change based on the user's locale, such as
|
||||||
|
translation files or icons. You can specify a locale in the
|
||||||
|
\uicontrol Language field.
|
||||||
|
|
||||||
|
Select \uicontrol Remove to remove the selected file from the resource
|
||||||
|
collection. In the \uicontrol {Remove File} dialog, select the
|
||||||
|
\uicontrol {Delete file permanently} check box to remove the file from
|
||||||
|
the file system. To remove files that cannot be found in the file system,
|
||||||
|
select \uicontrol {Remove Missing Files}.
|
||||||
|
|
||||||
|
The above functions are also available in the context menu in the
|
||||||
|
\uicontrol Projects view.
|
||||||
|
|
||||||
|
\section1 Creating OpenGL Fragment and Vertex Shaders
|
||||||
|
|
||||||
|
Qt provides support for integration with OpenGL implementations on all
|
||||||
|
platforms, which allows you to display hardware accelerated 3D graphics
|
||||||
|
alongside a more conventional user interface. For more information, see
|
||||||
|
\l{Qt GUI}.
|
||||||
|
|
||||||
|
You can use the QOpenGLShader class to compile OpenGL shaders written in the
|
||||||
|
OpenGL Shading Language (GLSL) and in the OpenGL/ES Shading Language
|
||||||
|
(GLSL/ES). QOpenGLShader and QOpenGLShaderProgram shelter you from the
|
||||||
|
details of
|
||||||
|
compiling and linking vertex and fragment shaders.
|
||||||
|
|
||||||
|
You can use \QC code editor to write fragment and vertex shaders
|
||||||
|
in GLSL or GLSL/ES. The code editor provides syntax highlighting and code
|
||||||
|
completion for the files.
|
||||||
|
|
||||||
|
\image qtcreator-new-opengl-file.png "New OpenGL file wizard"
|
||||||
|
*/
|
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2020 The Qt Company Ltd.
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -181,6 +181,13 @@
|
|||||||
target architecture. This is used to warn about ABI mismatches
|
target architecture. This is used to warn about ABI mismatches
|
||||||
within the kits.
|
within the kits.
|
||||||
|
|
||||||
|
\li In the \uicontrol {Target triple} field, specify the GCC target
|
||||||
|
architecture. If services provided by the code model fail because
|
||||||
|
Clang does not understand the target architecture, select
|
||||||
|
\uicontrol {Override for code model}.
|
||||||
|
|
||||||
|
\image qtcreator-compilers-target-triple.png "Target triple field"
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section1 Adding Nim Compilers
|
\section1 Adding Nim Compilers
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2021 The Qt Company Ltd.
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\previouspage creator-project-managing.html
|
\previouspage creator-project-managing.html
|
||||||
\page creator-project-creating.html
|
\page creator-project-creating.html
|
||||||
\nextpage creator-project-opening.html
|
\nextpage creator-file-creating.html
|
||||||
|
|
||||||
\title Creating Projects
|
\title Creating Projects
|
||||||
|
|
||||||
@@ -239,206 +239,7 @@
|
|||||||
|
|
||||||
\include creator-python-project.qdocinc python project wizards
|
\include creator-python-project.qdocinc python project wizards
|
||||||
|
|
||||||
\section1 Adding Files to Projects
|
\section1 Displaying Additional File Types in Projects View
|
||||||
|
|
||||||
You can use wizards also to add individual files to your projects.
|
|
||||||
The following table lists the wizard templates for creating files.
|
|
||||||
|
|
||||||
\table
|
|
||||||
\header
|
|
||||||
\li Category
|
|
||||||
\li Wizard Template
|
|
||||||
\li Purpose
|
|
||||||
\row
|
|
||||||
\li {1,3} C/C++
|
|
||||||
\li C++ Class
|
|
||||||
\li C++ header and source file for a new class that you can add to
|
|
||||||
a C++ project.
|
|
||||||
\row
|
|
||||||
\li C/C++ Source File
|
|
||||||
\li C++ source file that you can add to a C++ project.
|
|
||||||
\row
|
|
||||||
\li C/C++ Header File
|
|
||||||
\li C++ header file that you can add to a C++ project.
|
|
||||||
\row
|
|
||||||
\li {1,3} Modeling
|
|
||||||
\li State Chart
|
|
||||||
\li State Chart XML (SCXML) file that contains boilerplate
|
|
||||||
code for state machines. You can use the classes in the
|
|
||||||
\l {Qt SCXML} module to embed state machines created from
|
|
||||||
the files in Qt applications.
|
|
||||||
\row
|
|
||||||
\li Model
|
|
||||||
\li Universal Modeling Language (UML) style model with a structured
|
|
||||||
diagram. However, the model editor uses a variant of UML and
|
|
||||||
provides only a subset of properties for specifying the
|
|
||||||
appearance of model elements. For more information, see
|
|
||||||
\l {Modeling}.
|
|
||||||
\row
|
|
||||||
\li Scratch Model
|
|
||||||
\li Scratch model using a temporary file.
|
|
||||||
\row
|
|
||||||
\li {1,7} Qt
|
|
||||||
\li Qt Item Model
|
|
||||||
\li Source and header files that you can use to create classes
|
|
||||||
derived from QAbstractItemModel, QAbstractTableModel, or
|
|
||||||
QAbstractListModel.
|
|
||||||
\row
|
|
||||||
\li \QD Form Class
|
|
||||||
\li \QD form and a matching class for implementing a UI based
|
|
||||||
on Qt widgets.
|
|
||||||
\row
|
|
||||||
\li \QD Form
|
|
||||||
\li \QD form for Qt widget based projects. This is useful
|
|
||||||
if you already have an existing class for the UI logic.
|
|
||||||
\row
|
|
||||||
\li Qt Resource File
|
|
||||||
\li Resource file for storing binary files in the application
|
|
||||||
executable.
|
|
||||||
\row
|
|
||||||
\li QML File (Qt Quick 2)
|
|
||||||
\li QML file that imports Qt Quick 2.0 for use in Qt Quick projects.
|
|
||||||
\row
|
|
||||||
\li Qt Quick UI File
|
|
||||||
\li \l{UI Files}{UI file} (\e .ui.qml) and the corresponding
|
|
||||||
implementation file (\e .qml) for use in Qt Quick projects.
|
|
||||||
\row
|
|
||||||
\li JS File
|
|
||||||
\li JavaScript file that you can use to write the application logic
|
|
||||||
in Qt Quick projects.
|
|
||||||
\row
|
|
||||||
\li {1,4} GLSL
|
|
||||||
\li Fragment Shader (OpenGL/ES 2.0)
|
|
||||||
\li Fragment shader that generates the final pixel colors for
|
|
||||||
triangles, points, and lines rendered with OpenGL. You can use
|
|
||||||
it in both Qt Quick projects and Qt widget based projects.
|
|
||||||
\row
|
|
||||||
\li Vertex Shader (OpenGL/ES 2.0)
|
|
||||||
\li Vertex shader that transforms the positions, normals, and
|
|
||||||
texture coordinates of triangles, points, and lines rendered
|
|
||||||
with OpenGL. You can use it in both Qt Quick projects and Qt
|
|
||||||
widget based projects.
|
|
||||||
\row
|
|
||||||
\li Fragment Shader (Desktop OpenGL)
|
|
||||||
\li Fragment shader for use in both Qt Quick projects and Qt
|
|
||||||
widget based projects.
|
|
||||||
\row
|
|
||||||
\li Vertex Shader (Desktop OpenGL)
|
|
||||||
\li Vertex shader for use in both Qt Quick projects and Qt
|
|
||||||
widget based projects.
|
|
||||||
\row
|
|
||||||
\li {1,2} General
|
|
||||||
\li Empty File
|
|
||||||
\li Empty file that you can save with any filename extensio.
|
|
||||||
\row
|
|
||||||
\li Scratch Buffer
|
|
||||||
\li Scratch buffer that uses temporary files. You can
|
|
||||||
create this type of files for temporarily storing information
|
|
||||||
that you do not intend to save
|
|
||||||
\row
|
|
||||||
\li Java
|
|
||||||
\li Java File
|
|
||||||
\li Java class files that you can use to create Java classes.
|
|
||||||
\row
|
|
||||||
\li {1,2} Python
|
|
||||||
\li Python Class
|
|
||||||
\li Python class file.
|
|
||||||
\row
|
|
||||||
\li Python File
|
|
||||||
\li Python script file using UTF-8 encoding.
|
|
||||||
\row
|
|
||||||
\li {1,2} Nim (experimental)
|
|
||||||
\li Nim Script File
|
|
||||||
\li Empty Nim script file using UTF-8 encoding.
|
|
||||||
\row
|
|
||||||
\li Nim File
|
|
||||||
\li Empty Nim source file using UTF-8 encoding.
|
|
||||||
\endtable
|
|
||||||
|
|
||||||
\section2 Creating C++ Classes
|
|
||||||
|
|
||||||
The \uicontrol {C++ Class Wizard} allows you to create a C++ header and source
|
|
||||||
file for a new class that you can add to a C++ project. Specify the class
|
|
||||||
name, base class, and header and source files for the class.
|
|
||||||
|
|
||||||
The wizard supports namespaces. To use a namespace, enter a qualified
|
|
||||||
class name in the \uicontrol {Class name} field. For example:
|
|
||||||
\c MyNamespace::MySubNamespace::MyClass. The wizard suggests
|
|
||||||
existing namespaces and class names as you type.
|
|
||||||
|
|
||||||
\image qtcreator-cpp-class-wizard.png "Enter Class Name dialog"
|
|
||||||
|
|
||||||
The names of the header and source file are based on the class name. To
|
|
||||||
change the default suffix of a file, select \uicontrol Tools > \uicontrol Options >
|
|
||||||
\uicontrol {C++} > \uicontrol {File Naming}.
|
|
||||||
|
|
||||||
\image qtcreator-options-cpp-files.png "File Naming tab in Options"
|
|
||||||
|
|
||||||
In the \uicontrol {License template} field, you can use
|
|
||||||
\l{Using Variables in Wizards}{predefined wizard variables} to specify the
|
|
||||||
path and filename of the license to use in the source and header files.
|
|
||||||
|
|
||||||
You can create your own project and class wizards. For more information,
|
|
||||||
see \l{Adding New Custom Wizards}.
|
|
||||||
|
|
||||||
\section2 Creating Resource Files
|
|
||||||
|
|
||||||
\QC supports the \l{The Qt Resource System}{Qt Resource System}, which is a
|
|
||||||
platform-independent mechanism for storing files in the application's
|
|
||||||
executable.
|
|
||||||
|
|
||||||
\image qtcreator-add-resource-wizard.png "New File dialog"
|
|
||||||
|
|
||||||
The wizard creates a resource collection file (.qrc) that you can manage in
|
|
||||||
the resource editor.
|
|
||||||
|
|
||||||
\image qtcreator-add-resource.png "Editing resource files"
|
|
||||||
|
|
||||||
Select \uicontrol {Add Files} to locate and add individual
|
|
||||||
files.
|
|
||||||
|
|
||||||
To list the folders and files in ascending alphabetic order in the source
|
|
||||||
tree, select \uicontrol {Sort Alphabetically} in the context menu.
|
|
||||||
|
|
||||||
By default, resources are accessible in the application under the same file
|
|
||||||
name as they have in the source tree, with a \c{:/} prefix, or by a URL with
|
|
||||||
a \c qrc scheme. To specify a path prefix for all files in the \c .qrc file,
|
|
||||||
select \uicontrol {Add Prefix} and enter the prefix in the \uicontrol Prefix
|
|
||||||
field.
|
|
||||||
|
|
||||||
Some resources need to change based on the user's locale, such as
|
|
||||||
translation files or icons. You can specify a locale in the
|
|
||||||
\uicontrol Language field.
|
|
||||||
|
|
||||||
Select \uicontrol Remove to remove the selected file from the resource
|
|
||||||
collection. In the \uicontrol {Remove File} dialog, select the
|
|
||||||
\uicontrol {Delete file permanently} check box to remove the file from
|
|
||||||
the file system. To remove files that cannot be found in the file system,
|
|
||||||
select \uicontrol {Remove Missing Files}.
|
|
||||||
|
|
||||||
The above functions are also available in the context menu in the
|
|
||||||
\uicontrol Projects view.
|
|
||||||
|
|
||||||
\section2 Creating OpenGL Fragment and Vertex Shaders
|
|
||||||
|
|
||||||
Qt provides support for integration with OpenGL implementations on all
|
|
||||||
platforms, which allows you to display hardware accelerated 3D graphics
|
|
||||||
alongside a more conventional user interface. For more information, see
|
|
||||||
\l{Qt GUI}.
|
|
||||||
|
|
||||||
You can use the QOpenGLShader class to compile OpenGL shaders written in the
|
|
||||||
OpenGL Shading Language (GLSL) and in the OpenGL/ES Shading Language
|
|
||||||
(GLSL/ES). QOpenGLShader and QOpenGLShaderProgram shelter you from the
|
|
||||||
details of
|
|
||||||
compiling and linking vertex and fragment shaders.
|
|
||||||
|
|
||||||
You can use \QC code editor to write fragment and vertex shaders
|
|
||||||
in GLSL or GLSL/ES. The code editor provides syntax highlighting and code
|
|
||||||
completion for the files.
|
|
||||||
|
|
||||||
\image qtcreator-new-opengl-file.png "New OpenGL file wizard"
|
|
||||||
|
|
||||||
\section2 Displaying Additional File Types in Projects View
|
|
||||||
|
|
||||||
\QC displays all files that are declared to be part of the project by the
|
\QC displays all files that are declared to be part of the project by the
|
||||||
project files in the \l Projects view. The files are sorted into categories
|
project files in the \l Projects view. The files are sorted into categories
|
||||||
@@ -448,7 +249,7 @@
|
|||||||
Alternatively, you can see all the files in a project in the
|
Alternatively, you can see all the files in a project in the
|
||||||
\l {File System} view.
|
\l {File System} view.
|
||||||
|
|
||||||
\section3 CMake Projects
|
\section2 CMake Projects
|
||||||
|
|
||||||
When using CMake, you can specify additional files to display in the
|
When using CMake, you can specify additional files to display in the
|
||||||
\uicontrol Projects view by either adding them as sources or installing
|
\uicontrol Projects view by either adding them as sources or installing
|
||||||
@@ -470,7 +271,7 @@
|
|||||||
Alternatively, to install the files, use the \l {CMake: install command}
|
Alternatively, to install the files, use the \l {CMake: install command}
|
||||||
{install} command with the \c FILES or \c DIRECTORY property.
|
{install} command with the \c FILES or \c DIRECTORY property.
|
||||||
|
|
||||||
\section3 qmake Projects
|
\section2 qmake Projects
|
||||||
|
|
||||||
When using qmake, add filenames as values of the \c {DISTFILES} variable
|
When using qmake, add filenames as values of the \c {DISTFILES} variable
|
||||||
in the .pro file. You can also use wildcards.
|
in the .pro file. You can also use wildcards.
|
||||||
@@ -550,6 +351,7 @@
|
|||||||
\section1 Related Topics
|
\section1 Related Topics
|
||||||
|
|
||||||
\list
|
\list
|
||||||
|
\li \l{Creating Files}
|
||||||
\li \l{Opening Projects}
|
\li \l{Opening Projects}
|
||||||
\li \l{Adding Libraries to Projects}
|
\li \l{Adding Libraries to Projects}
|
||||||
\li \l{Adding New Custom Wizards}
|
\li \l{Adding New Custom Wizards}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2020 The Qt Company Ltd.
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
// **********************************************************************
|
// **********************************************************************
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\previouspage creator-project-creating.html
|
\previouspage creator-file-creating.html
|
||||||
\page creator-project-opening.html
|
\page creator-project-opening.html
|
||||||
\nextpage creator-project-qmake-libraries.html
|
\nextpage creator-project-qmake-libraries.html
|
||||||
|
|
||||||
|
@@ -58,6 +58,7 @@
|
|||||||
\list
|
\list
|
||||||
\li \l{Creating Projects}
|
\li \l{Creating Projects}
|
||||||
\list
|
\list
|
||||||
|
\li \l{Creating Files}
|
||||||
\li \l{Opening Projects}
|
\li \l{Opening Projects}
|
||||||
\li \l{Adding Libraries to Projects}
|
\li \l{Adding Libraries to Projects}
|
||||||
\li \l{Adding New Custom Wizards}
|
\li \l{Adding New Custom Wizards}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2021 The Qt Company Ltd.
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -83,7 +83,11 @@
|
|||||||
line endings, indentation, owner, size, last read and modified
|
line endings, indentation, owner, size, last read and modified
|
||||||
dates, and permissions.
|
dates, and permissions.
|
||||||
\li Create new files. For more information, see
|
\li Create new files. For more information, see
|
||||||
|
\if defined(qtdesignstudio)
|
||||||
\l{Adding Files to Projects}.
|
\l{Adding Files to Projects}.
|
||||||
|
\else
|
||||||
|
\l{Creating Files}.
|
||||||
|
\endif
|
||||||
\li Rename or remove existing files.
|
\li Rename or remove existing files.
|
||||||
\li Create new folders.
|
\li Create new folders.
|
||||||
\li Compare the selected file with the currently open file in the diff
|
\li Compare the selected file with the currently open file in the diff
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2021 The Qt Company Ltd.
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -79,7 +79,11 @@
|
|||||||
\li Set a project as the active project.
|
\li Set a project as the active project.
|
||||||
\li Execute the \uicontrol Build menu commands.
|
\li Execute the \uicontrol Build menu commands.
|
||||||
\li Create new files. For more information, see
|
\li Create new files. For more information, see
|
||||||
|
\if defined(qtdesignstudio)
|
||||||
\l{Adding Files to Projects}.
|
\l{Adding Files to Projects}.
|
||||||
|
\else
|
||||||
|
\l{Creating Files}.
|
||||||
|
\endif
|
||||||
\li Rename or remove existing files. If you change the base name of a
|
\li Rename or remove existing files. If you change the base name of a
|
||||||
file, \QC displays a list of other files with the same base name
|
file, \QC displays a list of other files with the same base name
|
||||||
and offers to rename them as well.
|
and offers to rename them as well.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2021 The Qt Company Ltd.
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -508,10 +508,10 @@
|
|||||||
|
|
||||||
\image qtcreator-issues.png "Issues output pane"
|
\image qtcreator-issues.png "Issues output pane"
|
||||||
|
|
||||||
Right-clicking on a line brings up a context menu with actions that you can
|
Select one or several lines to apply context-menu actions to their contents.
|
||||||
apply to the contents of the line. You can remove a line, copy its contents
|
You can remove the selected lines or copy their contents to the clipboard.
|
||||||
to the clipboard, or search the Internet for a solution using the contents
|
For single lines, you can search the Internet for a solution using the
|
||||||
of the line as search criteria. In addition, you can show a version control
|
contents of the line as search criteria or open a version control
|
||||||
annotation view of the line that causes the error message.
|
annotation view of the line that causes the error message.
|
||||||
|
|
||||||
To navigate to the corresponding source code, click an issue or
|
To navigate to the corresponding source code, click an issue or
|
||||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 20 KiB |
@@ -24,7 +24,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\example loginui1
|
\example Loginui1
|
||||||
\ingroup gstutorials
|
\ingroup gstutorials
|
||||||
\nextpage {Log In UI - Positioning}
|
\nextpage {Log In UI - Positioning}
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@
|
|||||||
adds the following \e import statements to the UI files (.ui.qml) that it
|
adds the following \e import statements to the UI files (.ui.qml) that it
|
||||||
creates:
|
creates:
|
||||||
|
|
||||||
\quotefromfile Loginui1/Content/Screen01.ui.qml
|
\quotefromfile Loginui1/content/Screen01.ui.qml
|
||||||
\skipto import
|
\skipto import
|
||||||
\printuntil Controls
|
\printuntil Controls
|
||||||
|
|
||||||
@@ -334,7 +334,7 @@
|
|||||||
To be able to use the functionality of the Button control, the wizard template
|
To be able to use the functionality of the Button control, the wizard template
|
||||||
adds the following \e import statements to the \e EntryField.ui.qml file:
|
adds the following \e import statements to the \e EntryField.ui.qml file:
|
||||||
|
|
||||||
\quotefromfile Loginui1/Content/EntryField.ui.qml
|
\quotefromfile Loginui1/content/EntryField.ui.qml
|
||||||
\skipto import
|
\skipto import
|
||||||
\printuntil Controls
|
\printuntil Controls
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\example loginui3
|
\example Loginui3
|
||||||
\ingroup gstutorials
|
\ingroup gstutorials
|
||||||
|
|
||||||
\title Log In UI - States
|
\title Log In UI - States
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\example loginui4
|
\example Loginui4
|
||||||
\ingroup gstutorials
|
\ingroup gstutorials
|
||||||
|
|
||||||
\title Log In UI - Timeline
|
\title Log In UI - Timeline
|
||||||
@@ -312,7 +312,7 @@
|
|||||||
the following \e import statement to the UI files where it uses the
|
the following \e import statement to the UI files where it uses the
|
||||||
components:
|
components:
|
||||||
|
|
||||||
\quotefromfile Loginui4/Content/Screen01.ui.qml
|
\quotefromfile Loginui4/content/Screen01.ui.qml
|
||||||
\skipto QtQuick.Timeline
|
\skipto QtQuick.Timeline
|
||||||
\printuntil 1.0
|
\printuntil 1.0
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 96 KiB |
@@ -62,6 +62,10 @@
|
|||||||
\li Category
|
\li Category
|
||||||
\li Wizard Preset
|
\li Wizard Preset
|
||||||
\li Purpose
|
\li Purpose
|
||||||
|
\row
|
||||||
|
\li Recents
|
||||||
|
\li
|
||||||
|
\li Lists the most recent presets that you have used.
|
||||||
\row
|
\row
|
||||||
\li {1,2} General
|
\li {1,2} General
|
||||||
\li Empty
|
\li Empty
|
||||||
|
@@ -17,5 +17,7 @@ QtcProduct {
|
|||||||
return defines;
|
return defines;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
destinationDirectory: project.buildDirectory + '/'
|
||||||
|
+ FileInfo.relativePath(project.ide_source_tree, sourceDirectory)
|
||||||
install: false
|
install: false
|
||||||
}
|
}
|
||||||
|
@@ -126,8 +126,9 @@ def common_cmake_arguments(args):
|
|||||||
'-G', 'Ninja']
|
'-G', 'Ninja']
|
||||||
|
|
||||||
if args.python3:
|
if args.python3:
|
||||||
cmake_args += ['-DPYTHON_EXECUTABLE=' + args.python3]
|
|
||||||
cmake_args += ['-DPython3_EXECUTABLE=' + args.python3]
|
cmake_args += ['-DPython3_EXECUTABLE=' + args.python3]
|
||||||
|
if args.python_path:
|
||||||
|
cmake_args += ['-DPython3_ROOT_DIR=' + args.python_path]
|
||||||
|
|
||||||
if args.module_paths:
|
if args.module_paths:
|
||||||
module_paths = [common.to_posix_path(os.path.abspath(fp)) for fp in args.module_paths]
|
module_paths = [common.to_posix_path(os.path.abspath(fp)) for fp in args.module_paths]
|
||||||
@@ -140,11 +141,6 @@ def common_cmake_arguments(args):
|
|||||||
if not os.environ.get('CC') and not os.environ.get('CXX'):
|
if not os.environ.get('CC') and not os.environ.get('CXX'):
|
||||||
cmake_args += ['-DCMAKE_C_COMPILER=cl',
|
cmake_args += ['-DCMAKE_C_COMPILER=cl',
|
||||||
'-DCMAKE_CXX_COMPILER=cl']
|
'-DCMAKE_CXX_COMPILER=cl']
|
||||||
if args.python_path:
|
|
||||||
python_library = glob.glob(os.path.join(args.python_path, 'libs', 'python??.lib'))
|
|
||||||
if python_library:
|
|
||||||
cmake_args += ['-DPYTHON_LIBRARY=' + python_library[0],
|
|
||||||
'-DPYTHON_INCLUDE_DIR=' + os.path.join(args.python_path, 'include')]
|
|
||||||
|
|
||||||
pch_option = 'ON' if args.with_pch else 'OFF'
|
pch_option = 'ON' if args.with_pch else 'OFF'
|
||||||
cmake_args += ['-DBUILD_WITH_PCH=' + pch_option]
|
cmake_args += ['-DBUILD_WITH_PCH=' + pch_option]
|
||||||
|
@@ -32,6 +32,11 @@ View3D {
|
|||||||
|
|
||||||
property Material previewMaterial
|
property Material previewMaterial
|
||||||
|
|
||||||
|
function fitToViewPort()
|
||||||
|
{
|
||||||
|
// No need to zoom this view, this is here just to avoid runtime warnings
|
||||||
|
}
|
||||||
|
|
||||||
SceneEnvironment {
|
SceneEnvironment {
|
||||||
id: sceneEnv
|
id: sceneEnv
|
||||||
antialiasingMode: SceneEnvironment.MSAA
|
antialiasingMode: SceneEnvironment.MSAA
|
||||||
|
@@ -41,8 +41,6 @@ Item {
|
|||||||
property var modelViewComponent
|
property var modelViewComponent
|
||||||
property var nodeViewComponent
|
property var nodeViewComponent
|
||||||
|
|
||||||
property bool ready: false
|
|
||||||
|
|
||||||
function destroyView()
|
function destroyView()
|
||||||
{
|
{
|
||||||
previewObject = null;
|
previewObject = null;
|
||||||
@@ -58,8 +56,6 @@ Item {
|
|||||||
createViewForModel(obj);
|
createViewForModel(obj);
|
||||||
else if (obj instanceof Node)
|
else if (obj instanceof Node)
|
||||||
createViewForNode(obj);
|
createViewForNode(obj);
|
||||||
|
|
||||||
previewObject = obj;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createViewForMaterial(material)
|
function createViewForMaterial(material)
|
||||||
@@ -70,6 +66,8 @@ Item {
|
|||||||
// Always recreate the view to ensure material is up to date
|
// Always recreate the view to ensure material is up to date
|
||||||
if (materialViewComponent.status === Component.Ready)
|
if (materialViewComponent.status === Component.Ready)
|
||||||
view = materialViewComponent.createObject(viewRect, {"previewMaterial": material});
|
view = materialViewComponent.createObject(viewRect, {"previewMaterial": material});
|
||||||
|
|
||||||
|
previewObject = material;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createViewForModel(model)
|
function createViewForModel(model)
|
||||||
@@ -80,6 +78,8 @@ Item {
|
|||||||
// Always recreate the view to ensure model is up to date
|
// Always recreate the view to ensure model is up to date
|
||||||
if (modelViewComponent.status === Component.Ready)
|
if (modelViewComponent.status === Component.Ready)
|
||||||
view = modelViewComponent.createObject(viewRect, {"sourceModel": model});
|
view = modelViewComponent.createObject(viewRect, {"sourceModel": model});
|
||||||
|
|
||||||
|
previewObject = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createViewForNode(node)
|
function createViewForNode(node)
|
||||||
@@ -90,16 +90,13 @@ Item {
|
|||||||
// Always recreate the view to ensure node is up to date
|
// Always recreate the view to ensure node is up to date
|
||||||
if (nodeViewComponent.status === Component.Ready)
|
if (nodeViewComponent.status === Component.Ready)
|
||||||
view = nodeViewComponent.createObject(viewRect, {"importScene": node});
|
view = nodeViewComponent.createObject(viewRect, {"importScene": node});
|
||||||
|
|
||||||
|
previewObject = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
function afterRender()
|
function fitToViewPort()
|
||||||
{
|
{
|
||||||
if (previewObject instanceof Node) {
|
|
||||||
view.fitToViewPort();
|
view.fitToViewPort();
|
||||||
ready = view.ready;
|
|
||||||
} else {
|
|
||||||
ready = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
View3D {
|
View3D {
|
||||||
|
@@ -32,24 +32,13 @@ View3D {
|
|||||||
environment: sceneEnv
|
environment: sceneEnv
|
||||||
camera: theCamera
|
camera: theCamera
|
||||||
|
|
||||||
property bool ready: false
|
|
||||||
property real prevZoomFactor: -1
|
|
||||||
property Model sourceModel
|
property Model sourceModel
|
||||||
|
|
||||||
function fitToViewPort()
|
function fitToViewPort()
|
||||||
{
|
{
|
||||||
cameraControl.focusObject(model, theCamera.eulerRotation, true, false);
|
// The magic number is the distance from camera default pos to origin
|
||||||
|
_generalHelper.calculateNodeBoundsAndFocusCamera(theCamera, importScene, root,
|
||||||
if (cameraControl._zoomFactor < 0.1) {
|
1040);
|
||||||
model.scale = model.scale.times(10);
|
|
||||||
} else if (cameraControl._zoomFactor > 10) {
|
|
||||||
model.scale = model.scale.times(0.1);
|
|
||||||
} else {
|
|
||||||
// We need one more render after zoom factor change, so only set ready when zoom factor
|
|
||||||
// or scaling hasn't changed from the previous frame
|
|
||||||
ready = _generalHelper.fuzzyCompare(cameraControl._zoomFactor, prevZoomFactor);
|
|
||||||
prevZoomFactor = cameraControl._zoomFactor;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneEnvironment {
|
SceneEnvironment {
|
||||||
@@ -58,14 +47,6 @@ View3D {
|
|||||||
antialiasingQuality: SceneEnvironment.High
|
antialiasingQuality: SceneEnvironment.High
|
||||||
}
|
}
|
||||||
|
|
||||||
EditCameraController {
|
|
||||||
id: cameraControl
|
|
||||||
camera: theCamera
|
|
||||||
anchors.fill: parent
|
|
||||||
view3d: root
|
|
||||||
ignoreToolState: true
|
|
||||||
}
|
|
||||||
|
|
||||||
DirectionalLight {
|
DirectionalLight {
|
||||||
eulerRotation.x: -30
|
eulerRotation.x: -30
|
||||||
eulerRotation.y: -30
|
eulerRotation.y: -30
|
||||||
@@ -75,15 +56,15 @@ View3D {
|
|||||||
id: theCamera
|
id: theCamera
|
||||||
z: 600
|
z: 600
|
||||||
y: 600
|
y: 600
|
||||||
|
x: 600
|
||||||
eulerRotation.x: -45
|
eulerRotation.x: -45
|
||||||
|
eulerRotation.y: -45
|
||||||
clipFar: 10000
|
clipFar: 10000
|
||||||
clipNear: 1
|
clipNear: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
Model {
|
Model {
|
||||||
id: model
|
id: model
|
||||||
eulerRotation.y: 45
|
|
||||||
|
|
||||||
source: sourceModel.source
|
source: sourceModel.source
|
||||||
geometry: sourceModel.geometry
|
geometry: sourceModel.geometry
|
||||||
|
|
||||||
|
@@ -32,30 +32,11 @@ View3D {
|
|||||||
environment: sceneEnv
|
environment: sceneEnv
|
||||||
camera: theCamera
|
camera: theCamera
|
||||||
|
|
||||||
property bool ready: false
|
|
||||||
property bool first: true
|
|
||||||
property real prevZoomFactor: -1
|
|
||||||
|
|
||||||
function fitToViewPort()
|
function fitToViewPort()
|
||||||
{
|
{
|
||||||
if (first) {
|
// The magic number is the distance from camera default pos to origin
|
||||||
first = false;
|
_generalHelper.calculateNodeBoundsAndFocusCamera(theCamera, importScene, root,
|
||||||
selectionBox.targetNode = root.importScene;
|
1040);
|
||||||
} else {
|
|
||||||
cameraControl.focusObject(selectionBox.model, theCamera.eulerRotation, true, false);
|
|
||||||
|
|
||||||
if (cameraControl._zoomFactor < 0.1) {
|
|
||||||
root.importScene.scale = root.importScene.scale.times(10);
|
|
||||||
} else if (cameraControl._zoomFactor > 10) {
|
|
||||||
root.importScene.scale = root.importScene.scale.times(0.1);
|
|
||||||
} else {
|
|
||||||
// We need one more render after zoom factor change, so only set ready when zoom factor
|
|
||||||
// or scaling hasn't changed from the previous frame
|
|
||||||
ready = _generalHelper.fuzzyCompare(cameraControl._zoomFactor, prevZoomFactor);
|
|
||||||
prevZoomFactor = cameraControl._zoomFactor;
|
|
||||||
selectionBox.visible = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneEnvironment {
|
SceneEnvironment {
|
||||||
@@ -64,20 +45,6 @@ View3D {
|
|||||||
antialiasingQuality: SceneEnvironment.High
|
antialiasingQuality: SceneEnvironment.High
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectionBox {
|
|
||||||
id: selectionBox
|
|
||||||
view3D: root
|
|
||||||
geometryName: "NodeNodeViewSB"
|
|
||||||
}
|
|
||||||
|
|
||||||
EditCameraController {
|
|
||||||
id: cameraControl
|
|
||||||
camera: theCamera
|
|
||||||
anchors.fill: parent
|
|
||||||
view3d: root
|
|
||||||
ignoreToolState: true
|
|
||||||
}
|
|
||||||
|
|
||||||
DirectionalLight {
|
DirectionalLight {
|
||||||
eulerRotation.x: -30
|
eulerRotation.x: -30
|
||||||
eulerRotation.y: -30
|
eulerRotation.y: -30
|
||||||
|
@@ -32,6 +32,11 @@ View3D {
|
|||||||
|
|
||||||
property Material previewMaterial
|
property Material previewMaterial
|
||||||
|
|
||||||
|
function fitToViewPort()
|
||||||
|
{
|
||||||
|
// No need to zoom this view, this is here just to avoid runtime warnings
|
||||||
|
}
|
||||||
|
|
||||||
SceneEnvironment {
|
SceneEnvironment {
|
||||||
id: sceneEnv
|
id: sceneEnv
|
||||||
antialiasingMode: SceneEnvironment.MSAA
|
antialiasingMode: SceneEnvironment.MSAA
|
||||||
|
@@ -41,8 +41,6 @@ Item {
|
|||||||
property var modelViewComponent
|
property var modelViewComponent
|
||||||
property var nodeViewComponent
|
property var nodeViewComponent
|
||||||
|
|
||||||
property bool ready: false
|
|
||||||
|
|
||||||
function destroyView()
|
function destroyView()
|
||||||
{
|
{
|
||||||
previewObject = null;
|
previewObject = null;
|
||||||
@@ -58,8 +56,6 @@ Item {
|
|||||||
createViewForModel(obj);
|
createViewForModel(obj);
|
||||||
else if (obj instanceof Node)
|
else if (obj instanceof Node)
|
||||||
createViewForNode(obj);
|
createViewForNode(obj);
|
||||||
|
|
||||||
previewObject = obj;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createViewForMaterial(material)
|
function createViewForMaterial(material)
|
||||||
@@ -70,6 +66,8 @@ Item {
|
|||||||
// Always recreate the view to ensure material is up to date
|
// Always recreate the view to ensure material is up to date
|
||||||
if (materialViewComponent.status === Component.Ready)
|
if (materialViewComponent.status === Component.Ready)
|
||||||
view = materialViewComponent.createObject(viewRect, {"previewMaterial": material});
|
view = materialViewComponent.createObject(viewRect, {"previewMaterial": material});
|
||||||
|
|
||||||
|
previewObject = material;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createViewForModel(model)
|
function createViewForModel(model)
|
||||||
@@ -80,6 +78,8 @@ Item {
|
|||||||
// Always recreate the view to ensure model is up to date
|
// Always recreate the view to ensure model is up to date
|
||||||
if (modelViewComponent.status === Component.Ready)
|
if (modelViewComponent.status === Component.Ready)
|
||||||
view = modelViewComponent.createObject(viewRect, {"sourceModel": model});
|
view = modelViewComponent.createObject(viewRect, {"sourceModel": model});
|
||||||
|
|
||||||
|
previewObject = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createViewForNode(node)
|
function createViewForNode(node)
|
||||||
@@ -90,16 +90,13 @@ Item {
|
|||||||
// Always recreate the view to ensure node is up to date
|
// Always recreate the view to ensure node is up to date
|
||||||
if (nodeViewComponent.status === Component.Ready)
|
if (nodeViewComponent.status === Component.Ready)
|
||||||
view = nodeViewComponent.createObject(viewRect, {"importScene": node});
|
view = nodeViewComponent.createObject(viewRect, {"importScene": node});
|
||||||
|
|
||||||
|
previewObject = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
function afterRender()
|
function fitToViewPort()
|
||||||
{
|
{
|
||||||
if (previewObject instanceof Node) {
|
|
||||||
view.fitToViewPort();
|
view.fitToViewPort();
|
||||||
ready = view.ready;
|
|
||||||
} else {
|
|
||||||
ready = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
@@ -32,24 +32,13 @@ View3D {
|
|||||||
environment: sceneEnv
|
environment: sceneEnv
|
||||||
camera: theCamera
|
camera: theCamera
|
||||||
|
|
||||||
property bool ready: false
|
|
||||||
property real prevZoomFactor: -1
|
|
||||||
property Model sourceModel
|
property Model sourceModel
|
||||||
|
|
||||||
function fitToViewPort()
|
function fitToViewPort()
|
||||||
{
|
{
|
||||||
cameraControl.focusObject(model, theCamera.eulerRotation, true, false);
|
// The magic number is the distance from camera default pos to origin
|
||||||
|
_generalHelper.calculateNodeBoundsAndFocusCamera(theCamera, importScene, root,
|
||||||
if (cameraControl._zoomFactor < 0.1) {
|
1040);
|
||||||
model.scale = model.scale.times(10);
|
|
||||||
} else if (cameraControl._zoomFactor > 10) {
|
|
||||||
model.scale = model.scale.times(0.1);
|
|
||||||
} else {
|
|
||||||
// We need one more render after zoom factor change, so only set ready when zoom factor
|
|
||||||
// or scaling hasn't changed from the previous frame
|
|
||||||
ready = _generalHelper.fuzzyCompare(cameraControl._zoomFactor, prevZoomFactor);
|
|
||||||
prevZoomFactor = cameraControl._zoomFactor;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneEnvironment {
|
SceneEnvironment {
|
||||||
@@ -58,14 +47,6 @@ View3D {
|
|||||||
antialiasingQuality: SceneEnvironment.High
|
antialiasingQuality: SceneEnvironment.High
|
||||||
}
|
}
|
||||||
|
|
||||||
EditCameraController {
|
|
||||||
id: cameraControl
|
|
||||||
camera: theCamera
|
|
||||||
anchors.fill: parent
|
|
||||||
view3d: root
|
|
||||||
ignoreToolState: true
|
|
||||||
}
|
|
||||||
|
|
||||||
DirectionalLight {
|
DirectionalLight {
|
||||||
eulerRotation.x: -30
|
eulerRotation.x: -30
|
||||||
eulerRotation.y: -30
|
eulerRotation.y: -30
|
||||||
@@ -75,16 +56,15 @@ View3D {
|
|||||||
id: theCamera
|
id: theCamera
|
||||||
z: 600
|
z: 600
|
||||||
y: 600
|
y: 600
|
||||||
|
x: 600
|
||||||
eulerRotation.x: -45
|
eulerRotation.x: -45
|
||||||
|
eulerRotation.y: -45
|
||||||
clipFar: 10000
|
clipFar: 10000
|
||||||
clipNear: 1
|
clipNear: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
Model {
|
Model {
|
||||||
id: model
|
id: model
|
||||||
readonly property bool _edit3dLocked: true // Make this non-pickable
|
|
||||||
eulerRotation.y: 45
|
|
||||||
|
|
||||||
source: sourceModel.source
|
source: sourceModel.source
|
||||||
geometry: sourceModel.geometry
|
geometry: sourceModel.geometry
|
||||||
|
|
||||||
|
@@ -32,30 +32,11 @@ View3D {
|
|||||||
environment: sceneEnv
|
environment: sceneEnv
|
||||||
camera: theCamera
|
camera: theCamera
|
||||||
|
|
||||||
property bool ready: false
|
|
||||||
property bool first: true
|
|
||||||
property real prevZoomFactor: -1
|
|
||||||
|
|
||||||
function fitToViewPort()
|
function fitToViewPort()
|
||||||
{
|
{
|
||||||
if (first) {
|
// The magic number is the distance from camera default pos to origin
|
||||||
first = false;
|
_generalHelper.calculateNodeBoundsAndFocusCamera(theCamera, importScene, root,
|
||||||
selectionBox.targetNode = root.importScene;
|
1040);
|
||||||
} else {
|
|
||||||
cameraControl.focusObject(selectionBox.model, theCamera.eulerRotation, true, false);
|
|
||||||
|
|
||||||
if (cameraControl._zoomFactor < 0.1) {
|
|
||||||
root.importScene.scale = root.importScene.scale.times(10);
|
|
||||||
} else if (cameraControl._zoomFactor > 10) {
|
|
||||||
root.importScene.scale = root.importScene.scale.times(0.1);
|
|
||||||
} else {
|
|
||||||
// We need one more render after zoom factor change, so only set ready when zoom factor
|
|
||||||
// or scaling hasn't changed from the previous frame
|
|
||||||
ready = _generalHelper.fuzzyCompare(cameraControl._zoomFactor, prevZoomFactor);
|
|
||||||
prevZoomFactor = cameraControl._zoomFactor;
|
|
||||||
selectionBox.visible = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneEnvironment {
|
SceneEnvironment {
|
||||||
@@ -64,20 +45,6 @@ View3D {
|
|||||||
antialiasingQuality: SceneEnvironment.High
|
antialiasingQuality: SceneEnvironment.High
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectionBox {
|
|
||||||
id: selectionBox
|
|
||||||
view3D: root
|
|
||||||
geometryName: "NodeNodeViewSB"
|
|
||||||
}
|
|
||||||
|
|
||||||
EditCameraController {
|
|
||||||
id: cameraControl
|
|
||||||
camera: theCamera
|
|
||||||
anchors.fill: parent
|
|
||||||
view3d: root
|
|
||||||
ignoreToolState: true
|
|
||||||
}
|
|
||||||
|
|
||||||
DirectionalLight {
|
DirectionalLight {
|
||||||
eulerRotation.x: -30
|
eulerRotation.x: -30
|
||||||
eulerRotation.y: -30
|
eulerRotation.y: -30
|
||||||
|
@@ -55,6 +55,11 @@ const QString _globalStateId = QStringLiteral("@GTS"); // global tool state
|
|||||||
const QString _lastSceneIdKey = QStringLiteral("lastSceneId");
|
const QString _lastSceneIdKey = QStringLiteral("lastSceneId");
|
||||||
const QString _rootSizeKey = QStringLiteral("rootSize");
|
const QString _rootSizeKey = QStringLiteral("rootSize");
|
||||||
|
|
||||||
|
static const float floatMin = std::numeric_limits<float>::lowest();
|
||||||
|
static const float floatMax = std::numeric_limits<float>::max();
|
||||||
|
static const QVector3D maxVec = QVector3D(floatMax, floatMax, floatMax);
|
||||||
|
static const QVector3D minVec = QVector3D(floatMin, floatMin, floatMin);
|
||||||
|
|
||||||
GeneralHelper::GeneralHelper()
|
GeneralHelper::GeneralHelper()
|
||||||
: QObject()
|
: QObject()
|
||||||
{
|
{
|
||||||
@@ -269,6 +274,37 @@ QVector4D GeneralHelper::focusNodesToCamera(QQuick3DCamera *camera, float defaul
|
|||||||
return QVector4D(lookAt, cameraZoomFactor);
|
return QVector4D(lookAt, cameraZoomFactor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This function can be used to synchronously focus camera on a node, which doesn't have to be
|
||||||
|
// a selection box for bound calculations to work. This is used to focus the view for
|
||||||
|
// various preview image generations, where doing things asynchronously is not good
|
||||||
|
// and recalculating bounds for every frame is not a problem.
|
||||||
|
void GeneralHelper::calculateNodeBoundsAndFocusCamera(
|
||||||
|
QQuick3DCamera *camera, QQuick3DNode *node, QQuick3DViewport *viewPort,
|
||||||
|
float defaultLookAtDistance)
|
||||||
|
{
|
||||||
|
QVector3D minBounds;
|
||||||
|
QVector3D maxBounds;
|
||||||
|
|
||||||
|
getBounds(viewPort, node, minBounds, maxBounds);
|
||||||
|
|
||||||
|
QVector3D extents = maxBounds - minBounds;
|
||||||
|
QVector3D lookAt = minBounds + (extents / 2.f);
|
||||||
|
float maxExtent = qMax(extents.x(), qMax(extents.y(), extents.z()));
|
||||||
|
|
||||||
|
// Reset camera position to default zoom
|
||||||
|
QMatrix4x4 m = camera->sceneTransform();
|
||||||
|
const float *dataPtr(m.data());
|
||||||
|
QVector3D newLookVector(dataPtr[8], dataPtr[9], dataPtr[10]);
|
||||||
|
newLookVector.normalize();
|
||||||
|
newLookVector *= defaultLookAtDistance;
|
||||||
|
|
||||||
|
camera->setPosition(lookAt + newLookVector);
|
||||||
|
|
||||||
|
float newZoomFactor = maxExtent / 725.f; // Divisor taken from focusNodesToCamera function
|
||||||
|
|
||||||
|
zoomCamera(viewPort, camera, 0, defaultLookAtDistance, lookAt, newZoomFactor, false);
|
||||||
|
}
|
||||||
|
|
||||||
// Aligns any cameras found in nodes list to a camera.
|
// Aligns any cameras found in nodes list to a camera.
|
||||||
// Only position and rotation are copied, rest of the camera properties stay the same.
|
// Only position and rotation are copied, rest of the camera properties stay the same.
|
||||||
void GeneralHelper::alignCameras(QQuick3DCamera *camera, const QVariant &nodes)
|
void GeneralHelper::alignCameras(QQuick3DCamera *camera, const QVariant &nodes)
|
||||||
@@ -727,6 +763,129 @@ QVector3D GeneralHelper::pivotScenePosition(QQuick3DNode *node) const
|
|||||||
return mat44::getPosition(sceneTransform);
|
return mat44::getPosition(sceneTransform);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calculate bounds for given node, including all child nodes.
|
||||||
|
// Returns true if the tree contains at least one Model node.
|
||||||
|
bool GeneralHelper::getBounds(QQuick3DViewport *view3D, QQuick3DNode *node, QVector3D &minBounds,
|
||||||
|
QVector3D &maxBounds, bool recursive)
|
||||||
|
{
|
||||||
|
if (!node) {
|
||||||
|
const float halfExtent = 100.f;
|
||||||
|
minBounds = {-halfExtent, -halfExtent, -halfExtent};
|
||||||
|
maxBounds = {halfExtent, halfExtent, halfExtent};
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMatrix4x4 localTransform;
|
||||||
|
auto nodePriv = QQuick3DObjectPrivate::get(node);
|
||||||
|
auto renderNode = static_cast<QSSGRenderNode *>(nodePriv->spatialNode);
|
||||||
|
|
||||||
|
if (recursive && renderNode) {
|
||||||
|
if (renderNode->flags.testFlag(QSSGRenderNode::Flag::TransformDirty))
|
||||||
|
renderNode->calculateLocalTransform();
|
||||||
|
localTransform = renderNode->localTransform;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVector3D localMinBounds = maxVec;
|
||||||
|
QVector3D localMaxBounds = minVec;
|
||||||
|
|
||||||
|
// Find bounds for children
|
||||||
|
QVector<QVector3D> minBoundsVec;
|
||||||
|
QVector<QVector3D> maxBoundsVec;
|
||||||
|
const auto children = node->childItems();
|
||||||
|
bool hasModel = false;
|
||||||
|
for (const auto child : children) {
|
||||||
|
if (auto childNode = qobject_cast<QQuick3DNode *>(child)) {
|
||||||
|
QVector3D newMinBounds = minBounds;
|
||||||
|
QVector3D newMaxBounds = maxBounds;
|
||||||
|
hasModel = getBounds(view3D, childNode, newMinBounds, newMaxBounds, true);
|
||||||
|
// Ignore any subtrees that do not have Model in them as we don't need those
|
||||||
|
// for visual bounds calculations
|
||||||
|
if (hasModel) {
|
||||||
|
minBoundsVec << newMinBounds;
|
||||||
|
maxBoundsVec << newMaxBounds;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
auto combineMinBounds = [](QVector3D &target, const QVector3D &source) {
|
||||||
|
target.setX(qMin(source.x(), target.x()));
|
||||||
|
target.setY(qMin(source.y(), target.y()));
|
||||||
|
target.setZ(qMin(source.z(), target.z()));
|
||||||
|
};
|
||||||
|
auto combineMaxBounds = [](QVector3D &target, const QVector3D &source) {
|
||||||
|
target.setX(qMax(source.x(), target.x()));
|
||||||
|
target.setY(qMax(source.y(), target.y()));
|
||||||
|
target.setZ(qMax(source.z(), target.z()));
|
||||||
|
};
|
||||||
|
auto transformCorner = [&](const QMatrix4x4 &m, QVector3D &minTarget, QVector3D &maxTarget,
|
||||||
|
const QVector3D &corner) {
|
||||||
|
QVector3D mappedCorner = m.map(corner);
|
||||||
|
combineMinBounds(minTarget, mappedCorner);
|
||||||
|
combineMaxBounds(maxTarget, mappedCorner);
|
||||||
|
};
|
||||||
|
auto transformCorners = [&](const QMatrix4x4 &m, QVector3D &minTarget, QVector3D &maxTarget,
|
||||||
|
const QVector3D &minCorner, const QVector3D &maxCorner) {
|
||||||
|
transformCorner(m, minTarget, maxTarget, minCorner);
|
||||||
|
transformCorner(m, minTarget, maxTarget, maxCorner);
|
||||||
|
transformCorner(m, minTarget, maxTarget, QVector3D(minCorner.x(), minCorner.y(), maxCorner.z()));
|
||||||
|
transformCorner(m, minTarget, maxTarget, QVector3D(minCorner.x(), maxCorner.y(), minCorner.z()));
|
||||||
|
transformCorner(m, minTarget, maxTarget, QVector3D(maxCorner.x(), minCorner.y(), minCorner.z()));
|
||||||
|
transformCorner(m, minTarget, maxTarget, QVector3D(minCorner.x(), maxCorner.y(), maxCorner.z()));
|
||||||
|
transformCorner(m, minTarget, maxTarget, QVector3D(maxCorner.x(), maxCorner.y(), minCorner.z()));
|
||||||
|
transformCorner(m, minTarget, maxTarget, QVector3D(maxCorner.x(), minCorner.y(), maxCorner.z()));
|
||||||
|
};
|
||||||
|
|
||||||
|
// Combine all child bounds
|
||||||
|
for (const auto &newBounds : qAsConst(minBoundsVec))
|
||||||
|
combineMinBounds(localMinBounds, newBounds);
|
||||||
|
for (const auto &newBounds : qAsConst(maxBoundsVec))
|
||||||
|
combineMaxBounds(localMaxBounds, newBounds);
|
||||||
|
|
||||||
|
if (qobject_cast<QQuick3DModel *>(node)) {
|
||||||
|
if (auto renderModel = static_cast<QSSGRenderModel *>(renderNode)) {
|
||||||
|
QWindow *window = static_cast<QWindow *>(view3D->window());
|
||||||
|
if (window) {
|
||||||
|
QSSGRef<QSSGRenderContextInterface> context;
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
context = QSSGRenderContextInterface::getRenderContextInterface(quintptr(window));
|
||||||
|
#else
|
||||||
|
context = QQuick3DObjectPrivate::get(node)->sceneManager->rci;
|
||||||
|
#endif
|
||||||
|
if (!context.isNull()) {
|
||||||
|
auto bufferManager = context->bufferManager();
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0)
|
||||||
|
QSSGBounds3 bounds = renderModel->getModelBounds(bufferManager);
|
||||||
|
#else
|
||||||
|
QSSGBounds3 bounds = bufferManager->getModelBounds(renderModel);
|
||||||
|
#endif
|
||||||
|
QVector3D center = bounds.center();
|
||||||
|
QVector3D extents = bounds.extents();
|
||||||
|
QVector3D localMin = center - extents;
|
||||||
|
QVector3D localMax = center + extents;
|
||||||
|
|
||||||
|
combineMinBounds(localMinBounds, localMin);
|
||||||
|
combineMaxBounds(localMaxBounds, localMax);
|
||||||
|
|
||||||
|
hasModel = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
combineMinBounds(localMinBounds, {});
|
||||||
|
combineMaxBounds(localMaxBounds, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (localMaxBounds == minVec) {
|
||||||
|
localMinBounds = {};
|
||||||
|
localMaxBounds = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Transform local space bounding box to parent space
|
||||||
|
transformCorners(localTransform, minBounds, maxBounds, localMinBounds, localMaxBounds);
|
||||||
|
|
||||||
|
return hasModel;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -72,6 +72,9 @@ public:
|
|||||||
const QVariant &nodes, QQuick3DViewport *viewPort,
|
const QVariant &nodes, QQuick3DViewport *viewPort,
|
||||||
float oldZoom, bool updateZoom = true,
|
float oldZoom, bool updateZoom = true,
|
||||||
bool closeUp = false);
|
bool closeUp = false);
|
||||||
|
Q_INVOKABLE void calculateNodeBoundsAndFocusCamera(QQuick3DCamera *camera, QQuick3DNode *node,
|
||||||
|
QQuick3DViewport *viewPort,
|
||||||
|
float defaultLookAtDistance);
|
||||||
Q_INVOKABLE void alignCameras(QQuick3DCamera *camera, const QVariant &nodes);
|
Q_INVOKABLE void alignCameras(QQuick3DCamera *camera, const QVariant &nodes);
|
||||||
Q_INVOKABLE QVector3D alignView(QQuick3DCamera *camera, const QVariant &nodes,
|
Q_INVOKABLE QVector3D alignView(QQuick3DCamera *camera, const QVariant &nodes,
|
||||||
const QVector3D &lookAtPoint);
|
const QVector3D &lookAtPoint);
|
||||||
@@ -126,6 +129,8 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void handlePendingToolStateUpdate();
|
void handlePendingToolStateUpdate();
|
||||||
QVector3D pivotScenePosition(QQuick3DNode *node) const;
|
QVector3D pivotScenePosition(QQuick3DNode *node) const;
|
||||||
|
bool getBounds(QQuick3DViewport *view3D, QQuick3DNode *node, QVector3D &minBounds,
|
||||||
|
QVector3D &maxBounds, bool recursive = false);
|
||||||
|
|
||||||
QTimer m_overlayUpdateTimer;
|
QTimer m_overlayUpdateTimer;
|
||||||
QTimer m_toolStateUpdateTimer;
|
QTimer m_toolStateUpdateTimer;
|
||||||
|
@@ -1588,6 +1588,11 @@ bool NodeInstanceServer::isInformationServer() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool NodeInstanceServer::isPreviewServer() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static QString baseProperty(const QString &property)
|
static QString baseProperty(const QString &property)
|
||||||
{
|
{
|
||||||
int index = property.indexOf('.');
|
int index = property.indexOf('.');
|
||||||
|
@@ -229,8 +229,10 @@ public:
|
|||||||
|
|
||||||
virtual QImage grabWindow() = 0;
|
virtual QImage grabWindow() = 0;
|
||||||
virtual QImage grabItem(QQuickItem *item) = 0;
|
virtual QImage grabItem(QQuickItem *item) = 0;
|
||||||
|
virtual bool renderWindow() = 0;
|
||||||
|
|
||||||
virtual bool isInformationServer() const;
|
virtual bool isInformationServer() const;
|
||||||
|
virtual bool isPreviewServer() const;
|
||||||
void addAnimation(QQuickAbstractAnimation *animation);
|
void addAnimation(QQuickAbstractAnimation *animation);
|
||||||
QVector<QQuickAbstractAnimation *> animations() const;
|
QVector<QQuickAbstractAnimation *> animations() const;
|
||||||
QVariant animationDefaultValue(int index) const;
|
QVariant animationDefaultValue(int index) const;
|
||||||
|
@@ -180,6 +180,11 @@ bool ObjectNodeInstance::isLayoutable() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ObjectNodeInstance::isRenderable() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool ObjectNodeInstance::equalGraphicsItem(QGraphicsItem * /*item*/) const
|
bool ObjectNodeInstance::equalGraphicsItem(QGraphicsItem * /*item*/) const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@@ -103,6 +103,7 @@ public:
|
|||||||
virtual bool isQuickItem() const;
|
virtual bool isQuickItem() const;
|
||||||
virtual bool isQuickWindow() const;
|
virtual bool isQuickWindow() const;
|
||||||
virtual bool isLayoutable() const;
|
virtual bool isLayoutable() const;
|
||||||
|
virtual bool isRenderable() const;
|
||||||
|
|
||||||
virtual bool equalGraphicsItem(QGraphicsItem *item) const;
|
virtual bool equalGraphicsItem(QGraphicsItem *item) const;
|
||||||
|
|
||||||
|
@@ -44,10 +44,10 @@ QImage renderImage(ServerNodeInstance rootNodeInstance)
|
|||||||
|
|
||||||
QSize previewImageSize = rootNodeInstance.boundingRect().size().toSize();
|
QSize previewImageSize = rootNodeInstance.boundingRect().size().toSize();
|
||||||
if (previewImageSize.isEmpty())
|
if (previewImageSize.isEmpty())
|
||||||
previewImageSize = {300, 300};
|
previewImageSize = {150, 150};
|
||||||
|
|
||||||
if (previewImageSize.width() > 300 || previewImageSize.height() > 300)
|
if (previewImageSize.width() > 150 || previewImageSize.height() > 150)
|
||||||
previewImageSize.scale({300, 300}, Qt::KeepAspectRatio);
|
previewImageSize.scale({150, 150}, Qt::KeepAspectRatio);
|
||||||
|
|
||||||
QImage previewImage = rootNodeInstance.renderPreviewImage(previewImageSize);
|
QImage previewImage = rootNodeInstance.renderPreviewImage(previewImageSize);
|
||||||
|
|
||||||
@@ -68,7 +68,8 @@ void Qt5CaptureImageNodeInstanceServer::collectItemChangesAndSendChangeCommands(
|
|||||||
inFunction = true;
|
inFunction = true;
|
||||||
|
|
||||||
auto rooNodeInstance = rootNodeInstance();
|
auto rooNodeInstance = rootNodeInstance();
|
||||||
rooNodeInstance.rootQuickItem()->setClip(true);
|
if (QQuickItem *qitem = rooNodeInstance.rootQuickItem())
|
||||||
|
qitem->setClip(true);
|
||||||
|
|
||||||
DesignerSupport::polishItems(quickWindow());
|
DesignerSupport::polishItems(quickWindow());
|
||||||
|
|
||||||
|
@@ -1007,17 +1007,17 @@ void Qt5InformationNodeInstanceServer::doRenderModelNodeImageView()
|
|||||||
void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView()
|
void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView()
|
||||||
{
|
{
|
||||||
#ifdef QUICK3D_MODULE
|
#ifdef QUICK3D_MODULE
|
||||||
m_modelNode3DImageViewAsyncData.cleanup();
|
|
||||||
if (m_modelNode3DImageViewData.rootItem) {
|
if (m_modelNode3DImageViewData.rootItem) {
|
||||||
QMetaObject::invokeMethod(m_modelNode3DImageViewData.rootItem, "destroyView");
|
QMetaObject::invokeMethod(m_modelNode3DImageViewData.rootItem, "destroyView");
|
||||||
if (!m_modelNode3DImageViewData.contentItem)
|
if (!m_modelNode3DImageViewData.contentItem)
|
||||||
m_modelNode3DImageViewData.contentItem = getContentItemForRendering(m_modelNode3DImageViewData.rootItem);
|
m_modelNode3DImageViewData.contentItem = getContentItemForRendering(m_modelNode3DImageViewData.rootItem);
|
||||||
|
|
||||||
|
QImage renderImage;
|
||||||
if (m_modelNodePreviewImageCache.contains(m_modelNodePreviewImageCommand.componentPath())) {
|
if (m_modelNodePreviewImageCache.contains(m_modelNodePreviewImageCommand.componentPath())) {
|
||||||
m_modelNode3DImageViewAsyncData.renderImage
|
renderImage = m_modelNodePreviewImageCache[m_modelNodePreviewImageCommand.componentPath()];
|
||||||
= m_modelNodePreviewImageCache[m_modelNodePreviewImageCommand.componentPath()];
|
|
||||||
modelNode3DImageViewSendImageToCreator();
|
|
||||||
} else {
|
} else {
|
||||||
|
bool createdFromComponent = false;
|
||||||
|
QObject *instanceObj = nullptr;
|
||||||
ServerNodeInstance instance = instanceForId(m_modelNodePreviewImageCommand.instanceId());
|
ServerNodeInstance instance = instanceForId(m_modelNodePreviewImageCommand.instanceId());
|
||||||
if (!m_modelNodePreviewImageCommand.componentPath().isEmpty()
|
if (!m_modelNodePreviewImageCommand.componentPath().isEmpty()
|
||||||
&& instance.isSubclassOf("QQuick3DNode")) {
|
&& instance.isSubclassOf("QQuick3DNode")) {
|
||||||
@@ -1026,15 +1026,14 @@ void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView()
|
|||||||
// wouldn't want the children of the Node to appear in the preview.
|
// wouldn't want the children of the Node to appear in the preview.
|
||||||
QQmlComponent component(engine());
|
QQmlComponent component(engine());
|
||||||
component.loadUrl(QUrl::fromLocalFile(m_modelNodePreviewImageCommand.componentPath()));
|
component.loadUrl(QUrl::fromLocalFile(m_modelNodePreviewImageCommand.componentPath()));
|
||||||
m_modelNode3DImageViewAsyncData.instanceObj = qobject_cast<QQuick3DObject *>(component.create());
|
instanceObj = qobject_cast<QQuick3DObject *>(component.create());
|
||||||
if (!m_modelNode3DImageViewAsyncData.instanceObj) {
|
if (!instanceObj) {
|
||||||
qWarning() << "Could not create preview component: " << component.errors();
|
qWarning() << "Could not create preview component: " << component.errors();
|
||||||
m_modelNode3DImageViewAsyncData.cleanup();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_modelNode3DImageViewAsyncData.createdFromComponent = true;
|
createdFromComponent = true;
|
||||||
} else {
|
} else {
|
||||||
m_modelNode3DImageViewAsyncData.instanceObj = instance.internalObject();
|
instanceObj = instance.internalObject();
|
||||||
}
|
}
|
||||||
QSize renderSize = m_modelNodePreviewImageCommand.size();
|
QSize renderSize = m_modelNodePreviewImageCommand.size();
|
||||||
if (Internal::QuickItemNodeInstance::unifiedRenderPathOrQt6()) {
|
if (Internal::QuickItemNodeInstance::unifiedRenderPathOrQt6()) {
|
||||||
@@ -1055,41 +1054,18 @@ void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView()
|
|||||||
|
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(
|
||||||
m_modelNode3DImageViewData.rootItem, "createViewForObject",
|
m_modelNode3DImageViewData.rootItem, "createViewForObject",
|
||||||
Q_ARG(QVariant, objectToVariant(m_modelNode3DImageViewAsyncData.instanceObj)));
|
Q_ARG(QVariant, objectToVariant(instanceObj)));
|
||||||
|
|
||||||
// Selection box geometry updates have an asynchronous step, so we need to do rendering
|
// Need to render twice, first render updates spatial nodes
|
||||||
// in asynchronous steps as well, since we are adjusting the selection box geometry
|
for (int i = 0; i < 2; ++i) {
|
||||||
// while finding correct zoom level.
|
if (i == 1)
|
||||||
m_modelNode3DImageViewAsyncData.timer.start();
|
QMetaObject::invokeMethod(m_modelNode3DImageViewData.rootItem, "fitToViewPort"
|
||||||
}
|
, Qt::DirectConnection);
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void Qt5InformationNodeInstanceServer::modelNode3DImageViewSendImageToCreator()
|
|
||||||
{
|
|
||||||
if (!m_modelNode3DImageViewAsyncData.renderImage.isNull()) {
|
|
||||||
// Key number is selected so that it is unlikely to conflict other ImageContainer use.
|
|
||||||
ImageContainer imgContainer(m_modelNodePreviewImageCommand.instanceId(), {}, 2100000001);
|
|
||||||
imgContainer.setImage(m_modelNode3DImageViewAsyncData.renderImage);
|
|
||||||
|
|
||||||
// send the rendered image to creator process
|
|
||||||
nodeInstanceClient()->handlePuppetToCreatorCommand(
|
|
||||||
{PuppetToCreatorCommand::RenderModelNodePreviewImage,
|
|
||||||
QVariant::fromValue(imgContainer)});
|
|
||||||
|
|
||||||
m_modelNode3DImageViewAsyncData.cleanup();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Qt5InformationNodeInstanceServer::modelNode3DImageViewRenderStep()
|
|
||||||
{
|
|
||||||
++m_modelNode3DImageViewAsyncData.count;
|
|
||||||
|
|
||||||
updateNodesRecursive(m_modelNode3DImageViewData.contentItem);
|
updateNodesRecursive(m_modelNode3DImageViewData.contentItem);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
if (Internal::QuickItemNodeInstance::unifiedRenderPath()) {
|
if (Internal::QuickItemNodeInstance::unifiedRenderPath()) {
|
||||||
m_modelNode3DImageViewAsyncData.renderImage = m_modelNode3DImageViewData.window->grabWindow();
|
renderImage = m_modelNode3DImageViewData.window->grabWindow();
|
||||||
} else {
|
} else {
|
||||||
// Fake render loop signaling to update things like QML items as 3D textures
|
// Fake render loop signaling to update things like QML items as 3D textures
|
||||||
m_modelNode3DImageViewData.window->beforeSynchronizing();
|
m_modelNode3DImageViewData.window->beforeSynchronizing();
|
||||||
@@ -1097,27 +1073,34 @@ void Qt5InformationNodeInstanceServer::modelNode3DImageViewRenderStep()
|
|||||||
|
|
||||||
QSizeF size = qobject_cast<QQuickItem *>(m_modelNode3DImageViewData.contentItem)->size();
|
QSizeF size = qobject_cast<QQuickItem *>(m_modelNode3DImageViewData.contentItem)->size();
|
||||||
QRectF renderRect(QPointF(0., 0.), size);
|
QRectF renderRect(QPointF(0., 0.), size);
|
||||||
m_modelNode3DImageViewAsyncData.renderImage
|
renderImage = designerSupport()->renderImageForItem(m_modelNode3DImageViewData.contentItem,
|
||||||
= designerSupport()->renderImageForItem(m_modelNode3DImageViewData.contentItem,
|
|
||||||
renderRect, size.toSize());
|
renderRect, size.toSize());
|
||||||
m_modelNode3DImageViewData.window->afterRendering();
|
m_modelNode3DImageViewData.window->afterRendering();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
m_modelNode3DImageViewAsyncData.renderImage = grabRenderControl(m_modelNode3DImageViewData);
|
renderImage = grabRenderControl(m_modelNode3DImageViewData);
|
||||||
#endif
|
#endif
|
||||||
QMetaObject::invokeMethod(m_modelNode3DImageViewData.rootItem, "afterRender");
|
}
|
||||||
const bool ready = QQmlProperty::read(m_modelNode3DImageViewData.rootItem, "ready").value<bool>();
|
|
||||||
if (ready || m_modelNode3DImageViewAsyncData.count >= 10) {
|
|
||||||
QMetaObject::invokeMethod(m_modelNode3DImageViewData.rootItem, "destroyView");
|
QMetaObject::invokeMethod(m_modelNode3DImageViewData.rootItem, "destroyView");
|
||||||
if (m_modelNode3DImageViewAsyncData.createdFromComponent) {
|
|
||||||
|
if (createdFromComponent) {
|
||||||
// If component changes, puppet will need a reset anyway, so we can cache the image
|
// If component changes, puppet will need a reset anyway, so we can cache the image
|
||||||
m_modelNodePreviewImageCache.insert(m_modelNodePreviewImageCommand.componentPath(),
|
m_modelNodePreviewImageCache.insert(m_modelNodePreviewImageCommand.componentPath(),
|
||||||
m_modelNode3DImageViewAsyncData.renderImage);
|
renderImage);
|
||||||
|
delete instanceObj;
|
||||||
}
|
}
|
||||||
modelNode3DImageViewSendImageToCreator();
|
|
||||||
} else {
|
|
||||||
m_modelNode3DImageViewAsyncData.timer.start();
|
|
||||||
}
|
}
|
||||||
|
// Key number is selected so that it is unlikely to conflict other ImageContainer use.
|
||||||
|
ImageContainer imgContainer(m_modelNodePreviewImageCommand.instanceId(), {}, 2100000001);
|
||||||
|
imgContainer.setImage(renderImage);
|
||||||
|
|
||||||
|
// send the rendered image to creator process
|
||||||
|
nodeInstanceClient()->handlePuppetToCreatorCommand(
|
||||||
|
{PuppetToCreatorCommand::RenderModelNodePreviewImage,
|
||||||
|
QVariant::fromValue(imgContainer)});
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static QRectF itemBoundingRect(QQuickItem *item)
|
static QRectF itemBoundingRect(QQuickItem *item)
|
||||||
@@ -1234,7 +1217,6 @@ Qt5InformationNodeInstanceServer::Qt5InformationNodeInstanceServer(NodeInstanceC
|
|||||||
m_render3DEditViewTimer.setSingleShot(true);
|
m_render3DEditViewTimer.setSingleShot(true);
|
||||||
m_inputEventTimer.setSingleShot(true);
|
m_inputEventTimer.setSingleShot(true);
|
||||||
m_renderModelNodeImageViewTimer.setSingleShot(true);
|
m_renderModelNodeImageViewTimer.setSingleShot(true);
|
||||||
m_modelNode3DImageViewAsyncData.timer.setSingleShot(true);
|
|
||||||
m_dynamicAddObjectTimer.setSingleShot(true);
|
m_dynamicAddObjectTimer.setSingleShot(true);
|
||||||
|
|
||||||
#ifdef FPS_COUNTER
|
#ifdef FPS_COUNTER
|
||||||
@@ -1260,7 +1242,6 @@ Qt5InformationNodeInstanceServer::~Qt5InformationNodeInstanceServer()
|
|||||||
m_render3DEditViewTimer.stop();
|
m_render3DEditViewTimer.stop();
|
||||||
m_inputEventTimer.stop();
|
m_inputEventTimer.stop();
|
||||||
m_renderModelNodeImageViewTimer.stop();
|
m_renderModelNodeImageViewTimer.stop();
|
||||||
m_modelNode3DImageViewAsyncData.timer.stop();
|
|
||||||
m_dynamicAddObjectTimer.stop();
|
m_dynamicAddObjectTimer.stop();
|
||||||
|
|
||||||
if (m_editView3DData.rootItem)
|
if (m_editView3DData.rootItem)
|
||||||
@@ -1677,8 +1658,6 @@ void Qt5InformationNodeInstanceServer::setup3DEditView(const QList<ServerNodeIns
|
|||||||
this, &Qt5InformationNodeInstanceServer::doRender3DEditView);
|
this, &Qt5InformationNodeInstanceServer::doRender3DEditView);
|
||||||
QObject::connect(&m_inputEventTimer, &QTimer::timeout,
|
QObject::connect(&m_inputEventTimer, &QTimer::timeout,
|
||||||
this, &Qt5InformationNodeInstanceServer::handleInputEvents);
|
this, &Qt5InformationNodeInstanceServer::handleInputEvents);
|
||||||
QObject::connect(&m_modelNode3DImageViewAsyncData.timer, &QTimer::timeout,
|
|
||||||
this, &Qt5InformationNodeInstanceServer::modelNode3DImageViewRenderStep);
|
|
||||||
QObject::connect(&m_dynamicAddObjectTimer, &QTimer::timeout,
|
QObject::connect(&m_dynamicAddObjectTimer, &QTimer::timeout,
|
||||||
this, &Qt5InformationNodeInstanceServer::handleDynamicAddObjectTimeout);
|
this, &Qt5InformationNodeInstanceServer::handleDynamicAddObjectTimeout);
|
||||||
|
|
||||||
@@ -2165,7 +2144,6 @@ void Qt5InformationNodeInstanceServer::view3DAction(const View3DActionCommand &c
|
|||||||
|
|
||||||
void Qt5InformationNodeInstanceServer::requestModelNodePreviewImage(const RequestModelNodePreviewImageCommand &command)
|
void Qt5InformationNodeInstanceServer::requestModelNodePreviewImage(const RequestModelNodePreviewImageCommand &command)
|
||||||
{
|
{
|
||||||
m_modelNode3DImageViewAsyncData.timer.stop();
|
|
||||||
m_modelNodePreviewImageCommand = command;
|
m_modelNodePreviewImageCommand = command;
|
||||||
renderModelNodeImageView();
|
renderModelNodeImageView();
|
||||||
}
|
}
|
||||||
|
@@ -140,8 +140,6 @@ private:
|
|||||||
void renderModelNodeImageView();
|
void renderModelNodeImageView();
|
||||||
void doRenderModelNodeImageView();
|
void doRenderModelNodeImageView();
|
||||||
void doRenderModelNode3DImageView();
|
void doRenderModelNode3DImageView();
|
||||||
void modelNode3DImageViewSendImageToCreator();
|
|
||||||
void modelNode3DImageViewRenderStep();
|
|
||||||
void doRenderModelNode2DImageView();
|
void doRenderModelNode2DImageView();
|
||||||
void updateLockedAndHiddenStates(const QSet<ServerNodeInstance> &instances);
|
void updateLockedAndHiddenStates(const QSet<ServerNodeInstance> &instances);
|
||||||
void handleInputEvents();
|
void handleInputEvents();
|
||||||
@@ -190,26 +188,6 @@ private:
|
|||||||
QObject *m_3dHelper = nullptr;
|
QObject *m_3dHelper = nullptr;
|
||||||
int m_need3DEditViewRender = 0;
|
int m_need3DEditViewRender = 0;
|
||||||
QSet<QObject *> m_dynamicObjectConstructors;
|
QSet<QObject *> m_dynamicObjectConstructors;
|
||||||
|
|
||||||
struct ModelNode3DImageViewAsyncData {
|
|
||||||
QTimer timer;
|
|
||||||
QImage renderImage;
|
|
||||||
int count = 0;
|
|
||||||
bool createdFromComponent = false;
|
|
||||||
QObject *instanceObj = nullptr;
|
|
||||||
|
|
||||||
void cleanup()
|
|
||||||
{
|
|
||||||
timer.stop();
|
|
||||||
count = 0;
|
|
||||||
renderImage = {};
|
|
||||||
if (createdFromComponent)
|
|
||||||
delete instanceObj;
|
|
||||||
instanceObj = nullptr;
|
|
||||||
createdFromComponent = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ModelNode3DImageViewAsyncData m_modelNode3DImageViewAsyncData;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
@@ -70,6 +70,7 @@ public:
|
|||||||
|
|
||||||
QImage grabWindow() override;
|
QImage grabWindow() override;
|
||||||
QImage grabItem(QQuickItem *item) override;
|
QImage grabItem(QQuickItem *item) override;
|
||||||
|
bool renderWindow() override;
|
||||||
|
|
||||||
static QQuickItem *parentEffectItem(QQuickItem *item);
|
static QQuickItem *parentEffectItem(QQuickItem *item);
|
||||||
|
|
||||||
@@ -97,7 +98,6 @@ protected:
|
|||||||
|
|
||||||
virtual bool initRhi(RenderViewData &viewData);
|
virtual bool initRhi(RenderViewData &viewData);
|
||||||
virtual QImage grabRenderControl(RenderViewData &viewData);
|
virtual QImage grabRenderControl(RenderViewData &viewData);
|
||||||
virtual bool renderWindow();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RenderViewData m_viewData;
|
RenderViewData m_viewData;
|
||||||
|
@@ -133,4 +133,9 @@ void Qt5PreviewNodeInstanceServer::changePreviewImageSize(
|
|||||||
collectItemChangesAndSendChangeCommands();
|
collectItemChangesAndSendChangeCommands();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Qt5PreviewNodeInstanceServer::isPreviewServer() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
@@ -39,6 +39,7 @@ public:
|
|||||||
void changeState(const ChangeStateCommand &command) override;
|
void changeState(const ChangeStateCommand &command) override;
|
||||||
void removeSharedMemory(const RemoveSharedMemoryCommand &command) override;
|
void removeSharedMemory(const RemoveSharedMemoryCommand &command) override;
|
||||||
void changePreviewImageSize(const ChangePreviewImageSizeCommand &command) override;
|
void changePreviewImageSize(const ChangePreviewImageSizeCommand &command) override;
|
||||||
|
bool isPreviewServer() const override;
|
||||||
|
|
||||||
QImage renderPreviewImage();
|
QImage renderPreviewImage();
|
||||||
|
|
||||||
|
@@ -26,6 +26,8 @@
|
|||||||
#include "quick3dnodeinstance.h"
|
#include "quick3dnodeinstance.h"
|
||||||
#include "qt5nodeinstanceserver.h"
|
#include "qt5nodeinstanceserver.h"
|
||||||
#include "qt5informationnodeinstanceserver.h"
|
#include "qt5informationnodeinstanceserver.h"
|
||||||
|
#include "quickitemnodeinstance.h"
|
||||||
|
#include "../editor3d/generalhelper.h"
|
||||||
|
|
||||||
#include <qmlprivategate.h>
|
#include <qmlprivategate.h>
|
||||||
|
|
||||||
@@ -37,6 +39,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#ifdef QUICK3D_MODULE
|
#ifdef QUICK3D_MODULE
|
||||||
|
#include <private/qquick3dobject_p.h>
|
||||||
#include <private/qquick3dnode_p.h>
|
#include <private/qquick3dnode_p.h>
|
||||||
#include <private/qquick3dmodel_p.h>
|
#include <private/qquick3dmodel_p.h>
|
||||||
#include <private/qquick3dnode_p_p.h>
|
#include <private/qquick3dnode_p_p.h>
|
||||||
@@ -45,8 +48,10 @@
|
|||||||
#if defined(QUICK3D_ASSET_UTILS_MODULE) && QT_VERSION > QT_VERSION_CHECK(6, 2, 0)
|
#if defined(QUICK3D_ASSET_UTILS_MODULE) && QT_VERSION > QT_VERSION_CHECK(6, 2, 0)
|
||||||
#include <private/qquick3druntimeloader_p.h>
|
#include <private/qquick3druntimeloader_p.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <private/qquickstategroup_p.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -57,6 +62,7 @@ Quick3DNodeInstance::Quick3DNodeInstance(QObject *node)
|
|||||||
|
|
||||||
Quick3DNodeInstance::~Quick3DNodeInstance()
|
Quick3DNodeInstance::~Quick3DNodeInstance()
|
||||||
{
|
{
|
||||||
|
delete m_dummyRootView;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Quick3DNodeInstance::initialize(const ObjectNodeInstance::Pointer &objectNodeInstance,
|
void Quick3DNodeInstance::initialize(const ObjectNodeInstance::Pointer &objectNodeInstance,
|
||||||
@@ -87,10 +93,123 @@ void Quick3DNodeInstance::initialize(const ObjectNodeInstance::Pointer &objectNo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
// In case this is the scene root, we need to create a dummy View3D for the scene
|
||||||
|
// in preview puppets
|
||||||
|
if (instanceId() == 0 && nodeInstanceServer()->isPreviewServer()) {
|
||||||
|
auto helper = new QmlDesigner::Internal::GeneralHelper();
|
||||||
|
engine()->rootContext()->setContextProperty("_generalHelper", helper);
|
||||||
|
|
||||||
|
QQmlComponent component(engine());
|
||||||
|
component.loadUrl(QUrl("qrc:/qtquickplugin/mockfiles/qt6/ModelNode3DImageView.qml"));
|
||||||
|
m_dummyRootView = qobject_cast<QQuickItem *>(component.create());
|
||||||
|
|
||||||
|
QMetaObject::invokeMethod(
|
||||||
|
m_dummyRootView, "createViewForNode",
|
||||||
|
Q_ARG(QVariant, QVariant::fromValue(object())));
|
||||||
|
|
||||||
|
nodeInstanceServer()->setRootItem(m_dummyRootView);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
ObjectNodeInstance::initialize(objectNodeInstance, flags);
|
ObjectNodeInstance::initialize(objectNodeInstance, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QImage Quick3DNodeInstance::renderImage() const
|
||||||
|
{
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
if (!isRootNodeInstance() || !m_dummyRootView)
|
||||||
|
return {};
|
||||||
|
|
||||||
|
QSize size(640, 480);
|
||||||
|
nodeInstanceServer()->quickWindow()->resize(size);
|
||||||
|
m_dummyRootView->setSize(size);
|
||||||
|
|
||||||
|
// Just render the window once to update spatial nodes
|
||||||
|
nodeInstanceServer()->renderWindow();
|
||||||
|
|
||||||
|
QMetaObject::invokeMethod(m_dummyRootView, "fitToViewPort", Qt::DirectConnection);
|
||||||
|
|
||||||
|
QRectF renderBoundingRect = m_dummyRootView->boundingRect();
|
||||||
|
QImage renderImage;
|
||||||
|
|
||||||
|
if (QuickItemNodeInstance::unifiedRenderPath()) {
|
||||||
|
renderImage = nodeInstanceServer()->grabWindow();
|
||||||
|
renderImage = renderImage.copy(renderBoundingRect.toRect());
|
||||||
|
} else {
|
||||||
|
renderImage = nodeInstanceServer()->grabItem(m_dummyRootView);
|
||||||
|
}
|
||||||
|
|
||||||
|
// When grabbing an offscreen window the device pixel ratio is 1
|
||||||
|
renderImage.setDevicePixelRatio(1);
|
||||||
|
|
||||||
|
return renderImage;
|
||||||
|
#endif
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
QImage Quick3DNodeInstance::renderPreviewImage(const QSize &previewImageSize) const
|
||||||
|
{
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
if (!isRootNodeInstance() || !m_dummyRootView)
|
||||||
|
return {};
|
||||||
|
|
||||||
|
nodeInstanceServer()->quickWindow()->resize(previewImageSize);
|
||||||
|
m_dummyRootView->setSize(previewImageSize);
|
||||||
|
|
||||||
|
// Just render the window once to update spatial nodes
|
||||||
|
nodeInstanceServer()->renderWindow();
|
||||||
|
|
||||||
|
QMetaObject::invokeMethod(m_dummyRootView, "fitToViewPort", Qt::DirectConnection);
|
||||||
|
|
||||||
|
QRectF previewItemBoundingRect = boundingRect();
|
||||||
|
|
||||||
|
if (previewItemBoundingRect.isValid()) {
|
||||||
|
const QSize size = previewImageSize;
|
||||||
|
if (m_dummyRootView->isVisible()) {
|
||||||
|
QImage image;
|
||||||
|
image = nodeInstanceServer()->grabWindow();
|
||||||
|
image = image.copy(previewItemBoundingRect.toRect());
|
||||||
|
image = image.scaledToWidth(size.width());
|
||||||
|
return image;
|
||||||
|
} else {
|
||||||
|
QImage transparentImage(size, QImage::Format_ARGB32_Premultiplied);
|
||||||
|
transparentImage.fill(Qt::transparent);
|
||||||
|
return transparentImage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Quick3DNodeInstance::isRenderable() const
|
||||||
|
{
|
||||||
|
return m_dummyRootView;
|
||||||
|
}
|
||||||
|
|
||||||
|
QRectF Quick3DNodeInstance::boundingRect() const
|
||||||
|
{
|
||||||
|
if (m_dummyRootView)
|
||||||
|
return m_dummyRootView->boundingRect();
|
||||||
|
return ObjectNodeInstance::boundingRect();
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<ServerNodeInstance> Quick3DNodeInstance::stateInstances() const
|
||||||
|
{
|
||||||
|
QList<ServerNodeInstance> instanceList;
|
||||||
|
#ifdef QUICK3D_MODULE
|
||||||
|
if (auto obj3D = quick3DNode()) {
|
||||||
|
const QList<QQuickState *> stateList = QQuick3DObjectPrivate::get(obj3D)->_states()->states();
|
||||||
|
for (QQuickState *state : stateList) {
|
||||||
|
if (state && nodeInstanceServer()->hasInstanceForObject(state))
|
||||||
|
instanceList.append(nodeInstanceServer()->instanceForObject(state));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return instanceList;
|
||||||
|
}
|
||||||
|
|
||||||
Qt5NodeInstanceServer *Quick3DNodeInstance::qt5NodeInstanceServer() const
|
Qt5NodeInstanceServer *Quick3DNodeInstance::qt5NodeInstanceServer() const
|
||||||
{
|
{
|
||||||
return qobject_cast<Qt5NodeInstanceServer *>(nodeInstanceServer());
|
return qobject_cast<Qt5NodeInstanceServer *>(nodeInstanceServer());
|
||||||
|
@@ -47,12 +47,22 @@ public:
|
|||||||
void initialize(const ObjectNodeInstance::Pointer &objectNodeInstance,
|
void initialize(const ObjectNodeInstance::Pointer &objectNodeInstance,
|
||||||
InstanceContainer::NodeFlags flags) override;
|
InstanceContainer::NodeFlags flags) override;
|
||||||
|
|
||||||
|
QImage renderImage() const override;
|
||||||
|
QImage renderPreviewImage(const QSize &previewImageSize) const override;
|
||||||
|
|
||||||
|
bool isRenderable() const override;
|
||||||
|
QRectF boundingRect() const override;
|
||||||
|
|
||||||
|
QList<ServerNodeInstance> stateInstances() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit Quick3DNodeInstance(QObject *node);
|
explicit Quick3DNodeInstance(QObject *node);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Qt5NodeInstanceServer *qt5NodeInstanceServer() const;
|
Qt5NodeInstanceServer *qt5NodeInstanceServer() const;
|
||||||
QQuick3DNode *quick3DNode() const;
|
QQuick3DNode *quick3DNode() const;
|
||||||
|
|
||||||
|
QQuickItem *m_dummyRootView = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -571,6 +571,11 @@ bool QuickItemNodeInstance::isQuickItem() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QuickItemNodeInstance::isRenderable() const
|
||||||
|
{
|
||||||
|
return quickItem() && (!s_unifiedRenderPath || isRootNodeInstance());
|
||||||
|
}
|
||||||
|
|
||||||
QList<ServerNodeInstance> QuickItemNodeInstance::stateInstances() const
|
QList<ServerNodeInstance> QuickItemNodeInstance::stateInstances() const
|
||||||
{
|
{
|
||||||
QList<ServerNodeInstance> instanceList;
|
QList<ServerNodeInstance> instanceList;
|
||||||
|
@@ -94,6 +94,7 @@ public:
|
|||||||
bool isResizable() const override;
|
bool isResizable() const override;
|
||||||
bool isMovable() const override;
|
bool isMovable() const override;
|
||||||
bool isQuickItem() const override;
|
bool isQuickItem() const override;
|
||||||
|
bool isRenderable() const override;
|
||||||
|
|
||||||
QList<ServerNodeInstance> stateInstances() const override;
|
QList<ServerNodeInstance> stateInstances() const override;
|
||||||
|
|
||||||
|
@@ -154,7 +154,7 @@ void ServerNodeInstance::setNodeSource(const QString &source)
|
|||||||
|
|
||||||
bool ServerNodeInstance::holdsGraphical() const
|
bool ServerNodeInstance::holdsGraphical() const
|
||||||
{
|
{
|
||||||
return m_nodeInstance->isQuickItem();
|
return m_nodeInstance->isRenderable();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ServerNodeInstance::isComponentWrap() const
|
bool ServerNodeInstance::isComponentWrap() const
|
||||||
|
@@ -32,28 +32,40 @@ import StudioTheme 1.0 as StudioTheme
|
|||||||
Column {
|
Column {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
spacing: 5
|
||||||
|
|
||||||
|
signal back()
|
||||||
|
|
||||||
|
Row {
|
||||||
|
spacing: 5
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
text: "<"
|
||||||
|
width: 25
|
||||||
|
height: 25
|
||||||
|
onClicked: back()
|
||||||
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: header
|
|
||||||
text: qsTr("Select a Module to Add")
|
text: qsTr("Select a Module to Add")
|
||||||
color: StudioTheme.Values.themeTextColor
|
color: StudioTheme.Values.themeTextColor
|
||||||
font.pixelSize: 16
|
font.pixelSize: 16
|
||||||
width: parent.width
|
}
|
||||||
height: 50
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollView { // ListView not used because of QTBUG-52941
|
ScrollView { // ListView not used because of QTBUG-52941
|
||||||
id: listView
|
id: listView
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height - header.height
|
height: parent.height - y
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
spacing: 2
|
spacing: 2
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: addImportModel
|
model: addModuleModel
|
||||||
|
|
||||||
delegate: Rectangle {
|
delegate: Rectangle {
|
||||||
id: itemBackground
|
id: itemBackground
|
@@ -40,6 +40,11 @@ Item {
|
|||||||
property var contextDir: undefined
|
property var contextDir: undefined
|
||||||
property bool isDirContextMenu: false
|
property bool isDirContextMenu: false
|
||||||
|
|
||||||
|
function clearSearchFilter()
|
||||||
|
{
|
||||||
|
searchBox.text = "";
|
||||||
|
}
|
||||||
|
|
||||||
DropArea {
|
DropArea {
|
||||||
id: dropArea
|
id: dropArea
|
||||||
|
|
||||||
@@ -90,6 +95,70 @@ Item {
|
|||||||
selectedAssetsChanged()
|
selectedAssetsChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StudioControls.Menu {
|
||||||
|
id: contextMenu
|
||||||
|
|
||||||
|
StudioControls.MenuItem {
|
||||||
|
text: qsTr("Expand All")
|
||||||
|
enabled: allExpandedState !== 1
|
||||||
|
visible: isDirContextMenu
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
|
onTriggered: assetsModel.toggleExpandAll(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
StudioControls.MenuItem {
|
||||||
|
text: qsTr("Collapse All")
|
||||||
|
enabled: allExpandedState !== 2
|
||||||
|
visible: isDirContextMenu
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
|
onTriggered: assetsModel.toggleExpandAll(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
StudioControls.MenuSeparator {
|
||||||
|
visible: isDirContextMenu
|
||||||
|
height: visible ? StudioTheme.Values.border : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
StudioControls.MenuItem {
|
||||||
|
text: qsTr("Delete File")
|
||||||
|
visible: contextFilePath
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
|
onTriggered: assetsModel.deleteFile(contextFilePath)
|
||||||
|
}
|
||||||
|
|
||||||
|
StudioControls.MenuSeparator {
|
||||||
|
visible: contextFilePath
|
||||||
|
height: visible ? StudioTheme.Values.border : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
StudioControls.MenuItem {
|
||||||
|
text: qsTr("Rename Folder")
|
||||||
|
visible: isDirContextMenu
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
|
onTriggered: renameFolderDialog.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
StudioControls.MenuItem {
|
||||||
|
text: qsTr("New Folder")
|
||||||
|
onTriggered: newFolderDialog.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
StudioControls.MenuItem {
|
||||||
|
text: qsTr("Delete Folder")
|
||||||
|
visible: isDirContextMenu
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
|
onTriggered: {
|
||||||
|
var dirEmpty = !(contextDir.dirsModel && contextDir.dirsModel.rowCount() > 0)
|
||||||
|
&& !(contextDir.filesModel && contextDir.filesModel.rowCount() > 0);
|
||||||
|
|
||||||
|
if (dirEmpty)
|
||||||
|
assetsModel.deleteFolder(contextDir.dirPath)
|
||||||
|
else
|
||||||
|
confirmDeleteFolderDialog.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RegExpValidator {
|
RegExpValidator {
|
||||||
id: folderNameValidator
|
id: folderNameValidator
|
||||||
regExp: /^(\w[^*/><?\\|:]*)$/
|
regExp: /^(\w[^*/><?\\|:]*)$/
|
||||||
@@ -317,77 +386,44 @@ Item {
|
|||||||
onOpened: folderNotEmpty.forceActiveFocus()
|
onOpened: folderNotEmpty.forceActiveFocus()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.topMargin: 5
|
||||||
|
spacing: 5
|
||||||
|
|
||||||
|
Row {
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
SearchBox {
|
||||||
|
id: searchBox
|
||||||
|
|
||||||
|
width: parent.width - addAssetButton.width - 5
|
||||||
|
}
|
||||||
|
|
||||||
|
PlusButton {
|
||||||
|
id: addAssetButton
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
tooltip: qsTr("Add a new asset to the project.")
|
||||||
|
|
||||||
|
onClicked: rootView.handleAddAsset()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: qsTr("No match found.")
|
||||||
|
leftPadding: 10
|
||||||
|
color: StudioTheme.Values.themeTextColor
|
||||||
|
font.pixelSize: 12
|
||||||
|
visible: assetsModel.isEmpty && !searchBox.isEmpty()
|
||||||
|
}
|
||||||
|
|
||||||
ScrollView { // TODO: experiment using ListView instead of ScrollView + Column
|
ScrollView { // TODO: experiment using ListView instead of ScrollView + Column
|
||||||
id: assetsView
|
id: assetsView
|
||||||
anchors.fill: parent
|
width: parent.width
|
||||||
|
height: parent.height - y
|
||||||
|
clip: true
|
||||||
interactive: assetsView.verticalScrollBarVisible
|
interactive: assetsView.verticalScrollBarVisible
|
||||||
|
|
||||||
Item {
|
|
||||||
StudioControls.Menu {
|
|
||||||
id: contextMenu
|
|
||||||
|
|
||||||
StudioControls.MenuItem {
|
|
||||||
text: qsTr("Expand All")
|
|
||||||
enabled: allExpandedState !== 1
|
|
||||||
visible: isDirContextMenu
|
|
||||||
height: visible ? implicitHeight : 0
|
|
||||||
onTriggered: assetsModel.toggleExpandAll(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
StudioControls.MenuItem {
|
|
||||||
text: qsTr("Collapse All")
|
|
||||||
enabled: allExpandedState !== 2
|
|
||||||
visible: isDirContextMenu
|
|
||||||
height: visible ? implicitHeight : 0
|
|
||||||
onTriggered: assetsModel.toggleExpandAll(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
StudioControls.MenuSeparator {
|
|
||||||
visible: isDirContextMenu
|
|
||||||
height: visible ? StudioTheme.Values.border : 0
|
|
||||||
}
|
|
||||||
|
|
||||||
StudioControls.MenuItem {
|
|
||||||
text: qsTr("Delete File")
|
|
||||||
visible: contextFilePath
|
|
||||||
height: visible ? implicitHeight : 0
|
|
||||||
onTriggered: assetsModel.deleteFile(contextFilePath)
|
|
||||||
}
|
|
||||||
|
|
||||||
StudioControls.MenuSeparator {
|
|
||||||
visible: contextFilePath
|
|
||||||
height: visible ? StudioTheme.Values.border : 0
|
|
||||||
}
|
|
||||||
|
|
||||||
StudioControls.MenuItem {
|
|
||||||
text: qsTr("Rename Folder")
|
|
||||||
visible: isDirContextMenu
|
|
||||||
height: visible ? implicitHeight : 0
|
|
||||||
onTriggered: renameFolderDialog.open()
|
|
||||||
}
|
|
||||||
|
|
||||||
StudioControls.MenuItem {
|
|
||||||
text: qsTr("New Folder")
|
|
||||||
onTriggered: newFolderDialog.open()
|
|
||||||
}
|
|
||||||
|
|
||||||
StudioControls.MenuItem {
|
|
||||||
text: qsTr("Delete Folder")
|
|
||||||
visible: isDirContextMenu
|
|
||||||
height: visible ? implicitHeight : 0
|
|
||||||
onTriggered: {
|
|
||||||
var dirEmpty = !(contextDir.dirsModel && contextDir.dirsModel.rowCount() > 0)
|
|
||||||
&& !(contextDir.filesModel && contextDir.filesModel.rowCount() > 0);
|
|
||||||
|
|
||||||
if (dirEmpty)
|
|
||||||
assetsModel.deleteFolder(contextDir.dirPath)
|
|
||||||
else
|
|
||||||
confirmDeleteFolderDialog.open()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
Repeater {
|
Repeater {
|
||||||
model: assetsModel // context property
|
model: assetsModel // context property
|
||||||
@@ -564,11 +600,12 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Placeholder when the assets panel is empty
|
// Placeholder when the assets panel is empty
|
||||||
Column {
|
Column {
|
||||||
id: colNoAssets
|
id: colNoAssets
|
||||||
visible: assetsModel.isEmpty && !rootView.searchActive
|
visible: assetsModel.isEmpty && searchBox.isEmpty()
|
||||||
|
|
||||||
spacing: 20
|
spacing: 20
|
||||||
x: 20
|
x: 20
|
||||||
@@ -612,13 +649,4 @@ Item {
|
|||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
|
||||||
text: qsTr("No match found.")
|
|
||||||
x: 20
|
|
||||||
y: 10
|
|
||||||
color: StudioTheme.Values.themeTextColor
|
|
||||||
font.pixelSize: 12
|
|
||||||
visible: assetsModel.isEmpty && rootView.searchActive
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -81,6 +81,7 @@ Item {
|
|||||||
property var currentCategory: null
|
property var currentCategory: null
|
||||||
property var currentImport: null
|
property var currentImport: null
|
||||||
property bool isHorizontalView: false
|
property bool isHorizontalView: false
|
||||||
|
property bool isAddModuleView: false
|
||||||
|
|
||||||
// Called also from C++ to close context menu on focus out
|
// Called also from C++ to close context menu on focus out
|
||||||
function closeContextMenu()
|
function closeContextMenu()
|
||||||
@@ -89,6 +90,12 @@ Item {
|
|||||||
itemContextMenu.close()
|
itemContextMenu.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Called also from C++
|
||||||
|
function switchToComponentsView()
|
||||||
|
{
|
||||||
|
isAddModuleView = false
|
||||||
|
}
|
||||||
|
|
||||||
onWidthChanged: {
|
onWidthChanged: {
|
||||||
itemsView.isHorizontalView = itemsView.width > widthLimit
|
itemsView.isHorizontalView = itemsView.width > widthLimit
|
||||||
}
|
}
|
||||||
@@ -188,9 +195,38 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: col
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
y: 5
|
||||||
|
spacing: 5
|
||||||
|
|
||||||
|
Row {
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
SearchBox {
|
||||||
|
id: searchBox
|
||||||
|
|
||||||
|
width: parent.width - addAssetButton.width - 5
|
||||||
|
}
|
||||||
|
|
||||||
|
PlusButton {
|
||||||
|
id: addAssetButton
|
||||||
|
tooltip: qsTr("Add a module.")
|
||||||
|
|
||||||
|
onClicked: isAddModuleView = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
anchors.fill: parent
|
id: loader
|
||||||
sourceComponent: itemsView.isHorizontalView ? horizontalView : verticalView
|
|
||||||
|
width: col.width
|
||||||
|
height: col.height - y - 5
|
||||||
|
sourceComponent: isAddModuleView ? addModuleView
|
||||||
|
: itemsView.isHorizontalView ? horizontalView : verticalView
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
@@ -198,8 +234,9 @@ Item {
|
|||||||
|
|
||||||
ScrollView {
|
ScrollView {
|
||||||
id: verticalScrollView
|
id: verticalScrollView
|
||||||
width: itemsView.width
|
anchors.fill: parent
|
||||||
height: itemsView.height
|
clip: true
|
||||||
|
|
||||||
onContentHeightChanged: {
|
onContentHeightChanged: {
|
||||||
var maxPosition = Math.max(contentHeight - verticalScrollView.height, 0)
|
var maxPosition = Math.max(contentHeight - verticalScrollView.height, 0)
|
||||||
if (contentY > maxPosition)
|
if (contentY > maxPosition)
|
||||||
@@ -312,7 +349,9 @@ Item {
|
|||||||
ScrollView {
|
ScrollView {
|
||||||
id: horizontalScrollView
|
id: horizontalScrollView
|
||||||
width: 270
|
width: 270
|
||||||
height: itemsView.height
|
height: parent.height
|
||||||
|
clip: true
|
||||||
|
|
||||||
onContentHeightChanged: {
|
onContentHeightChanged: {
|
||||||
var maxPosition = Math.max(contentHeight - horizontalScrollView.height, 0)
|
var maxPosition = Math.max(contentHeight - horizontalScrollView.height, 0)
|
||||||
if (contentY > maxPosition)
|
if (contentY > maxPosition)
|
||||||
@@ -452,4 +491,12 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: addModuleView
|
||||||
|
|
||||||
|
AddModuleView {
|
||||||
|
onBack: isAddModuleView = false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,266 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2021 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
import QtQuick 2.15
|
|
||||||
import QtQuick.Controls 2.15
|
|
||||||
import QtQuickDesignerTheme 1.0
|
|
||||||
import HelperWidgets 2.0 as HelperWidgets
|
|
||||||
import StudioControls 1.0 as StudioControls
|
|
||||||
import StudioTheme 1.0 as StudioTheme
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
function setTab(index)
|
|
||||||
{
|
|
||||||
tabBar.setCurrentIndex(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearSearchFilter()
|
|
||||||
{
|
|
||||||
searchFilterText.text = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
spacing: 9
|
|
||||||
|
|
||||||
TabBar {
|
|
||||||
id: tabBar
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.leftMargin: 5
|
|
||||||
anchors.rightMargin: 5
|
|
||||||
spacing: 40
|
|
||||||
|
|
||||||
background: Rectangle {
|
|
||||||
color: StudioTheme.Values.themePanelBackground
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: [{title: qsTr("Components"), addToolTip: qsTr("Add Module")},
|
|
||||||
{title: qsTr("Assets"), addToolTip: qsTr("Add new assets to project.")}]
|
|
||||||
|
|
||||||
TabButton {
|
|
||||||
topPadding: 4
|
|
||||||
bottomPadding: 4
|
|
||||||
contentItem: Item {
|
|
||||||
implicitHeight: plusButton.height
|
|
||||||
|
|
||||||
Text { // TabButton text
|
|
||||||
text: modelData.title
|
|
||||||
font.pixelSize: 13
|
|
||||||
font.bold: false
|
|
||||||
color: tabBar.currentIndex === index ? StudioTheme.Values.themeInteraction
|
|
||||||
: StudioTheme.Values.themeTextColor
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.right: plusButton.left
|
|
||||||
anchors.bottomMargin: 2
|
|
||||||
horizontalAlignment: Text.AlignLeft
|
|
||||||
verticalAlignment: Text.AlignBottom
|
|
||||||
elide: Text.ElideRight
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle { // + button
|
|
||||||
id: plusButton
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.topMargin: 1
|
|
||||||
width: 24
|
|
||||||
height: 24
|
|
||||||
color: mouseArea.containsMouse && enabled
|
|
||||||
? StudioTheme.Values.themeControlBackgroundHover
|
|
||||||
: StudioTheme.Values.themeControlBackground
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: StudioTheme.Values.hoverDuration
|
|
||||||
easing.type: StudioTheme.Values.hoverEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
enabled: index !== 0 || !rootView.subCompEditMode
|
|
||||||
|
|
||||||
Label { // + sign
|
|
||||||
text: StudioTheme.Constants.plus
|
|
||||||
font.family: StudioTheme.Constants.iconFont.family
|
|
||||||
font.pixelSize: StudioTheme.Values.myIconFontSize
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color: !plusButton.enabled
|
|
||||||
? StudioTheme.Values.themeIconColorDisabled
|
|
||||||
: tabBar.currentIndex === index
|
|
||||||
? StudioTheme.Values.themeIconColorSelected
|
|
||||||
: StudioTheme.Values.themeIconColor
|
|
||||||
}
|
|
||||||
|
|
||||||
HelperWidgets.ToolTipArea {
|
|
||||||
id: mouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
onClicked: index === 0 ? rootView.handleAddModule()
|
|
||||||
: rootView.handleAddAsset()
|
|
||||||
tooltip: modelData.addToolTip
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
background: Item { // TabButton background
|
|
||||||
Rectangle { // bottom strip
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
width: parent.width
|
|
||||||
height: 2
|
|
||||||
color: tabBar.currentIndex === index ? StudioTheme.Values.themeInteraction
|
|
||||||
: StudioTheme.Values.themeTextColor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: rootView.handleTabChanged(index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TextField { // filter
|
|
||||||
id: searchFilterText
|
|
||||||
placeholderText: qsTr("Search")
|
|
||||||
placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor
|
|
||||||
color: StudioTheme.Values.themeTextColor
|
|
||||||
selectionColor: StudioTheme.Values.themeTextSelectionColor
|
|
||||||
selectedTextColor: StudioTheme.Values.themeTextSelectedTextColor
|
|
||||||
background: Rectangle {
|
|
||||||
id: textFieldBackground
|
|
||||||
color: StudioTheme.Values.themeControlBackground
|
|
||||||
border.color: StudioTheme.Values.themeControlOutline
|
|
||||||
border.width: StudioTheme.Values.border
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: StudioTheme.Values.hoverDuration
|
|
||||||
easing.type: StudioTheme.Values.hoverEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
height: StudioTheme.Values.defaultControlHeight
|
|
||||||
|
|
||||||
leftPadding: 32
|
|
||||||
rightPadding: 30
|
|
||||||
topPadding: 6
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.leftMargin: 5
|
|
||||||
anchors.rightMargin: 5
|
|
||||||
selectByMouse: true
|
|
||||||
hoverEnabled: true
|
|
||||||
|
|
||||||
onTextChanged: rootView.handleSearchfilterChanged(text)
|
|
||||||
|
|
||||||
Label {
|
|
||||||
text: StudioTheme.Constants.search
|
|
||||||
font.family: StudioTheme.Constants.iconFont.family
|
|
||||||
font.pixelSize: 16
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: 7
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
color: StudioTheme.Values.themeIconColor
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle { // x button
|
|
||||||
width: 16
|
|
||||||
height: 15
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: 5
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
visible: searchFilterText.text !== ""
|
|
||||||
color: xMouseArea.containsMouse ? StudioTheme.Values.themePanelBackground
|
|
||||||
: "transparent"
|
|
||||||
|
|
||||||
Label {
|
|
||||||
text: StudioTheme.Constants.closeCross
|
|
||||||
font.family: StudioTheme.Constants.iconFont.family
|
|
||||||
font.pixelSize: StudioTheme.Values.myIconFontSize
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color: StudioTheme.Values.themeIconColor
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: xMouseArea
|
|
||||||
hoverEnabled: true
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: searchFilterText.text = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "default"
|
|
||||||
when: !searchFilterText.hovered && !searchFilterText.activeFocus
|
|
||||||
PropertyChanges {
|
|
||||||
target: textFieldBackground
|
|
||||||
color: StudioTheme.Values.themeControlBackground
|
|
||||||
border.color: StudioTheme.Values.themeControlOutline
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: searchFilterText
|
|
||||||
placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "hover"
|
|
||||||
when: searchFilterText.hovered && !searchFilterText.activeFocus
|
|
||||||
PropertyChanges {
|
|
||||||
target: textFieldBackground
|
|
||||||
color: StudioTheme.Values.themeControlBackgroundHover
|
|
||||||
border.color: StudioTheme.Values.themeControlOutline
|
|
||||||
}
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
target: searchFilterText
|
|
||||||
placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "edit"
|
|
||||||
when: searchFilterText.activeFocus
|
|
||||||
PropertyChanges {
|
|
||||||
target: textFieldBackground
|
|
||||||
color: StudioTheme.Values.themeControlBackgroundInteraction
|
|
||||||
border.color: StudioTheme.Values.themeControlOutlineInteraction
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: searchFilterText
|
|
||||||
placeholderTextColor: StudioTheme.Values.themePlaceholderTextColorInteraction
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -0,0 +1,79 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
import QtQuick 2.15
|
||||||
|
import QtQuick.Controls 2.15
|
||||||
|
import QtQuickDesignerTheme 1.0
|
||||||
|
import HelperWidgets 2.0 as HelperWidgets
|
||||||
|
import StudioControls 1.0 as StudioControls
|
||||||
|
import StudioTheme 1.0 as StudioTheme
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property string tooltip: ""
|
||||||
|
|
||||||
|
signal clicked()
|
||||||
|
|
||||||
|
implicitWidth: 29
|
||||||
|
implicitHeight: 29
|
||||||
|
color: mouseArea.containsMouse && enabled
|
||||||
|
? StudioTheme.Values.themeControlBackgroundHover
|
||||||
|
: StudioTheme.Values.themeControlBackground
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: StudioTheme.Values.hoverDuration
|
||||||
|
easing.type: StudioTheme.Values.hoverEasing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label { // + sign
|
||||||
|
text: StudioTheme.Constants.plus
|
||||||
|
font.family: StudioTheme.Constants.iconFont.family
|
||||||
|
font.pixelSize: StudioTheme.Values.myIconFontSize
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
anchors.centerIn: parent
|
||||||
|
color: root.enabled ? StudioTheme.Values.themeIconColor
|
||||||
|
: StudioTheme.Values.themeIconColorDisabled
|
||||||
|
scale: mouseArea.containsMouse ? 1.4 : 1
|
||||||
|
|
||||||
|
Behavior on scale {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: 300
|
||||||
|
easing.type: Easing.OutExpo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HelperWidgets.ToolTipArea {
|
||||||
|
id: mouseArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
onClicked: root.clicked()
|
||||||
|
tooltip: root.tooltip
|
||||||
|
}
|
||||||
|
}
|
168
share/qtcreator/qmldesigner/itemLibraryQmlSources/SearchBox.qml
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
import QtQuick 2.15
|
||||||
|
import QtQuick.Controls 2.15
|
||||||
|
import QtQuickDesignerTheme 1.0
|
||||||
|
import HelperWidgets 2.0 as HelperWidgets
|
||||||
|
import StudioControls 1.0 as StudioControls
|
||||||
|
import StudioTheme 1.0 as StudioTheme
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property alias text: searchFilterText.text
|
||||||
|
|
||||||
|
function clearSearchFilter()
|
||||||
|
{
|
||||||
|
searchFilterText.text = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function isEmpty()
|
||||||
|
{
|
||||||
|
return searchFilterText.text === "";
|
||||||
|
}
|
||||||
|
|
||||||
|
implicitWidth: searchFilterText.width
|
||||||
|
implicitHeight: searchFilterText.height
|
||||||
|
|
||||||
|
TextField {
|
||||||
|
id: searchFilterText
|
||||||
|
|
||||||
|
placeholderText: qsTr("Search")
|
||||||
|
placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor
|
||||||
|
color: StudioTheme.Values.themeTextColor
|
||||||
|
selectionColor: StudioTheme.Values.themeTextSelectionColor
|
||||||
|
selectedTextColor: StudioTheme.Values.themeTextSelectedTextColor
|
||||||
|
background: Rectangle {
|
||||||
|
id: textFieldBackground
|
||||||
|
color: StudioTheme.Values.themeControlBackground
|
||||||
|
border.color: StudioTheme.Values.themeControlOutline
|
||||||
|
border.width: StudioTheme.Values.border
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: StudioTheme.Values.hoverDuration
|
||||||
|
easing.type: StudioTheme.Values.hoverEasing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
height: StudioTheme.Values.defaultControlHeight
|
||||||
|
|
||||||
|
leftPadding: 32
|
||||||
|
rightPadding: 30
|
||||||
|
topPadding: 6
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.leftMargin: 5
|
||||||
|
anchors.rightMargin: 5
|
||||||
|
selectByMouse: true
|
||||||
|
hoverEnabled: true
|
||||||
|
|
||||||
|
onTextChanged: rootView.handleSearchfilterChanged(text)
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: StudioTheme.Constants.search
|
||||||
|
font.family: StudioTheme.Constants.iconFont.family
|
||||||
|
font.pixelSize: 16
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: 7
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
color: StudioTheme.Values.themeIconColor
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle { // x button
|
||||||
|
width: 16
|
||||||
|
height: 15
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 5
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: searchFilterText.text !== ""
|
||||||
|
color: xMouseArea.containsMouse ? StudioTheme.Values.themePanelBackground
|
||||||
|
: "transparent"
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: StudioTheme.Constants.closeCross
|
||||||
|
font.family: StudioTheme.Constants.iconFont.family
|
||||||
|
font.pixelSize: StudioTheme.Values.myIconFontSize
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
anchors.centerIn: parent
|
||||||
|
color: StudioTheme.Values.themeIconColor
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: xMouseArea
|
||||||
|
hoverEnabled: true
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: searchFilterText.text = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "default"
|
||||||
|
when: !searchFilterText.hovered && !searchFilterText.activeFocus
|
||||||
|
PropertyChanges {
|
||||||
|
target: textFieldBackground
|
||||||
|
color: StudioTheme.Values.themeControlBackground
|
||||||
|
border.color: StudioTheme.Values.themeControlOutline
|
||||||
|
}
|
||||||
|
PropertyChanges {
|
||||||
|
target: searchFilterText
|
||||||
|
placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "hover"
|
||||||
|
when: searchFilterText.hovered && !searchFilterText.activeFocus
|
||||||
|
PropertyChanges {
|
||||||
|
target: textFieldBackground
|
||||||
|
color: StudioTheme.Values.themeControlBackgroundHover
|
||||||
|
border.color: StudioTheme.Values.themeControlOutline
|
||||||
|
}
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: searchFilterText
|
||||||
|
placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "edit"
|
||||||
|
when: searchFilterText.activeFocus
|
||||||
|
PropertyChanges {
|
||||||
|
target: textFieldBackground
|
||||||
|
color: StudioTheme.Values.themeControlBackgroundInteraction
|
||||||
|
border.color: StudioTheme.Values.themeControlOutlineInteraction
|
||||||
|
}
|
||||||
|
PropertyChanges {
|
||||||
|
target: searchFilterText
|
||||||
|
placeholderTextColor: StudioTheme.Values.themePlaceholderTextColorInteraction
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
86
share/qtcreator/qmldesigner/misc/BusyIndicator.qml
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
|
||||||
|
BusyIndicator {
|
||||||
|
id: control
|
||||||
|
|
||||||
|
contentItem: Item {
|
||||||
|
implicitWidth: 64
|
||||||
|
implicitHeight: 64
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: item
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: 64
|
||||||
|
height: 64
|
||||||
|
opacity: control.running ? 1 : 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
OpacityAnimator {
|
||||||
|
duration: 250
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RotationAnimator {
|
||||||
|
target: item
|
||||||
|
running: control.visible && control.running
|
||||||
|
from: 0
|
||||||
|
to: 360
|
||||||
|
loops: Animation.Infinite
|
||||||
|
duration: 2000
|
||||||
|
}
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
id: repeater
|
||||||
|
model: 6
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: delegate
|
||||||
|
anchors.centerIn: parent
|
||||||
|
implicitWidth: 10
|
||||||
|
implicitHeight: 10
|
||||||
|
radius: 5
|
||||||
|
color: "#2aafd3"
|
||||||
|
|
||||||
|
required property int index
|
||||||
|
|
||||||
|
transform: [
|
||||||
|
Translate {
|
||||||
|
y: -Math.min(item.width, item.height) * 0.5 + 5
|
||||||
|
},
|
||||||
|
Rotation {
|
||||||
|
angle: delegate.index / repeater.count * 360
|
||||||
|
origin.x: 5
|
||||||
|
origin.y: 5
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -3,8 +3,9 @@
|
|||||||
<container floating="false">
|
<container floating="false">
|
||||||
<splitter orientation="Horizontal" count="3">
|
<splitter orientation="Horizontal" count="3">
|
||||||
<splitter orientation="Vertical" count="2">
|
<splitter orientation="Vertical" count="2">
|
||||||
<area tabs="3" current="Library">
|
<area tabs="4" current="Components">
|
||||||
<widget name="Library" closed="false"/>
|
<widget name="Components" closed="false"/>
|
||||||
|
<widget name="Assets" closed="false"/>
|
||||||
<widget name="Navigator" closed="false"/>
|
<widget name="Navigator" closed="false"/>
|
||||||
<widget name="DebugView" closed="false"/>
|
<widget name="DebugView" closed="false"/>
|
||||||
</area>
|
</area>
|
||||||
|
@@ -3,8 +3,9 @@
|
|||||||
<container floating="false">
|
<container floating="false">
|
||||||
<splitter orientation="Horizontal" count="3">
|
<splitter orientation="Horizontal" count="3">
|
||||||
<splitter orientation="Vertical" count="3">
|
<splitter orientation="Vertical" count="3">
|
||||||
<area tabs="2" current="Library">
|
<area tabs="3" current="Components">
|
||||||
<widget name="Library" closed="false"/>
|
<widget name="Components" closed="false"/>
|
||||||
|
<widget name="Assets" closed="false"/>
|
||||||
<widget name="DebugView" closed="false"/>
|
<widget name="DebugView" closed="false"/>
|
||||||
</area>
|
</area>
|
||||||
<area tabs="3" current="Projects">
|
<area tabs="3" current="Projects">
|
||||||
|
@@ -42,9 +42,9 @@ def clean_environment_script():
|
|||||||
'TERM_SESSION_ID'])
|
'TERM_SESSION_ID'])
|
||||||
return r'''
|
return r'''
|
||||||
function ignore() {
|
function ignore() {
|
||||||
local keys="''' + env_to_keep + '''"
|
local keys=(''' + env_to_keep + ''')
|
||||||
local v=$1
|
local v=$1
|
||||||
for e in $keys; do [[ "$e" == "$v" ]] && return 0; done
|
for e in "${keys[@]}"; do [[ "$e" == "$v" ]] && return 0; done
|
||||||
}
|
}
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
key=$(echo $line | /usr/bin/cut -d '=' -f 1)
|
key=$(echo $line | /usr/bin/cut -d '=' -f 1)
|
||||||
|
@@ -29,6 +29,7 @@ add_qtc_library(KSyntaxHighlighting SHARED
|
|||||||
src/lib/foldingregion.cpp src/lib/foldingregion.h
|
src/lib/foldingregion.cpp src/lib/foldingregion.h
|
||||||
src/lib/format.cpp src/lib/format.h src/lib/format_p.h
|
src/lib/format.cpp src/lib/format.h src/lib/format_p.h
|
||||||
src/lib/htmlhighlighter.cpp src/lib/htmlhighlighter.h
|
src/lib/htmlhighlighter.cpp src/lib/htmlhighlighter.h
|
||||||
|
src/lib/highlightingdata.cpp src/lib/highlightingdata_p.hpp
|
||||||
src/lib/keywordlist.cpp src/lib/keywordlist_p.h
|
src/lib/keywordlist.cpp src/lib/keywordlist_p.h
|
||||||
src/lib/matchresult_p.h
|
src/lib/matchresult_p.h
|
||||||
src/lib/repository.cpp src/lib/repository.h src/lib/repository_p.h
|
src/lib/repository.cpp src/lib/repository.h src/lib/repository_p.h
|
||||||
|
@@ -3,10 +3,10 @@
|
|||||||
#ifndef SyntaxHighlighting_VERSION_H
|
#ifndef SyntaxHighlighting_VERSION_H
|
||||||
#define SyntaxHighlighting_VERSION_H
|
#define SyntaxHighlighting_VERSION_H
|
||||||
|
|
||||||
#define SyntaxHighlighting_VERSION_STRING "5.87.0"
|
#define SyntaxHighlighting_VERSION_STRING "5.90.0"
|
||||||
#define SyntaxHighlighting_VERSION_MAJOR 5
|
#define SyntaxHighlighting_VERSION_MAJOR 5
|
||||||
#define SyntaxHighlighting_VERSION_MINOR 87
|
#define SyntaxHighlighting_VERSION_MINOR 90
|
||||||
#define SyntaxHighlighting_VERSION_PATCH 0
|
#define SyntaxHighlighting_VERSION_PATCH 0
|
||||||
#define SyntaxHighlighting_VERSION ((5<<16)|(87<<8)|(0))
|
#define SyntaxHighlighting_VERSION ((5<<16)|(90<<8)|(0))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -88,7 +88,7 @@
|
|||||||
#define KSYNTAXHIGHLIGHTING_BUILD_DEPRECATED_SINCE(major, minor) 1
|
#define KSYNTAXHIGHLIGHTING_BUILD_DEPRECATED_SINCE(major, minor) 1
|
||||||
|
|
||||||
#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED
|
#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED
|
||||||
# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0x55700
|
# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0x55a00
|
||||||
#endif
|
#endif
|
||||||
#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS
|
#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS
|
||||||
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0
|
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
# ifdef KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT
|
# ifdef KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT
|
||||||
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT
|
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT
|
||||||
# else
|
# else
|
||||||
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0x55700
|
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0x55a00
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
#define KSYNTAXHIGHLIGHTING_BUILD_DEPRECATED_SINCE(major, minor) 1
|
#define KSYNTAXHIGHLIGHTING_BUILD_DEPRECATED_SINCE(major, minor) 1
|
||||||
|
|
||||||
#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED
|
#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED
|
||||||
# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0x55700
|
# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0x55a00
|
||||||
#endif
|
#endif
|
||||||
#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS
|
#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS
|
||||||
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0
|
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
# ifdef KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT
|
# ifdef KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT
|
||||||
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT
|
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT
|
||||||
# else
|
# else
|
||||||
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0x55700
|
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0x55a00
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -64,7 +64,7 @@ if (QRC_SYNTAX)
|
|||||||
|
|
||||||
# generate the qrc file manually, to make dependencies on generated files work...
|
# generate the qrc file manually, to make dependencies on generated files work...
|
||||||
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp"
|
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp"
|
||||||
COMMAND ${Qt5Core_RCC_EXECUTABLE} --name syntax_data -o "${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp" "${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc"
|
COMMAND Qt${QT_MAJOR_VERSION}::rcc --name syntax_data -o "${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp" "${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc"
|
||||||
DEPENDS ${defs} ${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax
|
DEPENDS ${defs} ${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax
|
||||||
)
|
)
|
||||||
set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp" PROPERTIES SKIP_AUTOMOC ON)
|
set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp" PROPERTIES SKIP_AUTOMOC ON)
|
||||||
@@ -79,5 +79,5 @@ endif()
|
|||||||
# this needs some more recent CMake than generally required
|
# this needs some more recent CMake than generally required
|
||||||
set_property(TARGET SyntaxHighlightingData PROPERTY POSITION_INDEPENDENT_CODE 1)
|
set_property(TARGET SyntaxHighlightingData PROPERTY POSITION_INDEPENDENT_CODE 1)
|
||||||
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.13.0")
|
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.13.0")
|
||||||
target_link_libraries(SyntaxHighlightingData PRIVATE Qt5::Core)
|
target_link_libraries(SyntaxHighlightingData PRIVATE Qt${QT_MAJOR_VERSION}::Core)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -1,7 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE language SYSTEM "language.dtd"
|
<!DOCTYPE language SYSTEM "language.dtd"
|
||||||
[
|
[
|
||||||
<!ENTITY id_re "[_A-Za-z][\-_0-9A-Za-z]*">
|
<!-- NOTE See https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#variable-references -->
|
||||||
|
<!ENTITY var_ref_re "[/\.\+\-_0-9A-Za-z]+">
|
||||||
|
<!-- NOTE See `cmGeneratorExpression::IsValidTargetName` -->
|
||||||
|
<!ENTITY tgt_name_re "[A-Za-z0-9_\.\+\-]+">
|
||||||
]>
|
]>
|
||||||
<!--
|
<!--
|
||||||
This file is part of KDE's kate project.
|
This file is part of KDE's kate project.
|
||||||
@@ -38,7 +41,9 @@
|
|||||||
<item><!--{command.name}--></item>
|
<item><!--{command.name}--></item>
|
||||||
<!--[- endfor ]-->
|
<!--[- endfor ]-->
|
||||||
</list>
|
</list>
|
||||||
<!--[ for command in commands -]-->
|
|
||||||
|
<!--[- macro render_command_arg_lists(commands) ]-->
|
||||||
|
<!--[- for command in commands -]-->
|
||||||
<!--[- if command.named_args and command.named_args.kw ]-->
|
<!--[- if command.named_args and command.named_args.kw ]-->
|
||||||
<list name="<!--{command.name}-->_nargs">
|
<list name="<!--{command.name}-->_nargs">
|
||||||
<!--[- for arg in command.named_args.kw ]-->
|
<!--[- for arg in command.named_args.kw ]-->
|
||||||
@@ -54,6 +59,9 @@
|
|||||||
</list>
|
</list>
|
||||||
<!--[- endif ]-->
|
<!--[- endif ]-->
|
||||||
<!--[- endfor ]-->
|
<!--[- endfor ]-->
|
||||||
|
<!--[- endmacro ]-->
|
||||||
|
<!--{- render_command_arg_lists(commands) }-->
|
||||||
|
<!--{- render_command_arg_lists(standard_module_commands) }-->
|
||||||
|
|
||||||
<list name="variables">
|
<list name="variables">
|
||||||
<!--[- for var in variables.kw ]-->
|
<!--[- for var in variables.kw ]-->
|
||||||
@@ -87,6 +95,24 @@
|
|||||||
<!--[- endfor ]-->
|
<!--[- endfor ]-->
|
||||||
</list>
|
</list>
|
||||||
|
|
||||||
|
<list name="standard-modules">
|
||||||
|
<!--[- for module in modules.utility ]-->
|
||||||
|
<item><!--{ module }--></item>
|
||||||
|
<!--[- endfor ]-->
|
||||||
|
</list>
|
||||||
|
|
||||||
|
<list name="standard-finder-modules">
|
||||||
|
<!--[- for module in modules.finder ]-->
|
||||||
|
<item><!--{ module | replace('Find', '') }--></item>
|
||||||
|
<!--[- endfor ]-->
|
||||||
|
</list>
|
||||||
|
|
||||||
|
<list name="deprecated-modules">
|
||||||
|
<!--[- for module in modules.deprecated ]-->
|
||||||
|
<item><!--{ module }--></item>
|
||||||
|
<!--[- endfor ]-->
|
||||||
|
</list>
|
||||||
|
|
||||||
<contexts>
|
<contexts>
|
||||||
|
|
||||||
<context attribute="Normal Text" lineEndContext="#stay" name="Normal Text">
|
<context attribute="Normal Text" lineEndContext="#stay" name="Normal Text">
|
||||||
@@ -94,25 +120,68 @@
|
|||||||
<!--[ for command in commands -]-->
|
<!--[ for command in commands -]-->
|
||||||
<WordDetect String="<!--{command.name}-->" insensitive="true" attribute="Command" context="<!--{command.name}-->_ctx"<!--[ if command.start_region ]--> beginRegion="<!--{command.start_region}-->"<!--[ endif -]--> <!--[- if command.end_region ]--> endRegion="<!--{command.end_region}-->"<!--[ endif ]--> />
|
<WordDetect String="<!--{command.name}-->" insensitive="true" attribute="Command" context="<!--{command.name}-->_ctx"<!--[ if command.start_region ]--> beginRegion="<!--{command.start_region}-->"<!--[ endif -]--> <!--[- if command.end_region ]--> endRegion="<!--{command.end_region}-->"<!--[ endif ]--> />
|
||||||
<!--[ endfor -]-->
|
<!--[ endfor -]-->
|
||||||
|
<!--[ for command in standard_module_commands -]-->
|
||||||
|
<WordDetect String="<!--{command.name}-->" insensitive="true" attribute="CMake Provided Function/Macro" context="<!--{command.name}-->_ctx" />
|
||||||
|
<!--[ endfor -]-->
|
||||||
<DetectChar attribute="Comment" context="Match Comments and Docs" char="#" lookAhead="true" />
|
<DetectChar attribute="Comment" context="Match Comments and Docs" char="#" lookAhead="true" />
|
||||||
<DetectIdentifier attribute="User Function/Macro" context="User Function" />
|
<DetectIdentifier attribute="User Function/Macro" context="User Function" />
|
||||||
<RegExpr attribute="@Variable Substitution" context="@VarSubst" String="@&id_re;@" lookAhead="true" />
|
<RegExpr attribute="@Variable Substitution" context="@VarSubst" String="@&var_ref_re;@" lookAhead="true" />
|
||||||
<!-- Include keywords matching for language autocompleter work -->
|
<RegExpr attribute="Error" context="#stay" String=".*" />
|
||||||
<keyword attribute="Command" context="#stay" String="commands" />
|
|
||||||
</context>
|
</context>
|
||||||
|
<!--[- macro render_command_parsers(commands) ]-->
|
||||||
<!--[ for command in commands -]-->
|
<!--[ for command in commands -]-->
|
||||||
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx">
|
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx">
|
||||||
<DetectChar attribute="Normal Text" context="<!--{command.name}-->_ctx_op" char="(" />
|
<DetectChar attribute="Normal Text" context="<!--{command.name}-->_ctx_op<!--{'_tgt_first' if command.first_arg_is_target else '_tgts_first' if command.first_args_are_targets else ''}-->" char="(" />
|
||||||
|
<DetectChar attribute="Normal Text" context="#pop" char=")" />
|
||||||
</context>
|
</context>
|
||||||
|
<!--[- if command.first_arg_is_target ]-->
|
||||||
|
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op_tgt_first">
|
||||||
|
<RegExpr attribute="Aliased Targets" context="<!--{command.name}-->_ctx_op" String="&tgt_name_re;::&tgt_name_re;(?:\:\:&tgt_name_re;)*" />
|
||||||
|
<RegExpr attribute="Targets" context="<!--{command.name}-->_ctx_op" String="&tgt_name_re;" />
|
||||||
|
<DetectChar attribute="Normal Text" context="#pop" char=")" lookAhead="true" />
|
||||||
|
<IncludeRules context="User Function Args" />
|
||||||
|
<DetectSpaces />
|
||||||
|
<RegExpr attribute="Error" context="#stay" String=".*" />
|
||||||
|
</context>
|
||||||
|
<!--[- endif ]-->
|
||||||
|
<!--[- if command.first_args_are_targets ]-->
|
||||||
|
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op_tgts_first">
|
||||||
|
<!--[- if command.named_args and command.named_args.kw ]-->
|
||||||
|
<!-- NOTE Handle the only case in CMake nowadays:
|
||||||
|
1. `set_target_properties` have a named keyword (`PROPERTIES`) after targets list
|
||||||
|
-->
|
||||||
|
<keyword context="<!--{command.name}-->_ctx_op" String="<!--{command.name}-->_nargs" lookAhead="true" />
|
||||||
|
<!--[- endif ]-->
|
||||||
|
<IncludeRules context="Detect Aliased Targets" />
|
||||||
|
<RegExpr attribute="Targets" context="#stay" String="&tgt_name_re;" />
|
||||||
|
<DetectChar attribute="Normal Text" context="#pop" char=")" lookAhead="true" />
|
||||||
|
<IncludeRules context="User Function Args" />
|
||||||
|
<DetectSpaces />
|
||||||
|
<RegExpr attribute="Error" context="#stay" String=".*" />
|
||||||
|
</context>
|
||||||
|
<!--[- endif ]-->
|
||||||
|
<!--[- if not command.first_args_are_targets or (command.named_args and command.named_args.kw) ]-->
|
||||||
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op">
|
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op">
|
||||||
<!--[- if command.nested_parentheses ]-->
|
<!--[- if command.nested_parentheses ]-->
|
||||||
<DetectChar attribute="Normal Text" context="<!--{command.name}-->_ctx_op_nested" char="(" />
|
<DetectChar attribute="Normal Text" context="<!--{command.name}-->_ctx_op_nested" char="(" />
|
||||||
<!--[- endif ]-->
|
<!--[- endif ]-->
|
||||||
<IncludeRules context="EndCmdPop2" />
|
<DetectChar attribute="Normal Text" context="#pop" char=")" lookAhead="true" />
|
||||||
<!--[- if command.named_args and command.named_args.kw ]-->
|
<!--[- if command.named_args and command.named_args.kw ]-->
|
||||||
|
<!--[- if command.has_target_name_after_kw ]-->
|
||||||
|
<WordDetect String="<!--{command.has_target_name_after_kw}-->" attribute="Named Args" context="Target Name" />
|
||||||
|
<!--[- endif ]-->
|
||||||
|
<!--[- if command.has_target_names_after_kw ]-->
|
||||||
|
<WordDetect String="<!--{command.has_target_names_after_kw}-->" attribute="Named Args" context="<!--{command.name}-->_tgts" />
|
||||||
|
<!--[- endif ]-->
|
||||||
<keyword attribute="Named Args" context="#stay" String="<!--{command.name}-->_nargs" />
|
<keyword attribute="Named Args" context="#stay" String="<!--{command.name}-->_nargs" />
|
||||||
<!--[- endif ]-->
|
<!--[- endif ]-->
|
||||||
|
<!--[- if command.name == 'include' ]-->
|
||||||
|
<keyword attribute="Standard Module" context="#stay" String="standard-modules" />
|
||||||
|
<keyword attribute="Deprecated Module" context="#stay" String="deprecated-modules" />
|
||||||
|
<!--[- endif ]-->
|
||||||
|
<!--[- if command.name == 'find_package' ]-->
|
||||||
|
<keyword attribute="Standard Module" context="#stay" String="standard-finder-modules" />
|
||||||
|
<!--[- endif ]-->
|
||||||
<!--[- if command.special_args and command.special_args.kw ]-->
|
<!--[- if command.special_args and command.special_args.kw ]-->
|
||||||
<keyword attribute="Special Args" context="#stay" String="<!--{command.name}-->_sargs" />
|
<keyword attribute="Special Args" context="#stay" String="<!--{command.name}-->_sargs" />
|
||||||
<!--[- endif ]-->
|
<!--[- endif ]-->
|
||||||
@@ -132,9 +201,21 @@
|
|||||||
<!--[- endif ]-->
|
<!--[- endif ]-->
|
||||||
<!--[- endif ]-->
|
<!--[- endif ]-->
|
||||||
</context>
|
</context>
|
||||||
|
<!--[- endif ]-->
|
||||||
|
<!--[- if command.has_target_names_after_kw ]-->
|
||||||
|
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_tgts">
|
||||||
|
<DetectChar attribute="Normal Text" context="#pop" char=")" lookAhead="true" />
|
||||||
|
<keyword attribute="Named Args" context="#pop" String="<!--{command.name}-->_nargs" />
|
||||||
|
<RegExpr attribute="Aliased Targets" context="#stay" String="&tgt_name_re;::&tgt_name_re;(?:\:\:&tgt_name_re;)*" />
|
||||||
|
<RegExpr attribute="Targets" context="#stay" String="&tgt_name_re;" />
|
||||||
|
<IncludeRules context="User Function Args" />
|
||||||
|
<DetectSpaces />
|
||||||
|
<RegExpr attribute="Error" context="#stay" String=".*" />
|
||||||
|
</context>
|
||||||
|
<!--[- endif ]-->
|
||||||
<!--[- if command.nested_parentheses ]-->
|
<!--[- if command.nested_parentheses ]-->
|
||||||
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op_nested">
|
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op_nested">
|
||||||
<IncludeRules context="EndCmdPop" />
|
<DetectChar attribute="Normal Text" context="#pop" char=")" />
|
||||||
<!--[- if command.named_args and command.named_args.kw ]-->
|
<!--[- if command.named_args and command.named_args.kw ]-->
|
||||||
<keyword attribute="Named Args" context="#stay" String="<!--{command.name}-->_nargs" />
|
<keyword attribute="Named Args" context="#stay" String="<!--{command.name}-->_nargs" />
|
||||||
<!--[- endif ]-->
|
<!--[- endif ]-->
|
||||||
@@ -153,33 +234,27 @@
|
|||||||
</context>
|
</context>
|
||||||
<!--[- endif ]-->
|
<!--[- endif ]-->
|
||||||
<!--[ endfor -]-->
|
<!--[ endfor -]-->
|
||||||
|
<!--[- endmacro -]-->
|
||||||
|
<!--{- render_command_parsers(commands) -}-->
|
||||||
|
<!--{- render_command_parsers(standard_module_commands) -}-->
|
||||||
<!--[ for kind in properties.kinds if properties[kind].re -]-->
|
<!--[ for kind in properties.kinds if properties[kind].re -]-->
|
||||||
<context attribute="Normal Text" lineEndContext="#stay" name="Detect More <!--{ kind|replace('_', '-') }-->">
|
<context attribute="Normal Text" lineEndContext="#stay" name="Detect More <!--{ kind|replace('_', '-') }-->">
|
||||||
<RegExpr attribute="Property" context="#stay" String="<!--{properties[kind].re}-->" />
|
<RegExpr attribute="Property" context="#stay" String="<!--{properties[kind].re}-->" />
|
||||||
</context><!--{ '\n' }-->
|
</context><!--{ '\n' }-->
|
||||||
<!--[ endfor -]-->
|
<!--[ endfor -]-->
|
||||||
|
|
||||||
<context attribute="Normal Text" lineEndContext="#stay" name="EndCmdPop">
|
<context attribute="User Function/Macro" lineEndContext="#stay" name="User Function">
|
||||||
|
<DetectChar attribute="Normal Text" context="User Function Opened" char="(" />
|
||||||
<DetectChar attribute="Normal Text" context="#pop" char=")" />
|
<DetectChar attribute="Normal Text" context="#pop" char=")" />
|
||||||
</context>
|
</context>
|
||||||
|
|
||||||
<context attribute="Normal Text" lineEndContext="#stay" name="EndCmdPop2">
|
|
||||||
<DetectChar attribute="Normal Text" context="#pop#pop" char=")" />
|
|
||||||
</context>
|
|
||||||
|
|
||||||
<context attribute="User Function/Macro" lineEndContext="#stay" name="User Function">
|
|
||||||
<DetectChar attribute="Normal Text" context="User Function Opened" char="(" />
|
|
||||||
<IncludeRules context="EndCmdPop2" />
|
|
||||||
</context>
|
|
||||||
|
|
||||||
<context attribute="Normal Text" lineEndContext="#stay" name="User Function Opened">
|
<context attribute="Normal Text" lineEndContext="#stay" name="User Function Opened">
|
||||||
<IncludeRules context="EndCmdPop2" />
|
<DetectChar attribute="Normal Text" context="#pop" char=")" lookAhead="true" />
|
||||||
<IncludeRules context="User Function Args" />
|
<IncludeRules context="User Function Args" />
|
||||||
</context>
|
</context>
|
||||||
|
|
||||||
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Builtin Variables">
|
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Builtin Variables">
|
||||||
<RegExpr attribute="Internal Name" context="#stay" String="\b_&id_re;\b" />
|
<RegExpr attribute="Internal Name" context="#stay" String="\b_&var_ref_re;\b" />
|
||||||
<keyword attribute="CMake Internal Variable" context="#stay" String="deprecated-or-internal-variables" insensitive="false" />
|
<keyword attribute="CMake Internal Variable" context="#stay" String="deprecated-or-internal-variables" insensitive="false" />
|
||||||
<keyword attribute="Builtin Variable" context="#stay" String="variables" insensitive="false" />
|
<keyword attribute="Builtin Variable" context="#stay" String="variables" insensitive="false" />
|
||||||
<IncludeRules context="Detect More Builtin Variables" />
|
<IncludeRules context="Detect More Builtin Variables" />
|
||||||
@@ -198,7 +273,7 @@
|
|||||||
<RegExpr attribute="Cache Variable Substitution" context="#stay" String="\$CACHE\{\s*[\w-]+\s*\}" />
|
<RegExpr attribute="Cache Variable Substitution" context="#stay" String="\$CACHE\{\s*[\w-]+\s*\}" />
|
||||||
<RegExpr attribute="Environment Variable Substitution" context="EnvVarSubst" String="\$?ENV\{" />
|
<RegExpr attribute="Environment Variable Substitution" context="EnvVarSubst" String="\$?ENV\{" />
|
||||||
<Detect2Chars attribute="Variable Substitution" context="VarSubst" char="$" char1="{" />
|
<Detect2Chars attribute="Variable Substitution" context="VarSubst" char="$" char1="{" />
|
||||||
<RegExpr attribute="@Variable Substitution" context="@VarSubst" String="@&id_re;@" lookAhead="true" />
|
<RegExpr attribute="@Variable Substitution" context="@VarSubst" String="@&var_ref_re;@" lookAhead="true" />
|
||||||
</context>
|
</context>
|
||||||
|
|
||||||
<context attribute="Environment Variable Substitution" lineEndContext="#pop" name="EnvVarSubst">
|
<context attribute="Environment Variable Substitution" lineEndContext="#pop" name="EnvVarSubst">
|
||||||
@@ -229,6 +304,15 @@
|
|||||||
<DetectChar attribute="@Variable Substitution" context="#pop#pop" char="@" />
|
<DetectChar attribute="@Variable Substitution" context="#pop#pop" char="@" />
|
||||||
</context>
|
</context>
|
||||||
|
|
||||||
|
<context attribute="Normal Text" lineEndContext="#stay" name="Target Name">
|
||||||
|
<RegExpr attribute="Aliased Targets" context="#pop" String="&tgt_name_re;::&tgt_name_re;(?:\:\:&tgt_name_re;)*" />
|
||||||
|
<RegExpr attribute="Targets" context="#pop" String="&tgt_name_re;" />
|
||||||
|
<DetectChar attribute="Normal Text" context="#pop" char=")" lookAhead="true" />
|
||||||
|
<IncludeRules context="User Function Args" />
|
||||||
|
<DetectSpaces />
|
||||||
|
<RegExpr attribute="Error" context="#stay" String=".*" />
|
||||||
|
</context>
|
||||||
|
|
||||||
<context attribute="Normal Text" lineEndContext="#stay" name="User Function Args">
|
<context attribute="Normal Text" lineEndContext="#stay" name="User Function Args">
|
||||||
<Detect2Chars attribute="Normal Text" context="#stay" char="\" char1="(" />
|
<Detect2Chars attribute="Normal Text" context="#stay" char="\" char1="(" />
|
||||||
<Detect2Chars attribute="Normal Text" context="#stay" char="\" char1=")" />
|
<Detect2Chars attribute="Normal Text" context="#stay" char="\" char1=")" />
|
||||||
@@ -261,12 +345,12 @@
|
|||||||
<WordDetect attribute="False Special Arg" context="#stay" String="N" insensitive="true" />
|
<WordDetect attribute="False Special Arg" context="#stay" String="N" insensitive="true" />
|
||||||
<WordDetect attribute="False Special Arg" context="#stay" String="IGNORE" insensitive="true" />
|
<WordDetect attribute="False Special Arg" context="#stay" String="IGNORE" insensitive="true" />
|
||||||
<WordDetect attribute="False Special Arg" context="#stay" String="0" />
|
<WordDetect attribute="False Special Arg" context="#stay" String="0" />
|
||||||
<RegExpr attribute="False Special Arg" context="#stay" String="\b(?:&id_re;-)?NOTFOUND\b" />
|
<RegExpr attribute="False Special Arg" context="#stay" String="\b(?:&var_ref_re;-)?NOTFOUND\b" />
|
||||||
<RegExpr attribute="Special Args" context="#stay" String="\bCMP[0-9][0-9][0-9]\b" />
|
<RegExpr attribute="Special Args" context="#stay" String="\bCMP[0-9][0-9][0-9][0-9]\b" />
|
||||||
</context>
|
</context>
|
||||||
|
|
||||||
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Aliased Targets">
|
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Aliased Targets">
|
||||||
<RegExpr attribute="Aliased Targets" context="#stay" String="\b&id_re;::&id_re;(?:\:\:&id_re;)*\b" />
|
<RegExpr attribute="Aliased Targets" context="#stay" String="&tgt_name_re;::&tgt_name_re;(?:\:\:&tgt_name_re;)*" />
|
||||||
</context>
|
</context>
|
||||||
|
|
||||||
<context attribute="Comment" lineEndContext="#pop" name="Match Comments">
|
<context attribute="Comment" lineEndContext="#pop" name="Match Comments">
|
||||||
@@ -330,9 +414,12 @@
|
|||||||
|
|
||||||
<itemDatas>
|
<itemDatas>
|
||||||
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false" />
|
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false" />
|
||||||
|
<itemData name="Comment" defStyleNum="dsComment" spellChecking="true" />
|
||||||
<itemData name="Command" defStyleNum="dsKeyword" spellChecking="false" />
|
<itemData name="Command" defStyleNum="dsKeyword" spellChecking="false" />
|
||||||
|
<itemData name="CMake Provided Function/Macro" defStyleNum="dsFunction" bold="true" spellChecking="false" />
|
||||||
<itemData name="User Function/Macro" defStyleNum="dsFunction" spellChecking="false" />
|
<itemData name="User Function/Macro" defStyleNum="dsFunction" spellChecking="false" />
|
||||||
<itemData name="Property" defStyleNum="dsOthers" spellChecking="false" />
|
<itemData name="Property" defStyleNum="dsOthers" spellChecking="false" />
|
||||||
|
<itemData name="Targets" defStyleNum="dsBaseN" spellChecking="false" />
|
||||||
<itemData name="Aliased Targets" defStyleNum="dsBaseN" spellChecking="false" />
|
<itemData name="Aliased Targets" defStyleNum="dsBaseN" spellChecking="false" />
|
||||||
<itemData name="Named Args" defStyleNum="dsOthers" spellChecking="false" />
|
<itemData name="Named Args" defStyleNum="dsOthers" spellChecking="false" />
|
||||||
<itemData name="Special Args" defStyleNum="dsOthers" spellChecking="false" />
|
<itemData name="Special Args" defStyleNum="dsOthers" spellChecking="false" />
|
||||||
@@ -351,8 +438,10 @@
|
|||||||
<itemData name="Standard Environment Variable" defStyleNum="dsFloat" spellChecking="false" />
|
<itemData name="Standard Environment Variable" defStyleNum="dsFloat" spellChecking="false" />
|
||||||
<itemData name="Generator Expression Keyword" defStyleNum="dsKeyword" color="#b84040" selColor="#b84040" spellChecking="false" />
|
<itemData name="Generator Expression Keyword" defStyleNum="dsKeyword" color="#b84040" selColor="#b84040" spellChecking="false" />
|
||||||
<itemData name="Generator Expression" defStyleNum="dsOthers" color="#b86050" selColor="#b86050" spellChecking="false" />
|
<itemData name="Generator Expression" defStyleNum="dsOthers" color="#b86050" selColor="#b86050" spellChecking="false" />
|
||||||
<itemData name="Comment" defStyleNum="dsComment" spellChecking="true" />
|
<itemData name="Standard Module" defStyleNum="dsImport" spellChecking="false" />
|
||||||
|
<itemData name="Deprecated Module" defStyleNum="dsImport" spellChecking="false" />
|
||||||
<itemData name="Region Marker" defStyleNum="dsRegionMarker" spellChecking="false" />
|
<itemData name="Region Marker" defStyleNum="dsRegionMarker" spellChecking="false" />
|
||||||
|
<itemData name="Error" defStyleNum="dsError" spellChecking="false" />
|
||||||
</itemDatas>
|
</itemDatas>
|
||||||
|
|
||||||
</highlighting>
|
</highlighting>
|
||||||
|