Results 1 to 2 of 2

Thread: #include <QBean>... what's it mean?

  1. #1
    Join Date
    Feb 2007
    Location
    Philadelphia, USA
    Posts
    255
    Thanks
    43
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default #include <QBean>... what's it mean?

    I often see "#include <QString>" or "#include <QMainWindow>" or whatever. In fact I use this syntax too. My question is... what does it translate to by the precompiler? For example, does the precompiler simply turn the "QMainWindow" to all lowercase and then add a .h? Or is there something else going on behind the scenes? For example, would #include <qStrinG> be incorrect? What's the general rule?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: #include <QBean>... what's it mean?

    Quote Originally Posted by magland View Post
    I often see "#include <QString>" or "#include <QMainWindow>" or whatever. In fact I use this syntax too. My question is... what does it translate to by the precompiler? For example, does the precompiler simply turn the "QMainWindow" to all lowercase and then add a .h? Or is there something else going on behind the scenes?
    These are so called "convenience headers". The headers actually exist but all they do is to include the corresponding actual header. For example header QMainWindow includes qmainwindow.h. This is also what module headers do; for example header QtGui includes actual headers of classes belonging to QtGui module.

    For example, would #include <qStrinG> be incorrect? What's the general rule?
    Yes, it's incorrect. Still if this works on file systems that do no care about the case (like Windows) it breaks on file systems that do care (like Linux). No black magic is done behind the curtains.
    Last edited by jpn; 9th July 2007 at 09:00. Reason: spelling error
    J-P Nurmi

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

    magland (9th July 2007)

Similar Threads

  1. QApplication: no such file or directory
    By jochen_r in forum Newbie
    Replies: 13
    Last Post: 15th November 2008, 22:46
  2. Painting problem
    By Mel in forum Qt Programming
    Replies: 10
    Last Post: 8th May 2007, 22:38
  3. Can't create an object : initialisation problem ?
    By Nyphel in forum Qt Programming
    Replies: 5
    Last Post: 12th March 2007, 10:07
  4. Replies: 7
    Last Post: 2nd June 2006, 13:48
  5. use button from another Window
    By raphaelf in forum Qt Programming
    Replies: 11
    Last Post: 2nd March 2006, 21:31

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.