Results 1 to 2 of 2

Thread: HELP! #warning "Inclusion of header files from include/Qt is deprecated."

  1. #1
    Join Date
    Apr 2012
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question HELP! #warning "Inclusion of header files from include/Qt is deprecated."

    hello,
    I upgrade my qt from 4.3 to 4.7. And I found many files in the directory "include/Qt/*" increase some code like this:
    Qt Code:
    1. #ifndef QT_NO_QT_INCLUDE_WARN
    2. #if defined(__GNUC__)
    3. #warning "Inclusion of header files from include/Qt is deprecated."
    4. #elif defined(_MSC_VER)
    5. #pragma message("WARNING: Inclusion of header files from include/Qt is deprecated.")
    6. #endif
    7. #endif
    To copy to clipboard, switch view to plain text mode 

    That means, if I want to avoid the warning message , I must define the micro "QT_NO_QT_INCLUDE_WARN" ? But what is the meaning of warning message ?

    thanks

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: HELP! #warning "Inclusion of header files from include/Qt is deprecated."

    No, it means you should fix your source code to not use the deprecated include files and start using the documented include files. For example,
    Qt Code:
    1. #include "Qt/qwidget.h"
    2. // should be
    3. #include <QWidget> // this is what typically appears in the documentation and examples
    4. // or even
    5. #include <QtGui/QWidget> // this appears from time to time in examples
    6. #include <QtGui/qwidget.h> // and even this
    To copy to clipboard, switch view to plain text mode 
    In the meantime you can suppress the warning by defining QT_NO_QT_INCLUDE_WARN, but you will still have to fix your source before the deprecated includes disappear.

    BTW: I only see those warnings in the Qt 4.8 source, not Qt 4.7

Similar Threads

  1. How to avoid "warning: deprecated conversion from"?
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 18th January 2011, 16:11
  2. Replies: 5
    Last Post: 16th January 2011, 16:19
  3. Replies: 4
    Last Post: 18th April 2010, 01:37
  4. Replies: 2
    Last Post: 28th February 2010, 08:38
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05

Tags for this Thread

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.