Results 1 to 6 of 6

Thread: Inclusion of header files from include/Qt is deprecated.

  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    84
    Thanks
    7
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

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

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Inclusion of header files from include/Qt is deprecated.

    What file causes the message to appear?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    84
    Thanks
    7
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Inclusion of header files from include/Qt is deprecated.

    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

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Inclusion of header files from include/Qt is deprecated.

    Does it need to include all of them for the warning to appear or only some of them or maybe just one (which one?)?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    84
    Thanks
    7
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Inclusion of header files from include/Qt is deprecated.

    hard to say,
    could it be that you should include <QtGui/QColor> instead of <QColor> etc ?
    regards,
    jh

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Inclusion of header files from include/Qt is deprecated.

    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:
    Qt Code:
    1. #include <QtGlobal>//<Qt/qglobal.h>
    2.  
    3. #ifdef MYLIB_LIB
    4. # define MYLIB_EXPORT Q_DECL_EXPORT
    5. #else
    6. # define MYLIB_EXPORT Q_DECL_IMPORT
    7. #endif
    To copy to clipboard, switch view to plain text mode 
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. The header file 'mainwindow.h' doesn't include <QObject>.
    By nhs_0702 in forum Qt Programming
    Replies: 5
    Last Post: 14th May 2010, 17:02
  2. compile to arm+include header
    By nataly in forum Qt Programming
    Replies: 1
    Last Post: 8th November 2009, 12:59
  3. 2 classes header file inclusion probleml !!
    By sujan.dasmahapatra in forum General Programming
    Replies: 4
    Last Post: 15th October 2009, 19:31
  4. AVOIDING mutiple inclusion of header file???
    By pratik in forum General Programming
    Replies: 4
    Last Post: 10th July 2007, 14:09
  5. unable to include header file
    By sonia in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2007, 08:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.