Results 1 to 4 of 4

Thread: QDateTimeEdit : Dumb Mistake or bug?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Brisbane, Australia
    Thanked 1,592 Times in 1,520 Posts
    Qt products
    Qt4 Qt5
    Unix/X11 Windows
    Wiki edits

    Default QDateTimeEdit : Dumb Mistake or bug?

    This code:
    Qt Code:
    1. #include <QApplication>
    2. #include <QDateTimeEdit>
    4. int main(int argc, char **argv)
    5. {
    6. QApplication app(argc, argv);
    8. edit.setDateTime(QDateTime::currentDateTimeUtc());
    9. edit.setDisplayFormat("yyyy-MM-dd hh:mm");
    10. edit.setSelectedSection(QDateTimeEdit::DaySection);
    11. // also tried these:
    12. // edit.setCurrentSection(QDateTimeEdit::DaySection);
    13. // edit.setCurrentSectionIndex(2);
    16. return app.exec();
    17. }
    To copy to clipboard, switch view to plain text mode 
    I would have expected to show the current time with the "dd" day field already selected. What I get with 4.8.5/5.1.0 on 64-bit Linux, and 4.8.4 on 32-bit Windows is the year (first, presumably default) section selected. I have also tried deferring the setSelectedSection() call until after the show() with a zero timer. Meanwhile the currentSection() property returns 0x100, i.e. the DaySection.

    Am I missing the absolutely obvious?
    Last edited by ChrisW67; 11th November 2013 at 08:04.

Similar Threads

  1. Dumb newbie SQLITE, C++, Qt question...
    By scott_hollen in forum Newbie
    Replies: 3
    Last Post: 27th January 2011, 12:08
  2. Whre is the mistake?
    By unix7777 in forum Newbie
    Replies: 6
    Last Post: 18th March 2010, 22:30
  3. QComboBox Assert Mistake
    By jfe in forum Qt Programming
    Replies: 8
    Last Post: 30th July 2007, 13:00
  4. Qt Quarterly mistake
    By munna in forum General Discussion
    Replies: 2
    Last Post: 20th June 2006, 19:08
  5. Bug in Qt or Qt Designer or my mistake?
    By [maTa] in forum Qt Programming
    Replies: 5
    Last Post: 9th February 2006, 00:02

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.