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