Results 1 to 4 of 4

Thread: QDateTimeEdit : Dumb Mistake or bug?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QDateTimeEdit : Dumb Mistake or bug?

    I refined it and lodged a bug
    https://bugreports.qt-project.org/browse/QTBUG-34759

    It appears that the focusInEvent() is resetting the currentSection() so I am working around this by subclassing QDateTimeEdit, which is OK for my purposes:
    Qt Code:
    1. class Edit: public QDateTimeEdit {
    2. public:
    3. Edit(QWidget *p): QDateTimeEdit(p) { }
    4. protected:
    5. void focusInEvent(QFocusEvent *event) {
    6. Section section = currentSection();
    7. QDateTimeEdit::focusInEvent(event);
    8. setSelectedSection(section);
    9. }
    10. };
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to ChrisW67 for this useful post:

    LynneV (27th November 2014)

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

Bookmarks

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.