PDA

View Full Version : Inclusion of header files from include/Qt is deprecated.



jh
25th November 2010, 22:18
hi,

i get this warning since Qt 4.7.1:

'Inclusion of header files from include/Qt is deprecated.'

what is the problem and what can i do to fix this?

regards,
jh

wysota
25th November 2010, 23:14
What file causes the message to appear?

jh
26th November 2010, 14:18
a file which includes the following stuff:

#include "NavigatorProject.h" // header of the current class

#include <QFileDialog>
#include <QFileInfo>
#include <QList>
#include <QDataStream>
#include <QMessageBox>
#include <QInputDialog>


// many, many classes imported from my own libs

...
...
...


the warning comes when the file is compiled which includes the shown headers.

regards,
jh

wysota
26th November 2010, 14:29
Does it need to include all of them for the warning to appear or only some of them or maybe just one (which one?)?

jh
22nd December 2010, 16:55
hard to say,
could it be that you should include <QtGui/QColor> instead of <QColor> etc ?
regards,
jh

high_flyer
16th January 2011, 15:19
I think this is a Qt bug, in how the auto file generation works for libs, under windows, I don't know if only with VS2008.
If your project is auto generated lib with VS2008, then the export/import definition file <projectname>_global.h is generated and it calls "Qt/qglobal.h" - which caused the warning.
Change the file as follows, and the warning will go away:


#include <QtGlobal>//<Qt/qglobal.h>

#ifdef MYLIB_LIB
# define MYLIB_EXPORT Q_DECL_EXPORT
#else
# define MYLIB_EXPORT Q_DECL_IMPORT
#endif