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. Limits for Edit box

Limits for Edit box

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

    Hi Sir,
    The given data must be in limits of +-30 only.If other than that number that should be invalid.Please help me..vry urgent required

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      Try "QIntValidator":https://qt-project.org/doc/qt-5-snapshot/qintvalidator.html#details

      1 Reply Last reply
      0
      • S Offline
        S Offline
        shirisha
        wrote on last edited by
        #3

        hi sir..

             I dt get the anwser .Please help me
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Go to the documentation page linked by andreyc, it shows what class to use and how to use it to limit you number input from -30 to + 30. However you can also use a "QSpinBox":http://doc.qt.io/qt-5/qspinbox.html

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

            Hi sir,
            can i use Text edit box for displaying range value without spin box ..

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

              Do you mean QLineEdit ? Then yes and use the QIntValidator like andreyc suggested. Or you can also hide the two arrows from the QSpinBox

              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