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. QDateEdit to 00/00/0000
Qt 6.11 is out! See what's new in the release blog

QDateEdit to 00/00/0000

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.1k Views 3 Watching
  • 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.
  • freddy311082F Offline
    freddy311082F Offline
    freddy311082
    wrote on last edited by
    #1

    Hi Guys... I need to use QDateEdit in my app and I need to set as day something like

    00/00/0000
    in that case the date value will be null for my app, but I cant't set this date to some QDateEdit.

    I need the same for the time and the QDateTimeEdit

    how can I do that ? regards

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      This is an invalid date. See QDate's documentation

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      freddy311082F 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        This is an invalid date. See QDate's documentation

        freddy311082F Offline
        freddy311082F Offline
        freddy311082
        wrote on last edited by
        #3

        @SGaist

        yes, i know, but i need to do that...

        I need to set this invalid date because when my date is 00/00/0000 we set the date to NULL. In my system I need to do that, because I don't have any way to have a real invalid date in the QDateEdit for when I ask if the date is invalid and the result is false, I can take it as a NULL date, an then, set to null this date in the data base.

        That's what I need.. any suggestion to do that ?

        regards

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Does it mean that if your user don't enter any date it should be an invalid date ?
          If so why not put e.g. a checkbox beside the QDateTimeEdit so if the checkbox is unchecked -> null date for the database and if checked -> date from the QDateTimeEdit ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • JKSHJ Offline
            JKSHJ Offline
            JKSH
            Moderators
            wrote on last edited by
            #5

            Hi @freddy311082 ,

            Other people have had this problem before. See what they tried:

            • https://forum.qt.io/topic/3068/
            • http://www.qtcentre.org/threads/16440-QDateTimeEdit-(QTimeEdit-QDateEdit)-invalid-input

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            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