Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. numerical inputs?

numerical inputs?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 3 Posters 628 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.
  • K Offline
    K Offline
    kgregory
    wrote on last edited by
    #1

    I'm trying to find a good numerical input control. I'm using Qt 5.12. SpinBox is pretty close to what I want, but you can't click on the middle of it and type in a number. I tried TextInput with IntValidator, which seems like it could be a good solution except that the text property is inherently text and it would take some extra jiggering to get it to convert values to integers as I need.

    Does anyone have suggestions for me?

    C 1 Reply Last reply
    0
    • K kgregory

      I'm trying to find a good numerical input control. I'm using Qt 5.12. SpinBox is pretty close to what I want, but you can't click on the middle of it and type in a number. I tried TextInput with IntValidator, which seems like it could be a good solution except that the text property is inherently text and it would take some extra jiggering to get it to convert values to integers as I need.

      Does anyone have suggestions for me?

      C Offline
      C Offline
      Circuits
      wrote on last edited by
      #2

      @kgregory " but you can't click on the middle of it and type in a number."

      set the editable property to true

      1 Reply Last reply
      4
      • K Offline
        K Offline
        kgregory
        wrote on last edited by
        #3

        omg! I love you!

        bonus points: how can I change the appearance of the spinbox? for example, combobox and slider both have good documentation on how to change the color and shape of various subcomponents, but spinbox doesn't. It looks a little out of place in my app.

        JonBJ 1 Reply Last reply
        0
        • K kgregory

          omg! I love you!

          bonus points: how can I change the appearance of the spinbox? for example, combobox and slider both have good documentation on how to change the color and shape of various subcomponents, but spinbox doesn't. It looks a little out of place in my app.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @kgregory
          https://doc.qt.io/qt-5/qspinbox-members.html shows all the inherited methods & properties, it can do all the standard widget stuff.

          Search https://doc.qt.io/qt-5/stylesheet-reference.html for QSpinBox and you will see the special QSS styles supported. https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qspinbox shows you a variety of attributes you can alter on its appearance.

          1 Reply Last reply
          1

          • Login

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