How to put many controls in a window with scrollbars?
-
In my case, that are hundres of buttons to show, I need a scroll view.
( The buttons are arranged by categories, the user should see all of them at a glance.)What's the proper way?
I have tried to put a
QWidget
(withadjustSize
) inQScrollArea
, it works.
ButadjustSize
has limits, the doc says:For windows, the screen size is also taken into account. If the sizeHint() is less than (200, 100) and the size policy is expanding, the window will be at least (200, 100). The maximum size of a window is 2/3 of the screen's width and height.
-
@JonB
Only when they are used with setIndexWidget() ;)In this case its more due to the fact that a QScrollArea with
"hundres of buttons" gets slow pretty fast on non
Desktop class devices.So View + Delegate is the sure road to better performance and
in many cases the preferred way which you likely already know. :)