summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2022-02-23 17:39:50 +0100
committerThomas Hartmann <thomas.hartmann@qt.io>2022-07-15 14:23:24 +0000
commita3f08d8ac6b0f1594fb04002d0d10cf36dd7bd5f (patch)
tree4dda485a9550594aeafef3e13aac7c3b1bff1c99
parent234958a47a6edcd17bae255411a5b0f0bbaea6c7 (diff)
downloadqt-creator-a3f08d8ac6b0f1594fb04002d0d10cf36dd7bd5f.tar.gz
QmlDesigner: Add default Connections to wizard template
Task-number: QDS-5963 Change-Id: I894ce59adfaafa6ff71d6fa958b8aa836564a20a Reviewed-by: Brook Cronin <brook.cronin@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/application/Screen01.ui.qml.tpl50
1 files changed, 49 insertions, 1 deletions
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/application/Screen01.ui.qml.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/application/Screen01.ui.qml.tpl
index 1527710b08..a25bcb9d17 100644
--- a/share/qtcreator/qmldesigner/studio_templates/projects/application/Screen01.ui.qml.tpl
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/application/Screen01.ui.qml.tpl
@@ -10,14 +10,62 @@ import QtQuick.Controls %{QtQuickVersion}
import %{ImportModuleName} %{ImportModuleVersion}
Rectangle {
+ id: rectangle
width: Constants.width
height: Constants.height
color: Constants.backgroundColor
+ Button {
+ id: button
+ text: qsTr("Press me")
+ anchors.verticalCenter: parent.verticalCenter
+ checkable: true
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Connections {
+ target: button
+ onClicked: animation.start()
+ }
+ }
+
Text {
+ id: label
text: qsTr("Hello %{ProjectName}")
- anchors.centerIn: parent
+ anchors.top: button.bottom
font.family: Constants.font.family
+ anchors.topMargin: 45
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ SequentialAnimation {
+ id: animation
+
+ ColorAnimation {
+ id: colorAnimation1
+ target: rectangle
+ property: "color"
+ to: "#2294c6"
+ from: Constants.backgroundColor
+ }
+
+ ColorAnimation {
+ id: colorAnimation2
+ target: rectangle
+ property: "color"
+ to: Constants.backgroundColor
+ from: "#2294c6"
+ }
+ }
}
+ states: [
+ State {
+ name: "clicked"
+ when: button.checked
+
+ PropertyChanges {
+ target: label
+ text: qsTr("Button Checked")
+ }
+ }
+ ]
}