Results 1 to 3 of 3

Thread: What's the difference beetwem those two notations in including Qt's header files?

  1. #1
    Join Date
    Sep 2011
    Posts
    86
    Thanks
    4
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default What's the difference beetwem those two notations in including Qt's header files?

    I see in QtCreator and documentation this way:
    #include <QtGui/QWidget>

    Why not just
    #include <QWidget>

    I do not remeber if it is related with c++ syntax... maybe namespaces or something?

  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: What's the difference beetwem those two notations in including Qt's header files?

    There's no difference from a user perspective except that one is shorter to type. They both identify the same file called QWidget. On my Linux machine qmake supplements the compiler include path with:
    Qt Code:
    1. g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED \
    2. -I/usr/share/qt4/mkspecs/linux-g++ \
    3. -I. \
    4. -I/usr/include/qt4/QtCore \
    5. -I/usr/include/qt4/QtGui \
    6. -I/usr/include/qt4 \
    7. -I. -I. -o main.o main.cpp
    To copy to clipboard, switch view to plain text mode 
    for a simple GUI program. The first include style will find the file via "/usr/include/qt4", the second style via "/usr/include/qt4/QtGui".

  3. #3
    Join Date
    Sep 2011
    Posts
    86
    Thanks
    4
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: What's the difference beetwem those two notations in including Qt's header files?

    Thanks, you resolved my doubts.

Similar Threads

  1. Qt Creator PROBLEM INCLUDING 'QSystemInfo' HEADER FILE
    By Rakula in forum Qt Tools
    Replies: 1
    Last Post: 24th September 2010, 09:28
  2. Replies: 2
    Last Post: 28th February 2010, 07:38
  3. Problem with including lib files
    By metow in forum Qt Tools
    Replies: 2
    Last Post: 12th December 2009, 21:57
  4. Replies: 1
    Last Post: 6th November 2009, 21:25
  5. qmake and including files doubt
    By clinisbut in forum Newbie
    Replies: 3
    Last Post: 16th August 2008, 15:40

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.