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. Range Slider unable to set StepSize property
Qt 6.11 is out! See what's new in the release blog

Range Slider unable to set StepSize property

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 706 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.
  • gfxxG Offline
    gfxxG Offline
    gfxx
    wrote on last edited by gfxx
    #1

    on my ui.qml file I insert a rengeSlider and in designer I set StepSize to 1,00 (but 10,00 is the same) to try to have rangeslider.first.value and rangeslider.second.value as integer only value (so 1,00 - 2,00 - 3,00 - 4,00 and so on).
    But the value returned is only double with decimal part (0,789185 - 1,981625 - 2,65816 and so on).

    Where are my error?

    Update ... after these code in myFunction:

                property int  integerValue: 0
                property double doubleValue: 0
                property int  integerValueSlid1: 0
                property double doubleValueSlid1: 0
                property int  integerValueSlid2: 0
                property double doubleValueSlid2: 0
    
    
                function changeRangeValue(){
                    doubleValueSlid1 = 0
                    integerValueSlid1 = 0
                    doubleValueSlid2 = 0
                    integerValueSlid2 = 0
                    doubleValueSlid1 = rangeSliderNum.first.value
                    integerValueSlid1 = doubleValueSlid1
                    doubleValueSlid2 = rangeSliderNum.second.value
                    integerValueSlid2 = doubleValueSlid2
                    //console.log((integerValueSlid1))
                    teTempoMinSlider.text = integerValueSlid1
                    teTempoMaxSlider.text = integerValueSlid2 - integerValueSlid1
    

    the range slider work ok!!
    I write this just because it is added to the search for the forum ... can serve someone.

    regards

    bkt

    ODБOïO 1 Reply Last reply
    0
    • gfxxG gfxx

      on my ui.qml file I insert a rengeSlider and in designer I set StepSize to 1,00 (but 10,00 is the same) to try to have rangeslider.first.value and rangeslider.second.value as integer only value (so 1,00 - 2,00 - 3,00 - 4,00 and so on).
      But the value returned is only double with decimal part (0,789185 - 1,981625 - 2,65816 and so on).

      Where are my error?

      Update ... after these code in myFunction:

                  property int  integerValue: 0
                  property double doubleValue: 0
                  property int  integerValueSlid1: 0
                  property double doubleValueSlid1: 0
                  property int  integerValueSlid2: 0
                  property double doubleValueSlid2: 0
      
      
                  function changeRangeValue(){
                      doubleValueSlid1 = 0
                      integerValueSlid1 = 0
                      doubleValueSlid2 = 0
                      integerValueSlid2 = 0
                      doubleValueSlid1 = rangeSliderNum.first.value
                      integerValueSlid1 = doubleValueSlid1
                      doubleValueSlid2 = rangeSliderNum.second.value
                      integerValueSlid2 = doubleValueSlid2
                      //console.log((integerValueSlid1))
                      teTempoMinSlider.text = integerValueSlid1
                      teTempoMaxSlider.text = integerValueSlid2 - integerValueSlid1
      

      the range slider work ok!!
      I write this just because it is added to the search for the forum ... can serve someone.

      regards

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      @gfxx
      see also parseInt(), parseFloat()

      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