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

Zoomable scrollbar

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 741 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.
  • A Offline
    A Offline
    ABcourt
    wrote on last edited by
    #1

    I'm building an audio editor which requires a zoomable scrollbar in the timeline so the user can zoom in and out. My approach is to build a custom scrollbar where the user can expand and stretch the slider in order to zoom in and out, in a similar way to other DAWs:

    2a651ca3-e956-4c77-a1c4-4e054c936bca-image.png

    Any tips on how to handle the event of stretching/expanding from the ends of the slider and resizing it?

    1 Reply Last reply
    1
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      By zoomable, do you mean it should get its min and max values adjusted by a zoom factor ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ABcourt
        wrote on last edited by
        #3

        I guess so. The range of the scrollbar would change depending on how long the slider is. However, the event that I don't know how to get is when the mouse is over the ends of the slider so the user can change its length and so the range of the scrollbar (min/max values).

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I may have misunderstood how you want your UI to work.

          Can you describe the steps your users should do ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            ABcourt
            wrote on last edited by ABcourt
            #5

            The scrollbar that I'm trying to implement will be able to change the scale / zoom of a timeline.

            When opening the app, the scrollbar's default setup will be the slider occupying the full length of the scrollbar, like this:

            63e04f2f-7273-4a3b-9730-6a0b569d7c10-image.png

            The user will be able to stretch the slider from the ends of it and that would change the scale / zoom of the viewport, and so change the size of the slider within the scrollbar, like this:

            https://drive.google.com/file/d/1La-XbdSxtcz7S47fQKRS4SPx1-gsPFpp/view?usp=share_link

            50938900-f323-46c7-a288-958138372a34-image.png

            Hopefully, with this demo video is easier to understand my goal. Thanks for your help!

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Way clearer ! Thanks

              Then I think you will have to go from QAbstractSlider and implement a custom handle that you can resize and when that occurs adjust the max value of your slider.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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