-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.11.2
-
None
-
-
57325020f (dev), 2e1337d87 (dev), 2e37850da (6.10), 7664d1d5a (6.9), dd8fddb19 (tqtc/lts-6.8), 60f0e4f5f (6.10), ab3781ee0 (6.9), 2462ea517 (tqtc/lts-6.8)
I was working with the Qt.labs.calendar MonthGrid. When using the delegate I compared the model.day with the model.date.getDate() and they do not match. The onClicked returns the model.date from the current cell that was clicked which is wrong.
Below is example code that compares the two objects.
Labs.MonthGrid{
id: monthGrid
Layout.fillWidth: true
Layout.fillHeight: true
month: model.month
year: model.year
locale: Qt.locale("en_US")
delegate: Column{Label{
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
opacity: model.month === monthGrid.month ? 1 : 0.5
text: model.month +"/"+model.day+"/"+model.year
}
Label{
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
opacity: model.month === monthGrid.month ? 1 : 0.5
text: model.date.getMonth()+"/"+model.date.getDate()+"/" +model.date.getYear()
}
Label{
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: model.day !== model.date.getDate() ? "Wrong Date":"Correct Date"
}
}
onClicked: {
console.log("onClicked date", date)
}
onPressAndHold: {
console.log("onPressAndHold date", date)
}
onPressed: {
console.log("onPressed date", date)
}
onReleased: {
console.log("onReleased date", date)
}
}
Attached is an image of the test program I was using. It compares the QtQuick.Controls 1.4 Calendar against one made with Qt.labs.calendar
- is duplicated by
-
QTBUG-137723 MonthGrid OnClicked Documentation Should Reference Time is Given in UTC 00:00:00 Before Being Converted to Timezone
-
- Closed
-
- relates to
-
QTBUG-64485 QDateEdit has a problem of display 2017-10-15
-
- Closed
-
-
QTBUG-114525 Implement ECMAScrip'ts Temporal in QML's V4 engine
-
- Open
-