Table of Contents:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rectangle { | |
id: rect1 | |
x: 12; y: 12 | |
width: 76; height: 96 | |
color: "lightsteelblue" | |
MouseArea { | |
id: area | |
width: parent.width | |
height: parent.height | |
onClicked: rect2.visible = !rect2.visible |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Image { | |
x: 12; y: 12 | |
// width: 72 | |
// height: 72 | |
source: "assets/triangle_red.png" | |
} | |
Image { | |
x: 12+64+12; y: 12 | |
// width: 72 | |
height: 72/2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Text { | |
width: 40; height: 120 | |
text: 'A very long text' | |
// '...' shall appear in the middle | |
elide: Text.ElideMiddle | |
// red sunken text styling | |
style: Text.Sunken | |
styleColor: '#FF4444' | |
// align text to the top | |
verticalAlignment: Text.AlignTop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Text { | |
text: "The quick brown fox" | |
color: "#303030" | |
font.family: "Ubuntu" | |
font.pixelSize: 28 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rectangle { | |
id: rect1 | |
x: 12; y: 12 | |
width: 176; height: 96 | |
gradient: Gradient { | |
GradientStop { position: 0.0; color: "lightsteelblue" } | |
GradientStop { position: 1.0; color: "slategray" } | |
} | |
border.color: "slategray" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Text | |
{ | |
id: label | |
x: 24; y: 24 | |
// custom counter property for space presses | |
property int spacePresses: 0 | |
text: "Space pressed: " + spacePresses + " times" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyLabel | |
{ย | |
someText: Text { text: "world!" }ย | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyLabel | |
{ย | |
Text { text: "world!" }ย | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MyLabel.qml | |
import QtQuick 2.0ย | |
Text | |
{ย | |
default property var someText text: "Hello, " + someText.textย | |
} |
NewerOlder