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. [Solved]How can i set double step to QSpinBox
QtWS25 Last Chance

[Solved]How can i set double step to QSpinBox

Scheduled Pinned Locked Moved General and Desktop
10 Posts 5 Posters 7.7k 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.
  • R Offline
    R Offline
    Ruzik
    wrote on last edited by
    #1

    Hellow!, How can i set double step to QSpinBox?
    In advance many thanks for your help!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on last edited by
      #2

      If you mean you want to increment or decrement by 2, try looking at "QSpinBox::setSingleStep()":http://doc.qt.nokia.com/4.7-snapshot/qspinbox.html#singleStep-prop

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Ruzik
        wrote on last edited by
        #3

        I need to increment or decrement by 0.01, i need to this method not for int, for double
        Can i do this by conventional ways or i need to make new class?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mlong
          wrote on last edited by
          #4

          Ah. You need a "QDoubleSpinBox.":http://doc.qt.nokia.com/4.7-snapshot/qdoublespinbox.html it also has a setSingleStep() method, which you can set to 0.01.

          Software Engineer
          My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

          1 Reply Last reply
          0
          • EddyE Offline
            EddyE Offline
            Eddy
            wrote on last edited by
            #5

            Did you try this :

            @void setSingleStep ( double val )@

            The docs say: By default val == 1.0 and val must be greater than 0.

            Qt Certified Specialist
            www.edalsolutions.be

            1 Reply Last reply
            0
            • V Offline
              V Offline
              vsorokin
              wrote on last edited by
              #6

              you need use [[Doc:QDoubleSpinBox]] and method setSingleStep(double val) for set your step 0.01

              --
              Vasiliy

              1 Reply Last reply
              0
              • R Offline
                R Offline
                Ruzik
                wrote on last edited by
                #7

                thank you for your help!

                1 Reply Last reply
                0
                • EddyE Offline
                  EddyE Offline
                  Eddy
                  wrote on last edited by
                  #8

                  3 answers to your question! You must feel happy?!

                  Could you change your title and add [solved] to it? Thanks.

                  Qt Certified Specialist
                  www.edalsolutions.be

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    mlong
                    wrote on last edited by
                    #9

                    Glad to help!

                    Software Engineer
                    My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                    1 Reply Last reply
                    0
                    • B Offline
                      B Offline
                      behnam
                      wrote on last edited by
                      #10

                      Hi you can use "morph into" by right click on spinbox on ui
                      and use ->setPrecision(3); in code

                      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