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. How to make a calendar window

How to make a calendar window

Scheduled Pinned Locked Moved Solved QML and Qt Quick
9 Posts 2 Posters 705 Views 2 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.
  • M Offline
    M Offline
    Mikeeeeee
    wrote on last edited by
    #1

    Hi!
    How to make a calendar window?
    This not work, because I use QtQuick.Controls 2.12

    1 Reply Last reply
    0
    • IntruderExcluderI Offline
      IntruderExcluderI Offline
      IntruderExcluder
      wrote on last edited by
      #2

      Use calendar from labs module.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mikeeeeee
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • M Offline
          M Offline
          Mikeeeeee
          wrote on last edited by
          #4

          I connected the module Qt.labs.calendar 1.0 and do this:

              Calendar   {
                  x: 23
                  y: 154
                  width: 340
                  height: 355
              }
          

          But the calendar does not accept width, height and coordinates. What to do? How to use this calendar?

          1 Reply Last reply
          0
          • IntruderExcluderI Offline
            IntruderExcluderI Offline
            IntruderExcluder
            wrote on last edited by
            #5

            Use MonthGrid to customize calendar appearance.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Mikeeeeee
              wrote on last edited by
              #6

              Thanks, it's working. But how to fasten the backlight and buttons to the right days?

              1 Reply Last reply
              0
              • IntruderExcluderI Offline
                IntruderExcluderI Offline
                IntruderExcluder
                wrote on last edited by
                #7

                Set custom delegate to your grid. There are some useful options.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  Mikeeeeee
                  wrote on last edited by
                  #8

                  If so add a delegate, ceases to display the calendar. Please tell me why how to fix it?

                      MonthGrid {
                          id: mothGrid1
                          month: Calendar.December
                          year: 2019
                          x: 23
                          y: 154
                          width: 340
                          height: 355
                          //locale: Qt.locale("en_US")
                  
                          delegate: Item {
                              MouseArea{
                                  anchors.fill: parent
                                  //onClicked: console.log("day = " )
                              }
                          }
                      }
                  
                  
                  1 Reply Last reply
                  0
                  • IntruderExcluderI Offline
                    IntruderExcluderI Offline
                    IntruderExcluder
                    wrote on last edited by
                    #9
                    import QtQuick 2.11
                    import QtQuick.Window 2.11
                    import Qt.labs.calendar 1.0
                    import QtQuick.Templates 2.2 as T
                    
                    Window {
                        visible: true
                        width: 640
                        height: 480
                        title: qsTr("Hello World")
                    
                        MonthGrid {
                            id: mg
                            anchors.centerIn: parent
                            month: Calendar.December
                            year: 2019
                            delegate: T.ItemDelegate {
                                id: control
                                implicitWidth:  40
                                implicitHeight: 40
                                hoverEnabled: true
                                contentItem: Item {
                                    Text {
                                        anchors.centerIn: parent
                                        text: model.date.getDate()
                                        color: model.month === mg.month ? "black" : "darkgrey"
                                    }
                                }
                                background: Rectangle {
                                    color: "plum"
                                    visible: control.hovered && model.month === mg.month
                                }
                                onClicked: console.log("DAY:", model.date)
                            }
                        }
                    }
                    
                    
                    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