Results 1 to 4 of 4

Thread: including QObject

  1. #1
    Join Date
    Jun 2015
    Location
    California, USA
    Posts
    61
    Thanks
    43
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11

    Default including QObject

    I've noticed that #include <QObject> doesn't seem to be necessary in the .h when you subclass QObject.
    Is it included in all files associated with a .pro file, or is the Q_OBJECT macro responsible?
    Last edited by ravas; 30th October 2015 at 17:49.

  2. #2
    Join Date
    Feb 2012
    Location
    Warsaw, Poland
    Posts
    37
    Thanks
    3
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: including QObject

    Maybe some other file includes it and you are including it not directly?
    What files are you including to .h file of your QObject subclass?

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

    ravas (31st October 2015)

  4. #3
    Join Date
    Jun 2015
    Location
    California, USA
    Posts
    61
    Thanks
    43
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11

    Default Re: including QObject

    I see one included file has <Qt>, <QtGlobal> and <QtPrintSupport/QPrinter>.
    But I didn't see any mention of QObject in their documentation.

  5. #4
    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: including QObject

    You get QObject indirectly through at least the QPrinter include.

    There is no include file <Qt> I can see.

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

    ravas (31st October 2015)

Similar Threads

  1. including the gui from another process in my app
    By apatras in forum Qt Programming
    Replies: 1
    Last Post: 12th April 2011, 15:44
  2. Including the QT libraries
    By hapheston in forum Installation and Deployment
    Replies: 3
    Last Post: 22nd August 2010, 13:23
  3. help on including the headers
    By newb in forum Qt Programming
    Replies: 0
    Last Post: 21st June 2010, 05:41
  4. including Qt headers in DLL
    By dave_mm0 in forum Newbie
    Replies: 7
    Last Post: 15th July 2009, 21:39
  5. including
    By mickey in forum General Programming
    Replies: 2
    Last Post: 26th July 2006, 21:08

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.