Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Thank you Qt for quietly fixing a bug in MonthGrid and ruining everything ;-)
Forum Updated to NodeBB v4.3 + New Features

Thank you Qt for quietly fixing a bug in MonthGrid and ruining everything ;-)

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 45 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DesiVideoGamer
    wrote last edited by
    #1

    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)

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DesiVideoGamer
      wrote last edited by DesiVideoGamer
      #2

      My current workaround, lol:

              onClicked: function(getDate) {
                  if(getDate.getHours() > 0) {
                      myDate = new Date(getDate.getFullYear(),
                                        getDate.getMonth(),
                                        getDate.getDate() +1);
                  }
                  else {
                      myDate = getDate
                  }
      
      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved