I want to group a bunch of widgets, text fields, buttons, labels, etc., into one type of object that can be created and destroyed dynamically while the application is running; is the possible? If so, any quick words on where to get started? Thanks.
I want to group a bunch of widgets, text fields, buttons, labels, etc., into one type of object that can be created and destroyed dynamically while the application is running; is the possible? If so, any quick words on where to get started? Thanks.
Sure, just define a new widget class (derived from QWidget) and, in its constructor, populate it with all those child widgets and a layout manager. Then you can create as many instances of this compound widget as you want.
To get started, see, for instance, the Calculator example in Qt; it defines a Calculator widget with several children. Or you could just create your widget in Design mode in Qt Creator and have it generate all the boilerplate code.
Bookmarks