diff --git a/Motus/Case.qml b/Motus/Case.qml new file mode 100644 index 0000000000000000000000000000000000000000..f15db8fb1aa36b2391cb525850efe0004836fa6b --- /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 15ec52707ebd521c61cec06f60cf1b73bef3c9bf..7718d9cf5c326df34158accd86de242064f1f8d0 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 0000000000000000000000000000000000000000..388ced6d162a2ff549f9ce804e0ee581a39adf5d --- /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 41424f88973df650d0672dfdc62f670e86708de2..f3600ff8772d225923ab66632801feb34103b358 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 + } }