Results 1 to 20 of 21

Thread: Determine if QCoreApplication or QApplication is running

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Location
    Vienna, Austria
    Posts
    57
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Determine if QCoreApplication or QApplication is running

    No, I'm using the QTEST_APPLESS_MAIN() macro.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Determine if QCoreApplication or QApplication is running

    So you don't have any application object - neither console nor non-console. In this case QCoreApplication::startingUp() would be enough.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Oct 2009
    Location
    Vienna, Austria
    Posts
    57
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Determine if QCoreApplication or QApplication is running

    This is correct! I was nevertheless looking for a more generic way that would also allow me to work if a QCoreApplication would be instantiated explicitly.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Determine if QCoreApplication or QApplication is running

    Then qobject_cast<QApplication*>(QCoreApplication::inst ance()) works.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    doberkofler (21st September 2010)

Similar Threads

  1. Replies: 0
    Last Post: 25th November 2009, 15:07
  2. Replies: 4
    Last Post: 9th November 2009, 21:12
  3. Replies: 4
    Last Post: 1st December 2008, 11:13
  4. Replies: 1
    Last Post: 17th May 2006, 00:23
  5. <QtGui/QApplication> vs. <QApplication>
    By seneca in forum Qt Programming
    Replies: 5
    Last Post: 25th January 2006, 10:58

Tags for this Thread

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.