summaryrefslogtreecommitdiff
path: root/doc/qtcreator/examples/transitions
diff options
context:
space:
mode:
Diffstat (limited to 'doc/qtcreator/examples/transitions')
-rw-r--r--doc/qtcreator/examples/transitions/Page1Form.ui.qml47
-rw-r--r--doc/qtcreator/examples/transitions/Page2Form.ui.qml6
-rw-r--r--doc/qtcreator/examples/transitions/main.cpp20
-rw-r--r--doc/qtcreator/examples/transitions/main.qml15
-rw-r--r--doc/qtcreator/examples/transitions/transitions.pro14
5 files changed, 62 insertions, 40 deletions
diff --git a/doc/qtcreator/examples/transitions/Page1Form.ui.qml b/doc/qtcreator/examples/transitions/Page1Form.ui.qml
index 785433154d..5e47850424 100644
--- a/doc/qtcreator/examples/transitions/Page1Form.ui.qml
+++ b/doc/qtcreator/examples/transitions/Page1Form.ui.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator
@@ -47,13 +47,20 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-import QtQuick 2.9
-import QtQuick.Controls 2.2
+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")
@@ -61,20 +68,12 @@ Page {
padding: 10
}
- property alias icon: icon
- property alias topLeftRect: topLeftRect
- property alias bottomLeftRect: bottomLeftRect
- property alias middleRightRect: middleRightRect
-
- property alias mouseArea2: mouseArea2
- property alias mouseArea1: mouseArea1
- property alias mouseArea: mouseArea
-
Image {
id: icon
x: 10
y: 20
source: "qt-logo.png"
+ fillMode: Image.PreserveAspectFit
}
Rectangle {
@@ -82,11 +81,11 @@ Page {
width: 55
height: 41
color: "#00000000"
+ border.color: "#808080"
anchors.left: parent.left
anchors.leftMargin: 10
anchors.top: parent.top
anchors.topMargin: 20
- border.color: "#808080"
MouseArea {
id: mouseArea
@@ -99,10 +98,10 @@ Page {
width: 55
height: 41
color: "#00000000"
+ border.color: "#808080"
+ anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 10
- anchors.verticalCenter: parent.verticalCenter
- border.color: "#808080"
MouseArea {
id: mouseArea1
anchors.fill: parent
@@ -114,14 +113,26 @@ Page {
width: 55
height: 41
color: "#00000000"
+ border.color: "#808080"
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
- border.color: "#808080"
+ anchors.left: parent.left
+ anchors.leftMargin: 10
MouseArea {
id: mouseArea2
anchors.fill: parent
}
- anchors.left: parent.left
- anchors.leftMargin: 10
}
+
+ 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}
}
+##^##*/
+
diff --git a/doc/qtcreator/examples/transitions/Page2Form.ui.qml b/doc/qtcreator/examples/transitions/Page2Form.ui.qml
index 11a8abff4a..57178073ca 100644
--- a/doc/qtcreator/examples/transitions/Page2Form.ui.qml
+++ b/doc/qtcreator/examples/transitions/Page2Form.ui.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator
@@ -47,8 +47,8 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-import QtQuick 2.9
-import QtQuick.Controls 2.2
+import QtQuick 2.12
+import QtQuick.Controls 2.5
Page {
width: 600
diff --git a/doc/qtcreator/examples/transitions/main.cpp b/doc/qtcreator/examples/transitions/main.cpp
index 4e002b280e..9fb8458284 100644
--- a/doc/qtcreator/examples/transitions/main.cpp
+++ b/doc/qtcreator/examples/transitions/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator
@@ -47,20 +47,28 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ 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);
QQmlApplicationEngine engine;
- engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
- if (engine.rootObjects().isEmpty())
- return -1;
+ const QUrl url(QStringLiteral("qrc:/main.qml"));
+ QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
+ &app, [url](QObject *obj, const QUrl &objUrl) {
+ if (!obj && url == objUrl)
+ QCoreApplication::exit(-1);
+ }, Qt::QueuedConnection);
+ engine.load(url);
return app.exec();
}
diff --git a/doc/qtcreator/examples/transitions/main.qml b/doc/qtcreator/examples/transitions/main.qml
index 464b48e545..f49672d803 100644
--- a/doc/qtcreator/examples/transitions/main.qml
+++ b/doc/qtcreator/examples/transitions/main.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator
@@ -47,9 +47,8 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
-import QtQuick 2.9
-import QtQuick.Controls 2.2
+import QtQuick 2.12
+import QtQuick.Controls 2.5
ApplicationWindow {
visible: true
@@ -64,15 +63,14 @@ ApplicationWindow {
Page1Form {
id: page
-
mouseArea {
- onClicked: stateGroup.state = ' '
+ onClicked: stateGroup.state = ' '
}
mouseArea1 {
- onClicked: stateGroup.state = 'State1'
+ onClicked: stateGroup.state = 'State1'
}
mouseArea2 {
- onClicked: stateGroup.state = 'State2'
+ onClicked: stateGroup.state = 'State2'
}
}
@@ -102,6 +100,7 @@ ApplicationWindow {
}
}
]
+
transitions: [
Transition {
from: "*"; to: "State1"
diff --git a/doc/qtcreator/examples/transitions/transitions.pro b/doc/qtcreator/examples/transitions/transitions.pro
index e2173bcccb..70f8fe7f3b 100644
--- a/doc/qtcreator/examples/transitions/transitions.pro
+++ b/doc/qtcreator/examples/transitions/transitions.pro
@@ -1,18 +1,20 @@
QT += quick
+
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
-# any feature of Qt which as been marked deprecated (the exact warnings
-# depend on your compiler). Please consult the documentation of the
-# deprecated API in order to know how to port your code away from it.
+# 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 you use deprecated APIs.
+# You can also 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 += main.cpp
+SOURCES += \
+ main.cpp
RESOURCES += qml.qrc
@@ -26,3 +28,5 @@ QML_DESIGNER_IMPORT_PATH =
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
+
+DISTFILES +=