PDA

View Full Version : Grouping Widgets Together



joshuajcarson
21st October 2008, 19:52
For my current project at work, I'm suppose to implement a way to group and ungroup different widgets together. I'm using QMdiArea for the windowing system right now, and right now we just fill it with QMdiSubWindows everytime they create a new widget.

Should I just subclass QWidget, put a QGridLayout (or whatever layout I want), fill it with the individual widgets that are currently being used, then put my new subclassed QWidget into a QMdiSubWindow? Does Qt already have a widget whose sole purpose is to act as a container for lots of other widgets? Based off what I just told you, can you think of a different solution that would allow me to get the grouping capabilities my boss wants?

I'll continue developing my container class, but I was hoping I could gain some wisdom by giong to these forums before I get too far into this project.

maverick_pol
21st October 2008, 20:17
Depending whether you need to have a group of object as a graphical representation or a data set you might think of these:
1) use a Layout or a custom layout
2) use a containter to keep QObjects
3) use a groupbox
4) you may also develop a class like QActionGroup to hold a group of objects and have the interface like this class.
5) surely there are more ideas and surely faster, but these are just the ones that come to mind right now

kacper