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. Disable editing in QDateEdit
Forum Updated to NodeBB v4.3 + New Features

Disable editing in QDateEdit

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

    I use the QDateEdit widget. I would like to choose data from popup calendar only - I am not be able to disable the edit box.

    jsulmJ 1 Reply Last reply
    0
    • M Offline
      M Offline
      Milosz
      wrote on last edited by
      #5

      Of course - thanks a lot

      1 Reply Last reply
      0
      • M Milosz

        I use the QDateEdit widget. I would like to choose data from popup calendar only - I am not be able to disable the edit box.

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @Milosz Use https://doc.qt.io/qt-5/qabstractspinbox.html#lineEdit to get the line edit widget and call setDisabled(true) on it.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        2
        • M Offline
          M Offline
          Milosz
          wrote on last edited by Milosz
          #3

          But the lineEdit is protected

          jsulmJ 1 Reply Last reply
          0
          • M Milosz

            But the lineEdit is protected

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @Milosz You're right. Then you will need to subclass QDateEdit.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1
            • M Offline
              M Offline
              Milosz
              wrote on last edited by
              #5

              Of course - thanks a lot

              1 Reply Last reply
              0
              • mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #6

                Hi
                What about its ReadOnly property?
                dateEdit->setReadOnly(true);

                1 Reply Last reply
                4

                • Login

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