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. Custom Slider implementation
Qt 6.11 is out! See what's new in the release blog

Custom Slider implementation

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 1.1k 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.
  • V Offline
    V Offline
    Vinoth Rajendran4
    wrote on last edited by Vinoth Rajendran4
    #1

    alt text

    I want to implement a slider which looks like the above.

    I can implement the handle part.

    But how to implement the background which has straight line and tiny dots ?

    Can someone help me with few details on how to start implementing the background part ?

    any help is appreciated...

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Documentation shows how to do it: https://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-slider or using range slider https://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-rangeslider.

      For each tick, you can simply draw it using Rectangle:

      Rectangle {
        width: 6
        height: 6
        radius: 3
      }
      

      You can instantiate them with some Repeater.

      (Z(:^

      V 1 Reply Last reply
      5
      • sierdzioS sierdzio

        Documentation shows how to do it: https://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-slider or using range slider https://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-rangeslider.

        For each tick, you can simply draw it using Rectangle:

        Rectangle {
          width: 6
          height: 6
          radius: 3
        }
        

        You can instantiate them with some Repeater.

        V Offline
        V Offline
        Vinoth Rajendran4
        wrote on last edited by
        #3

        @sierdzio , Thanks .. I used the repeater to implement

        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