Added a new QML file for UserConfiguration and also the initial

implementation for a CalendarGrid
This commit is contained in:
2025-11-16 17:26:00 +02:00
parent d5e742155f
commit 9f43833cb1
5 changed files with 102 additions and 0 deletions

View File

@@ -30,6 +30,13 @@ Rectangle
width: 50
height: parent.height - 4
anchors.right: parent.right
onClicked: userConfiguration.open()
}
UserConfiguration
{
id: userConfiguration
}
}

View File

@@ -25,6 +25,8 @@ qt_add_qml_module(appProject-Orion
QML_FILES CustomButton.qml
QML_FILES Appheader.qml
RESOURCES resources.qrc
QML_FILES CalendarGrid.qml
QML_FILES UserConfiguration.qml
)
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.

View File

@@ -0,0 +1,48 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
GridLayout {
columns: 2
DayOfWeekRow {
locale: grid.locale
Layout.column: 1
Layout.fillWidth: true
}
WeekNumberColumn {
month: grid.month
year: grid.year
locale: grid.locale
Layout.fillHeight: true
delegate: Text {
text: weekNumber
font: control.font
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: myPalette.text
required property int weekNumber
}
}
MonthGrid {
id: grid
month: Calendar.November
year: 2025
locale: Qt.locale("en_US")
Layout.fillWidth: true
Layout.fillHeight: true
delegate: Text {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
opacity: model.month === monthGrid.month ? 1 : 0
text: monthGrid.locale.toString(model.date, "d")
font: monthGrid.font
required property var model
}
}
}

View File

@@ -0,0 +1,44 @@
import QtQuick
import QtQuick.Controls
Dialog {
id: dialog
modal: true
title: "Configure a new user"
width: 600
height: 400
Row {
id: usernameRow
spacing: 100
Label {
id: nameFieldLabel
text: qsTr("Username:")
}
TextField {
id: nameField
color: myPalette.text
width: 400
placeholderText: "Enter the new user's username"
}
}
Row {
id: dateOfBirthRow
anchors.top: usernameRow.bottom
spacing: 100
Label {
id: dateOfBirthLabel
text: qsTr("Date of birth:")
}
CalendarGrid {
id: dateOfBirthGrid
}
}
standardButtons: Dialog.Ok | Dialog.Cancel
}

View File

@@ -3,4 +3,5 @@
<file>user.svg</file>
<file>tick.svg</file>
</qresource>
<qresource prefix="/"/>
</RCC>