Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Limits for Edit box

    General and Desktop
    3
    6
    1018
    Loading More Posts
    • 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
      shirisha last edited by

      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 Reply Quote 0
      • A
        andreyc last edited by

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

        1 Reply Last reply Reply Quote 0
        • S
          shirisha last edited by

          hi sir..

               I dt get the anwser .Please help me
          
          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 0
            • S
              shirisha last edited by

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

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 Reply Quote 0
                • First post
                  Last post