2

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

Georges
  • 43
  • 1
  • 1
  • 7

1 Answers1

5

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.

Community
  • 1
  • 1
Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313
  • thank you that actually solved my problem.I have another question I need to put a lot of plot s and text boxes and tables and I want to chose there place on the grid and size i can't do that with your code because It keep setting the layout automatically do you know how do I proceed after I palce the widget myself in design mode in order to make it keep it's place after adding it to the layout? I have around 50 widgets and as the user scrolls he will see more of the widgets sort of like having different pages – Georges Jun 09 '16 at 14:17
  • @Georges Without a layout you will be solely responsible for widget placement. That's all. I don't understand what are you asking. Or what kind of answer do you expect? It's not true that layouts are added without a way to remove them. You have full control over what widgets have layouts. – Kuba hasn't forgotten Monica Jun 10 '16 at 17:10
  • I am new to programming a user interface and new to qt could you explain to me how I could place widgets manually?Or how to modify the layout? – Georges Jun 10 '16 at 17:46
  • @Georges Programmatically: add a new widget instance, parent it properly, then set its geometry. Using Designer: clear the layout from the parent widget. Add child widgets. Move/size them as desired. – Kuba hasn't forgotten Monica Jun 13 '16 at 13:50