Adding scroll bar to a Qwidget

2019-07-25 14:47发布

问题:

I want to add scroll bars to the frame container. the QscrollArea can only take on widget but in my frame I need many wigets

I tried to write a code for the bars after adding a horizantal and vertical one but It's too hard.Is there any pre-made free code I could use ?

thank you

回答1:

QScrollArea can take any number of widgets - indirectly. The widget() can contain any number of child widgets, it can have a layout set, etc. See e.g. this answer.