Results 1 to 4 of 4

Thread: Which to include QtGui or QLabel, QLineEdit...

  1. #1
    Join Date
    Aug 2009
    Location
    Saudi Arabia - Buraidah
    Posts
    48
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Which to include QtGui or QLabel, QLineEdit...

    Hi All,

    If I used these widgets in my application:
    QLabel
    QLineEdit
    QPushButton
    QRadioButton
    QGroupBox

    QHBoxLayout
    QVBoxLayout
    QGridLayout

    ... etc

    Is it better to include theme separately or just include <QtGui> instead and what is the difference in size and memory usage?

    Thanks
    Mohammad
    http://brainstorm.ubuntu.com/idea/24714/image/1/
    The Linux Counter Project - user number # 497262
    The Ubuntu Counter Project - user number # 29025

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Which to include QtGui or QLabel, QLineEdit...

    rule of thumb:
    * collecting includes like QtGui are less to type.
    * they take longer to compile (because more include files will be read and processed than nec.) - if this is really noticeable, depends on the includes and the size of your project
    * they might increase code size (though probably only a bit), like iostream does

    You can't really say without checking the contents.
    I usually use the indiv. header files and use QtGui only for test programs or bug reports...

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

    MIH1406 (3rd June 2010)

  4. #3
    Join Date
    Aug 2009
    Location
    Saudi Arabia - Buraidah
    Posts
    48
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Which to include QtGui or QLabel, QLineEdit...

    I did not take your idea are with <QtGui> or not.

    Be clear please

    Thank you
    http://brainstorm.ubuntu.com/idea/24714/image/1/
    The Linux Counter Project - user number # 497262
    The Ubuntu Counter Project - user number # 29025

  5. #4
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Which to include QtGui or QLabel, QLineEdit...

    Better stick with individual include with forward declaration in header and actual include in source file.

  6. The following user says thank you to yogeshgokul for this useful post:

    MIH1406 (3rd June 2010)

Similar Threads

  1. segmentation fault on closing
    By harakiri in forum Qt Programming
    Replies: 6
    Last Post: 8th July 2009, 13:54
  2. QLineEdit
    By GuL in forum Newbie
    Replies: 3
    Last Post: 19th August 2008, 17:54
  3. Pointer Question related to QLineEdit
    By ChrisReath in forum Qt Programming
    Replies: 1
    Last Post: 23rd May 2008, 15:13
  4. Replies: 7
    Last Post: 10th September 2007, 19:35
  5. Calling a new form from current form
    By webgenius in forum Qt Programming
    Replies: 7
    Last Post: 8th April 2007, 19:50

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.