Merge remote-tracking branch 'origin/4.13' into master

Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: Ibb60b8a7ac531b239bb9c490da843d5cc1a6300a
This commit is contained in:
Eike Ziller
2020-08-14 13:31:05 +02:00
37 changed files with 504 additions and 566 deletions

View File

@@ -1,138 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2020 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.12
import QtQuick.Controls 2.5
Page {
id: page
width: 600
height: 400
property alias mouseArea2: mouseArea2
property alias mouseArea1: mouseArea1
property alias mouseArea: mouseArea
property alias icon: icon
property alias bottomLeftRect: bottomLeftRect
property alias middleRightRect: middleRightRect
property alias topLeftRect: topLeftRect
header: Label {
text: qsTr("Page 1")
font.pixelSize: Qt.application.font.pixelSize * 2
padding: 10
}
Image {
id: icon
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.leftMargin: 10
anchors.top: parent.top
anchors.topMargin: 20
MouseArea {
id: mouseArea
anchors.fill: parent
}
}
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
}
}
Rectangle {
id: bottomLeftRect
width: 55
height: 41
color: "#00000000"
border.color: "#808080"
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
anchors.left: parent.left
anchors.leftMargin: 10
MouseArea {
id: mouseArea2
anchors.fill: parent
}
}
NumberAnimation {
id: numberAnimation
}
}
/*##^##
Designer {
D{i:0;formeditorZoom:0.75}D{i:4;anchors_height:100;anchors_width:100}D{i:6;anchors_height:100;anchors_width:100}
D{i:8;anchors_height:100;anchors_width:100}
}
##^##*/

View File

@@ -1,67 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2020 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.12
import QtQuick.Controls 2.5
Page {
width: 600
height: 400
header: Label {
text: qsTr("Page 2")
font.pixelSize: Qt.application.font.pixelSize * 2
padding: 10
}
Label {
text: qsTr("You are on Page 2.")
anchors.centerIn: parent
}
}

View File

@@ -1,63 +1,9 @@
/****************************************************************************
**
** Copyright (C) 2020 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 <QQmlApplicationEngine>
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"));
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
}
QGuiApplication app(argc, argv);

View File

@@ -1,141 +1,214 @@
/****************************************************************************
**
** Copyright (C) 2020 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.12
import QtQuick.Controls 2.5
import QtQuick 2.14
ApplicationWindow {
visible: true
Rectangle {
id: page
width: 640
height: 480
title: qsTr("Tabs")
visible: true
border.color: "#808080"
state: "State1"
SwipeView {
id: swipeView
Image {
id: icon
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
currentIndex: tabBar.currentIndex
Page1Form {
id: page
mouseArea {
onClicked: stateGroup.state = ' '
Connections {
target: mouseArea
onClicked: page.state = "State1"
}
mouseArea1 {
onClicked: stateGroup.state = 'State1'
}
mouseArea2 {
onClicked: stateGroup.state = 'State2'
}
}
Page2Form {
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"
}
}
}
StateGroup {
id: stateGroup
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: page.icon
x: page.middleRightRect.x
y: page.middleRightRect.y
target: icon
x: 10
y: 20
}
},
State {
name: "State2"
PropertyChanges {
target: page.icon
x: page.bottomLeftRect.x
y: page.bottomLeftRect.y
target: icon
x: 575
y: 219
}
},
State {
name: "State3"
PropertyChanges {
target: icon
x: 10
y: 419
}
}
]
transitions: [
Transition {
from: "*"; to: "State1"
NumberAnimation {
easing.type: Easing.OutBounce
properties: "x,y";
duration: 1000
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 {
from: "*"; to: "State2"
NumberAnimation {
properties: "x,y";
easing.type: Easing.InOutQuad;
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
}
},
Transition {
NumberAnimation {
properties: "x,y";
duration: 200
}
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"
}
]
}
footer: TabBar {
id: tabBar
currentIndex: swipeView.currentIndex
TabButton {
text: qsTr("Page 1")
}
TabButton {
text: qsTr("Page 2")
}
}
/*##^##
Designer {
D{i:0;formeditorZoom:0.6600000262260437}D{i:17;transitionDuration:2000}D{i:25;transitionDuration:2000}
D{i:33;transitionDuration:2000}
}
##^##*/

View File

@@ -1,10 +1,6 @@
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>Page1Form.ui.qml</file>
<file>Page2Form.ui.qml</file>
<file>main.qml</file>
<file>qtquickcontrols2.conf</file>
<file>qt-logo.png</file>
</qresource>
</RCC>

View File

@@ -1,6 +0,0 @@
; This file can be edited to change the style of the application
; Read "Qt Quick Controls 2 Configuration File" for details:
; http://doc.qt.io/qt-5/qtquickcontrols2-configuration.html
[Controls]
Style=Default

View File

@@ -2,15 +2,8 @@ QT += quick
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Refer to the documentation for the
# deprecated API to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if it uses deprecated APIs.
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
@@ -28,5 +21,3 @@ QML_DESIGNER_IMPORT_PATH =
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
DISTFILES +=

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -23,12 +23,6 @@
**
****************************************************************************/
// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************
/*!
\previouspage creator-tutorials.html
\example transitions
@@ -40,7 +34,6 @@
\l{Qt Quick}.
For more information about the UI choices you have, see \l{User Interfaces}.
This tutorial describes how to use \QC to implement Qt Quick states and
transitions. We create an application that displays a Qt logo that moves
between three rectangles on the page when you click them.
@@ -52,39 +45,45 @@
For examples of using Qt Quick Controls, see \l{Qt Quick Controls Examples}.
\include creator-tutorial-create-qq-project.qdocinc qt quick application
\include qtquick-tutorial-create-empty-project.qdocinc qtquick empty application
\QC generates a QML file, \e main.qml, and opens it in
\uicontrol {Text Editor}. The wizard template uses the \l Window type,
which does not support adding states. Because we want to use states in
this example, we first replace the Window type with a \l Rectangle type.
We must also remove the line that sets the \c title property, which the
Rectangle type does not have. If you change the value of the
\uicontrol Type property in the \uicontrol Properties view, \QC offers
to automatically remove the \c title property.
\section1 Creating the Main View
The main view of the application displays a Qt logo in the top left corner
of the view and two empty rectangles.
The main view of the application displays a Qt logo inside a rectangle in
the top left corner of the view and two empty rectangles.
To use the \e qt-logo.png image in your application, you must copy it from
the Qt examples directory to the project directory (same subdirectory as
the QML file). The image appears in \uicontrol Assets. 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 QML type, instead.
\note If a view is hidden, you can show it by selecting \uicontrol View >
\uicontrol Views.
\list 1
\li In the \uicontrol Projects view, double-click the \e Page1Form.ui.qml
file to open it in the Design mode.
\li Select \uicontrol Rectangle in \uicontrol Navigator, and enter
\e page in the \uicontrol Id field in the \uicontrol Properties
view.
\image qmldesigner-tutorial-design-mode.png "Transitions project in Design Mode"
\li Select \uicontrol Library > \uicontrol Assets >
\uicontrol {Add New Assets} to locate qt-logo.png (or your own
image) and add it to the project folder.
\note If a view is hidden, you can show it by selecting
\uicontrol View > \uicontrol Views.
\li In the \uicontrol Navigator, select \uicontrol Label and press
\key Delete to delete it.
\li Select \uicontrol Page in \uicontrol Navigator, and enter \e page in
the \uicontrol Id field in the \uicontrol Properties view.
\li In \uicontrol Library > \uicontrol Assets, select qt-logo.png and
drag and drop it to the \e page in \uicontrol Navigator.
\li Drag and drop the image from \uicontrol Assets to \e page in
\uicontrol Navigator.
\image qmldesigner-tutorial-user-icon.png "Image properties"
\li In \uicontrol Properties, edit image properties:
\list a
\li In the \uicontrol Id field, enter \e icon.
@@ -94,17 +93,14 @@
\endlist
\li In the \uicontrol Projects view, right-click the resource file,
qml.qrc, and select \uicontrol {Add Existing File} to add
qt-logo.png to the resource file for deployment.
\li In \uicontrol Library > \uicontrol {QML Types} >
\uicontrol {Qt Quick - Basic}, select \uicontrol Rectangle,
drag and drop it to \e page in \uicontrol Navigator, and
edit its properties in the \uicontrol Properties view.
\uicontrol {Qt Quick - Basic}, select \uicontrol Rectangle and
drag and drop it to \e page in \uicontrol Navigator.
\image qmldesigner-tutorial-topleftrect.png "Rectangle properties"
\li In \uicontrol Properties, edit rectangle properties:
\list a
\li In the \uicontrol Id field, enter \e topLeftRect.
@@ -118,8 +114,9 @@
(\uicontrol Transparent) button to make the rectangle
transparent.
\li In the \uicontrol {Border color} field, set the border color to
\e #808080.
\li In the \uicontrol {Border color} field, set the border
color to \e #808080 to make the rectangle visible on
the white background.
\li Click \uicontrol {Layout}, and then click the
\inlineimage anchor-top.png
@@ -182,130 +179,133 @@
\endlist
\li In the \uicontrol Navigator, select the
\inlineimage export_unchecked.png
(\uicontrol Export) button for each type to export all types as
properties. This enables you to use the properties in the
\e main.qml file.
\li Press \key {Ctrl+S} to save the changes.
\endlist
To check your code, you can view your \e {Page1Form.ui.qml} file in the
\uicontrol {Text Editor} and compare it with the \e {Page1Form.ui.qml}
To check your code, you can view your \e {main.qml} file in the
\uicontrol {Text Editor} and compare it with the \e {main.qml}
example file.
The new project wizard adds boilerplate code to the \e Page1.qml file to
create menu items and push buttons. Modify the boilerplate code by removing
obsolete code. You removed the push buttons from the
UI form, so you also need to remove the corresponding code from
\e Page1.qml (or the application cannot be built).
The UI is now ready and you can switch to editing the \e main.qml file in
the \uicontrol {Text Editor} to add animation to the application, as described
in the following section.
The UI design is now ready.
\image qmldesigner-tutorial-ui-ready.png "Transitions UI"
\section1 Adding Application Logic
For more information about the views you used, see:
Edit the \e main.qml file to add pointers to two additional states: \e State1
and \e State2. You cannot use the \uicontrol {Form Editor} to add states for
a Window QML type. Use the \uicontrol {Text Editor} to add the states inside
a StateGroup QML type and refer to them by using the id of the state group.
\list
\li \l{Creating Components}
\li \l{Managing Item Hierarchy}
\li \l{Specifying Item Properties}
\endlist
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.
\section1 Connecting Mouse Clicks to State Changes
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
\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.
To make sure that the image is displayed within the rectangle when the view
is scaled on different sizes of screens, we bind the values of the \c x and
\c y properties of \e icon to those of the rectangles.
\list 1
\li Specify an id for the Page1 type to be able to use the properties
that you exported in \e Page1Form.ui.qml:
\quotefromfile transitions/main.qml
\skipto ApplicationWindow
\printuntil page
\li Add a pointer to the clicked expressions in \uicontrol mouseArea:
\printuntil }
The expression sets the state to the base state and returns the
image to its initial position.
\li Add a pointer to a clicked expression to \uicontrol mouseArea1
to set the state to \e State1:
\printuntil }
\li Add a pointer to a clicked expression to \uicontrol mouseArea2 to
set the state to \e State2:
\printuntil }
\printuntil }
\li Bind the position of the Qt logo to the
rectangle to make sure that the logo is displayed within the
rectangle when the view is scaled on different sizes of screens. Set
expressions for the x and y properties, as illustrated by the
following code snippet:
\skipto StateGroup
\printuntil ]
\li In the \uicontrol States view, click the \inlineimage plus.png
button three times to create \e State1, \e State2, and \e State3.
\li Select \e State1 in \uicontrol States.
\li Select \inlineimage icons/action-icon.png
to open the \uicontrol Actions menu, and then select
\uicontrol {Set as Default} to display \e State1 when
the application starts.
\li Select \e State2 in \uicontrol States.
\li Select \e icon in \uicontrol Navigator and drag it on top of the
middle left rectangle in \uicontrol {Form Editor}. This changes the
\c x and \c y property values of \e icon to match those of
\e middleRightRect in \e State2.
\image qmldesigner-tutorial-states.png "States view"
\li Select \e State3 in \uicontrol States, and drag \e icon on top of
the bottom left rectangle in \uicontrol {Form Editor}.
\li In the \uicontrol Connections view, click the \inlineimage plus.png
button to create a new connection.
\image qmldesigner-tutorial-connections.png "Connections tab"
\li Double-click the value in the \uicontrol Target column, and select
\e mouseArea in the list.
\li In the \uicontrol {Signal Handler} column, select \e onClicked.
\li In the \uicontrol Action column, select \e {page.state = 'State1'}.
\li Create two more connections to connect the \c onClicked signal of
\uicontrol mouseArea1 to State2, and that of \uicontrol mouseArea2
to State3.
\li Press \key {Ctrl+R} to run the application.
\endlist
Click the rectangles to move the Qt logo from one rectangle to another.
\section1 Adding Animation to the View
Add transitions inside the state group to define how the properties change
when the Qt logo moves
between states. The transitions apply animations to the Qt logo. For example,
the Qt logo bounces back when it moves to the middleRightRect and eases into
bottomLeftRect.
\list 1
\li In the \uicontrol {Text Editor}, add the following code to specify
that when moving to State1, the x and y coordinates of the Qt logo
change linearly over a duration of 1 second:
\printuntil },
\li You can use the Qt Quick toolbar for animation to change the easing
curve type from linear to OutBounce:
\list a
\li Click \uicontrol NumberAnimation in the \uicontrol {Text Editor}
to display the \inlineimage refactormarker.png
icon, and then click the icon to open the toolbar:
\image qmldesigner-tutorial-quick-toolbar.png "Qt Quick toolbar for animation"
\li In the \uicontrol Easing field, select \uicontrol Bounce.
\li In the \uicontrol Subtype field, select \uicontrol Out.
For more information about the views you used, see:
\list
\li \l{Adding States}
\li \l{Connecting Objects to Signals}
\endlist
\li Add the following code to specify that when moving to State2, the x
and y coordinates of the Qt logo change over a duration of 2
seconds, and an InOutQuad easing function is used:
\section1 Animating Transitions
\dots
\printuntil },
\li Add the following code to specify that for any other state changes,
the x and y coordinates of the Qt logo change linearly over a
duration of 200 milliseconds:
\dots
\printuntil ]
We will now create transitions to apply animation to the image. For example,
the image bounces back when it moves to \e middleRightRect and eases into
\e bottomLeftRect.
\list 1
\li In the \uicontrol {Transition Editor} view, click the
\inlineimage plus.png
button to create a new transition.
\li Click the \inlineimage animation.png
button to specify transitions for switching to each state.
\image qmldesigner-tutorial-transition-settings.png "Transition Settings dialog"
\li In the \uicontrol {Transition ID} field, enter \e toState1.
\li In the \uicontrol From field, select \e State2 and \e State3.
\li In the \uicontrol To field, select \e State1.
\li Click \inlineimage plus.png
to add transitions for switching to \e State2 and \e State3, with
the IDs \e toState2 and \e toState3.
\li Select \uicontrol Close to save the settings and return to
\uicontrol {Transition Editor}.
\li Select \e toState2 in the list of transitions.
\image qmldesigner-tutorial-transitions.png "Transition Editor view"
\li Pull the right edge of the blue bar next to \e icon to frame 1000
to specify that the x and y coordinates of the image change
linearly over a duration of 1 second.
\li Select the \uicontrol x property, and click
\inlineimage curve_editor.png
to change the easing curve type from linear to easeOutBounce
(\c{[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]})
in \uicontrol {Easing Curve Editor}.
\image qmldesigner-tutorial-easing-curves.png "Easing Curve Editor"
\li Select the \uicontrol y property and set the easing curve for it,
too.
\li Close \uicontrol {Easing Curve Editor} to return to
\uicontrol {Transition Editor}, and select \e toState3
in the list of transitions.
\li Pull the right edge of the blue bar next to \e icon to frame 2000
to specify that the x and y coordinates of the image change
linearly over a duration of 2 seconds.
\li In \uicontrol {Easing Curve Editor}, change the easing curve type
from linear to easeInOutQuad (\c{[0.455,0.03,0.515,0.955,1,1]}).
\li Select \e toState1 in the list of transitions, and pull the blue
bar to frame 200 to specify that the x and y coordinates of the
image change linearly over a duration of 200 milliseconds.
\li Press \key {Ctrl+R} to run the application.
\endlist
For more information about the views you used, see:
\list
\li \l{Editing Easing Curves}
\li \l{Animating Transitions Between States}
\endlist
Click the rectangles to view the animated transitions.

View File

@@ -0,0 +1,84 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/
/*!
//! [qtquick empty application]
\section1 Creating the Project
\list 1
\li Select \uicontrol File > \uicontrol {New File or Project} >
\uicontrol {Application (Qt Quick)} >
\uicontrol {Qt Quick Application - Empty}.
\li Select \uicontrol Choose to open the
\uicontrol {Project Location} dialog.
\li In the \uicontrol Name field, enter a name for the application.
\li In the \uicontrol {Create in} field, enter the path for the project
files.
\li Select \uicontrol Next (or \uicontrol Continue on \macos) to open
the \uicontrol {Define Build System} dialog.
\li In the \uicontrol {Build system} field, select the build system to
use for building and running the project: \l qmake,
\l {Setting Up CMake}{CMake}, or \l {Setting Up Qbs}{Qbs}.
\li Select \uicontrol Next to open the
\uicontrol {Define Project Details} dialog.
\li Select \uicontrol Next to use the default settings and to open
the \uicontrol {Translation File} dialog.
\li Select \uicontrol Next to use the default settings and to open
the \uicontrol {Kit Selection} dialog.
\li Select \l{glossary-buildandrun-kit}{kits} for the platforms that
you want to build the application for. To build applications for
mobile devices, select kits for Android ARM and iPhone OS.
\note Kits are listed if they have been specified in \uicontrol
Tools > \uicontrol Options > \uicontrol Kits (on Windows and Linux)
or in \uicontrol {\QC} > \uicontrol Preferences >
\uicontrol Kits (on \macos).
For more information, see \l {Adding Kits}.
\li Select \uicontrol Next to open the \uicontrol {Project Management}
dialog.
\li Review the project settings, and select \uicontrol{Finish}
(or \uicontrol Done on \macos) to create the project.
\endlist
For more information about the settings that you skipped, see
\l{Creating Qt Quick Applications}.
//! [qtquick empty application]
*/
Con

View File

@@ -66,8 +66,8 @@
the import statements automatically. You can remove import statements in
\uicontrol {QML Imports}.
\uicontrol {Assets} displays the images and other files that you copy
to the project folder (to the same subfolder as the QML files).
\uicontrol {Assets} displays the images and other files that you import to
the project folder by selecting \uicontrol {Add New Assets}.
\section1 Adding Components to Designs

View File

@@ -232,7 +232,7 @@
\row
\li HDR Bloom Tonemap
\li \image effect-HDR-bloom-tonemap.png "The HDR Bloom Tonemap effect"
\li \image effect-hdr-bloom-tonemap.png "The HDR Bloom Tonemap effect"
\li A bloom with tonemapping effect that adjusts the gamma and exposure
of the high-dynamic range rendered content to achieve the image quality
you want. Also applies an adjustable bloom effect to very bright areas

View File

@@ -96,6 +96,8 @@ NodeInstanceClientProxy::NodeInstanceClientProxy(QObject *parent)
m_puppetAliveTimer.start();
}
NodeInstanceClientProxy::~NodeInstanceClientProxy() = default;
void NodeInstanceClientProxy::initializeSocket()
{
QLocalSocket *localSocket = new QLocalSocket(this);

View File

@@ -70,6 +70,7 @@ class NodeInstanceClientProxy : public QObject, public NodeInstanceClientInterfa
public:
NodeInstanceClientProxy(QObject *parent);
~NodeInstanceClientProxy() override;
void informationChanged(const InformationChangedCommand &command) override;
void valuesChanged(const ValuesChangedCommand &command) override;

View File

@@ -42,6 +42,7 @@ const char *OptionsParser::LOAD_OPTION = "-load";
const char *OptionsParser::TEST_OPTION = "-test";
const char *OptionsParser::NOTEST_OPTION = "-notest";
const char *OptionsParser::PROFILE_OPTION = "-profile";
const char *OptionsParser::NO_CRASHCHECK_OPTION = "-no-crashcheck";
OptionsParser::OptionsParser(const QStringList &args,
const QMap<QString, bool> &appOptions,
@@ -79,6 +80,8 @@ bool OptionsParser::parse()
continue;
if (checkForProfilingOption())
continue;
if (checkForNoCrashcheckOption())
continue;
#ifdef WITH_TESTS
if (checkForTestOptions())
continue;
@@ -243,6 +246,14 @@ bool OptionsParser::checkForProfilingOption()
return true;
}
bool OptionsParser::checkForNoCrashcheckOption()
{
if (m_currentArg != QLatin1String(NO_CRASHCHECK_OPTION))
return false;
m_pmPrivate->enableCrashCheck = false;
return true;
}
bool OptionsParser::checkForPluginOption()
{
bool requiresParameter;

View File

@@ -49,6 +49,8 @@ public:
static const char *TEST_OPTION;
static const char *NOTEST_OPTION;
static const char *PROFILE_OPTION;
static const char *NO_CRASHCHECK_OPTION;
private:
// return value indicates if the option was processed
// it doesn't indicate success (--> m_hasError)
@@ -59,6 +61,7 @@ private:
bool checkForAppOption();
bool checkForPluginOption();
bool checkForProfilingOption();
bool checkForNoCrashcheckOption();
bool checkForUnknownOption();
void forceDisableAllPluginsExceptTestedAndForceEnabled();

View File

@@ -64,6 +64,7 @@
#endif
#include <functional>
#include <memory>
Q_LOGGING_CATEGORY(pluginLog, "qtc.extensionsystem", QtWarningMsg)
@@ -729,6 +730,12 @@ void PluginManager::formatOptions(QTextStream &str, int optionIndentation, int d
formatOption(str, QLatin1String(OptionsParser::PROFILE_OPTION),
QString(), QLatin1String("Profile plugin loading"),
optionIndentation, descriptionIndentation);
formatOption(str,
QLatin1String(OptionsParser::NO_CRASHCHECK_OPTION),
QString(),
QLatin1String("Disable startup check for previously crashed instance"),
optionIndentation,
descriptionIndentation);
#ifdef WITH_TESTS
formatOption(str, QString::fromLatin1(OptionsParser::TEST_OPTION)
+ QLatin1String(" <plugin>[,testfunction[:testdata]]..."), QString(),
@@ -1409,6 +1416,8 @@ private:
void PluginManagerPrivate::checkForProblematicPlugins()
{
if (!enableCrashCheck)
return;
const Utils::optional<QString> pluginName = LockFile::lockedPluginName(this);
if (pluginName) {
PluginSpec *spec = pluginByName(*pluginName);
@@ -1464,7 +1473,9 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt
if (!spec->isEffectivelyEnabled() && destState == PluginSpec::Loaded)
return;
LockFile f(this, spec);
std::unique_ptr<LockFile> lockFile;
if (enableCrashCheck)
lockFile.reset(new LockFile(this, spec));
switch (destState) {
case PluginSpec::Running:

View File

@@ -138,6 +138,7 @@ public:
mutable QReadWriteLock m_lock;
bool m_isInitializationDone = false;
bool enableCrashCheck = true;
private:
PluginManager *q;

View File

@@ -198,12 +198,15 @@ protected:
} else {
return false;
}
int argCount = 0;
for (const ExpressionListAST *list = ast->expression_list; list && list->value;
list = list->next) {
++argCount;
}
// must have at least four arguments
if (!ast->expression_list
|| !ast->expression_list->value || !ast->expression_list->next
|| !ast->expression_list->next->value || !ast->expression_list->next->next
|| !ast->expression_list->next->next->value || !ast->expression_list->next->next->next
|| !ast->expression_list->next->next->next->value)
if (argCount < 4)
return false;
switch (registrationFunction) {
case InvalidRegistrationFunction:
@@ -215,15 +218,11 @@ protected:
case QmlRegisterSingletonTypeCallback2:
case QmlRegisterSingletonTypeUrl:
case QmlRegisterUncreatableType:
if (!ast->expression_list->next->next->next->next
|| !ast->expression_list->next->next->next->next->value
|| ast->expression_list->next->next->next->next->next)
if (argCount != 5)
return false;
break;
case QmlRegisterUncreatableMetaObject:
if (!ast->expression_list->next->next->next->next->next
|| !ast->expression_list->next->next->next->next->next->value
|| ast->expression_list->next->next->next->next->next->next)
if (argCount != 6)
return false;
}
ExpressionAST *uriExp = nullptr;

View File

@@ -42,10 +42,13 @@ void CapturingConnectionManager::setUp(NodeInstanceServerProxy *nodeInstanceServ
int indexOfCapturePuppetStream = QCoreApplication::arguments().indexOf(
"-capture-puppet-stream");
if (indexOfCapturePuppetStream > 0) {
m_captureFileForTest.setFileName(
QCoreApplication::arguments().at(indexOfCapturePuppetStream + 1));
const QString filePath = QCoreApplication::arguments().at(indexOfCapturePuppetStream + 1);
m_captureFileForTest.setFileName(filePath);
bool isOpen = m_captureFileForTest.open(QIODevice::WriteOnly);
qDebug() << "file is open: " << isOpen;
if (isOpen)
qDebug() << "capture file is open:" << filePath;
else
qDebug() << "capture file could not be opened!";
}
}
@@ -62,4 +65,15 @@ void CapturingConnectionManager::processFinished(int exitCode, QProcess::ExitSta
InteractiveConnectionManager::processFinished(exitCode, exitStatus);
}
void CapturingConnectionManager::writeCommand(const QVariant &command)
{
InteractiveConnectionManager::writeCommand(command);
if (m_captureFileForTest.isWritable()) {
qDebug() << "command name: " << QMetaType::typeName(command.userType());
writeCommandToIODevice(command, &m_captureFileForTest, m_writeCommandCounter);
qDebug() << "\tcatpure file offset: " << m_captureFileForTest.pos();
}
}
} // namespace QmlDesigner

View File

@@ -29,7 +29,7 @@
namespace QmlDesigner {
class CapturingConnectionManager : public InteractiveConnectionManager
class QMLDESIGNERCORE_EXPORT CapturingConnectionManager : public InteractiveConnectionManager
{
public:
void setUp(NodeInstanceServerProxy *nodeInstanceServerProxy,
@@ -38,6 +38,8 @@ public:
void processFinished(int exitCode, QProcess::ExitStatus exitStatus) override;
void writeCommand(const QVariant &command) override;
private:
QFile m_captureFileForTest;
};

View File

@@ -28,6 +28,7 @@
#ifndef QMLDESIGNER_TEST
#include <abstractview.h>
#include <capturingconnectionmanager.h>
#include <componentaction.h>
#include <componentview.h>
#include <crumblebar.h>
@@ -37,7 +38,6 @@
#include <edit3dview.h>
#include <formeditorview.h>
#include <importmanagerview.h>
#include <interactiveconnectionmanager.h>
#include <itemlibraryview.h>
#include <navigatorview.h>
#include <nodeinstanceview.h>
@@ -61,10 +61,13 @@ class ViewManagerData
{
public:
InteractiveConnectionManager connectionManager;
CapturingConnectionManager capturingConnectionManager;
QmlModelState savedState;
Internal::DebugView debugView;
DesignerActionManagerView designerActionManagerView;
NodeInstanceView nodeInstanceView{connectionManager};
NodeInstanceView nodeInstanceView{
QCoreApplication::arguments().contains("-capture-puppet-stream") ? capturingConnectionManager
: connectionManager};
ComponentView componentView;
Edit3DView edit3DView;
FormEditorView formEditorView;

View File

@@ -780,6 +780,8 @@ Project {
"richtexteditor/richtexteditor.cpp",
"richtexteditor/richtexteditor.h",
"richtexteditor/richtexteditor.ui",
"richtexteditor/richtexteditorproxy.cpp",
"richtexteditor/richtexteditorproxy.h",
"sourcetool/sourcetool.cpp",
"sourcetool/sourcetool.h",
"texttool/textedititem.cpp",

View File

@@ -13,11 +13,11 @@
<description><![CDATA[Developing Qt applications using C++ and the Qt Widgets module.]]></description>
<tags>qt,qt creator,qt designer,widgets,c++,help</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtcreator/doc/qt-creator-transitions-example.html" projectPath="" name="Help: Creating a Qt Quick Application">
<tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtcreator/doc/qtcreator-transitions-example.html" projectPath="" name="Help: Creating a Qt Quick Application">
<description><![CDATA[Using basic QML elements and learning about basic concepts of Qt Quick.]]></description>
<tags>qt creator,qt quick designer,qt quick,qml,states,transitions,help</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtcreator/doc/qt-creator-accelbubble-example.html" projectPath="" name="Help: Creating a Mobile Qt Application">
<tutorial imageUrl=":qtsupport/images/icons/tutorialicon.png" difficulty="" docUrl="qthelp://org.qt-project.qtcreator/doc/qtcreator-accelbubble-example.html" projectPath="" name="Help: Creating a Mobile Qt Application">
<description><![CDATA[Developing Qt Quick applications for Android and iOS devices using Qt Quick Controls.]]></description>
<tags>qt creator,qt quick designer,qml,android,ios,controls,help</tags>
</tutorial>

View File

@@ -96,6 +96,7 @@
#include <QFutureWatcher>
#include <QGridLayout>
#include <QKeyEvent>
#include <QLoggingCategory>
#include <QMap>
#include <QMenu>
#include <QMessageBox>
@@ -1147,6 +1148,8 @@ static void printPage(int index, QPainter *painter, const QTextDocument *doc,
painter->restore();
}
Q_LOGGING_CATEGORY(printLog, "qtc.editor.print", QtWarningMsg)
void TextEditorWidgetPrivate::print(QPrinter *printer)
{
QTextDocument *doc = q->document();
@@ -1256,6 +1259,13 @@ void TextEditorWidgetPrivate::print(QPrinter *printer)
ascending = false;
}
qCDebug(printLog) << "Printing " << m_document->filePath() << ":\n"
<< " number of copies:" << printer->numCopies() << '\n'
<< " from page" << fromPage << "to" << toPage << '\n'
<< " document page count:" << doc->pageCount() << '\n'
<< " page rectangle:" << pageRect << '\n'
<< " title box:" << titleBox << '\n';
for (int i = 0; i < docCopies; ++i) {
int page = fromPage;