Thank you Qt for quietly fixing a bug in MonthGrid and ruining everything ;-)
-
So lets say you have the following QML code:
import QtQuick import QtQuick.Layouts import QtQuick.Controls ApplicationWindow { visible: true width: 320 height: 240 property var myDate: new Date(); MonthGrid { anchors.fill: parent id: monthGrid locale: Qt.locale("en_US") Layout.fillWidth: true month: myDate.getMonth(); year: myDate.getFullYear(); delegate: Label { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter enabled: model.month === myDate.getMonth() text: model.day Rectangle { anchors.fill: parent color: "blue" opacity: .5 radius: 100 visible: (model.month === myDate.getMonth()) && (model.day === myDate.getDate()) } } onClicked: function(getDate) { console.debug(getDate); myDate = getDate; } } }You run it on Qt 6.9 or later. It works fine. Great! But run it on Qt 6.8 or older (including 5.15), you will notice the clicked date will always be off by one. Why? Because there was a bug in the MonthGrid's onClicked function that would give the wrong date. So they fixed it. Great, right? No! So you now need a different version of the code for Kubuntu 25.04 (or Debian 13) vs. 25.10! And it's not that easy to figure out if you got the 6.9 fix or not. Now I have to decide if I want to support Debian or not.
Thanks Qt, for ruining everything!!! (/s)
-
My current workaround, lol:
onClicked: function(getDate) { if(getDate.getHours() > 0) { myDate = new Date(getDate.getFullYear(), getDate.getMonth(), getDate.getDate() +1); } else { myDate = getDate }