Important: Please read the Qt Code of Conduct -

Adding in vertical bar

  • Hello all,

    I have a canvas with a set size. The amount of widgets that I would like to add to the canvas will exceed the size that the canvas can hold.

    I was thinking that I could implement a scrolling feature where there would be a vertical side bar and the user scrolls with the sidebar to gain access to the other widgets. I have been exploring Qt for this feature but I haven't found anything yet.

    Does any know if I can do this with Qt?

  • Lifetime Qt Champion


    Are you thinking about something like QScrollArea ?

  • That looks like a possibility. Looking at the description, I can only associate 1 widget to the scroll area. Can I still use the QScrollArea with multiple widgets? Or is there a widget that groups multiple widgets into 1?

  • Lifetime Qt Champion

    You can add as many widgets to the scroll area as you want.
    You just add it as children to the first widget using a layout.
    so the one you set via setWidget is the main widget but it can contain any
    number of other widgets and the scroll area will handle the scrolling.

  • Great,

    thank you

Log in to reply