Skip to content
Snippets Groups Projects
Commit bfa12a66 authored by Pouchet Pierre's avatar Pouchet Pierre
Browse files

bouton, liste

parent ebfdaeaa
Branches
No related tags found
No related merge requests found
import QtQuick
Item {
width: 400
height: 200
property alias _textText: _text.text
Rectangle {
id: rectangle
x: 0
y: 0
width: 400
height: 200
color: "#db8f41"
Text {
id: _text
x: 0
y: 0
width: 400
height: 200
text: qsTr("Text")
font.pixelSize: 50
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
}
......@@ -19,6 +19,7 @@ qt_add_qml_module(appMotus
Main.qml
RESOURCES Ressources.qrc
QML_FILES Case.qml
QML_FILES Bouton.qml
)
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
......
......@@ -12,23 +12,30 @@ Window {
y: 0
width: 1920
height: 1080
color: "#f56363"
color: "#5f97af"
focus: true
Case {
id: case1
x: 225
y: 647
x: 99
y: 381
_textText: "A"
}
Case {
id: case2
x: 945
y: 736
x: 201
y: 372
_textText: "B"
}
Bouton {
id: bouton
x: 76
y: 47
_textText: "Générer un mot"
}
Keys.onPressed: (event) => {
if (event.key === Qt.Key_A) {
case1._textText = qsTr("C"); // Correcte modification
......
<RCC>
<qresource prefix="/">
<file>Case.qml</file>
<file>Bouton.qml</file>
</qresource>
</RCC>
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment