Results 1 to 2 of 2

Thread: QSingleApplication

  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany.
    Posts
    111
    Thanks
    29
    Thanked 3 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default QSingleApplication

    Hello all,
    Can somebody tell me what's going on with my single app? Both the app.SendMessage() and the app.isRunning() below, return false always. Which means that I can launch as many instances as I like!
    thanks
    K
    Qt Code:
    1. #include <QtSingleApplication.h>
    2. #include "mainwindow.h"
    3.  
    4. int main(int argc, char **argv)
    5. {
    6. QtSingleApplication app("f76f6f66f66sa987g9866a", argc, argv);
    7.  
    8. if (app.sendMessage("Do I exist?"))
    9. return 0;
    10.  
    11. if(app.isRunning ())
    12. return 0;
    13.  
    14. app.initialize();
    15.  
    16. MainWindow w;
    17.  
    18. QObject::connect(&app, SIGNAL(messageReceived(const QString&)),
    19. &app, SLOT(activateMainWidget()));
    20.  
    21. w.show();
    22.  
    23. return app.exec();
    24. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSingleApplication

    Since the QSingleApplication class is a part of a commercial solution I would suggest that you contact the Trolltech helpdesk.

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.