TheKedge
2nd November 2006, 15:37
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
#include <QtSingleApplication.h>
#include "mainwindow.h"
int main(int argc, char **argv)
{
QtSingleApplication app("f76f6f66f66sa987g9866a", argc, argv);
if (app.sendMessage("Do I exist?"))
return 0;
if(app.isRunning ())
return 0;
app.initialize();
MainWindow w;
QObject::connect(&app, SIGNAL(messageReceived(const QString&)),
&app, SLOT(activateMainWidget()));
w.show();
return app.exec();
}
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
#include <QtSingleApplication.h>
#include "mainwindow.h"
int main(int argc, char **argv)
{
QtSingleApplication app("f76f6f66f66sa987g9866a", argc, argv);
if (app.sendMessage("Do I exist?"))
return 0;
if(app.isRunning ())
return 0;
app.initialize();
MainWindow w;
QObject::connect(&app, SIGNAL(messageReceived(const QString&)),
&app, SLOT(activateMainWidget()));
w.show();
return app.exec();
}