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. How can we create custom slider?

How can we create custom slider?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 6.2k 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.
  • P Offline
    P Offline
    pratik041
    wrote on last edited by
    #1

    I want to create a slider which contain a custom slider handle and i want to paint it according to slider handle position.

    Pratik Agrawal

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      you could subclass QAbstractSlider and do all on your own or derive from QSlider. Just check, how much you have to change...

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pratik041
        wrote on last edited by
        #3

        can we paint some portion of slider and change it according to requirement?

        Pratik Agrawal

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          If the docs do notstate it, not.
          You could use style sheets for that, there you can change the handle etc.
          Also using a custom style would be possible, as all parts of the slider are drawn by the style.

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0
          • D Offline
            D Offline
            deimos
            wrote on last edited by
            #5

            I did something that maybe is also for you.
            I subclassed QAbstactSlider and reimplemented paint event to draw a custom handler and a buffer progress under it like when you watch videos on the web.
            You can find the sources "here":https://gitorious.org/mediadownloader/mediadownloader/blobs/master/main/mbslider.cpp

            1 Reply Last reply
            0
            • P Offline
              P Offline
              pratik041
              wrote on last edited by
              #6

              thank's

              Pratik Agrawal

              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