Results 1 to 3 of 3

Thread: Doubt about includes

  1. #1
    Join Date
    Jun 2007
    Posts
    20
    Thanks
    7
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Doubt about includes

    Hi,

    I have a doubt.

    What's better (it is just an example):
    Qt Code:
    1. #include <GtGui>
    To copy to clipboard, switch view to plain text mode 
    or
    Qt Code:
    1. #include <QDir>
    2. #include <QFileInfo>
    3. #include <QTranslator>
    4. ...
    To copy to clipboard, switch view to plain text mode 

    I'm studing some Qt4 applications (source code) and all of them define all the individual includes, when using the #include <GtGui> all includes are "included". What we win defining all the includes individually?

    Best regards, xEsk.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Doubt about includes

    When you include all of the headers, the preprocessor and the compiler have to read all of them from the disk and then parse them. This takes time, although it's only a problem if you don't use precompiled headers.
    Last edited by jacek; 15th November 2007 at 21:34. Reason: typo

  3. The following user says thank you to jacek for this useful post:

    xEsk (15th November 2007)

  4. #3
    Join Date
    Jun 2007
    Posts
    20
    Thanks
    7
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Doubt about includes

    Ok, thank's!

Similar Threads

  1. QGraphicsItem HoverEvent Doubt
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 7th August 2007, 17:40
  2. QGraphicsView: Dialog Position Doubt
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 6th August 2007, 17:48
  3. Replies: 6
    Last Post: 5th July 2007, 02:00
  4. Doubt ?
    By Cutey in forum Qt Tools
    Replies: 2
    Last Post: 3rd March 2007, 09:45
  5. Global includes with designer custom widgets
    By mab in forum Qt Programming
    Replies: 2
    Last Post: 5th October 2006, 22:06

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.