Results 1 to 3 of 3

Thread: Creating QObjects before QCoreApplication

  1. #1
    Join Date
    Mar 2011
    Location
    PL
    Posts
    11
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Creating QObjects before QCoreApplication

    Is this correct to create and use QObjects before I create an instance of QCoreApplication? I'm writing an application, which works as system service and I need to do initialization (Write log using QFile for example) before I create QCoreApplication

  2. #2
    Join Date
    May 2010
    Posts
    61
    Thanks
    2
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Creating QObjects before QCoreApplication

    hi dawwin,

    I know that only QApplication has such a requirement that it needs to be created before any other UI object.
    There is nothing like this in the docs about QCoreApplication.

    Regards,
    wladek
    One second is long, everything longer than two seconds is definitely too long.

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Creating QObjects before QCoreApplication

    The application object is the one responsible for the event loop.
    You can create QObject before the QApplication / QCoreApplication but you wont be able to use events or signal slots.
    But writing / reading from a file should not be a problem.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Generic XML Serialization of QObjects
    By nickolais in forum Qt Programming
    Replies: 3
    Last Post: 23rd March 2011, 08:47
  2. Find QObjects that insatlled event filter
    By babu198649 in forum Qt Programming
    Replies: 4
    Last Post: 15th December 2010, 11:27
  3. Replies: 4
    Last Post: 24th August 2010, 15:28
  4. QObjects as data members stored by value
    By Radagast in forum Qt Programming
    Replies: 3
    Last Post: 6th August 2009, 19:14
  5. QCoreApplication!!!!
    By fellobo in forum Qt Programming
    Replies: 6
    Last Post: 17th January 2007, 00:56

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.