PDA

View Full Version : Which to include QtGui or QLabel, QLineEdit...



MIH1406
3rd October 2009, 11:28
Hi All,

If I used these widgets in my application:
QLabel
QLineEdit
QPushButton
QRadioButton
QGroupBox

QHBoxLayout
QVBoxLayout
QGridLayout

... etc

Is it better to include theme separately or just include <QtGui> instead and what is the difference in size and memory usage?

Thanks
Mohammad

caduel
3rd October 2009, 12:09
rule of thumb:
* collecting includes like QtGui are less to type.
* they take longer to compile (because more include files will be read and processed than nec.) - if this is really noticeable, depends on the includes and the size of your project
* they might increase code size (though probably only a bit), like iostream does

You can't really say without checking the contents.
I usually use the indiv. header files and use QtGui only for test programs or bug reports...

MIH1406
7th October 2009, 21:15
I did not take your idea are with <QtGui> or not.

Be clear please

Thank you

yogeshgokul
8th October 2009, 12:23
Better stick with individual include with forward declaration in header and actual include in source file.