Qt 6.11 is out! See what's new in the release
blog
MonthGrid example not working pop up
-
I tried to use a "MonthGrid" like in the example but I used the whole thing in a pop up. Unfortunately it doesn't work.
Is this a bug or the documentation is wrong or do I something wrong?
Documentation:
https://doc.qt.io/qt-6/qml-qtquick-controls-monthgrid.htmlExample:
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 } MonthGrid { id: grid month: Calendar.December year: 2015 locale: Qt.locale("en_US") Layout.fillWidth: true Layout.fillHeight: true } }My usage:
Popup { id: calendar 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 } MonthGrid { id: grid month: endDateVar.getMonth() year: endDateVar.getFullYear() locale: Qt.locale("en_US") Layout.fillWidth: true Layout.fillHeight: true onClicked: (dateEvent) => { console.log( dateEvent ) } } } }That's how it looks like:
