Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved]Problem with QDateTimeEdit::setCurrentSection or setCurrentSectionIndex
QtWS25 Last Chance

[Solved]Problem with QDateTimeEdit::setCurrentSection or setCurrentSectionIndex

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 842 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.
  • P Offline
    P Offline
    pmseattle
    wrote on last edited by
    #1

    I am using a QDateTimeEdit widget to scroll through a graph consisting of data plotted against time. When I start the software, I would like the QDateTimeEdit widget to have the minutes section as the current section, so that when the user clicks the up or down arrow, the minutes section will increment or decrement. However, the month section always comes up as the current section until the user clicks on another section. I have tried using setCurrentSection and setCurrentSectionIndex in the constructor, but they have no effect. Likewise, since I am using QtDesigner, I have tried to set the current section to minutes in the QtDesigner form, but that doesn't work either. If I change the current section in the form to "minutes" and save the file or the project, it always goes back to "month" the next time I open the project. I obviously don't understand the function of setCurrentSection or setCurrentSectionIndex. Is there in fact a way to force a newly-constructed QDateTimeEdit come up with a section other than months as current section ?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      pmseattle
      wrote on last edited by
      #2

      Here I am answering myself !

      This is apparently a bug in Qt which was reported in November 2013 as QTBUG-34759. The person who reported it also gave a simple work around, which I incorporated, and it worked perfectly:)

      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