Merge remote-tracking branch 'origin/5.0'

Change-Id: I7ca9791b95032a1f276c520f8eefde3801510eb9
This commit is contained in:
Orgad Shaneh
2021-09-24 17:01:29 +03:00
51 changed files with 1101 additions and 457 deletions

View File

@@ -0,0 +1,59 @@
cmake_minimum_required(VERSION 3.14)
project(transitions VERSION 0.1 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Quick REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Quick REQUIRED)
set(PROJECT_SOURCES
main.cpp
qml.qrc
)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(transitions
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
# Define target properties for Android with Qt 6 as:
# set_property(TARGET transitions APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
# ${CMAKE_CURRENT_SOURCE_DIR}/android)
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
else()
if(ANDROID)
add_library(transitions SHARED
${PROJECT_SOURCES}
)
# Define properties for Android with Qt 5 after find_package() calls as:
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
else()
add_executable(transitions
${PROJECT_SOURCES}
)
endif()
endif()
target_compile_definitions(transitions
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(transitions
PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick)
set_target_properties(transitions PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
)
if(QT_VERSION_MAJOR EQUAL 6)
qt_import_qml_plugins(transitions)
qt_finalize_executable(transitions)
endif()

View File

@@ -0,0 +1,266 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator
**
** $QT_BEGIN_LICENSE:BSD$
** 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.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.15
import QtQuick.Window 2.15
Rectangle {
id: page
state: "State1"
Image {
id: icon
x: 20
y: 20
source: "images/qt-logo.png"
fillMode: Image.PreserveAspectFit
}
Rectangle {
id: topLeftRect
width: 55
height: 41
color: "#00ffffff"
border.color: "#808080"
anchors.left: parent.left
anchors.top: parent.top
anchors.leftMargin: 20
anchors.topMargin: 20
MouseArea {
id: mouseArea
anchors.fill: parent
Connections {
target: mouseArea
function onClicked()
{
page.state = "State1"
}
}
}
}
Rectangle {
id: middleRightRect
width: 55
height: 41
color: "#00ffffff"
border.color: "#808080"
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 20
MouseArea {
id: mouseArea1
anchors.fill: parent
Connections {
target: mouseArea1
function onClicked()
{
page.state = "State2"
}
}
}
}
Rectangle {
id: bottomLeftRect
width: 55
height: 41
color: "#00ffffff"
border.color: "#808080"
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
anchors.leftMargin: 20
MouseArea {
id: mouseArea2
anchors.fill: parent
Connections {
target: mouseArea2
function onClicked()
{
page.state = "State3"
}
}
}
}
states: [
State {
name: "State1"
},
State {
name: "State2"
PropertyChanges {
target: icon
x: middleRightRect.x
y: middleRightRect.y
}
},
State {
name: "State3"
PropertyChanges {
target: icon
x: bottomLeftRect.x
y: bottomLeftRect.y
}
}
]
transitions: [
Transition {
id: toState1
ParallelAnimation {
SequentialAnimation {
PauseAnimation {
duration: 0
}
PropertyAnimation {
target: icon
property: "y"
duration: 200
}
}
SequentialAnimation {
PauseAnimation {
duration: 0
}
PropertyAnimation {
target: icon
property: "x"
duration: 200
}
}
}
to: "State1"
from: "State2,State3"
},
Transition {
id: toState2
ParallelAnimation {
SequentialAnimation {
PauseAnimation {
duration: 0
}
PropertyAnimation {
target: icon
property: "y"
easing.bezierCurve: [0.233,0.161,0.264,0.997,0.393,0.997,0.522,0.997,0.555,0.752,0.61,0.75,0.664,0.748,0.736,1,0.775,1,0.814,0.999,0.861,0.901,0.888,0.901,0.916,0.901,0.923,0.995,1,1]
duration: 1006
}
}
SequentialAnimation {
PauseAnimation {
duration: 0
}
PropertyAnimation {
target: icon
property: "x"
easing.bezierCurve: [0.233,0.161,0.264,0.997,0.393,0.997,0.522,0.997,0.555,0.752,0.61,0.75,0.664,0.748,0.736,1,0.775,1,0.814,0.999,0.861,0.901,0.888,0.901,0.916,0.901,0.923,0.995,1,1]
duration: 1006
}
}
}
to: "State2"
from: "State1,State3"
},
Transition {
id: toState3
ParallelAnimation {
SequentialAnimation {
PauseAnimation {
duration: 0
}
PropertyAnimation {
target: icon
property: "y"
easing.bezierCurve: [0.455,0.03,0.515,0.955,1,1]
duration: 2000
}
}
SequentialAnimation {
PauseAnimation {
duration: 0
}
PropertyAnimation {
target: icon
property: "x"
easing.bezierCurve: [0.455,0.03,0.515,0.955,1,1]
duration: 2000
}
}
}
to: "State3"
from: "State1,State2"
}
]
}
/*##^##
Designer {
D{i:0;height:480;width:640}D{i:1}D{i:16;transitionDuration:2000}D{i:24;transitionDuration:2000}
D{i:32;transitionDuration:2000}
}
##^##*/

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,9 +1,67 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator
**
** $QT_BEGIN_LICENSE:BSD$
** 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.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QGuiApplication> #include <QGuiApplication>
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
if (qEnvironmentVariableIsEmpty("QTGLESSTREAM_DISPLAY")) {
qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("213"));
qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("120"));
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
}
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);

View File

@@ -1,214 +1,71 @@
import QtQuick 2.14 /****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator
**
** $QT_BEGIN_LICENSE:BSD$
** 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.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
Rectangle { import QtQuick 2.15
id: page import QtQuick.Window 2.15
Window {
width: 640 width: 640
height: 480 height: 480
visible: true visible: true
border.color: "#808080" title: qsTr("Hello World")
state: "State1"
Image { Page {
id: icon id: page
x: 10
y: 20
source: "qt-logo.png"
fillMode: Image.PreserveAspectFit
}
Rectangle {
id: topLeftRect
width: 55
height: 41
color: "#00000000"
border.color: "#808080"
anchors.left: parent.left
anchors.top: parent.top
anchors.leftMargin: 10
anchors.topMargin: 20
MouseArea {
id: mouseArea
anchors.fill: parent anchors.fill: parent
color: "#ffffff"
Connections {
target: mouseArea
onClicked: page.state = "State1"
} }
} }
}
Rectangle {
id: middleRightRect
width: 55
height: 41
color: "#00000000"
border.color: "#808080"
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 10
MouseArea {
id: mouseArea1
anchors.fill: parent
Connections {
target: mouseArea1
onClicked: page.state = "State2"
}
}
}
Rectangle {
id: bottomLeftRect
width: 55
height: 41
color: "#00000000"
border.color: "#808080"
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
MouseArea {
id: mouseArea2
anchors.fill: parent
Connections {
target: mouseArea2
onClicked: page.state = "State3"
}
}
anchors.leftMargin: 10
}
states: [
State {
name: "State1"
PropertyChanges {
target: icon
x: 10
y: 20
}
},
State {
name: "State2"
PropertyChanges {
target: icon
x: 575
y: 219
}
},
State {
name: "State3"
PropertyChanges {
target: icon
x: 10
y: 419
}
}
]
transitions: [
Transition {
id: toState1
ParallelAnimation {
SequentialAnimation {
PauseAnimation {
duration: 50
}
PropertyAnimation {
target: icon
property: "x"
easing.bezierCurve: [0.2,0.2,0.8,0.8,1,1]
duration: 152
}
}
SequentialAnimation {
PauseAnimation {
duration: 52
}
PropertyAnimation {
target: icon
property: "y"
easing.bezierCurve: [0.2,0.2,0.8,0.8,1,1]
duration: 152
}
}
}
to: "State1"
from: "State2,State3"
},
Transition {
id: toState2
ParallelAnimation {
SequentialAnimation {
PauseAnimation {
duration: 50
}
PropertyAnimation {
target: icon
property: "x"
easing.bezierCurve: [0.233,0.161,0.264,0.997,0.393,0.997,0.522,0.997,0.555,0.752,0.61,0.75,0.664,0.748,0.736,1,0.775,1,0.814,0.999,0.861,0.901,0.888,0.901,0.916,0.901,0.923,0.995,1,1]
duration: 951
}
}
SequentialAnimation {
PauseAnimation {
duration: 50
}
PropertyAnimation {
target: icon
property: "y"
easing.bezierCurve: [0.233,0.161,0.264,0.997,0.393,0.997,0.522,0.997,0.555,0.752,0.61,0.75,0.664,0.748,0.736,1,0.775,1,0.814,0.999,0.861,0.901,0.888,0.901,0.916,0.901,0.923,0.995,1,1]
duration: 951
}
}
}
to: "State2"
from: "State1,State3"
},
Transition {
id: toState3
ParallelAnimation {
SequentialAnimation {
PauseAnimation {
duration: 0
}
PropertyAnimation {
target: icon
property: "x"
easing.bezierCurve: [0.25,0.46,0.45,0.94,1,1]
duration: 2000
}
}
SequentialAnimation {
PauseAnimation {
duration: 0
}
PropertyAnimation {
target: icon
property: "y"
easing.bezierCurve: [0.25,0.46,0.45,0.94,1,1]
duration: 2000
}
}
}
to: "State3"
from: "State1,State2"
}
]
}
/*##^## /*##^##
Designer { Designer {
D{i:0;formeditorZoom:0.6600000262260437}D{i:17;transitionDuration:2000}D{i:25;transitionDuration:2000} D{i:0;formeditorZoom:0.75}
D{i:33;transitionDuration:2000}
} }
##^##*/ ##^##*/

View File

@@ -1,6 +1,7 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>main.qml</file> <file>main.qml</file>
<file>qt-logo.png</file> <file>images/qt-logo.png</file>
<file>Page.qml</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@@ -1,23 +0,0 @@
QT += quick
CONFIG += c++11
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp
RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -131,6 +131,7 @@
\li \l{Lists and Other Data Models} \li \l{Lists and Other Data Models}
\li \l{Animations} \li \l{Animations}
\li \l{3D Views} \li \l{3D Views}
\li \l{Node}
\li \l{Group} \li \l{Group}
\li \l{Instanced Rendering} \li \l{Instanced Rendering}
\li \l{Skeletal Animation} \li \l{Skeletal Animation}

View File

@@ -47,15 +47,14 @@
\include qtquick-tutorial-create-empty-project.qdocinc qtquick empty application \include qtquick-tutorial-create-empty-project.qdocinc qtquick empty application
\QC generates a component file, \e main.qml, and opens it in \QC generates a component file, \e main.qml, and opens it in the
\l {Text Editor}. The wizard template uses an instance of the \l Window \l {Text Editor} view. Select \uicontrol Design to open the file in
control, which does not support adding states. Because we want to use states the \l {Form Editor} view.
in this example, we first replace the instance of the Window component with
an instance of the basic \l {basic-rectangle}{Rectangle} component. We must \note The visibility of Design views depends on the selected workspace.
also remove the line that sets the \c title property, which the Rectangle To open hidden views, select \uicontrol View > \uicontrol Views
component does not have. If you change the value of the \l Type property in in the \uicontrol Design mode. For more information about moving
the \l Properties view, \QC offers to automatically remove the \c title views around, see \l {Managing Workspaces}.
property.
\section1 Creating the Main View \section1 Creating the Main View
@@ -65,15 +64,22 @@
We use the \e qt-logo.png image in this tutorial, but you can also use We use the \e qt-logo.png image in this tutorial, but you can also use
any other image or a component, instead. any other image or a component, instead.
\note If a view is hidden, you can show it by selecting \uicontrol View >
\uicontrol Views.
\list 1 \list 1
\li In \uicontrol Library > \uicontrol Components >
\uicontrol {Default Components} > \uicontrol Basic, select
\uicontrol Rectangle and drag and drop it to \e Window in
\uicontrol Navigator.
\li Select the \uicontrol Rectangle instance in \l Navigator, and enter \li Select the \uicontrol Rectangle instance in \l Navigator, and enter
\e page in the \uicontrol ID field in \l Properties. \e page in the \uicontrol ID field in \l Properties.
\li Select \l Library > \uicontrol Assets > \inlineimage plus.png \li In \uicontrol Layout, select the
\inlineimage icons/anchor-fill.png "Fill anchor button"
fill anchor button to anchor the rectangle to the window on all
sides.
\li Select \uicontrol Library > \uicontrol Assets > \inlineimage plus.png
to locate qt-logo.png (or your own image) and add it to the to locate qt-logo.png (or your own image) and add it to the
project folder. project folder.
@@ -91,7 +97,7 @@
\li In the \uicontrol ID field, enter \e icon. \li In the \uicontrol ID field, enter \e icon.
\li In the \uicontrol Position field, set \uicontrol X to \e 10 and \li In the \uicontrol Position field, set \uicontrol X and
\uicontrol Y to \e 20. \uicontrol Y to \e 20.
\endlist \endlist
@@ -111,26 +117,25 @@
\li In the \uicontrol ID field, enter \e topLeftRect. \li In the \uicontrol ID field, enter \e topLeftRect.
\li In the \uicontrol Size field, set \uicontrol W and \li In the \uicontrol Size field, set \uicontrol W and
\uicontrol H to \e 64, for the rectangle size to \uicontrol H to values that match the image size
match the image size. (\e 55 and \e 41).
\li In the \uicontrol Color field, click the \li Select the \uicontrol Color field, and then select the
\inlineimage icon_color_none.png \inlineimage icons/transparent.png "Transparent button"
(\uicontrol Transparent) button to make the rectangle button in the \l{Picking colors}{color picker} to make
transparent. the rectangle transparent.
\li In the \uicontrol {Border color} field, set the border \li In the \uicontrol {Border color} field, set the border
color to \e #808080 to make the rectangle visible on color to \e #808080 to make the rectangle visible on
the white background. the background.
\li Click \uicontrol {Layout}, and then click the \li Click \uicontrol {Layout}, and then click the
\inlineimage icons/anchor-top.png \inlineimage icons/anchor-top.png "Top anchor button"
(\uicontrol Top) and \inlineimage icons/anchor-left.png top and \inlineimage icons/anchor-left.png "Left anchor button"
(\uicontrol Left) anchor buttons to anchor the left anchor buttons to anchor the rectangle to the top left
rectangle to the top left corner of the page. corner of the page.
\li In the \uicontrol Margin field, select \e 20 for the top anchor \li In the \uicontrol Margin field, select \e 20 for both anchors.
and \e 10 for the left anchor.
\image qmldesigner-tutorial-topleftrect-layout.png "Anchor margins" \image qmldesigner-tutorial-topleftrect-layout.png "Anchor margins"
@@ -140,9 +145,8 @@
\uicontrol Library to \e topLeftRect in \uicontrol Navigator. \uicontrol Library to \e topLeftRect in \uicontrol Navigator.
\li Click \uicontrol {Layout}, and then click the \li Click \uicontrol {Layout}, and then click the
\inlineimage icons/anchor-fill.png \inlineimage icons/anchor-fill.png "Fill anchor button"
(\uicontrol {Fill to Parent}) button to anchor the mouse area to the button to anchor the mouse area to its parent.
rectangle.
\li In the \uicontrol Navigator, copy \e topLeftRect (by pressing \li In the \uicontrol Navigator, copy \e topLeftRect (by pressing
\key {Ctrl+C}) and paste it to \e page in \uicontrol Navigator \key {Ctrl+C}) and paste it to \e page in \uicontrol Navigator
@@ -156,13 +160,13 @@
\li In the \uicontrol ID field, enter \e middleRightRect. \li In the \uicontrol ID field, enter \e middleRightRect.
\li In \uicontrol {Layout}, select the \li In \uicontrol {Layout}, select the
\inlineimage icons/anchor-center-vertical.png \inlineimage icons/anchor-center-vertical.png "Vertical center anchor button"
(\uicontrol {Vertical Center} anchor button and then the vertical center anchor button and then the
\inlineimage icons/anchor-right.png \inlineimage icons/anchor-right.png "Right anchor button"
(\uicontrol Right) anchor button to anchor the rectangle right anchor button to anchor the rectangle
to the middle right margin of its parent. to the middle right margin of its parent.
\li In the \uicontrol Margin field, select \e 10 for the right \li In the \uicontrol Margin field, select \e 20 for the right
anchor and \e 0 for the vertical center anchor. anchor and \e 0 for the vertical center anchor.
\endlist \endlist
@@ -179,8 +183,7 @@
(\uicontrol Left) anchor buttons to anchor the rectangle (\uicontrol Left) anchor buttons to anchor the rectangle
to the bottom left margin of its parent. to the bottom left margin of its parent.
\li In the \uicontrol Margin field, select \e 20 for the bottom \li In the \uicontrol Margin field, select \e 20 for both anchors.
anchor and \e 10 for the left anchor.
\endlist \endlist
@@ -199,18 +202,41 @@
For more information about the views you used, see: For more information about the views you used, see:
\list \list
\li \l {Form Editor}
\li \l Library \li \l Library
\li \l Navigator \li \l Navigator
\li \l Properties \li \l Properties
\endlist \endlist
Next, we will make the image move between the rectangles when users click Next, we will make the image move between the rectangles when users click
them by adding states and by connecting mouse clicks to state changes. them by \l{Adding States}{adding states} and by connecting mouse clicks
to state changes.
Because the Window component requires states to be added into child
components, we must first move \e page into a separate component.
\section1 Turning Page into a Custom Component
To turn \e page into a custom component, right-click it
in \uicontrol Navigator or \uicontrol {Form Editor}, and select
\uicontrol {Move Component into Separate File} in the context menu.
\image qmldesigner-tutorial-page-component.png "Move page component instance into a separate file"
\list 1
\li In \uicontrol {Component name}, enter \e Page.
\li In \uicontrol {Property assignments for main.qml} select both
check boxes to preserve the appearance of the UI.
\li Select \uicontrol OK to create a file called \e Page.qml that
defines the Page custom component and to add an instance of it
into \e main.qml.
\endlist
\section1 Connecting Mouse Clicks to State Changes \section1 Connecting Mouse Clicks to State Changes
To make the image move between the rectangles when users click them, we add To make the image move between the rectangles when users click them, we add
states, where we change the values of the \c x and \c y properties of states to the Page component, where we change the values of the \c x and
\c y properties of
\e icon to match those of the middle right and top left rectangles. Then, \e icon to match those of the middle right and top left rectangles. Then,
we connect the \c onClicked signals of the mouse areas to the state changes. we connect the \c onClicked signals of the mouse areas to the state changes.
@@ -219,6 +245,9 @@
\c y properties of \e icon to those of the rectangles. \c y properties of \e icon to those of the rectangles.
\list 1 \list 1
\li Right-click \e page in \uicontrol Navigator, and select
\uicontrol {Go into Component} in the context menu to open
\e Page.qml in \uicontrol {Form Editor}.
\li In the \uicontrol States view, select \uicontrol {Create New State} \li In the \uicontrol States view, select \uicontrol {Create New State}
three times to create \e State1, \e State2, and \e State3. three times to create \e State1, \e State2, and \e State3.
\li Select \e State1 in \uicontrol States. \li Select \e State1 in \uicontrol States.
@@ -227,13 +256,22 @@
\uicontrol {Set as Default} to display \e State1 when \uicontrol {Set as Default} to display \e State1 when
the application starts. the application starts.
\li Select \e State2 in \uicontrol States. \li Select \e State2 in \uicontrol States.
\li Select \e icon in \uicontrol Navigator and drag it on top of the \li Select \e icon in \uicontrol Navigator to display its properties
middle left rectangle in \uicontrol {Form Editor}. This changes the in \uicontrol Properties.
\c x and \c y property values of \e icon to match those of \li In \uicontrol {Geometry - 2D} > \uicontrol Position > \uicontrol X,
\e middleRightRect in \e State2. select \inlineimage icons/action-icon.png "Actions button"
\image qmldesigner-tutorial-states.png "States view" , and then select \uicontrol {Set Binding} to open
\li Select \e State3 in \uicontrol States, and drag \e icon on top of \uicontrol {Binding Editor}.
the bottom left rectangle in \uicontrol {Form Editor}. \li Select the \e middleRightRect component and the \e x property
to bind the \e x property value of \e icon to that of
\e middleRightRect.
\image qmldesigner-tutorial-bindings.png "Binding Editor"
\li Select \uicontrol OK to create the binding.
\li Repeat for \uicontrol Y, but set the binding as
\e middleRightRect.y.
\li Select \e State3 in \uicontrol States, and bind the \e x and \e y
property values of \e icon to those of \e bottomLeftRect
(\e bottomLeftRect.x and \e bottomLeftRect.y).
\li In \l {Connection View} > \uicontrol Connections, click the \li In \l {Connection View} > \uicontrol Connections, click the
\inlineimage plus.png \inlineimage plus.png
button to create a new connection. button to create a new connection.
@@ -250,10 +288,30 @@
Click the rectangles to move the Qt logo from one rectangle to another. Click the rectangles to move the Qt logo from one rectangle to another.
If you develop with Qt 6, you must specify the connections as
functions. This is currently not supported in \uicontrol {Connections},
so you must do it in \uicontrol {Text Editor}. For example:
\code
MouseArea {
id: mouseArea
anchors.fill: parent
Connections {
target: mouseArea
function onClicked()
{
page.state = "State1"
}
}
}
\endcode
For more information about the views you used, see: For more information about the views you used, see:
\list \list
\li \l States \li \l States
\li \l{Setting Bindings}
\li \l{Connecting Components to Signals} \li \l{Connecting Components to Signals}
\endlist \endlist

View File

@@ -69,6 +69,7 @@
\list \list
\li \l {3D Views} \li \l {3D Views}
\li \l {Node}
\li \l {Group} \li \l {Group}
\li \l {Instanced Rendering} \li \l {Instanced Rendering}
\li \l {Skeletal Animation} \li \l {Skeletal Animation}

View File

@@ -94,8 +94,10 @@
\image qtquick-number-animation.gif "Number animation" \image qtquick-number-animation.gif "Number animation"
\if defined(qtdesignstudio)
For an example of using property animation to animate the scale and opacity For an example of using property animation to animate the scale and opacity
of components, see the \l{Coffee Machine} example. of components, see the \l{Coffee Machine} example.
\endif
\section2 Setting Non-Animated Properties \section2 Setting Non-Animated Properties

View File

@@ -26,7 +26,7 @@
/*! /*!
\page quick-converting-ui-projects.html \page quick-converting-ui-projects.html
\if defined(qtdesignstudio) \if defined(qtdesignstudio)
\previouspage creator-vcs-git.html \previouspage studio-porting-projects.html
\nextpage creator-editor-external.html \nextpage creator-editor-external.html
\else \else
\previouspage qtquick-iso-icon-browser.html \previouspage qtquick-iso-icon-browser.html

View File

@@ -70,6 +70,7 @@
\endif \endif
\li \l Animations \li \l Animations
\li \l{3D Views} \li \l{3D Views}
\li \l{Node}
\li \l{Group} \li \l{Group}
\li \l{Instanced Rendering} \li \l{Instanced Rendering}
\li \l{Skeletal Animation} \li \l{Skeletal Animation}

View File

@@ -33,7 +33,7 @@
\page creator-vcs-git.html \page creator-vcs-git.html
\if defined(qtdesignstudio) \if defined(qtdesignstudio)
\previouspage studio-developer-topics.html \previouspage studio-developer-topics.html
\nextpage quick-converting-ui-projects.html \nextpage studio-porting-projects.html
\else \else
\previouspage creator-vcs-cvs.html \previouspage creator-vcs-cvs.html
\nextpage creator-vcs-mercurial.html \nextpage creator-vcs-mercurial.html

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -88,6 +88,7 @@
\li \l{Logic Helpers} \li \l{Logic Helpers}
\li \l Animations \li \l Animations
\li \l{3D Views} \li \l{3D Views}
\li \l{Node}
\li \l{Group} \li \l{Group}
\li \l{Instanced Rendering} \li \l{Instanced Rendering}
\li \l{Skeletal Animation} \li \l{Skeletal Animation}
@@ -258,6 +259,7 @@
\li \l{Developer Topics} \li \l{Developer Topics}
\list \list
\li \l{Using Git} \li \l{Using Git}
\li \l{Converting Qt 5 Projects into Qt 6 Projects}
\li \l{Converting UI Projects to Applications} \li \l{Converting UI Projects to Applications}
\li \l{Using External Tools} \li \l{Using External Tools}
\endlist \endlist

View File

@@ -99,6 +99,7 @@
\li \b {\l{Developer Topics}} \li \b {\l{Developer Topics}}
\list \list
\li \l{Using Git} \li \l{Using Git}
\li \l{Converting Qt 5 Projects into Qt 6 Projects}
\li \l{Converting UI Projects to Applications} \li \l{Converting UI Projects to Applications}
\li \l{Using External Tools} \li \l{Using External Tools}
\endlist \endlist

View File

@@ -0,0 +1,141 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Design Studio documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/
/*!
\page studio-porting-projects.html
\previouspage creator-vcs-git.html
\nextpage quick-converting-ui-projects.html
\title Converting Qt 5 Projects into Qt 6 Projects
\QDS supports creating UIs with Qt 6 in addition to Qt 5. However, to
make a project that uses Qt 5 use Qt 6, you have to be aware of a few
differences and issues that are discussed in this topic.
\section1 Font Loader
Projects that were \l{Creating Projects}{created} with \QDS 2.1 use
\c FontLoader in a way that is not supported in Qt 6. Specifically, the
\c name property is read-only in Qt 6. Therefore, you must modify the
\c Constants.qml file to have fonts loaded correctly. You can either
remove the \c FontLoader or switch to using the \c source property
instead of the \c name property.
To remove the \c FontLoader, delete the following line from the
\c Constants.qml file:
\code
readonly property FontLoader mySystemFont: FontLoader { name: "Arial" }
\endcode
Then, remove the following lines that contain references to mySystemFont:
\code
readonly property font font: Qt.font({
family: mySystemFont.name,
pixelSize: Qt.application.font.pixelSize
})
readonly property font largeFont: Qt.font({
family: mySystemFont.name,
pixelSize: Qt.application.font.pixelSize * 1.6
})
\endcode
Alternatively, you can keep the \c FontLoader and use the \c source property
instead of the \c name property. If you are unsure about how to do this, you
can replace the \c Constants.qmlfile with a new one that you create by
using \QDS 2.2.
\section1 Qt Quick Studio Components
\l{Summary of Shapes}{Qt Quick Studio Components} are available in Qt 6,
except for the \l {Iso Icon} component. It specifies an icon from an
ISO 7000 icon library as a \l [QtQuickExtras] {Picture} component, which
is not supported in Qt 6. Therefore, Iso Icon is also not supported in Qt 6.
\section1 Qt Quick Studio Effects
\l{2D Effects} are only partially supported. The following 2D effects are
not available in Qt 6:
\list
\li Blend
\li Inner Shadow
\li Blur effects except:
\list
\li DirectionalBlur
\li FastBlur
\li GaussianBlur
\li MaskedBlur
\li RecursiveBlur
\li RadialBlur
\li ZoomBlur
\endlist
\endlist
Substitutes are provided for the obsolete effects to keep Qt 5 based
applications working, but the effects will not be rendered as expected.
\section1 Qt Quick 3D
In Qt 6, you cannot use the import \c {import QtQuick3D 1.15}, which
imports a Qt 5 based Qt Quick 3D module. Qt 6 does not require a version
for imports, and therefore it is not used by default. To turn a Qt 5 based
project into a Qt 6 based project, you have to adjust the imports in all
\c .qml files that use Qt Quick 3D by removing the version numbers.
For more information about changes in Qt Quick 3D, see the
\l{https://doc-snapshots.qt.io/qt6-dev/qtquick3d-changes-qt6.html}
{changes file}.
\section1 QML
For general information about changes in QML between Qt 5 and Qt 6, see:
\list
\li \l{https://doc.qt.io/qt-6/obsoleteqmltypes.html}{Obsolete types}
\li \l{https://doc.qt.io/qt-6/quick-changes-qt6.html}{Changes in Qt Quick}
\endlist
The most notable change is that Qt 6 does not require a version for
imports anymore.
\section1 \QDS
Projects that support only Qt 6 are marked with \c {qt6Project: true} in
the \c .qmlproject file. This line is added if you choose \uicontrol {Qt 6}
in the wizard when creating the project. If the project file does not
contain this line, the project will use Qt 5 and a Qt 5 kit by default.
You can change this in the project \uicontrol {Run Settings}, where you
can select \uicontrol {Qt 6} instead.
Projects that use Qt 6 specific features will not work with Qt 5.This
means that projects that are supposed to work with both Qt 5 and Qt 6
require versions for their imports.
Therefore, if you want to use Qt Quick 3D, using the same project with Qt 5
and Qt 6 is not possible.
*/

View File

@@ -33,25 +33,40 @@
\title Custom Shaders \title Custom Shaders
You can use the 3D shader utilities and commands available in \l Library You can use the 3D shader utilities and commands available in \l Library
> \uicontrol Components > \uicontrol QtQuick3D > \uicontrol > \uicontrol Components > \uicontrol {Qt Quick 3D} >
{Custom Shader Utils} to create your own effects and materials. \uicontrol {Qt Quick 3D Custom Shader Utilities} to create your own effects
and materials.
\image studio-qtquick-3d-shader-utilities.png
Additional 3D shader utilities include the \uicontrol Effect, which you can
find in \uicontrol Library > \uicontrol {QtQuick3D Effects} > \uicontrol
{Qt Quick 3D Custom Shader Utils}, and \uicontrol {Custom Material},
available in \uicontrol Library > \uicontrol {QtQuick3D Materials} >
\uicontrol {Qt Quick 3D Custom Shader Utils}.
\image studio-qtquick-3d-shader-effect.png
\image studio-qtquick-3d-shader-custom-material.png
If the custom shader utilities are not displayed in \uicontrol Library, add If the custom shader utilities are not displayed in \uicontrol Library, add
the \uicontrol QtQuick3D module to your project, as described in the \uicontrol QtQuick3D module to your project, as described in
\l {Adding and Removing Modules}. \l {Adding and Removing Modules}.
For more information on using the shaders, see \note If you select \uicontrol {Qt 5} as the \uicontrol {Target Qt Version}
when \l {Creating Projects}{creating your project}, the available custom
shader utilities and their properties will be slightly different, and some
of the components can be found in different locations in \uicontrol Library.
\image studio-qtquick-3d-shader-utilities.png "Custom shader utilities in Library"
You can find additional shader utilities, the \uicontrol Effect and
\uicontrol {Custom Material} components, in \uicontrol Library >
\uicontrol Components > \uicontrol {Qt Quick3D} > \uicontrol {Qt Quick 3D}.
\image studio-qtquick-3d-components.png "Effect and Custom Material Components in Library"
\note In Qt 5 the \uicontrol Effect component is located in
\uicontrol {Qt Quick 3D Effects} >
\uicontrol {Qt Quick 3D Custom Shader Utilities}. To use the
\uicontrol Effect component, add the \uicontrol QtQuick3D.Effects module to
your project.
\note In Qt 5 the \uicontrol {Custom Material} component can be found in
\uicontrol {Qt Quick 3D Materials} >
\uicontrol {Qt Quick 3D Custom Shader Utilities}. To use the
\uicontrol {Custom Material} component, add the
\uicontrol QtQuick3D.Materials module to your project.
For more information about using the shaders, see
\l {Custom Effects and Materials}. \l {Custom Effects and Materials}.
See the following tables for available shader utilities and commands. See the following tables for available shader utilities and commands.
@@ -60,125 +75,210 @@
\table \table
\header \header
\li Custom Shader \li Custom Shader
\li Qt 5 Only
\li Description \li Description
\row \row
\li \l Buffer \li \l Buffer
\li A buffer to be used for a pass of a Custom Material or an Effect. \li
\li A buffer to be used for a pass of \uicontrol {Custom Material}
or \uicontrol Effect instances.
Specify attributes for the buffer by defining the \uicontrol Name The \uicontrol Name property identifies the \uicontrol Buffer
and \uicontrol Format and \uicontrol {Allocation Flags} properties. instance. When the value of this property is empty, the buffer will
refer to the default output texture of the render pass instead of
allocating a buffer. This can be useful to override certain settings
of the output, such as the texture format, without introducing a new,
separate intermediate texture.
The \uicontrol Format property specifies the format of the buffer.
The \uicontrol Filter property specifies the filter operation when a The \uicontrol Filter property specifies the filter operation when a
render pass is reading the buffer that differs in size in comparison render pass is reading a buffer that differs in size in comparison
to the current output buffer. to the current output buffer.
The \uicontrol {Coordinate Operation} property specifies the texture The \uicontrol {Coordinate operation} property specifies the texture
coordinate operation for coordinates outside [0, 1] range. coordinate operation for coordinates outside [0, 1] range.
Select the \uicontrol ClampToEdge operation to clamp coordinates to
edges. The \uicontrol Repeat operation wraps the coordinates at the
edges to tile the texture, while \uicontrol MirroredRepeat also
mirrors every other repeat of the texture while tiling it.
You can also specify the \uicontrol {Size Multiplier} of the buffer. The \uicontrol {Allocation flags} property defines allocation flags
Value of 1.0 creates buffer with the same size while 0.5 creates for the \uicontrol Buffer instance. Select \uicontrol SceneLifeTime
buffer with width and height halved. to allocate the buffer for the whole lifetime of the scene.
\uicontrol {Size multiplier} specifies the size of the
\uicontrol Buffer instance. Value of 1.0 creates a buffer with the
same size, while 0.5 creates a buffer with width and height halved.
\row \row
\li \l {CustomMaterial} {Custom Material} \li \l {CustomMaterial} {Custom Material}
\li
\li The base component for creating custom materials used to shade \li The base component for creating custom materials used to shade
models. model instances.
The \uicontrol {Shading mode} property specifies whether the material
is \uicontrol Shaded or \uicontrol Unshaded.
The \uicontrol {Vertex shader} and \uicontrol {Fragment shader}
properties define the vertex and fragment shader files for the
material. Select the shader files from the dropdown menus. You can
select \inlineimage icons/add-file-16px.png
to add new shader files to the dropdown menus.
The \uicontrol {Source blend} and \uicontrol {Destination blend}
properties specify the source and destination blend factors.
The \uicontrol {Always dirty} property determines whether the
material is refreshed every time it is used.
The \uicontrol {Line Width} property defines the width of the lines
when the geometry is using lines or line strips.
Specify the attributes of the \uicontrol {Custom Material} by Specify the attributes of the \uicontrol {Custom Material} by
defining the \uicontrol Transparency, \uicontrol Refraction and defining the \uicontrol Transparency, \uicontrol Refraction and
\uicontrol {Always Dirty} properties. The \uicontrol Passes property \uicontrol {Always dirty} properties.
contains a list of render passes implemented by the material.
The \uicontrol {Shader Info} specifies the shader info of the The \uicontrol {Shader Info} specifies the shader info of the
material. For more information, see material. For more information, see \l {Custom Effects and Materials}.
\l {Custom Effects and Materials}.
\note In Qt 5 you can also define render passes for
\uicontrol {Custom Material} instances by using the
\uicontrol Passes property, which lists render passes implemented
by the material.
\row \row
\li \l Effect \li \l Effect
\li
\li A base component for creating post-processing effects. \li A base component for creating post-processing effects.
The \uicontrol Passes property contains a list of render passes The \uicontrol Passes property contains a list of render passes
implemented by the effect. For more information, see implemented by the effect. You can add more entry fields to the list
\l {Custom Effects and Materials}. by selecting \inlineimage plus.png
. For more information, see \l {Custom Effects and Materials}.
\row \row
\li \l Pass \li \l Pass
\li A render pass in a Custom Material or an Effect. \li
\li A render pass of an \uicontrol Effect instance. In Qt 5 you can also
use render passes for \uicontrol {Custom Materials}.
The \uicontrol Commands property specifies the list of render The \uicontrol Commands property specifies the list of render
commands of the pass. You can further define a render pass by using commands for the \uicontrol Pass instance, while the
the \uicontrol Buffer and \uicontrol Shaders properties. \uicontrol Shaders property lists the shaders for it. Use the
dropdown menus to select the render commands and shader files of
your choice.
The \uicontrol Buffer property specifies an output buffer for the
\uicontrol Pass instance.
\row \row
\li \l Shader \li \l Shader
\li A container component for defining shader code used by Custom \li
Materials and Effects. \li A container component for defining shader code used by
\uicontrol Effect instances.
Define the \uicontrol Shader attributes by specifying the The \uicontrol Source property specifies the shader file to be used
\uicontrol Source and \uicontrol Stage properties. by the \uicontrol Shader instance, and the \uicontrol Stage property
defines a \uicontrol Vertex or \uicontrol Fragment stage for it.
\note In Qt 5 you can also set the \uicontrol Stage property to
\uicontrol Shared, \uicontrol Geometry, or \uicontrol Compute.
\row \row
\li \l {ShaderInfo} {Shader Info} \li \l {ShaderInfo} {Shader Info}
\li \inlineimage ok.png
\li Basic information about custom shader code for Custom Materials. \li Basic information about custom shader code for Custom Materials.
The \uicontrol Version property specifies the shader code version, The \uicontrol Version property specifies the shader code version,
while the \uicontrol Type property defines the shader code type. while the \uicontrol Type property defines the shader code type.
The \uicontrol Key property specifies the options used by the shader The \uicontrol Key property specifies the options used by the shader
using the combination of shader key values, such as diffuse or using the combination of shader key values, such as diffuse or
specular lighting, refraction, transparency, displacement, specular lighting, refraction, transparency, displacement,
transmissiveness, glossiness, and alpha cutout. transmissiveness, glossiness, and alpha cutout.
The \uicontrol Key property specifies the options used by the shader
using the combination of shader key values. Use the dropdown list
to select the one of available shader keys:
\list
\li The \uicontrol Diffuse shader key applies diffuse lighting
and \uicontrol Specular applies specular lighting to the
shader instance.
\li The \uicontrol Cutout shader key applies alpha cutout to
the shader instance.
\li The \uicontrol Refraction shader key applies refraction to
the shader instance, while using the \uicontrol Transparent
key applies transparency to the shader instance.
\li The \uicontrol Displace shader key applies displacement
mapping to the shader instance.
\li The \uicontrol Transmissive shader key applies
transmissiveness to the shader instance.
\li The \uicontrol Glossy shader key applies glossiness to the
shader instance by default. This shader key is a combination
of \uicontrol Diffuse and \uicontrol Specular keys.
\endlist
\row \row
\li \l {TextureInput} {Texture Input} \li \l {TextureInput} {Texture Input}
\li A texture channel for a Custom Material or an Effect. \li
\li A texture channel for \uicontrol {Custom Material} and Effect
The \uicontrol Texture property specifies the texture to input, while instances.
the \uicontrol Enabled determines whether the texture is enabled.
The \uicontrol Texture property specifies the texture to input,
while \uicontrol Enabled determines whether the texture is
enabled.
In \uicontrol Effect instances, setting \uicontrol Enabled
to \uicontrol false causes the shaders to sample a dummy, opaque
black texture instead of the one specified by texture.
\endtable \endtable
\section1 Available Custom Shader Commands \section1 Available Custom Shader Commands
\table \table
\header \header
\li Command \li Command
\li Qt 5 Only
\li Description \li Description
\row \row
\li \l Blending \li \l Blending
\li \inlineimage ok.png
\li A pass command that specifies the source blending function. \li A pass command that specifies the source blending function.
Use the \uicontrol Source and \uicontrol Destination to further The \uicontrol Source property specifies the source blending
define the function. function, while the \uicontrol Destination property specifies the
destination for it.
\row \row
\li \l {BufferBlit} {Buffer Blit} \li \l {BufferBlit} {Buffer Blit}
\li \inlineimage ok.png
\li A copy operation between two buffers in a pass of a Custom Material \li A copy operation between two buffers in a pass of a Custom Material
or an Effect. or an Effect.
Define the source and the destination buffer of the copy-operation The \uicontrol Source and \uicontrol Destination specify the source
by using the \uicontrol Source and \uicontrol Destination and the destination buffers for the copy-operation.
properties.
\row \row
\li \l {BufferInput} {Buffer Input} \li \l {BufferInput} {Buffer Input}
\li
\li An input buffer to be used for a pass of a Custom Material or an \li An input buffer to be used for a pass of a Custom Material or an
Effect. Effect.
The \uicontrol Buffer property specifies the buffer used for the The \uicontrol Buffer property specifies the input buffer for an
parameter. The \uicontrol Parameter specifies the name of the input instance of the \uicontrol Pass instance. The \uicontrol Parameter
parameter in the shader. specifies the name of the input parameter in the shader.
\row \row
\li \l {CullMode} {Cull Mode} \li \l {CullMode} {Cull Mode}
\li \inlineimage ok.png
\li A culling mode for a render pass. \li A culling mode for a render pass.
The \uicontrol Mode specifies the culling mode in a pass when the The \uicontrol Mode property specifies the culling mode in a pass
\uicontrol {State} property of the \uicontrol {Render State} is when the \uicontrol {State} property of the \uicontrol {Render State}
set to \uicontrol CullFace. is set to \uicontrol CullFace. Use the dropdown menu to set the
culling mode to \uicontrol BackFaceCulling,
\uicontrol FrontFaceCulling, or \uicontrol NoCulling.
\row \row
\li \l {DepthInput} {Depth Input} \li \l {DepthInput} {Depth Input}
\li \inlineimage ok.png
\li An output texture for the depth buffer. \li An output texture for the depth buffer.
The \uicontrol Parameter property specifies the name of the texture The \uicontrol Parameter property specifies the name of the texture
@@ -186,14 +286,23 @@
\row \row
\li \l {RenderState} {Render State} \li \l {RenderState} {Render State}
\li The render state to be enabled or disabled in a pass of a Custom \li \inlineimage ok.png
Material or an Effect. \li The render state to be enabled or disabled in a pass of a
\uicontrol {Custom Material} or an \uicontrol Effect instance.
The \uicontrol State property specifies the render state to The \uicontrol State property specifies the render state to
enable or disable in a pass. enable or disable in a pass. Use the dropdown menu to set the
\uicontrol State to \uicontrol Blend, \uicontrol CullFace,
\uicontrol DepthTest, \uicontrol StencilTest,
\uicontrol ScissorTest, \uicontrol DepthWrite, or
\uicontrol Multisample.
The \uicontrol Enabled property defines the \uicontrol Enable state
for the \uicontrol {Render State}.
\row \row
\li \l {SetUniformValue} {Set Uniform Value} \li \l {SetUniformValue} {Set Uniform Value}
\li
\li A value to be set during a single pass. \li A value to be set during a single pass.
The \uicontrol Target property specifies the name of the uniform The \uicontrol Target property specifies the name of the uniform

View File

@@ -38,10 +38,14 @@
\uicontrol {Qt Quick 3D Effects} to a \uicontrol View3D component in \uicontrol {Qt Quick 3D Effects} to a \uicontrol View3D component in
\l Navigator. \l Navigator.
You can use the \l Effect component available in \uicontrol You can use the \l Effect component available in \uicontrol Library >
{Qt Quick 3D Effects} > \uicontrol {Custom Shader Utils} as the base \uicontrol {Qt Quick 3D} > \uicontrol {Qt Quick 3D} as the base
component for creating custom post-processing effects. For more information, component for creating custom post-processing effects. For more information,
see \l {Custom Effects and Materials} and \l {Custom Shaders}. see \l {Custom Effects and Materials} and \l {Custom Shaders}.
\note In \uicontrol {Qt 5}, the \uicontrol Effect component is located
in \uicontrol {Qt Quick 3D Effects} >
\uicontrol {Qt Quick 3D Custom Shader Utilities}.
You can apply multiple effects to a scene. Select the \uicontrol You can apply multiple effects to a scene. Select the \uicontrol
{Scene Environment} component in \uicontrol Navigator to view the applied {Scene Environment} component in \uicontrol Navigator to view the applied

View File

@@ -0,0 +1,51 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Design Studio documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/
/*!
\page studio-3d-group.html
\previouspage studio-3d-node.html
\nextpage studio-3d-instancing.html
\title Group
The \uicontrol Group component is a \l Node component that can be
used to wrap other objects for the purpose of grouping them. This allows you
to transform and set the opacity and visibility of multiple 3D components in
the \l Properties view simultaneously.
To add a \uicontrol Group component
to your scene, drag-and-drop it from \l Library > \uicontrol Components >
\uicontrol {Qt Quick 3D} > \uicontrol {Qt Quick 3D} to the \l {3D Editor}
view or to \l Navigator > \uicontrol View3D > \uicontrol {Scene Environment}
> \uicontrol Scene.
If the \uicontrol Group component is not displayed in
\uicontrol Library, you should add the \uicontrol {Qt Quick 3D} module to
your project, as described in \l {Adding and Removing Modules}.
Select the \uicontrol Group component in \uicontrol Navigator to modify
\uicontrol Node properties for its child components in the
\uicontrol Properties view.
*/

View File

@@ -25,7 +25,7 @@
/*! /*!
\page studio-3d-instancing.html \page studio-3d-instancing.html
\previouspage studio-3d-node.html \previouspage studio-3d-group.html
\nextpage studio-skeletal-components.html \nextpage studio-skeletal-components.html
\title Instanced Rendering \title Instanced Rendering

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2020 The Qt Company Ltd. ** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Design Studio documentation. ** This file is part of the Qt Design Studio documentation.
@@ -25,27 +25,22 @@
/*! /*!
\page studio-3d-node.html \page studio-3d-node.html
\previouspage quick-animations.html \previouspage studio-3d-view.html
\nextpage studio-3d-instancing.html \nextpage studio-3d-group.html
\title Group \title Node
The \uicontrol Group component is a \uicontrol Node component that can be You can set properties for 3D components that are based on the
used to wrap other objects for the purpose of grouping them. This allows you \uicontrol Node component in \uicontrol Properties > \uicontrol Node
to transform and set the opacity and visibility of multiple 3D components in and \uicontrol Transform.
the \l Properties view simultaneously. To add a \uicontrol Group component
to your scene, drag-and-drop it from \l Library > \uicontrol Components >
\uicontrol {Qt Quick 3D} > \uicontrol {Qt Quick 3D} to the \l {3D Editor}
view or to \l Navigator > \uicontrol View3D > \uicontrol {Scene Environment}
> \uicontrol Scene. If the \uicontrol Group component is not displayed in
\uicontrol Library, you should add the \uicontrol {Qt Quick 3D} module to
your project, as described in \l {Adding and Removing Modules}.
Select the \uicontrol Group component in \uicontrol Navigator to modify its
properties in the \uicontrol Properties view.
\section1 Setting Node Opacity and Visibility \section1 Setting Node Opacity and Visibility
You can set the opacity and visibility of 3D components that are based on
the \uicontrol Node component in \uicontrol Properties > \uicontrol Node.
\image studio-3d-properties-node.png "Node properties"
All components have an \uicontrol Opacity value applied to them. The opacity All components have an \uicontrol Opacity value applied to them. The opacity
of 100 makes a component fully opaque, while the opacity of 0 prevents a of 100 makes a component fully opaque, while the opacity of 0 prevents a
component from rendering at all. component from rendering at all.
@@ -61,8 +56,15 @@
show components. It is useful when you want to show a component in a show components. It is useful when you want to show a component in a
particular state, but hide it in another state, for example. particular state, but hide it in another state, for example.
The \uicontrol {Static flags} property is currently not used.
\section1 Managing 3D Transformations \section1 Managing 3D Transformations
You can manage 3D transformations for components that are based on the
\uicontrol Node component in \uicontrol Transform.
\image studio-3d-properties-transform.png "Transform properties"
The value of the \uicontrol Translation property contains the position The value of the \uicontrol Translation property contains the position
translation of the component in the local coordinate space established by translation of the component in the local coordinate space established by
the parent component. The \uicontrol Orientation property specifies whether the parent component. The \uicontrol Orientation property specifies whether

View File

@@ -31,7 +31,7 @@
\title 3D Views \title 3D Views
To create a Qt Quick 3D UI project, we recommend using a \uicontrol To create a Qt Quick 3D UI project, we recommend using a \uicontrol
{Qt Quick 3D Application Template} wizard template that adds the {Qt Quick 3D Application} wizard template that adds the
\l {3D Components}{Qt Quick 3D} components to \l Library > \l {3D Components}{Qt Quick 3D} components to \l Library >
\uicontrol Components and contains a 3D view. A 3D view component includes a \uicontrol Components and contains a 3D view. A 3D view component includes a
\l {Scene Environment}{scene environment} as well as a scene \l {Scene Environment}{scene environment} as well as a scene

View File

@@ -564,10 +564,9 @@ void NodeInstanceServer::setupDefaultDummyData()
qWarning() << error; qWarning() << error;
} }
if (m_dummyContextObject) { if (m_dummyContextObject)
qDebug() << "Loaded default dummy context object.";
m_dummyContextObject->setParent(this); m_dummyContextObject->setParent(this);
}
refreshBindings(); refreshBindings();
} }

View File

@@ -378,7 +378,6 @@ void doComponentCompleteRecursive(QObject *object, NodeInstanceServer *nodeInsta
} }
if (!isQuickStyleItem(item)) { if (!isQuickStyleItem(item)) {
qDebug() << Q_FUNC_INFO << item;
if (item) { if (item) {
static_cast<QQmlParserStatus *>(item)->componentComplete(); static_cast<QQmlParserStatus *>(item)->componentComplete();
} else { } else {

View File

@@ -157,9 +157,13 @@ PropertyEditorPane {
visible: specificsOne.source.toString() !== "" visible: specificsOne.source.toString() !== ""
} }
AdvancedSection {} AdvancedSection {
expanded: false
}
LayerSection {} LayerSection {
expanded: false
}
} }
Column { Column {

View File

@@ -34,9 +34,9 @@ Row {
property string scope: "Text" property string scope: "Text"
property bool blueHighlight: false property bool blueHighlight: false
property variant backendValue: backendValues.horizontalAlignment property variant backendValue: backendValues.horizontalAlignment
property variant value: backendValue.enumeration property variant value: root.backendValue.enumeration
property bool baseStateFlag: isBaseState property bool baseStateFlag: isBaseState
property color __currentColor: blueHighlight ? StudioTheme.Values.themeIconColorInteraction property color __currentColor: root.blueHighlight ? StudioTheme.Values.themeIconColorInteraction
: StudioTheme.Values.themeIconColor : StudioTheme.Values.themeIconColor
onValueChanged: { onValueChanged: {
@@ -45,45 +45,45 @@ Row {
buttonAlignRight.checked = false buttonAlignRight.checked = false
buttonAlignJustify.checked = false buttonAlignJustify.checked = false
if (value !== undefined) { if (root.value !== undefined) {
if (value === "AlignLeft") if (root.value === "AlignLeft")
buttonAlignLeft.checked = true buttonAlignLeft.checked = true
else if (value === "AlignHCenter") else if (root.value === "AlignHCenter")
buttonAlignHCenter.checked = true buttonAlignHCenter.checked = true
else if (value === "AlignRight") else if (root.value === "AlignRight")
buttonAlignRight.checked = true buttonAlignRight.checked = true
else if (value === "AlignJustify") else if (root.value === "AlignJustify")
buttonAlignJustify.checked = true buttonAlignJustify.checked = true
} }
evaluate() root.evaluate()
} }
property bool isInModel: { property bool isInModel: {
if (backendValue !== undefined && backendValue.isInModel !== undefined) if (root.backendValue !== undefined && root.backendValue.isInModel !== undefined)
return backendValue.isInModel return root.backendValue.isInModel
return false return false
} }
onIsInModelChanged: evaluate() onIsInModelChanged: root.evaluate()
property bool isInSubState: { property bool isInSubState: {
if (backendValue !== undefined && backendValue.isInSubState !== undefined) if (root.backendValue !== undefined && root.backendValue.isInSubState !== undefined)
return backendValue.isInSubState return root.backendValue.isInSubState
return false return false
} }
onIsInSubStateChanged: evaluate() onIsInSubStateChanged: root.evaluate()
function evaluate() { function evaluate() {
if (baseStateFlag) { if (root.baseStateFlag) {
if (backendValue !== null && backendValue.isInModel) if (root.backendValue !== null && root.backendValue.isInModel)
blueHighlight = true root.blueHighlight = true
else else
blueHighlight = false root.blueHighlight = false
} else { } else {
if (backendValue !== null && backendValue.isInSubState) if (root.backendValue !== null && root.backendValue.isInSubState)
blueHighlight = true root.blueHighlight = true
else else
blueHighlight = false root.blueHighlight = false
} }
} }
@@ -109,10 +109,10 @@ Row {
checkable: true checkable: true
autoExclusive: true autoExclusive: true
StudioControls.ButtonGroup.group: group StudioControls.ButtonGroup.group: group
iconColor: __currentColor iconColor: root.__currentColor
onClicked: { onClicked: {
if (checked) if (buttonAlignLeft.checked)
backendValue.setEnumeration(root.scope, "AlignLeft") root.backendValue.setEnumeration(root.scope, "AlignLeft")
} }
} }
@@ -122,10 +122,10 @@ Row {
checkable: true checkable: true
autoExclusive: true autoExclusive: true
StudioControls.ButtonGroup.group: group StudioControls.ButtonGroup.group: group
iconColor: __currentColor iconColor: root.__currentColor
onClicked: { onClicked: {
if (checked) if (buttonAlignHCenter.checked)
backendValue.setEnumeration(root.scope, "AlignHCenter") root.backendValue.setEnumeration(root.scope, "AlignHCenter")
} }
} }
@@ -135,10 +135,10 @@ Row {
checkable: true checkable: true
autoExclusive: true autoExclusive: true
StudioControls.ButtonGroup.group: group StudioControls.ButtonGroup.group: group
iconColor: __currentColor iconColor: root.__currentColor
onClicked: { onClicked: {
if (checked) if (buttonAlignRight.checked)
backendValue.setEnumeration(root.scope, "AlignRight") root.backendValue.setEnumeration(root.scope, "AlignRight")
} }
} }
@@ -148,10 +148,10 @@ Row {
checkable: true checkable: true
autoExclusive: true autoExclusive: true
StudioControls.ButtonGroup.group: group StudioControls.ButtonGroup.group: group
iconColor: __currentColor iconColor: root.__currentColor
onClicked: { onClicked: {
if (checked) if (buttonAlignRight.checked)
backendValue.setEnumeration(root.scope, "AlignJustify") root.backendValue.setEnumeration(root.scope, "AlignJustify")
} }
} }
} }

View File

@@ -34,9 +34,9 @@ Row {
property string scope: "Text" property string scope: "Text"
property bool blueHighlight: false property bool blueHighlight: false
property variant backendValue: backendValues.verticalAlignment property variant backendValue: backendValues.verticalAlignment
property variant value: backendValue.enumeration property variant value: root.backendValue.enumeration
property bool baseStateFlag: isBaseState property bool baseStateFlag: isBaseState
property color __currentColor: blueHighlight ? StudioTheme.Values.themeIconColorInteraction property color __currentColor: root.blueHighlight ? StudioTheme.Values.themeIconColorInteraction
: StudioTheme.Values.themeIconColor : StudioTheme.Values.themeIconColor
onValueChanged: { onValueChanged: {
@@ -44,43 +44,43 @@ Row {
buttonAlignVCenter.checked = false buttonAlignVCenter.checked = false
buttonAlignBottom.checked = false buttonAlignBottom.checked = false
if (value !== undefined) { if (root.value !== undefined) {
if (value === "AlignTop") if (root.value === "AlignTop")
buttonAlignTop.checked = true buttonAlignTop.checked = true
else if (value === "AlignVCenter") else if (root.value === "AlignVCenter")
buttonAlignVCenter.checked = true buttonAlignVCenter.checked = true
else if (value === "AlignBottom") else if (root.value === "AlignBottom")
buttonAlignBottom.checked = true buttonAlignBottom.checked = true
} }
evaluate() root.evaluate()
} }
property bool isInModel: { property bool isInModel: {
if (backendValue !== undefined && backendValue.isInModel !== undefined) if (root.backendValue !== undefined && root.backendValue.isInModel !== undefined)
return backendValue.isInModel return root.backendValue.isInModel
return false return false
} }
onIsInModelChanged: evaluate() onIsInModelChanged: root.evaluate()
property bool isInSubState: { property bool isInSubState: {
if (backendValue !== undefined && backendValue.isInSubState !== undefined) if (root.backendValue !== undefined && root.backendValue.isInSubState !== undefined)
return backendValue.isInSubState return root.backendValue.isInSubState
return false return false
} }
onIsInSubStateChanged: evaluate() onIsInSubStateChanged: root.evaluate()
function evaluate() { function evaluate() {
if (baseStateFlag) { if (root.baseStateFlag) {
if (backendValue !== null && backendValue.isInModel) if (root.backendValue !== null && root.backendValue.isInModel)
blueHighlight = true root.blueHighlight = true
else else
blueHighlight = false root.blueHighlight = false
} else { } else {
if (backendValue !== null && backendValue.isInSubState) if (root.backendValue !== null && root.backendValue.isInSubState)
blueHighlight = true root.blueHighlight = true
else else
blueHighlight = false root.blueHighlight = false
} }
} }
@@ -108,10 +108,10 @@ Row {
checkable: true checkable: true
autoExclusive: true autoExclusive: true
StudioControls.ButtonGroup.group: group StudioControls.ButtonGroup.group: group
iconColor: __currentColor iconColor: root.__currentColor
onClicked: { onClicked: {
if (checked) if (buttonAlignTop.checked)
backendValue.setEnumeration(root.scope, "AlignTop") root.backendValue.setEnumeration(root.scope, "AlignTop")
} }
} }
StudioControls.AbstractButton { StudioControls.AbstractButton {
@@ -120,10 +120,10 @@ Row {
checkable: true checkable: true
autoExclusive: true autoExclusive: true
StudioControls.ButtonGroup.group: group StudioControls.ButtonGroup.group: group
iconColor: __currentColor iconColor: root.__currentColor
onClicked: { onClicked: {
if (checked) if (buttonAlignVCenter.checked)
backendValue.setEnumeration(root.scope, "AlignVCenter") root.backendValue.setEnumeration(root.scope, "AlignVCenter")
} }
} }
StudioControls.AbstractButton { StudioControls.AbstractButton {
@@ -132,10 +132,10 @@ Row {
checkable: true checkable: true
autoExclusive: true autoExclusive: true
StudioControls.ButtonGroup.group: group StudioControls.ButtonGroup.group: group
iconColor: __currentColor iconColor: root.__currentColor
onClicked: { onClicked: {
if (checked) if (buttonAlignBottom.checked)
backendValue.setEnumeration(root.scope, "AlignBottom") root.backendValue.setEnumeration(root.scope, "AlignBottom")
} }
} }
} }

View File

@@ -34,46 +34,42 @@ StudioControls.Button {
property variant backendValue property variant backendValue
property bool isHighlighted: false property bool isHighlighted: false
iconColor: isHighlighted ? StudioTheme.Values.themeIconColorInteraction iconColor: button.isHighlighted ? StudioTheme.Values.themeIconColorInteraction
: StudioTheme.Values.themeIconColor : StudioTheme.Values.themeIconColor
actionIndicatorVisible: true actionIndicatorVisible: true
checkable: true checkable: true
QtObject { QtObject {
id: innerObject id: innerObject
function evaluate() { function evaluate() {
if (innerObject.baseStateFlag) { if (innerObject.baseStateFlag) {
if (button.backendValue !== null if (button.backendValue !== null && innerObject.isInModel)
&& innerObject.isInModel) { button.isHighlighted = true
isHighlighted = true else
button.isHighlighted = false
} else { } else {
isHighlighted = false if (button.backendValue !== null && innerObject.isInSubState)
} button.isHighlighted = true
} else { else
if (button.backendValue !== null button.isHighlighted = false
&& innerObject.isInSubState) {
isHighlighted = true
} else {
isHighlighted = false
}
} }
} }
property bool baseStateFlag: isBaseState property bool baseStateFlag: isBaseState
onBaseStateFlagChanged: evaluate() onBaseStateFlagChanged: innerObject.evaluate()
property bool isInModel: button.backendValue === undefined ? false property bool isInModel: button.backendValue === undefined ? false
: button.backendValue.isInModel : button.backendValue.isInModel
onIsInModelChanged: evaluate() onIsInModelChanged: innerObject.evaluate()
property bool isInSubState: button.backendValue === undefined ? false property bool isInSubState: button.backendValue === undefined ? false
: button.backendValue.isInSubState : button.backendValue.isInSubState
onIsInSubStateChanged: evaluate() onIsInSubStateChanged: innerObject.evaluate()
property variant theValue: button.backendValue === undefined ? 0 : button.backendValue.value property variant theValue: button.backendValue === undefined ? 0 : button.backendValue.value
onTheValueChanged: { onTheValueChanged: {
evaluate() innerObject.evaluate()
button.checked = innerObject.theValue button.checked = innerObject.theValue
} }
} }

View File

@@ -48,6 +48,8 @@ Row {
// + StudioTheme.Values.border on width because of negative spacing on the row // + StudioTheme.Values.border on width because of negative spacing on the row
width: actionIndicator.visible ? myButtonRow.__actionIndicatorWidth + StudioTheme.Values.border : 0 width: actionIndicator.visible ? myButtonRow.__actionIndicatorWidth + StudioTheme.Values.border : 0
height: actionIndicator.visible ? myButtonRow.__actionIndicatorHeight : 0 height: actionIndicator.visible ? myButtonRow.__actionIndicatorHeight : 0
onHoverChanged: myButtonRow.hoverCallback()
} }
spacing: -StudioTheme.Values.border spacing: -StudioTheme.Values.border

View File

@@ -25,6 +25,7 @@
#include "cmakespecificsettings.h" #include "cmakespecificsettings.h"
#include <coreplugin/icore.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <utils/layoutbuilder.h> #include <utils/layoutbuilder.h>
@@ -36,6 +37,9 @@ namespace Internal {
CMakeSpecificSettings::CMakeSpecificSettings() CMakeSpecificSettings::CMakeSpecificSettings()
{ {
// TODO: fixup of QTCREATORBUG-26289 , remove in Qt Creator 7 or so
Core::ICore::settings()->remove("CMakeSpecificSettings/NinjaPath");
setSettingsGroup("CMakeSpecificSettings"); setSettingsGroup("CMakeSpecificSettings");
setAutoApply(false); setAutoApply(false);
@@ -51,6 +55,9 @@ CMakeSpecificSettings::CMakeSpecificSettings()
registerAspect(&ninjaPath); registerAspect(&ninjaPath);
ninjaPath.setSettingsKey("NinjaPath"); ninjaPath.setSettingsKey("NinjaPath");
// never save this to the settings:
ninjaPath.setToSettingsTransformation(
[](const QVariant &) { return QVariant::fromValue(QString()); });
registerAspect(&packageManagerAutoSetup); registerAspect(&packageManagerAutoSetup);
packageManagerAutoSetup.setSettingsKey("PackageManagerAutoSetup"); packageManagerAutoSetup.setSettingsKey("PackageManagerAutoSetup");

View File

@@ -551,6 +551,12 @@ void FancyTabWidget::insertTab(int index, QWidget *tab, const QIcon &icon, const
m_tabBar->insertTab(index, icon, label, hasMenu); m_tabBar->insertTab(index, icon, label, hasMenu);
} }
void FancyTabWidget::removeTab(int index)
{
m_modesStack->removeWidget(m_modesStack->widget(index));
m_tabBar->removeTab(index);
}
void FancyTabWidget::setBackgroundBrush(const QBrush &brush) void FancyTabWidget::setBackgroundBrush(const QBrush &brush)
{ {
QPalette pal; QPalette pal;

View File

@@ -109,6 +109,12 @@ public:
updateGeometry(); updateGeometry();
} }
void setEnabled(int index, bool enabled); void setEnabled(int index, bool enabled);
void removeTab(int index)
{
FancyTab *tab = m_tabs.takeAt(index);
delete tab;
updateGeometry();
}
void setCurrentIndex(int index); void setCurrentIndex(int index);
int currentIndex() const { return m_currentIndex; } int currentIndex() const { return m_currentIndex; }
@@ -142,6 +148,7 @@ public:
FancyTabWidget(QWidget *parent = nullptr); FancyTabWidget(QWidget *parent = nullptr);
void insertTab(int index, QWidget *tab, const QIcon &icon, const QString &label, bool hasMenu); void insertTab(int index, QWidget *tab, const QIcon &icon, const QString &label, bool hasMenu);
void removeTab(int index);
void setBackgroundBrush(const QBrush &brush); void setBackgroundBrush(const QBrush &brush);
void addCornerWidget(QWidget *widget); void addCornerWidget(QWidget *widget);
void insertCornerWidget(int pos, QWidget *widget); void insertCornerWidget(int pos, QWidget *widget);

View File

@@ -256,6 +256,21 @@ void ModeManagerPrivate::appendMode(IMode *mode)
QObject::connect(mode, &IMode::enabledStateChanged, [this, mode] { enabledStateChanged(mode); }); QObject::connect(mode, &IMode::enabledStateChanged, [this, mode] { enabledStateChanged(mode); });
} }
void ModeManager::removeMode(IMode *mode)
{
const int index = d->m_modes.indexOf(mode);
if (index >= d->m_modes.size() - 1 && d->m_modes.size() > 1)
d->m_modeStack->setCurrentIndex(d->m_modes.size() - 2);
d->m_modes.remove(index);
if (d->m_startingUp)
return;
d->m_modeCommands.remove(index);
d->m_modeStack->removeTab(index);
d->m_mainWindow->removeContextObject(mode);
}
void ModeManagerPrivate::enabledStateChanged(IMode *mode) void ModeManagerPrivate::enabledStateChanged(IMode *mode)
{ {
int index = d->m_modes.indexOf(mode); int index = d->m_modes.indexOf(mode);

View File

@@ -67,6 +67,8 @@ public:
static void setFocusToCurrentMode(); static void setFocusToCurrentMode();
static Style modeStyle(); static Style modeStyle();
static void removeMode(IMode *mode);
public slots: public slots:
static void setModeStyle(Style layout); static void setModeStyle(Style layout);
static void cycleModeStyle(); static void cycleModeStyle();

View File

@@ -30,6 +30,7 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/theme/theme.h> #include <utils/theme/theme.h>
#include <QEasingCurve>
#include <QHeaderView> #include <QHeaderView>
#include <QHoverEvent> #include <QHoverEvent>
#include <QLayout> #include <QLayout>
@@ -38,6 +39,8 @@
#include <QPixmapCache> #include <QPixmapCache>
#include <QTimer> #include <QTimer>
#include <qdrawutil.h>
namespace Core { namespace Core {
using namespace Utils; using namespace Utils;
@@ -483,6 +486,7 @@ void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
QTextOption wrapped; QTextOption wrapped;
wrapped.setWrapMode(QTextOption::WordWrap); wrapped.setWrapMode(QTextOption::WordWrap);
int offset = 0; int offset = 0;
float animationProgress = 0; // Linear increase from 0.0 to 1.0 during hover animation
if (hovered) { if (hovered) {
if (index != m_previousIndex) { if (index != m_previousIndex) {
m_previousIndex = index; m_previousIndex = index;
@@ -491,9 +495,11 @@ void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
m_currentWidget = qobject_cast<QAbstractItemView *>( m_currentWidget = qobject_cast<QAbstractItemView *>(
const_cast<QWidget *>(option.widget)); const_cast<QWidget *>(option.widget));
} }
offset = m_startTime.elapsed() * GridProxyModel::GridItemHeight / 200; // Duration 200 ms. animationProgress = m_startTime.elapsed() / 200.0; // Duration 200 ms.
static const QEasingCurve animationCurve(QEasingCurve::OutQuad);
offset = animationCurve.valueForProgress(animationProgress) * shiftY;
if (offset < shiftY) if (offset < shiftY)
QTimer::singleShot(5, this, &ListItemDelegate::goon); QTimer::singleShot(10, this, &ListItemDelegate::goon);
else if (offset > shiftY) else if (offset > shiftY)
offset = shiftY; offset = shiftY;
} else { } else {
@@ -504,9 +510,9 @@ void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
const QRect shiftedTextRect = textRect.adjusted(0, -offset, 0, -offset); const QRect shiftedTextRect = textRect.adjusted(0, -offset, 0, -offset);
// The pixmap. // The pixmap.
if (offset == 0) { if (offset < shiftY) {
QPixmap pm = index.data(ListModel::ItemImageRole).value<QPixmap>(); QPixmap pm = index.data(ListModel::ItemImageRole).value<QPixmap>();
QRect inner(x + 11, y - offset, ListModel::defaultImageSize.width(), QRect inner(x + 11, y, ListModel::defaultImageSize.width(),
ListModel::defaultImageSize.height()); ListModel::defaultImageSize.height());
QRect pixmapRect = inner; QRect pixmapRect = inner;
if (!pm.isNull()) { if (!pm.isNull()) {
@@ -527,8 +533,13 @@ void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
painter->setFont(sizedFont(11, option.widget)); painter->setFont(sizedFont(11, option.widget));
painter->drawText(pixmapRect.adjusted(6, 10, -6, -10), item->description, wrapped); painter->drawText(pixmapRect.adjusted(6, 10, -6, -10), item->description, wrapped);
} }
painter->setPen(foregroundColor1); qDrawPlainRect(painter, pixmapRect.translated(-1, -1), foregroundColor1);
painter->drawRect(pixmapRect.adjusted(-1, -1, -1, -1)); }
// The description background rect
if (offset) {
QRect backgroundRect = shiftedTextRect.adjusted(0, -16, 0, 0);
painter->fillRect(backgroundRect, backgroundColor);
} }
// The title of the example. // The title of the example.
@@ -548,6 +559,7 @@ void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
if (offset) { if (offset) {
int ll = nameRect.bottom() + 5; int ll = nameRect.bottom() + 5;
painter->setPen(lightColor); painter->setPen(lightColor);
painter->setOpacity(animationProgress); // "fade in" separator line and description
painter->drawLine(x, ll, x + w, ll); painter->drawLine(x, ll, x + w, ll);
} }
@@ -558,6 +570,7 @@ void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
painter->setPen(foregroundColor2); painter->setPen(foregroundColor2);
painter->setFont(sizedFont(11, option.widget)); painter->setFont(sizedFont(11, option.widget));
painter->drawText(descRect, item->description, wrapped); painter->drawText(descRect, item->description, wrapped);
painter->setOpacity(1);
} }
// Separator line between text and 'Tags:' section // Separator line between text and 'Tags:' section
@@ -591,11 +604,8 @@ void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
} }
// Box it when hovered. // Box it when hovered.
if (hovered) { if (hovered)
painter->setPen(lightColor); qDrawPlainRect(painter, rc, lightColor);
painter->drawRect(rc.adjusted(0, 0, -1, -1));
}
} }
bool ListItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, bool ListItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,

View File

@@ -4469,10 +4469,16 @@ void GdbEngine::setupInferior()
? QString("Going to attach to %1 (%2)").arg(attachedPID).arg(attachedMainThreadID) ? QString("Going to attach to %1 (%2)").arg(attachedPID).arg(attachedMainThreadID)
: QString("Going to attach to %1").arg(attachedPID); : QString("Going to attach to %1").arg(attachedPID);
showMessage(msg, LogMisc); showMessage(msg, LogMisc);
// For some reason, this breaks GDB 9 on Linux. See QTCREATORBUG-26299.
if (HostOsInfo::isWindowsHost() && m_gdbVersion >= 100000) {
// Required for debugging MinGW32 apps with 64-bit GDB. See QTCREATORBUG-26208.
const QString executable const QString executable
= runParameters().inferior.command.executable().toFileInfo().absoluteFilePath(); = runParameters().inferior.command.executable().toFileInfo().absoluteFilePath();
runCommand({"-file-exec-and-symbols \"" + executable + '"', runCommand({"-file-exec-and-symbols \"" + executable + '"',
CB(handleFileExecAndSymbols)}); CB(handleFileExecAndSymbols)});
} else {
handleInferiorPrepared();
}
} else if (isPlainEngine()) { } else if (isPlainEngine()) {
setEnvironmentVariables(); setEnvironmentVariables();