diff --git a/dist/installer/mac/qmldesigner_qt.conf b/dist/installer/mac/qmldesigner_qt.conf
deleted file mode 100644
index 8d80be2292f..00000000000
--- a/dist/installer/mac/qmldesigner_qt.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-[Paths]
-Prefix = ../../..
-Imports = Imports/qtquick1
-Qml2Imports = Imports/qtquick2
-Plugins = PlugIns
diff --git a/doc/qtdesignstudio/images/extended-state.webp b/doc/qtdesignstudio/images/extended-state.webp
index 58eae1febfc..1feb878d76a 100644
Binary files a/doc/qtdesignstudio/images/extended-state.webp and b/doc/qtdesignstudio/images/extended-state.webp differ
diff --git a/doc/qtdesignstudio/images/no-extended-state.webp b/doc/qtdesignstudio/images/no-extended-state.webp
index 41fe322f0db..db0281aefff 100644
Binary files a/doc/qtdesignstudio/images/no-extended-state.webp and b/doc/qtdesignstudio/images/no-extended-state.webp differ
diff --git a/doc/qtdesignstudio/images/qmldesigner-screen-design.png b/doc/qtdesignstudio/images/qmldesigner-screen-design.png
index 08192e0b4fa..586a905fe17 100644
Binary files a/doc/qtdesignstudio/images/qmldesigner-screen-design.png and b/doc/qtdesignstudio/images/qmldesigner-screen-design.png differ
diff --git a/doc/qtdesignstudio/images/qmldesigner-states.png b/doc/qtdesignstudio/images/qmldesigner-states.png
index 552c644e647..f2dc8039bd4 100644
Binary files a/doc/qtdesignstudio/images/qmldesigner-states.png and b/doc/qtdesignstudio/images/qmldesigner-states.png differ
diff --git a/doc/qtdesignstudio/images/qmldesigner-transitions.png b/doc/qtdesignstudio/images/qmldesigner-transitions.png
index 4142cacee63..012863d6145 100644
Binary files a/doc/qtdesignstudio/images/qmldesigner-transitions.png and b/doc/qtdesignstudio/images/qmldesigner-transitions.png differ
diff --git a/doc/qtdesignstudio/src/qtbridge/qtbridge-ai.qdoc b/doc/qtdesignstudio/src/qtbridge/qtbridge-ai.qdoc
index 685eeadc57d..e94d8700bc6 100644
--- a/doc/qtdesignstudio/src/qtbridge/qtbridge-ai.qdoc
+++ b/doc/qtdesignstudio/src/qtbridge/qtbridge-ai.qdoc
@@ -9,7 +9,7 @@
\title Exporting Designs from Adobe Illustrator
Even though \QDS does not provide a specific export bridge for Adobe
- Illustrator, you can desing UIs in it and export your designs to \QDS in
+ Illustrator, you can design UIs in it and export your designs to \QDS in
the following ways:
\list
diff --git a/doc/qtdesignstudio/src/qtbridge/qtbridge-sketch-using.qdoc b/doc/qtdesignstudio/src/qtbridge/qtbridge-sketch-using.qdoc
index 88729477842..50bfff87060 100644
--- a/doc/qtdesignstudio/src/qtbridge/qtbridge-sketch-using.qdoc
+++ b/doc/qtdesignstudio/src/qtbridge/qtbridge-sketch-using.qdoc
@@ -231,7 +231,7 @@
you specified. This might take a little while depending on the complexity of
your project.
- You can now create a project in \QDS and import the .atbrige archive to it, as
+ You can now create a project in \QDS and import the .qtbridge archive to it, as
described in \l {Creating Projects} and \l{Importing Designs}.
\section1 Specifying Export Path and Asset Format
diff --git a/doc/qtdesignstudio/src/qtdesignstudio-platforms.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-platforms.qdoc
index 6133642c531..5a50eb2bf40 100644
--- a/doc/qtdesignstudio/src/qtdesignstudio-platforms.qdoc
+++ b/doc/qtdesignstudio/src/qtdesignstudio-platforms.qdoc
@@ -36,8 +36,9 @@
\QB is available for the following design tools:
\list
- \li Adobe Photoshop version 22.3.1
- \li Figma version 97.x
- \li Sketch version 72.2
+ \li Adobe Photoshop version 24.0
+ \li Adobe XD version 55.0.12
+ \li Figma version 116.4
+ \li Sketch version 90.0
\endlist
*/
diff --git a/doc/qtdesignstudio/src/views/qtquick-states.qdoc b/doc/qtdesignstudio/src/views/qtquick-states.qdoc
index aee10e2c5ba..6b55e5e59f0 100644
--- a/doc/qtdesignstudio/src/views/qtquick-states.qdoc
+++ b/doc/qtdesignstudio/src/views/qtquick-states.qdoc
@@ -180,7 +180,7 @@
Each state group has its own property changes and transitions.
- By default, there is one root state group.
+ By default, there is one default state group.
\section1 Extending States
diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh
index a4afd7f20a5..cc09b80ad67 100755
--- a/scripts/deployqtHelper_mac.sh
+++ b/scripts/deployqtHelper_mac.sh
@@ -74,12 +74,6 @@ if [ ! -f "$libexec_path/ios/qt.conf" ]; then
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/ios_qt.conf" "$libexec_path/ios/qt.conf" || exit 1
fi
-# copy qml2puppet's qt.conf
-if [ ! -f "$libexec_path/qmldesigner/qt.conf" ]; then
- echo "- Copying libexec/qmldesigner/qt.conf"
- cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/qmldesigner_qt.conf" "$libexec_path/qmldesigner/qt.conf" || exit 1
-fi
-
# copy Qt translations
# check for known existing translation to avoid copying multiple times
if [ ! -f "$resource_path/translations/qt_de.qm" ]; then
@@ -114,10 +108,7 @@ fi
if [ ! -d "$app_path/Contents/Frameworks/QtCore.framework" ]; then
- qml2puppetapp="$libexec_path/qmldesigner/qml2puppet"
- if [ -f "$qml2puppetapp" ]; then
- qml2puppetArgument="-executable=$qml2puppetapp"
- fi
+ echo "- Running macdeployqt ($bin_src/macdeployqt)"
qbsapp="$app_path/Contents/MacOS/qbs"
if [ -f "$qbsapp" ]; then
@@ -131,7 +122,10 @@ if [ ! -d "$app_path/Contents/Frameworks/QtCore.framework" ]; then
"-executable=$libexec_path/qbs_processlauncher")
fi
- echo "- Running macdeployqt ($bin_src/macdeployqt)"
+ qml2puppetapp="$libexec_path/qml2puppet"
+ if [ -f "$qml2puppetapp" ]; then
+ qml2puppetArgument="-executable=$qml2puppetapp"
+ fi
"$bin_src/macdeployqt" "$app_path" \
"-executable=$app_path/Contents/MacOS/qtdiag" \
diff --git a/share/qtcreator/CMakeLists.txt b/share/qtcreator/CMakeLists.txt
index 25d976ea9cf..5bd0f05bf22 100644
--- a/share/qtcreator/CMakeLists.txt
+++ b/share/qtcreator/CMakeLists.txt
@@ -4,7 +4,6 @@ set(resource_directories
glsl
indexer_preincludes
modeleditor
- qml
qmldesigner
qmlicons
qml-type-descriptions
diff --git a/share/qtcreator/qml/qmlpuppet/commands/commands.pri b/share/qtcreator/qml/qmlpuppet/commands/commands.pri
deleted file mode 100644
index 0fb8e0132c7..00000000000
--- a/share/qtcreator/qml/qmlpuppet/commands/commands.pri
+++ /dev/null
@@ -1,75 +0,0 @@
-INCLUDEPATH += $$PWD $$PWD/../interfaces
-
-HEADERS += $$PWD/synchronizecommand.h \ \
- $$PWD/captureddatacommand.h \
- $$PWD/changepreviewimagesizecommand.h \
- $$PWD/changelanguagecommand.h \
- $$PWD//debugoutputcommand.h \
- $$PWD/endpuppetcommand.h \
- $$PWD/scenecreatedcommand.h \
- $$PWD/tokencommand.h \
- $$PWD/componentcompletedcommand.h \
- $$PWD/completecomponentcommand.h \
- $$PWD/statepreviewimagechangedcommand.h \
- $$PWD/childrenchangedcommand.h \
- $$PWD/changebindingscommand.h \
- $$PWD/changefileurlcommand.h \
- $$PWD/changeidscommand.h \
- $$PWD/changenodesourcecommand.h \
- $$PWD/changestatecommand.h \
- $$PWD/changevaluescommand.h \
- $$PWD/createscenecommand.h \
- $$PWD/clearscenecommand.h \
- $$PWD/createinstancescommand.h \
- $$PWD/informationchangedcommand.h \
- $$PWD/nanotracecommand.h \
- $$PWD/pixmapchangedcommand.h \
- $$PWD/removeinstancescommand.h \
- $$PWD/removepropertiescommand.h \
- $$PWD/reparentinstancescommand.h \
- $$PWD/valueschangedcommand.h \
- $$PWD/changeauxiliarycommand.h \
- $$PWD/removesharedmemorycommand.h \
- $$PWD/puppetalivecommand.h \
- $$PWD/changeselectioncommand.h \
- $$PWD/update3dviewstatecommand.h \
- $$PWD/puppettocreatorcommand.h \
- $$PWD/inputeventcommand.h \
- $$PWD/view3dactioncommand.h \
- $$PWD/requestmodelnodepreviewimagecommand.h
-
-SOURCES += \
- $$PWD/changepreviewimagesizecommand.cpp \
- $$PWD/changelanguagecommand.cpp \
- $$PWD/debugoutputcommand.cpp \
- $$PWD/endpuppetcommand.cpp \
- $$PWD/tokencommand.cpp \
- $$PWD/componentcompletedcommand.cpp \
- $$PWD/completecomponentcommand.cpp \
- $$PWD/statepreviewimagechangedcommand.cpp \
- $$PWD/childrenchangedcommand.cpp \
- $$PWD/changebindingscommand.cpp \
- $$PWD/changefileurlcommand.cpp \
- $$PWD/changeidscommand.cpp \
- $$PWD/changenodesourcecommand.cpp \
- $$PWD/changestatecommand.cpp \
- $$PWD/changevaluescommand.cpp \
- $$PWD/informationchangedcommand.cpp \
- $$PWD/nanotracecommand.cpp \
- $$PWD/removeinstancescommand.cpp \
- $$PWD/removepropertiescommand.cpp \
- $$PWD/reparentinstancescommand.cpp \
- $$PWD/valueschangedcommand.cpp \
- $$PWD/clearscenecommand.cpp \
- $$PWD/createinstancescommand.cpp \
- $$PWD/createscenecommand.cpp \
- $$PWD/pixmapchangedcommand.cpp \
- $$PWD/changeauxiliarycommand.cpp \
- $$PWD/removesharedmemorycommand.cpp \
- $$PWD/puppetalivecommand.cpp \
- $$PWD/changeselectioncommand.cpp \
- $$PWD/update3dviewstatecommand.cpp \
- $$PWD/puppettocreatorcommand.cpp \
- $$PWD/inputeventcommand.cpp \
- $$PWD/view3dactioncommand.cpp \
- $$PWD/requestmodelnodepreviewimagecommand.cpp
diff --git a/share/qtcreator/qml/qmlpuppet/container/container.pri b/share/qtcreator/qml/qmlpuppet/container/container.pri
deleted file mode 100644
index 381e5cf117d..00000000000
--- a/share/qtcreator/qml/qmlpuppet/container/container.pri
+++ /dev/null
@@ -1,26 +0,0 @@
-INCLUDEPATH += $$PWD/
-
-HEADERS += $$PWD/addimportcontainer.h
-HEADERS += $$PWD/mockuptypecontainer.h
-HEADERS += $$PWD/sharedmemory.h
-HEADERS += $$PWD/imagecontainer.h
-HEADERS += $$PWD/idcontainer.h
-HEADERS += $$PWD/informationcontainer.h
-HEADERS += $$PWD/instancecontainer.h
-HEADERS += $$PWD/reparentcontainer.h
-HEADERS += $$PWD/propertyabstractcontainer.h
-HEADERS += $$PWD/propertybindingcontainer.h
-HEADERS += $$PWD/propertyvaluecontainer.h
-
-SOURCES += $$PWD/addimportcontainer.cpp
-SOURCES += $$PWD/mockuptypecontainer.cpp
-unix:SOURCES += $$PWD/sharedmemory_unix.cpp
-!unix:SOURCES += $$PWD/sharedmemory_qt.cpp
-SOURCES += $$PWD/imagecontainer.cpp
-SOURCES += $$PWD/idcontainer.cpp
-SOURCES += $$PWD/informationcontainer.cpp
-SOURCES += $$PWD/instancecontainer.cpp
-SOURCES += $$PWD/reparentcontainer.cpp
-SOURCES += $$PWD/propertyabstractcontainer.cpp
-SOURCES += $$PWD/propertybindingcontainer.cpp
-SOURCES += $$PWD/propertyvaluecontainer.cpp
diff --git a/share/qtcreator/qml/qmlpuppet/interfaces/interfaces.pri b/share/qtcreator/qml/qmlpuppet/interfaces/interfaces.pri
deleted file mode 100644
index aeaf3a765e2..00000000000
--- a/share/qtcreator/qml/qmlpuppet/interfaces/interfaces.pri
+++ /dev/null
@@ -1,8 +0,0 @@
-INCLUDEPATH += $$PWD/
-
-HEADERS += $$PWD/nodeinstanceclientinterface.h
-HEADERS += $$PWD/nodeinstanceglobal.h
-HEADERS += $$PWD/nodeinstanceserverinterface.h
-HEADERS += $$PWD/commondefines.h
-
-SOURCES += $$PWD/nodeinstanceserverinterface.cpp
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri b/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri
deleted file mode 100644
index 0b364d32b3e..00000000000
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri
+++ /dev/null
@@ -1,46 +0,0 @@
-QT += core gui widgets qml quick network
-QT += core-private qml-private quick-private gui-private
-
-CONFIG += c++17
-win32:!mingw: QMAKE_CXXFLAGS += /std:c++17
-
-DEFINES -= QT_CREATOR
-
-# This .pri file contains classes to enable a special multilanguage translator
-MULTILANGUAGE_SUPPORT_PRI=$$(MULTILANGUAGE_SUPPORT_PRI)
-!isEmpty(MULTILANGUAGE_SUPPORT_PRI) {
- exists($$(MULTILANGUAGE_SUPPORT_PRI)): message(including \"$$(MULTILANGUAGE_SUPPORT_PRI)\")
- else: error("MULTILANGUAGE_SUPPORT_PRI: \"$$(MULTILANGUAGE_SUPPORT_PRI)\" does not exist.")
- include($$(MULTILANGUAGE_SUPPORT_PRI))
- DEFINES += MULTILANGUAGE_TRANSLATIONPROVIDER
-}
-
-include (editor3d/editor3d.pri)
-include (../instances/instances.pri)
-include (instances/instances.pri)
-include (../commands/commands.pri)
-include (../container/container.pri)
-include (../interfaces/interfaces.pri)
-include (../types/types.pri)
-include (../qmlprivategate/qmlprivategate.pri)
-include (iconrenderer/iconrenderer.pri)
-include (import3d/import3d.pri)
-
-SOURCES += $$PWD/qml2puppetmain.cpp
-RESOURCES += $$PWD/../qmlpuppet.qrc
-
-versionAtLeast(QT_VERSION, 6.0.0): RESOURCES += $$PWD/../editor3d_qt6.qrc
-else: RESOURCES += $$PWD/../editor3d_qt5.qrc
-
-DISTFILES += Info.plist
-
-unix:!openbsd:!osx: LIBS += -lrt # posix shared memory
-
-osx {
- CONFIG -= app_bundle
- QMAKE_LFLAGS += -Wl,-sectcreate,__TEXT,__info_plist,$$system_quote($$PWD/Info.plist)
-}
-
-osx: target.path = $$INSTALL_LIBEXEC_PATH/qmldesigner
-else: target.path = $$INSTALL_LIBEXEC_PATH
-INSTALLS += target
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pro b/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pro
deleted file mode 100644
index 1457e8d10e8..00000000000
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TARGET = qml2puppet
-
-TEMPLATE = app
-CONFIG += console
-
-build_all:!build_pass {
- CONFIG -= build_all
- CONFIG += release
-}
-
-include(qml2puppet.pri)
diff --git a/share/qtcreator/qml/qmlpuppet/qmlpuppet_utilities.pri b/share/qtcreator/qml/qmlpuppet/qmlpuppet_utilities.pri
deleted file mode 100644
index 341550502a3..00000000000
--- a/share/qtcreator/qml/qmlpuppet/qmlpuppet_utilities.pri
+++ /dev/null
@@ -1,31 +0,0 @@
-# Try to find location of Qt private headers (see README)
-isEmpty(QT_PRIVATE_HEADERS) {
- QT_PRIVATE_HEADERS = $$[QT_INSTALL_HEADERS]
-} else {
- INCLUDEPATH += \
- $${QT_PRIVATE_HEADERS} \
- $${QT_PRIVATE_HEADERS}/QtCore \
- $${QT_PRIVATE_HEADERS}/QtGui \
- $${QT_PRIVATE_HEADERS}/QtScript \
- $${QT_PRIVATE_HEADERS}/QtDeclarative
-}
-
-defineTest(minQtVersion) {
- maj = $$1
- min = $$2
- patch = $$3
- isEqual(QT_MAJOR_VERSION, $$maj) {
- isEqual(QT_MINOR_VERSION, $$min) {
- isEqual(QT_PATCH_VERSION, $$patch) {
- return(true)
- }
- greaterThan(QT_PATCH_VERSION, $$patch) {
- return(true)
- }
- }
- greaterThan(QT_MINOR_VERSION, $$min) {
- return(true)
- }
- }
- return(false)
-}
diff --git a/share/qtcreator/qml/qmlpuppet/types/types.pri b/share/qtcreator/qml/qmlpuppet/types/types.pri
deleted file mode 100644
index e5f10bcbe46..00000000000
--- a/share/qtcreator/qml/qmlpuppet/types/types.pri
+++ /dev/null
@@ -1,3 +0,0 @@
-INCLUDEPATH += $$PWD/
-
-HEADERS += $$PWD/enumeration.h
diff --git a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibrary.qml b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibrary.qml
new file mode 100644
index 00000000000..bbe9641419e
--- /dev/null
+++ b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibrary.qml
@@ -0,0 +1,121 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuickDesignerTheme
+import HelperWidgets as HelperWidgets
+import StudioControls as StudioControls
+import StudioTheme as StudioTheme
+
+Item {
+ id: root
+
+ // Called also from C++ to close context menu on focus out
+ function closeContextMenu()
+ {
+ materialsView.closeContextMenu()
+ texturesView.closeContextMenu()
+ environmentsView.closeContextMenu()
+ }
+
+ // Called from C++
+ function clearSearchFilter()
+ {
+ searchBox.clear();
+ }
+
+ Column {
+ id: col
+ y: 5
+ spacing: 5
+
+ StudioControls.SearchBox {
+ id: searchBox
+
+ width: root.width
+ enabled: !materialsModel.hasMaterialRoot && materialsModel.hasQuick3DImport
+
+ onSearchChanged: (searchText) => {
+ rootView.handleSearchFilterChanged(searchText)
+
+ // make sure categories with matches are expanded
+ materialsView.expandVisibleSections()
+ }
+ }
+
+ Text {
+ // TODO: only disable the materials section, textures should be available
+ text: {
+ if (materialsModel.hasMaterialRoot)
+ qsTr("Content Library is disabled inside a material component.")
+ else if (!materialsModel.hasQuick3DImport)
+ qsTr("To use Content Library, first add the QtQuick3D module in the Components view.")
+ else
+ ""
+ }
+
+ textFormat: Text.RichText
+ color: StudioTheme.Values.themeTextColor
+ font.pixelSize: StudioTheme.Values.mediumFontSize
+ topPadding: 30
+ horizontalAlignment: Text.AlignHCenter
+ wrapMode: Text.WordWrap
+ width: root.width
+ visible: text !== ""
+ }
+
+ UnimportBundleMaterialDialog {
+ id: confirmUnimportDialog
+ }
+
+ ContentLibraryTabBar {
+ id: tabBar
+
+ visible: materialsModel.hasQuick3DImport
+ // TODO: update icons
+ tabsModel: [{name: qsTr("Materials"), icon: StudioTheme.Constants.gradient},
+ {name: qsTr("Textures"), icon: StudioTheme.Constants.materialPreviewEnvironment},
+ {name: qsTr("Environments"), icon: StudioTheme.Constants.translationSelectLanguages}]
+ }
+
+ StackLayout {
+ width: root.width
+ height: root.height - y
+ currentIndex: tabBar.currIndex
+ visible: materialsModel.hasQuick3DImport
+
+ ContentLibraryMaterialsView {
+ id: materialsView
+
+ width: root.width
+
+ searchBox: searchBox
+
+ onUnimport: (bundleMat) => {
+ unimportBundleMaterialDialog.targetBundleMaterial = bundleMat
+ unimportBundleMaterialDialog.open()
+ }
+ }
+
+ ContentLibraryTexturesView {
+ id: texturesView
+
+ width: root.width
+ model: texturesModel
+
+ searchBox: searchBox
+ }
+
+ ContentLibraryTexturesView {
+ id: environmentsView
+
+ width: root.width
+ model: environmentsModel
+
+ searchBox: searchBox
+ }
+ }
+ }
+}
diff --git a/share/qtcreator/qmldesigner/materialBrowserQmlSource/BundleMaterialItem.qml b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryMaterial.qml
similarity index 66%
rename from share/qtcreator/qmldesigner/materialBrowserQmlSource/BundleMaterialItem.qml
rename to share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryMaterial.qml
index 59541f47d39..4d6377359ce 100644
--- a/share/qtcreator/qmldesigner/materialBrowserQmlSource/BundleMaterialItem.qml
+++ b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryMaterial.qml
@@ -1,27 +1,5 @@
-/****************************************************************************
-**
-** 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.
-**
-****************************************************************************/
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
import QtQuick 2.15
import QtQuick.Layouts 1.15
@@ -45,8 +23,8 @@ Item {
acceptedButtons: Qt.LeftButton | Qt.RightButton
onPressed: (mouse) => {
- if (mouse.button === Qt.LeftButton && !materialBrowserBundleModel.importerRunning)
- rootView.startDragBundleMaterial(modelData, mapToGlobal(mouse.x, mouse.y))
+ if (mouse.button === Qt.LeftButton && !materialsModel.importerRunning)
+ rootView.startDragMaterial(modelData, mapToGlobal(mouse.x, mouse.y))
else if (mouse.button === Qt.RightButton)
root.showContextMenu()
}
@@ -102,10 +80,10 @@ Item {
pressColor: Qt.hsla(c.hslHue, c.hslSaturation, c.hslLightness, .4)
anchors.right: img.right
anchors.bottom: img.bottom
- enabled: !materialBrowserBundleModel.importerRunning
+ enabled: !materialsModel.importerRunning
onClicked: {
- materialBrowserBundleModel.addToProject(modelData)
+ materialsModel.addToProject(modelData)
}
}
}
diff --git a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryMaterialContextMenu.qml b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryMaterialContextMenu.qml
new file mode 100644
index 00000000000..a85699e6dc3
--- /dev/null
+++ b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryMaterialContextMenu.qml
@@ -0,0 +1,52 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
+
+import QtQuick 2.15
+import HelperWidgets 2.0
+import StudioControls 1.0 as StudioControls
+import StudioTheme 1.0 as StudioTheme
+
+StudioControls.Menu {
+ id: root
+
+ property var targetMaterial: null
+ signal unimport(var bundleMat);
+
+ function popupMenu(targetMaterial = null)
+ {
+ this.targetMaterial = targetMaterial
+ popup()
+ }
+
+ closePolicy: StudioControls.Menu.CloseOnEscape | StudioControls.Menu.CloseOnPressOutside
+
+ StudioControls.MenuItem {
+ text: qsTr("Apply to selected (replace)")
+ enabled: root.targetMaterial && materialsModel.hasModelSelection
+ onTriggered: materialsModel.applyToSelected(root.targetMaterial, false)
+ }
+
+ StudioControls.MenuItem {
+ text: qsTr("Apply to selected (add)")
+ enabled: root.targetMaterial && materialsModel.hasModelSelection
+ onTriggered: materialsModel.applyToSelected(root.targetMaterial, true)
+ }
+
+ StudioControls.MenuSeparator {}
+
+ StudioControls.MenuItem {
+ enabled: !materialsModel.importerRunning
+ text: qsTr("Add an instance to project")
+
+ onTriggered: {
+ materialsModel.addToProject(root.targetMaterial)
+ }
+ }
+
+ StudioControls.MenuItem {
+ enabled: !materialsModel.importerRunning && root.targetMaterial && root.targetMaterial.bundleMaterialImported
+ text: qsTr("Remove from project")
+
+ onTriggered: root.unimport(root.targetMaterial);
+ }
+}
diff --git a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryMaterialsView.qml b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryMaterialsView.qml
new file mode 100644
index 00000000000..589e0250b5e
--- /dev/null
+++ b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryMaterialsView.qml
@@ -0,0 +1,91 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import HelperWidgets as HelperWidgets
+import StudioControls as StudioControls
+import StudioTheme as StudioTheme
+
+HelperWidgets.ScrollView {
+ id: root
+
+ clip: true
+
+ readonly property int cellWidth: 100
+ readonly property int cellHeight: 120
+
+ property var currMaterialItem: null
+ property var rootItem: null
+
+ required property var searchBox
+
+ signal unimport(var bundleMat);
+
+ function closeContextMenu()
+ {
+ ctxMenu.close()
+ }
+
+ function expandVisibleSections()
+ {
+ for (let i = 0; i < categoryRepeater.count; ++i) {
+ let cat = categoryRepeater.itemAt(i)
+ if (cat.visible && !cat.expanded)
+ cat.expanded = true
+ }
+ }
+
+ Column {
+ ContentLibraryMaterialContextMenu {
+ id: ctxMenu
+
+ onUnimport: (bundleMat) => root.unimport(bundleMat)
+ }
+
+ Repeater {
+ id: categoryRepeater
+
+ model: materialsModel
+
+ delegate: HelperWidgets.Section {
+ width: root.width
+ caption: bundleCategoryName
+ addTopPadding: false
+ sectionBackgroundColor: "transparent"
+ visible: bundleCategoryVisible
+ expanded: bundleCategoryExpanded
+ expandOnClick: false
+ onToggleExpand: bundleCategoryExpanded = !bundleCategoryExpanded
+
+ Grid {
+ width: root.width
+ leftPadding: 5
+ rightPadding: 5
+ bottomPadding: 5
+ columns: root.width / root.cellWidth
+
+ Repeater {
+ model: bundleCategoryMaterials
+
+ delegate: ContentLibraryMaterial {
+ width: root.cellWidth
+ height: root.cellHeight
+
+ onShowContextMenu: ctxMenu.popupMenu(modelData)
+ }
+ }
+ }
+ }
+ }
+
+ Text {
+ id: noMatchText
+ text: qsTr("No match found.");
+ color: StudioTheme.Values.themeTextColor
+ font.pixelSize: StudioTheme.Values.baseFontSize
+ topPadding: 10
+ leftPadding: 10
+ visible: materialsModel.isEmpty && !searchBox.isEmpty() && !materialsModel.hasMaterialRoot
+ }
+ }
+}
diff --git a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTabBar.qml b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTabBar.qml
new file mode 100644
index 00000000000..024271d1a23
--- /dev/null
+++ b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTabBar.qml
@@ -0,0 +1,33 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import StudioTheme as StudioTheme
+
+Rectangle {
+ id: root
+
+ width: parent.width
+ height: 50
+ color: StudioTheme.Values.themeSectionHeadBackground
+
+ property int currIndex: 0
+ property alias tabsModel: repeater.model
+
+ Row {
+ spacing: 1
+
+ Repeater {
+ id: repeater
+
+ ContentLibraryTabButton {
+ height: root.height
+
+ name: modelData.name
+ icon: modelData.icon
+ selected: root.currIndex === index
+ onClicked: root.currIndex = index
+ }
+ }
+ }
+}
diff --git a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTabButton.qml b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTabButton.qml
new file mode 100644
index 00000000000..cd31f2579d2
--- /dev/null
+++ b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTabButton.qml
@@ -0,0 +1,58 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import StudioTheme as StudioTheme
+
+Rectangle {
+ id: root
+
+ signal clicked()
+
+ property alias icon: icon.text
+ property alias name: name.text
+ property bool selected: false
+
+ width: 100
+ height: 100
+ color: root.selected ? StudioTheme.Values.themePanelBackground
+ : mouseArea.containsMouse ? Qt.lighter(StudioTheme.Values.themeSectionHeadBackground, 1.3)
+ : StudioTheme.Values.themeSectionHeadBackground
+
+ Text {
+ id: icon
+
+ color: root.selected ? StudioTheme.Values.themeInteraction : StudioTheme.Values.themeTextColor
+
+ font.family: StudioTheme.Constants.iconFont.family
+ font.pixelSize: StudioTheme.Values.mediumIconFontSize
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: 8
+ }
+
+ Text {
+ id: name
+
+ font.weight: Font.DemiBold
+ font.pixelSize: StudioTheme.Values.baseFontSize
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 6
+
+ color: root.selected ? StudioTheme.Values.themeInteraction : StudioTheme.Values.themeTextColor
+ }
+
+ Rectangle { // strip
+ width: root.width
+ height: 4
+ color: root.selected ? StudioTheme.Values.themeInteraction : "transparent"
+ anchors.bottom: parent.bottom
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked: root.clicked()
+ }
+}
diff --git a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTexture.qml b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTexture.qml
new file mode 100644
index 00000000000..d6c24d4b2af
--- /dev/null
+++ b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTexture.qml
@@ -0,0 +1,34 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
+
+import QtQuick 2.15
+import QtQuick.Layouts 1.15
+import QtQuickDesignerTheme 1.0
+import HelperWidgets 2.0
+import QtQuick.Controls
+
+import StudioTheme 1.0 as StudioTheme
+
+Image {
+ id: root
+
+ source: modelData.textureIcon
+ visible: modelData.textureVisible
+ cache: false
+
+ signal showContextMenu()
+
+ MouseArea {
+ id: mouseArea
+
+ anchors.fill: parent
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+
+ onPressed: (mouse) => {
+ if (mouse.button === Qt.LeftButton)
+ rootView.startDragTexture(modelData, mapToGlobal(mouse.x, mouse.y))
+ else if (mouse.button === Qt.RightButton)
+ root.showContextMenu()
+ }
+ }
+}
diff --git a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTextureContextMenu.qml b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTextureContextMenu.qml
new file mode 100644
index 00000000000..61bd0ebfd7e
--- /dev/null
+++ b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTextureContextMenu.qml
@@ -0,0 +1,40 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
+
+import QtQuick 2.15
+import HelperWidgets 2.0
+import StudioControls 1.0 as StudioControls
+import StudioTheme 1.0 as StudioTheme
+
+StudioControls.Menu {
+ id: root
+
+ property var targetTexture: null
+ property bool hasSceneEnv: false
+
+ function popupMenu(targetTexture = null)
+ {
+ this.targetTexture = targetTexture
+ popup()
+ }
+
+ closePolicy: StudioControls.Menu.CloseOnEscape | StudioControls.Menu.CloseOnPressOutside
+
+ StudioControls.MenuItem {
+ text: qsTr("Add image")
+ enabled: root.targetTexture
+ onTriggered: rootView.addImage(root.targetTexture)
+ }
+
+ StudioControls.MenuItem {
+ text: qsTr("Add texture")
+ enabled: root.targetTexture
+ onTriggered: rootView.addTexture(root.targetTexture)
+ }
+
+ StudioControls.MenuItem {
+ text: qsTr("Add light probe")
+ enabled: root.hasSceneEnv && root.targetTexture
+ onTriggered: rootView.addLightProbe(root.targetTexture)
+ }
+}
diff --git a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTexturesView.qml b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTexturesView.qml
new file mode 100644
index 00000000000..4e2854a48bf
--- /dev/null
+++ b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTexturesView.qml
@@ -0,0 +1,92 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import HelperWidgets as HelperWidgets
+import StudioControls as StudioControls
+import StudioTheme as StudioTheme
+
+HelperWidgets.ScrollView {
+ id: root
+
+ clip: true
+
+ readonly property int cellWidth: 100
+ readonly property int cellHeight: 100
+
+ property var currMaterialItem: null
+ property var rootItem: null
+
+ required property var searchBox
+ required property var model
+
+ signal unimport(var bundleMat);
+
+ function closeContextMenu()
+ {
+ ctxMenu.close()
+ }
+
+ function expandVisibleSections()
+ {
+ for (let i = 0; i < categoryRepeater.count; ++i) {
+ let cat = categoryRepeater.itemAt(i)
+ if (cat.visible && !cat.expanded)
+ cat.expanded = true
+ }
+ }
+ Column {
+ ContentLibraryTextureContextMenu {
+ id: ctxMenu
+
+ hasSceneEnv: root.model.hasSceneEnv
+ }
+
+ Repeater {
+ id: categoryRepeater
+
+ model: root.model
+
+ delegate: HelperWidgets.Section {
+ width: root.width
+ caption: bundleCategoryName
+ addTopPadding: false
+ sectionBackgroundColor: "transparent"
+ visible: bundleCategoryVisible
+ expanded: bundleCategoryExpanded
+ expandOnClick: false
+ onToggleExpand: bundleCategoryExpanded = !bundleCategoryExpanded
+
+ Grid {
+ width: root.width
+ leftPadding: 5
+ rightPadding: 5
+ bottomPadding: 5
+ spacing: 5
+ columns: root.width / root.cellWidth
+
+ Repeater {
+ model: bundleCategoryTextures
+
+ delegate: ContentLibraryTexture {
+ width: root.cellWidth
+ height: root.cellHeight
+
+ onShowContextMenu: ctxMenu.popupMenu(modelData)
+ }
+ }
+ }
+ }
+ }
+
+ Text {
+ id: noMatchText
+ text: qsTr("No match found.");
+ color: StudioTheme.Values.themeTextColor
+ font.pixelSize: StudioTheme.Values.baseFontSize
+ topPadding: 10
+ leftPadding: 10
+ visible: root.model.isEmpty && !searchBox.isEmpty() && !root.model.hasMaterialRoot
+ }
+ }
+}
diff --git a/share/qtcreator/qmldesigner/materialBrowserQmlSource/UnimportBundleMaterialDialog.qml b/share/qtcreator/qmldesigner/contentLibraryQmlSource/UnimportBundleMaterialDialog.qml
similarity index 53%
rename from share/qtcreator/qmldesigner/materialBrowserQmlSource/UnimportBundleMaterialDialog.qml
rename to share/qtcreator/qmldesigner/contentLibraryQmlSource/UnimportBundleMaterialDialog.qml
index 82708467a8a..1c887ca317f 100644
--- a/share/qtcreator/qmldesigner/materialBrowserQmlSource/UnimportBundleMaterialDialog.qml
+++ b/share/qtcreator/qmldesigner/contentLibraryQmlSource/UnimportBundleMaterialDialog.qml
@@ -1,27 +1,5 @@
-/****************************************************************************
-**
-** 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.
-**
-****************************************************************************/
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
import QtQuick
import QtQuick.Controls
@@ -69,7 +47,7 @@ Dialog {
text: qsTr("Remove")
onClicked: {
- materialBrowserBundleModel.removeFromProject(root.targetBundleMaterial)
+ materialsModel.removeFromProject(root.targetBundleMaterial)
root.accept()
}
}
diff --git a/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialBrowser.qml b/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialBrowser.qml
index 2b921374ae6..7849dfd9269 100644
--- a/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialBrowser.qml
+++ b/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialBrowser.qml
@@ -19,13 +19,12 @@ Item {
function closeContextMenu()
{
ctxMenu.close()
- ctxMenuBundle.close()
}
// Called from C++ to refresh a preview material after it changes
function refreshPreview(idx)
{
- var item = gridRepeater.itemAt(idx);
+ var item = materialRepeater.itemAt(idx);
if (item)
item.refreshPreview();
}
@@ -36,6 +35,17 @@ Item {
searchBox.clear();
}
+ MouseArea {
+ id: focusGrabber
+ anchors.fill: parent
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+ onPressed: (mouse) => {
+ forceActiveFocus() // Steal focus from name edit
+ mouse.accepted = false
+ }
+ z: 1
+ }
+
MouseArea {
id: rootMouseArea
@@ -44,12 +54,14 @@ Item {
acceptedButtons: Qt.RightButton
onClicked: (mouse) => {
- // root context-menu works only for user materials
- var userMatsSecBottom = mapFromItem(userMaterialsSection, 0, userMaterialsSection.y).y
- + userMaterialsSection.height;
+ if (materialBrowserModel.hasMaterialRoot || !materialBrowserModel.hasQuick3DImport)
+ return;
+
+ var matsSecBottom = mapFromItem(materialsSection, 0, materialsSection.y).y
+ + materialsSection.height;
if (!materialBrowserModel.hasMaterialRoot && materialBrowserModel.hasQuick3DImport
- && (!materialBrowserBundleModel.matBundleExists || mouse.y < userMatsSecBottom)) {
+ && mouse.y < matsSecBottom) {
ctxMenu.popupMenu()
}
}
@@ -63,7 +75,7 @@ Item {
if (root.currMaterialItem)
root.currMaterialItem.commitRename();
- root.currMaterialItem = gridRepeater.itemAt(materialBrowserModel.selectedIndex);
+ root.currMaterialItem = materialRepeater.itemAt(materialBrowserModel.selectedIndex);
}
}
@@ -71,19 +83,6 @@ Item {
id: ctxMenu
}
- MaterialBundleContextMenu {
- id: ctxMenuBundle
-
- onUnimport: (bundleMat) => {
- unimportBundleMaterialDialog.targetBundleMaterial = bundleMat
- unimportBundleMaterialDialog.open()
- }
- }
-
- UnimportBundleMaterialDialog {
- id: unimportBundleMaterialDialog
- }
-
Column {
id: col
y: 5
@@ -100,19 +99,6 @@ Item {
onSearchChanged: (searchText) => {
rootView.handleSearchFilterChanged(searchText)
-
- // make sure searched categories that have matches are expanded
- if (!materialBrowserModel.isEmpty && !userMaterialsSection.expanded)
- userMaterialsSection.expanded = true
-
- if (!materialBrowserBundleModel.isEmpty && !bundleMaterialsSection.expanded)
- bundleMaterialsSection.expanded = true
-
- for (let i = 0; i < bundleMaterialsSectionRepeater.count; ++i) {
- let sec = bundleMaterialsSectionRepeater.itemAt(i)
- if (sec.visible && !sec.expanded)
- sec.expanded = true
- }
}
}
@@ -156,29 +142,28 @@ Item {
height: root.height - searchBox.height
clip: true
visible: materialBrowserModel.hasQuick3DImport && !materialBrowserModel.hasMaterialRoot
- interactive: !ctxMenu.opened && !ctxMenuBundle.opened
+ interactive: !ctxMenu.opened
Column {
Section {
- id: userMaterialsSection
+ id: materialsSection
width: root.width
caption: qsTr("Materials")
- hideHeader: !materialBrowserBundleModel.matBundleExists
dropEnabled: true
onDropEnter: (drag) => {
- drag.accepted = rootView.draggedBundleMaterial
- userMaterialsSection.highlight = rootView.draggedBundleMaterial
+ drag.accepted = drag.formats[0] === "application/vnd.qtdesignstudio.bundlematerial"
+ materialsSection.highlight = drag.accepted
}
onDropExit: {
- userMaterialsSection.highlight = false
+ materialsSection.highlight = false
}
onDrop: {
- userMaterialsSection.highlight = false
- materialBrowserBundleModel.addToProject(rootView.draggedBundleMaterial)
+ materialsSection.highlight = false
+ rootView.acceptBundleMaterialDrop()
}
Grid {
@@ -191,7 +176,7 @@ Item {
columns: root.width / root.cellWidth
Repeater {
- id: gridRepeater
+ id: materialRepeater
model: materialBrowserModel
delegate: MaterialItem {
@@ -226,62 +211,50 @@ Item {
}
Section {
- id: bundleMaterialsSection
+ id: texturesSection
width: root.width
- caption: qsTr("Material Library")
- addTopPadding: noMatchText.visible
- visible: materialBrowserBundleModel.matBundleExists
+ caption: qsTr("Textures")
+
+ Grid {
+ width: scrollView.width
+ leftPadding: 5
+ rightPadding: 5
+ bottomPadding: 5
+ columns: root.width / root.cellWidth
- Column {
Repeater {
- id: bundleMaterialsSectionRepeater
+ id: texturesRepeater
- model: materialBrowserBundleModel
+ model: materialBrowserTexturesModel
+ delegate: TextureItem {
+ width: root.cellWidth
+ height: root.cellWidth
- delegate: Section {
- width: root.width
- caption: bundleCategoryName
- addTopPadding: false
- sectionBackgroundColor: "transparent"
- visible: bundleCategoryVisible
- expanded: bundleCategoryExpanded
- expandOnClick: false
- onToggleExpand: bundleCategoryExpanded = !bundleCategoryExpanded
- onExpand: bundleCategoryExpanded = true
- onCollapse: bundleCategoryExpanded = false
-
- Grid {
- width: scrollView.width
- leftPadding: 5
- rightPadding: 5
- bottomPadding: 5
- columns: root.width / root.cellWidth
-
- Repeater {
- model: bundleCategoryMaterials
-
- delegate: BundleMaterialItem {
- width: root.cellWidth
- height: root.cellHeight
-
- onShowContextMenu: {
- ctxMenuBundle.popupMenu(modelData)
- }
- }
- }
+ onShowContextMenu: {
+// ctxMenuTexture.popupMenu(this, model) // TODO: implement textures context menu
}
}
}
+ }
- Text {
- id: noMatchText
- text: qsTr("No match found.");
- color: StudioTheme.Values.themeTextColor
- font.pixelSize: StudioTheme.Values.baseFontSize
- leftPadding: 10
- visible: materialBrowserBundleModel.isEmpty && !searchBox.isEmpty() && !materialBrowserModel.hasMaterialRoot
- }
+ Text {
+ text: qsTr("No match found.");
+ color: StudioTheme.Values.themeTextColor
+ font.pixelSize: StudioTheme.Values.baseFontSize
+ leftPadding: 10
+ visible: materialBrowserModel.isEmpty && !searchBox.isEmpty() && !materialBrowserModel.hasMaterialRoot
+ }
+
+ Text {
+ text:qsTr("There are no texture in this project.")
+ visible: materialBrowserTexturesModel.isEmpty && searchBox.isEmpty()
+ textFormat: Text.RichText
+ color: StudioTheme.Values.themeTextColor
+ font.pixelSize: StudioTheme.Values.mediumFontSize
+ horizontalAlignment: Text.AlignHCenter
+ wrapMode: Text.WordWrap
+ width: root.width
}
}
}
diff --git a/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialBrowserContextMenu.qml b/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialBrowserContextMenu.qml
index 796bcab6ebd..25e271c1c4e 100644
--- a/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialBrowserContextMenu.qml
+++ b/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialBrowserContextMenu.qml
@@ -1,27 +1,5 @@
-/****************************************************************************
-**
-** 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.
-**
-****************************************************************************/
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
import QtQuick
import HelperWidgets
diff --git a/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialBundleContextMenu.qml b/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialBundleContextMenu.qml
deleted file mode 100644
index eb698d69932..00000000000
--- a/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialBundleContextMenu.qml
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** 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 HelperWidgets 2.0
-import StudioControls 1.0 as StudioControls
-import StudioTheme 1.0 as StudioTheme
-
-StudioControls.Menu {
- id: root
-
- property var targetMaterial: null
- signal unimport(var bundleMat);
-
- function popupMenu(targetMaterial = null)
- {
- this.targetMaterial = targetMaterial
- popup()
- }
-
- closePolicy: StudioControls.Menu.CloseOnEscape | StudioControls.Menu.CloseOnPressOutside
-
- StudioControls.MenuItem {
- text: qsTr("Apply to selected (replace)")
- enabled: root.targetMaterial && materialBrowserModel.hasModelSelection
- onTriggered: materialBrowserBundleModel.applyToSelected(root.targetMaterial, false)
- }
-
- StudioControls.MenuItem {
- text: qsTr("Apply to selected (add)")
- enabled: root.targetMaterial && materialBrowserModel.hasModelSelection
- onTriggered: materialBrowserBundleModel.applyToSelected(root.targetMaterial, true)
- }
-
- StudioControls.MenuSeparator {}
-
- StudioControls.MenuItem {
- enabled: !materialBrowserBundleModel.importerRunning
- text: qsTr("Add an instance to project")
-
- onTriggered: {
- materialBrowserBundleModel.addToProject(root.targetMaterial)
- }
- }
-
- StudioControls.MenuItem {
- enabled: !materialBrowserBundleModel.importerRunning && root.targetMaterial.bundleMaterialImported
- text: qsTr("Remove from project")
-
- onTriggered: root.unimport(root.targetMaterial);
- }
-}
diff --git a/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialItem.qml b/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialItem.qml
index 71ac8911235..6eaf0351d2f 100644
--- a/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialItem.qml
+++ b/share/qtcreator/qmldesigner/materialBrowserQmlSource/MaterialItem.qml
@@ -23,6 +23,7 @@ Rectangle {
matName.readOnly = false
matName.selectAll()
matName.forceActiveFocus()
+ matName.ensureVisible(matName.text.length)
nameMouseArea.enabled = false
}
@@ -31,10 +32,8 @@ Rectangle {
if (matName.readOnly)
return;
- matName.readOnly = true
- nameMouseArea.enabled = true
-
materialBrowserModel.renameMaterial(index, matName.text);
+ mouseArea.forceActiveFocus()
}
border.width: materialBrowserModel.selectedIndex === index ? 1 : 0
@@ -102,6 +101,16 @@ Rectangle {
onEditingFinished: root.commitRename()
+ onActiveFocusChanged: {
+ if (!activeFocus) {
+ matName.readOnly = true
+ nameMouseArea.enabled = true
+ ensureVisible(0)
+ }
+ }
+
+ Component.onCompleted: ensureVisible(0)
+
MouseArea {
id: nameMouseArea
diff --git a/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml b/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml
new file mode 100644
index 00000000000..b5ef129a6c3
--- /dev/null
+++ b/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml
@@ -0,0 +1,46 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtQuick.Layouts
+import QtQuickDesignerTheme
+import HelperWidgets
+import StudioTheme as StudioTheme
+
+Rectangle {
+ id: root
+
+ visible: textureVisible
+
+ color: "transparent"
+ border.width: materialBrowserTexturesModel.selectedIndex === index ? 1 : 0
+ border.color: materialBrowserTexturesModel.selectedIndex === index
+ ? StudioTheme.Values.themeControlOutlineInteraction
+ : "transparent"
+
+ signal showContextMenu()
+
+ MouseArea {
+ id: mouseArea
+
+ anchors.fill: parent
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+
+ onPressed: (mouse) => {
+ materialBrowserTexturesModel.selectTexture(index)
+
+ if (mouse.button === Qt.LeftButton)
+ rootView.startDragTexture(index, mapToGlobal(mouse.x, mouse.y))
+ else if (mouse.button === Qt.RightButton)
+ root.showContextMenu()
+ }
+ }
+
+ Image {
+ source: textureSource
+ sourceSize.width: root.width - 10
+ sourceSize.height: root.height - 10
+ anchors.centerIn: parent
+ cache: false
+ }
+}
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ProgressBarSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ProgressBarSpecifics.qml
index 39919a462c1..6dde7ca6111 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ProgressBarSpecifics.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Controls/ProgressBarSpecifics.qml
@@ -85,10 +85,11 @@ Column {
CheckBox {
text: backendValues.indeterminate.valueToString
implicitWidth: StudioTheme.Values.twoControlColumnWidth
- + StudioTheme.Values.actionIndicatorWidt
+ + StudioTheme.Values.actionIndicatorWidth
backendValue: backendValues.indeterminate
enabled: backendValue.isAvailable
}
+ ExpandingSpacer {}
}
}
}
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/CheckBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/CheckBox.qml
index 0803049f6ea..cf7c588a3ce 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/CheckBox.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/CheckBox.qml
@@ -32,7 +32,7 @@ T.CheckBox {
implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding)
- spacing: StudioTheme.Values.checkBoxSpacing
+ spacing: checkBoxLabel.visible ? StudioTheme.Values.checkBoxSpacing : 0
hoverEnabled: true
activeFocusOnTab: false
@@ -85,7 +85,7 @@ T.CheckBox {
text: myCheckBox.text
font: myCheckBox.font
color: StudioTheme.Values.themeTextColor
- visible: text !== ""
+ visible: checkBoxLabel.text !== ""
}
states: [
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBox.qml
index c61c9d705e0..e20aa3634b3 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBox.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBox.qml
@@ -19,10 +19,14 @@ T.SpinBox {
property bool edit: spinBoxInput.activeFocus
// This property is used to indicate the global hover state
- property bool hover: (mySpinBox.hovered || actionIndicator.hover) && mySpinBox.enabled
+ property bool hover: (spinBoxInput.hover || actionIndicator.hover || spinBoxIndicatorUp.hover
+ || spinBoxIndicatorDown.hover || sliderIndicator.hover)
+ && mySpinBox.enabled
property bool drag: false
property bool sliderDrag: sliderPopup.drag
+ property bool dirty: false // user modification flag
+
property alias actionIndicatorVisible: actionIndicator.visible
property real __actionIndicatorWidth: StudioTheme.Values.actionIndicatorWidth
property real __actionIndicatorHeight: StudioTheme.Values.actionIndicatorHeight
@@ -35,12 +39,22 @@ T.SpinBox {
property real __sliderIndicatorWidth: StudioTheme.Values.sliderIndicatorWidth
property real __sliderIndicatorHeight: StudioTheme.Values.sliderIndicatorHeight
+ property alias __devicePixelRatio: spinBoxInput.devicePixelRatio
+ property alias pixelsPerUnit: spinBoxInput.pixelsPerUnit
+
+ property alias compressedValueTimer: myTimer
+
+ property string preFocusText: ""
+
signal compressedValueModified
+ signal dragStarted
+ signal dragEnded
+ signal dragging
// Use custom wheel handling due to bugs
property bool __wheelEnabled: false
wheelEnabled: false
- hoverEnabled: true // TODO
+ hoverEnabled: true
width: StudioTheme.Values.defaultControlWidth
height: StudioTheme.Values.defaultControlHeight
@@ -82,12 +96,11 @@ T.SpinBox {
myControl: mySpinBox
iconFlip: -1
visible: mySpinBox.spinBoxIndicatorVisible
- //hover: mySpinBox.up.hovered // TODO QTBUG-74688
pressed: mySpinBox.up.pressed
x: actionIndicator.width + StudioTheme.Values.border
y: StudioTheme.Values.border
- width: spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorWidth : 0
- height: spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorHeight : 0
+ width: mySpinBox.spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorWidth : 0
+ height: mySpinBox.spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorHeight : 0
enabled: (mySpinBox.from < mySpinBox.to) ? mySpinBox.value < mySpinBox.to
: mySpinBox.value > mySpinBox.to
@@ -97,12 +110,11 @@ T.SpinBox {
id: spinBoxIndicatorDown
myControl: mySpinBox
visible: mySpinBox.spinBoxIndicatorVisible
- //hover: mySpinBox.down.hovered // TODO QTBUG-74688
pressed: mySpinBox.down.pressed
x: actionIndicator.width + StudioTheme.Values.border
y: spinBoxIndicatorUp.y + spinBoxIndicatorUp.height
- width: spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorWidth : 0
- height: spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorHeight : 0
+ width: mySpinBox.spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorWidth : 0
+ height: mySpinBox.spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorHeight : 0
enabled: (mySpinBox.from < mySpinBox.to) ? mySpinBox.value > mySpinBox.from
: mySpinBox.value < mySpinBox.from
@@ -111,6 +123,23 @@ T.SpinBox {
contentItem: SpinBoxInput {
id: spinBoxInput
myControl: mySpinBox
+
+ function handleEditingFinished() {
+ mySpinBox.focus = false
+
+ // Keep the dirty state before calling setValueFromInput(),
+ // it will be set to false (cleared) internally
+ var valueModified = mySpinBox.dirty
+
+ mySpinBox.setValueFromInput()
+ myTimer.stop()
+
+ // Only trigger the signal, if the value was modified
+ if (valueModified)
+ mySpinBox.compressedValueModified()
+ }
+
+ onEditingFinished: spinBoxInput.handleEditingFinished()
}
background: Rectangle {
@@ -216,7 +245,7 @@ T.SpinBox {
id: myTimer
repeat: false
running: false
- interval: 100
+ interval: 400
onTriggered: mySpinBox.compressedValueModified()
}
@@ -224,9 +253,10 @@ T.SpinBox {
onFocusChanged: mySpinBox.setValueFromInput()
onDisplayTextChanged: spinBoxInput.text = mySpinBox.displayText
onActiveFocusChanged: {
- if (mySpinBox.activeFocus)
- // QTBUG-75862 && mySpinBox.focusReason === Qt.TabFocusReason)
+ if (mySpinBox.activeFocus) { // QTBUG-75862 && mySpinBox.focusReason === Qt.TabFocusReason)
+ mySpinBox.preFocusText = spinBoxInput.text
spinBoxInput.selectAll()
+ }
if (sliderPopup.opened && !mySpinBox.activeFocus)
sliderPopup.close()
@@ -265,8 +295,11 @@ T.SpinBox {
mySpinBox.stepSize = currStepSize
}
- if (event.key === Qt.Key_Escape)
- mySpinBox.focus = false
+ if (event.key === Qt.Key_Escape) {
+ spinBoxInput.text = mySpinBox.preFocusText
+ mySpinBox.dirty = true
+ spinBoxInput.handleEditingFinished()
+ }
// FIX: This is a temporary fix for QTBUG-74239
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter)
@@ -274,13 +307,13 @@ T.SpinBox {
}
function clamp(v, lo, hi) {
- if (v < lo || v > hi)
- return Math.min(Math.max(lo, v), hi)
-
- return v
+ return (v < lo || v > hi) ? Math.min(Math.max(lo, v), hi) : v
}
function setValueFromInput() {
+ if (!mySpinBox.dirty)
+ return
+
// FIX: This is a temporary fix for QTBUG-74239
var currValue = mySpinBox.value
@@ -298,5 +331,7 @@ T.SpinBox {
if (mySpinBox.value !== currValue)
mySpinBox.valueModified()
+
+ mySpinBox.dirty = false
}
}
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBoxInput.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBoxInput.qml
index dab26a07d59..f1735f96a0e 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBoxInput.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBoxInput.qml
@@ -14,6 +14,9 @@ TextInput {
property bool drag: false
property bool hover: mouseArea.containsMouse && textInput.enabled
+ property int devicePixelRatio: 1
+ property int pixelsPerUnit: 10
+
z: 2
font: myControl.font
color: StudioTheme.Values.themeTextColor
@@ -75,38 +78,197 @@ TextInput {
}
}
- TapHandler {
- id: tapHandler
- acceptedDevices: PointerDevice.Mouse
- enabled: true
- onTapped: {
- textInput.forceActiveFocus()
- textInput.deselect() // QTBUG-75862
+ Item {
+ id: dragModifierWorkaround
+ Keys.onPressed: function(event) {
+ event.accepted = true
+
+ if (event.modifiers & Qt.ControlModifier) {
+ mouseArea.stepSize = myControl.minStepSize
+ mouseArea.calcValue()
+ }
+
+ if (event.modifiers & Qt.ShiftModifier) {
+ mouseArea.stepSize = myControl.maxStepSize
+ mouseArea.calcValue()
+ }
}
+ Keys.onReleased: function(event) {
+ event.accepted = true
+ mouseArea.stepSize = myControl.realStepSize
+ mouseArea.calcValue()
+ }
+ }
+
+ // Ensure that we get Up and Down key press events first
+ Keys.onShortcutOverride: function(event) {
+ event.accepted = (event.key === Qt.Key_Up || event.key === Qt.Key_Down)
}
MouseArea {
id: mouseArea
+
+ property real stepSize: myControl.stepSize
+
+ // Properties to store the state of a drag operation
+ property bool dragging: false
+ property bool hasDragged: false
+ property bool potentialDragStart: false
+
+ property int initialValue: myControl.value // value on drag operation starts
+
+ property int pressStartX: 0
+ property int dragStartX: 0
+ property int translationX: 0
+
+ property int dragDirection: 0
+ property int totalUnits: 0 // total number of units dragged
+ property int units: 0
+
+ property real __pixelsPerUnit: textInput.devicePixelRatio * textInput.pixelsPerUnit
+
anchors.fill: parent
enabled: true
hoverEnabled: true
propagateComposedEvents: true
acceptedButtons: Qt.LeftButton
cursorShape: Qt.PointingHandCursor
- onPressed: function(mouse) { mouse.accepted = false }
- onWheel: function(wheel) {
- if (!myControl.__wheelEnabled)
+ preventStealing: true
+
+ onPositionChanged: function(mouse) {
+ if (!mouseArea.dragging
+ && !myControl.edit
+ && Math.abs(mouseArea.pressStartX - mouse.x) > StudioTheme.Values.dragThreshold
+ && mouse.buttons === Qt.LeftButton
+ && mouseArea.potentialDragStart) {
+ mouseArea.dragging = true
+ mouseArea.potentialDragStart = false
+ mouseArea.initialValue = myControl.value
+ mouseArea.cursorShape = Qt.ClosedHandCursor
+ mouseArea.dragStartX = mouse.x
+
+ myControl.drag = true
+ myControl.dragStarted()
+ // Force focus on the non visible component to receive key events
+ dragModifierWorkaround.forceActiveFocus()
+ textInput.deselect()
+ }
+
+ if (!mouseArea.dragging)
return
+ mouse.accepted = true
+
+ var translationX = mouse.x - mouseArea.dragStartX
+
+ // Early return if mouse didn't move along x-axis
+ if (translationX === 0)
+ return
+
+ var currentDragDirection = Math.sign(translationX)
+
+ // Has drag direction changed
+ if (currentDragDirection !== mouseArea.dragDirection) {
+ mouseArea.translationX = 0
+ mouseArea.dragDirection = currentDragDirection
+ mouseArea.totalUnits = mouseArea.units
+ }
+
+ mouseArea.translationX += translationX
+ mouseArea.calcValue()
+ //myControl.realValueModified()
+ }
+
+ onClicked: function(mouse) {
+ if (textInput.edit)
+ mouse.accepted = false
+
+ if (mouseArea.hasDragged) {
+ mouseArea.hasDragged = false
+ return
+ }
+
+ textInput.forceActiveFocus()
+ textInput.deselect() // QTBUG-75862
+ }
+
+ onPressed: function(mouse) {
+ if (textInput.edit)
+ mouse.accepted = false
+
+ mouseArea.potentialDragStart = true
+ mouseArea.pressStartX = mouse.x
+ }
+
+ onReleased: function(mouse) {
+ if (textInput.edit)
+ mouse.accepted = false
+
+ mouseArea.endDrag()
+ }
+
+ function endDrag() {
+ if (!mouseArea.dragging)
+ return
+
+ mouseArea.dragging = false
+ mouseArea.hasDragged = true
+
+ if (myControl.compressedValueTimer.running) {
+ myControl.compressedValueTimer.stop()
+ mouseArea.calcValue()
+ myControl.compressedValueModified()
+ }
+ mouseArea.cursorShape = Qt.PointingHandCursor
+ myControl.drag = false
+ myControl.dragEnded()
+ // Avoid active focus on the component after dragging
+ dragModifierWorkaround.focus = false
+ textInput.focus = false
+ myControl.focus = false
+
+ mouseArea.translationX = 0
+ mouseArea.units = 0
+ mouseArea.totalUnits = 0
+ }
+
+ function calcValue() {
+ var minUnit = (myControl.from - mouseArea.initialValue) / mouseArea.stepSize
+ var maxUnit = (myControl.to - mouseArea.initialValue) / mouseArea.stepSize
+
+ var units = Math.trunc(mouseArea.translationX / mouseArea.__pixelsPerUnit)
+ mouseArea.units = Math.min(Math.max(mouseArea.totalUnits + units, minUnit), maxUnit)
+ myControl.value = mouseArea.initialValue + (mouseArea.units * mouseArea.stepSize)
+
+ if (mouseArea.dragging)
+ myControl.dragging()
+ }
+
+ onWheel: function(wheel) {
+ if (!myControl.__wheelEnabled) {
+ wheel.accepted = false
+ return
+ }
+
+ // Set stepSize according to used modifier key
+ if (wheel.modifiers & Qt.ControlModifier)
+ mouseArea.stepSize = myControl.minStepSize
+
+ if (wheel.modifiers & Qt.ShiftModifier)
+ mouseArea.stepSize = myControl.maxStepSize
+
var val = myControl.valueFromText(textInput.text, myControl.locale)
if (myControl.value !== val)
myControl.value = val
var currValue = myControl.value
- myControl.value += wheel.angleDelta.y / 120
+ myControl.value += (wheel.angleDelta.y / 120 * mouseArea.stepSize)
if (currValue !== myControl.value)
myControl.valueModified()
+
+ // Reset stepSize
+ mouseArea.stepSize = myControl.stepSize
}
}
@@ -119,14 +281,6 @@ TextInput {
target: textInputBackground
color: StudioTheme.Values.themeControlBackground
}
- PropertyChanges {
- target: dragHandler
- enabled: true
- }
- PropertyChanges {
- target: tapHandler
- enabled: true
- }
PropertyChanges {
target: mouseArea
cursorShape: Qt.PointingHandCursor
@@ -156,14 +310,6 @@ TextInput {
target: textInputBackground
color: StudioTheme.Values.themeControlBackgroundInteraction
}
- PropertyChanges {
- target: dragHandler
- enabled: false
- }
- PropertyChanges {
- target: tapHandler
- enabled: false
- }
PropertyChanges {
target: mouseArea
cursorShape: Qt.IBeamCursor
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml
index 2355f33281c..536c8adc6a4 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml
@@ -13,6 +13,7 @@ QtObject {
property real mediumFont: 14
property real bigFont: 16
property real baseIconFont: 12
+ property real mediumIconFont: 18
property real bigIconFont: 26
property real scaleFactor: 1.0
@@ -24,6 +25,7 @@ QtObject {
property real bigFontSize: Math.round(values.bigFont * values.scaleFactor)
property real baseIconFontSize: Math.round(values.baseIconFont * values.scaleFactor)
property real myIconFontSize: values.baseIconFontSize; // TODO: rename all refs to myIconFontSize -> baseIconFontSize then remove myIconFontSize
+ property real mediumIconFontSize: Math.round(values.mediumIconFont * values.scaleFactor)
property real bigIconFontSize: Math.round(values.bigIconFont * values.scaleFactor)
property real squareComponentWidth: values.height
diff --git a/src/libs/3rdparty/json/json.hpp b/src/libs/3rdparty/json/json.hpp
index c66d8243ad3..e11f5296884 100644
--- a/src/libs/3rdparty/json/json.hpp
+++ b/src/libs/3rdparty/json/json.hpp
@@ -1,64 +1,164 @@
-/*
- __ _____ _____ _____
- __| | __| | | | JSON for Modern C++
-| | |__ | | | | | | version 3.6.1
-|_____|_____|_____|_|___| https://github.com/nlohmann/json
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann
+// SPDX-License-Identifier: MIT
-Licensed under the MIT License .
-SPDX-License-Identifier: MIT
-Copyright (c) 2013-2019 Niels Lohmann .
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-*/
+/****************************************************************************\
+ * Note on documentation: The source files contain links to the online *
+ * documentation of the public API at https://json.nlohmann.me. This URL *
+ * contains the most recent documentation and should also be applicable to *
+ * previous versions; documentation for deprecated functions is not *
+ * removed, but marked deprecated. See "Generate documentation" section in *
+ * file docs/README.md. *
+\****************************************************************************/
#ifndef INCLUDE_NLOHMANN_JSON_HPP_
#define INCLUDE_NLOHMANN_JSON_HPP_
-#define NLOHMANN_JSON_VERSION_MAJOR 3
-#define NLOHMANN_JSON_VERSION_MINOR 6
-#define NLOHMANN_JSON_VERSION_PATCH 1
-
#include // all_of, find, for_each
-#include // assert
-#include // and, not, or
#include // nullptr_t, ptrdiff_t, size_t
#include // hash, less
#include // initializer_list
-#include // istream, ostream
+#ifndef JSON_NO_IO
+ #include // istream, ostream
+#endif // JSON_NO_IO
#include // random_access_iterator_tag
#include // unique_ptr
-#include // accumulate
#include // string, stoi, to_string
#include // declval, forward, move, pair, swap
#include // vector
// #include
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann
+// SPDX-License-Identifier: MIT
+
#include
+// #include
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann
+// SPDX-License-Identifier: MIT
+
+
+
+// This file contains all macro definitions affecting or depending on the ABI
+
+#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
+ #if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH)
+ #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 11 || NLOHMANN_JSON_VERSION_PATCH != 2
+ #warning "Already included a different version of the library!"
+ #endif
+ #endif
+#endif
+
+#define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum)
+#define NLOHMANN_JSON_VERSION_MINOR 11 // NOLINT(modernize-macro-to-enum)
+#define NLOHMANN_JSON_VERSION_PATCH 2 // NOLINT(modernize-macro-to-enum)
+
+#ifndef JSON_DIAGNOSTICS
+ #define JSON_DIAGNOSTICS 0
+#endif
+
+#ifndef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON
+ #define JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 0
+#endif
+
+#if JSON_DIAGNOSTICS
+ #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS _diag
+#else
+ #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS
+#endif
+
+#if JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON
+ #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON _ldvcmp
+#else
+ #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON
+#endif
+
+#ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION
+ #define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0
+#endif
+
+// Construct the namespace ABI tags component
+#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b) json_abi ## a ## b
+#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b) \
+ NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b)
+
+#define NLOHMANN_JSON_ABI_TAGS \
+ NLOHMANN_JSON_ABI_TAGS_CONCAT( \
+ NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
+ NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON)
+
+// Construct the namespace version component
+#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \
+ _v ## major ## _ ## minor ## _ ## patch
+#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(major, minor, patch) \
+ NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch)
+
+#if NLOHMANN_JSON_NAMESPACE_NO_VERSION
+#define NLOHMANN_JSON_NAMESPACE_VERSION
+#else
+#define NLOHMANN_JSON_NAMESPACE_VERSION \
+ NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(NLOHMANN_JSON_VERSION_MAJOR, \
+ NLOHMANN_JSON_VERSION_MINOR, \
+ NLOHMANN_JSON_VERSION_PATCH)
+#endif
+
+// Combine namespace components
+#define NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) a ## b
+#define NLOHMANN_JSON_NAMESPACE_CONCAT(a, b) \
+ NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b)
+
+#ifndef NLOHMANN_JSON_NAMESPACE
+#define NLOHMANN_JSON_NAMESPACE \
+ nlohmann::NLOHMANN_JSON_NAMESPACE_CONCAT( \
+ NLOHMANN_JSON_ABI_TAGS, \
+ NLOHMANN_JSON_NAMESPACE_VERSION)
+#endif
+
+#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN
+#define NLOHMANN_JSON_NAMESPACE_BEGIN \
+ namespace nlohmann \
+ { \
+ inline namespace NLOHMANN_JSON_NAMESPACE_CONCAT( \
+ NLOHMANN_JSON_ABI_TAGS, \
+ NLOHMANN_JSON_NAMESPACE_VERSION) \
+ {
+#endif
+
+#ifndef NLOHMANN_JSON_NAMESPACE_END
+#define NLOHMANN_JSON_NAMESPACE_END \
+ } /* namespace (inline namespace) NOLINT(readability/namespace) */ \
+ } // namespace nlohmann
+#endif
+
// #include
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann
+// SPDX-License-Identifier: MIT
+
#include // transform
#include // array
-#include // and, not
#include // forward_list
#include // inserter, front_inserter, end
#include