PDA

View Full Version : Qt modules



ber_44
29th May 2007, 07:51
Just wondering:
Is there any advantage of doing #include <QHttp>, etc.
instead of doing #include <QtNetwork>?
Does it load less code into memory or what?

jpn
29th May 2007, 08:28
Including a header of a single class makes the compilation faster than including all the headers of the whole module. Headers QtCore, QtGui, QtNetwork, etc. are convenience headers that include all headers belonging to the corresponding module.

MarkoSan
30th May 2007, 07:28
I have another question regarding modules?

What is the difference between (for instance):



#include <QtGui/QAction>


and



#include <QAction>


Which is right? It seems both includes work fine ...

Eldritch
30th May 2007, 23:10
Using
#include <QAction> assumes your include paths point to the .../include/QtGui/ directory, whereas
#include <QtGui/QAction> requires only that your include path contain the main Qt .../include/ directory.