Results 1 to 3 of 3

Thread: invalidate QDateTime

  1. #1
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    27
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default invalidate QDateTime

    I want to invalidate QDateTime or at least member date of QDateTime. When creating a new QDateTime it's invalid by default. But how can I get to this state after having had a vaild date?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,593
    Thanks
    13
    Thanked 1,587 Times in 1,516 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: invalidate QDateTime

    Umm, assign a new invalid value to it:
    Qt Code:
    1. QDateTime test = QDateTime::currentDateTime();
    2. qDebug() << test.isValid(); // true
    3. test = QDateTime();
    4. qDebug() << test.isValid(); // false;
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    27
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: invalidate QDateTime

    life can be sooo easy

    Thanks!

Similar Threads

  1. about QDateTime & timezone
    By lllturtle in forum Qt Programming
    Replies: 1
    Last Post: 2nd August 2011, 11:34
  2. Replies: 3
    Last Post: 9th December 2010, 19:27
  3. Milliseconds from QDateTime
    By scamE in forum Qt Programming
    Replies: 3
    Last Post: 12th September 2010, 19:46
  4. QDateTime and comparsion
    By Talei in forum Newbie
    Replies: 0
    Last Post: 17th May 2010, 16:19
  5. QDateTime without Day
    By raphaelf in forum Qt Programming
    Replies: 4
    Last Post: 16th February 2006, 11:42

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.