[Qt-interest] Organize Qt Designer UI objects in hierarchy

Dr. X xunlei at renci.org
Tue Jul 6 19:57:49 CEST 2010


Hi All,
I am using Qt Designer to design a GUI with objects embedded in another 
object. For instance, I have both a QSlider and QDateEdit in a QGroupBox 
to control the date of the start of an event. And another pair of 
QSlider and QDateEdit in another QGroupBox for the end date of the same 
event. Through Qt Designer, all the objects are flat, i.e.
QGroupBox* groupBox_startDate;
QSlider* slider_startDate;
QDateEdit* dateEdit_startDate;

QGroupBox* groupBox_endDate;
QSlider* slider_endDate;
QDateEdit* dateEdit_endDate;
...

I would like some how to organize them as
struct DateControl{
QGroupBox* groupBox;
QSlider* slider;
QDateEdit* dateEdit;
};

It is conceptually straightforward and easier to maintain the code 
especially the coupled signal/slot actions with each object group.
Can anyone suggest how I can do so through Qt Designer? Since every time 
I modify the .ui file, I will have a new UICed .h file. This is quite 
annoying when you want to rely on Qt Designer to iterate through a 
project development. Thanks a lot.

Best,
xunlei



More information about the Qt-interest-old mailing list