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. How to set an empty(null) date in QDateEdit?
Forum Updated to NodeBB v4.3 + New Features

How to set an empty(null) date in QDateEdit?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 3.1k Views 1 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.
  • A Offline
    A Offline
    anargo
    wrote on last edited by
    #1

    The last answer in search is about five years ago.

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

      Hi and welcome to devnet,

      Nothing as changed. There's no empty date, either you have a valid or an invalid date. If you try to set a null date, it won't change anything.

      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
      • A Offline
        A Offline
        anargo
        wrote on last edited by
        #3

        Thank you.
        It's pretty terrible )

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

          What is your use case ?

          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
          • A Offline
            A Offline
            anargo
            wrote on last edited by
            #5

            I make a form with row search, using date-range (two date edits for each range). I can use wittingly large range, but it not comfortable for user (and date pickers actually not usefull). It will to confuse user. But there are high requirements to useability.
            I'm sorry for my english.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              anargo
              wrote on last edited by
              #6

              And the second case: We have a form with client birhtday (required parameter). Operator (user) sees an empty field - he will not forget to fill it (and it simle to check, if he forgot). But date 01.01.2000 (or any other) looks good (and we only can use a signal "dateChanged" to get to know there was a change or not). But even this does not guarantee the accuracy, because user may not change a date (a date may coincide with a correct), and we will not take a signal.

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

                For the raw search you can use a QCheckBox to enable/disable the date range from the earch.

                As for the birthdate, if you use the current date you are not likely to have someone of that age using your application.

                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

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved