From 33238813b96ef5f89b6e6053dba30080922ffde0 Mon Sep 17 00:00:00 2001 From: amassies <alexandre.massies@etu.ec-lyon.fr> Date: Thu, 13 Mar 2025 19:01:40 +0100 Subject: [PATCH] =?UTF-8?q?d=C3=A9but=20cases?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Motus/Case.qml | 37 +++++++++++++++++++++++++++++++++++++ Motus/Motus.pro | 6 +++++- Motus/Resources.qrc | 5 +++++ Motus/main.qml | 7 +++++++ 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 Motus/Case.qml create mode 100644 Motus/Resources.qrc diff --git a/Motus/Case.qml b/Motus/Case.qml new file mode 100644 index 0000000..f15db8f --- /dev/null +++ b/Motus/Case.qml @@ -0,0 +1,37 @@ +import QtQuick + +Item { + id: _item + property alias _textText: _text.text + width: 30 + height: 30 + focus: true + Rectangle { + id: rectangle + width: 30 + height: 30 + color: "#453c3c" + radius: 4 + border.width: 4 + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + + Text { + id: _text + width: 30 + height: 30 + color: "#ffffff" + text: qsTr("A") + anchors.verticalCenter: parent.verticalCenter + font.pixelSize: 20 + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + anchors.verticalCenterOffset: 0 + anchors.horizontalCenterOffset: 0 + font.bold: true + clip: false + anchors.horizontalCenter: parent.horizontalCenter + } + } + +} diff --git a/Motus/Motus.pro b/Motus/Motus.pro index 15ec527..7718d9c 100644 --- a/Motus/Motus.pro +++ b/Motus/Motus.pro @@ -5,7 +5,8 @@ SOURCES += \ resources.files = main.qml resources.prefix = /$${TARGET} -RESOURCES += resources +RESOURCES += resources \ + Resources.qrc # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = @@ -17,3 +18,6 @@ QML_DESIGNER_IMPORT_PATH = qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target + +DISTFILES += \ + Case.qml diff --git a/Motus/Resources.qrc b/Motus/Resources.qrc new file mode 100644 index 0000000..388ced6 --- /dev/null +++ b/Motus/Resources.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>Case.qml</file> + </qresource> +</RCC> diff --git a/Motus/main.qml b/Motus/main.qml index 41424f8..f3600ff 100644 --- a/Motus/main.qml +++ b/Motus/main.qml @@ -4,5 +4,12 @@ Window { width: 640 height: 480 visible: true + color: "#453c3c" title: qsTr("Hello World") + + Case { + id: _case + x: 199 + y: 274 + } } -- GitLab