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. MonthGrid example not working pop up
Qt 6.11 is out! See what's new in the release blog

MonthGrid example not working pop up

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 351 Views 1 Watching
  • 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.
  • RusticusR Offline
    RusticusR Offline
    Rusticus
    wrote on last edited by
    #1

    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.html

    Example:

    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:
    3a3a8a93-f48f-4658-a874-a4c656988a1c-image.png

    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