Results 1 to 2 of 2

Thread: QDate

  1. #1
    Join Date
    Jan 2016
    Posts
    9
    Qt products
    Qt5
    Platforms
    Windows

    Default QDate

    Problem in the screen :

    screen.jpg

  2. #2
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    120
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QDate

    Hello,

    the compiler gives you a precise error message: there exists no conversion from QString to QDate. In other words: you cannot assign a QString (obtained from your QLineEdit object) to a QDate.

    However, there exist static methods for converting a QString to a QDate:
    Qt Code:
    1. QDate fromString(const QString & string, Qt::DateFormat format = Qt::TextDate)
    2. QDate fromString(const QString & string, const QString & format)
    To copy to clipboard, switch view to plain text mode 
    See QDate documentation for more details.

    For future posts: Please do not post screen shots with code and compiler error messages. They are hard to read. Use code tags to wrap code snippets and error messages.

    Best regards
    ars

Similar Threads

  1. QDate
    By ggdev001 in forum Qt Programming
    Replies: 2
    Last Post: 26th February 2013, 15:21
  2. can't get Qdate
    By mmm286 in forum Newbie
    Replies: 1
    Last Post: 4th March 2010, 10:25
  3. QDate next day
    By AlexD in forum Qt Programming
    Replies: 2
    Last Post: 17th February 2010, 23:40
  4. Regarding QDate?
    By qtlinuxnewbie in forum Newbie
    Replies: 4
    Last Post: 5th February 2010, 08:02
  5. QDate Help pls
    By munna in forum Qt Programming
    Replies: 6
    Last Post: 8th May 2006, 07:50

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.