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 min and max date to QDateTimeEdit programly
Qt 6.11 is out! See what's new in the release blog

How to set min and max date to QDateTimeEdit programly

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.8k Views
  • 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.
  • M Offline
    M Offline
    mark_ua_1999
    wrote on last edited by
    #1

    Hi, I am trying to set but failed hope your ideas will help to resolve the problem, thank.
    QDateTimeEdit *line = new QDateTimeEdit();
    line->setDisplayFormat("yyyy-MM-dd HH:mm");
    // lin
    line->minimumDate( QDate::currentDate());

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      http://doc.qt.io/qt-5/qdatetimeedit.html#setDateRange

      http://doc.qt.io/qt-5/qdatetimeedit.html#minimumDate-prop
      http://doc.qt.io/qt-5/qdatetimeedit.html#maximumDate-prop

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      M 1 Reply Last reply
      2
      • VRoninV VRonin

        http://doc.qt.io/qt-5/qdatetimeedit.html#setDateRange

        http://doc.qt.io/qt-5/qdatetimeedit.html#minimumDate-prop
        http://doc.qt.io/qt-5/qdatetimeedit.html#maximumDate-prop

        M Offline
        M Offline
        mark_ua_1999
        wrote on last edited by
        #3

        @VRonin thanks it helped

        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