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. QML Qt Quick Controls 1.4 - Calendar

QML Qt Quick Controls 1.4 - Calendar

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 2 Posters 1.4k 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.
  • R Offline
    R Offline
    Rui Braz
    wrote on last edited by Rui Braz
    #1

    Hi,

    How can I switch between years quickly on the Calendar component?
    I can only navigate between months, but if I need to navigate many years, it takes a lot of time because I have to click 12x/year.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by dheerendra
      #2

      There is no direct way. You can use the showNextYear function. See the following sample code.

      ApplicationWindow {
      visible: true
      width: 640
      height: 480
      title: qsTr("Hello World")

      Calendar {
          id : cal
      }
      MouseArea {
          anchors.fill : parent
          onClicked:  {
              for(var i=0;i<20;i++){
                  cal.showNextYear();
              }
          }
      }
      

      }

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      R 1 Reply Last reply
      7
      • R Offline
        R Offline
        Rui Braz
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • dheerendraD dheerendra

          There is no direct way. You can use the showNextYear function. See the following sample code.

          ApplicationWindow {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")

          Calendar {
              id : cal
          }
          MouseArea {
              anchors.fill : parent
              onClicked:  {
                  for(var i=0;i<20;i++){
                      cal.showNextYear();
                  }
              }
          }
          

          }

          R Offline
          R Offline
          Rui Braz
          wrote on last edited by
          #4

          @dheerendra This is not quite what I intend, but after offering the code I am doing.
          But, thanks in the same

          1 Reply Last reply
          0
          • dheerendraD Offline
            dheerendraD Offline
            dheerendra
            Qt Champions 2022
            wrote on last edited by
            #5

            If this solved your issue, you can move your question to SOLVED state so that others make use of this.

            Dheerendra
            @Community Service
            Certified Qt Specialist
            http://www.pthinks.com

            1 Reply Last reply
            4

            • Login

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