2015-02-27 03:00:11 +08:00
|
|
|
#ifndef SINGLE_APPLICATION_H
|
|
|
|
#define SINGLE_APPLICATION_H
|
2012-12-23 06:12:38 +08:00
|
|
|
|
2015-02-27 03:00:11 +08:00
|
|
|
#include <QApplication>
|
2012-12-23 06:12:38 +08:00
|
|
|
#include <QLocalSocket>
|
2015-02-27 03:00:11 +08:00
|
|
|
#include <QLocalServer>
|
2012-12-23 06:12:38 +08:00
|
|
|
|
|
|
|
/**
|
2015-02-27 03:19:38 +08:00
|
|
|
* @brief The SingleApplication class handles multipe instances of the same Application
|
2015-02-27 03:00:11 +08:00
|
|
|
* @see QApplication
|
2012-12-23 06:12:38 +08:00
|
|
|
*/
|
2015-02-27 03:00:11 +08:00
|
|
|
class SingleApplication : public QApplication
|
2012-12-23 06:12:38 +08:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-04-08 05:17:57 +08:00
|
|
|
explicit SingleApplication(int&, char *[]);
|
2012-12-23 06:12:38 +08:00
|
|
|
~SingleApplication();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void showUp();
|
|
|
|
|
|
|
|
private slots:
|
2015-02-27 03:00:11 +08:00
|
|
|
void slotConnectionEstablished();
|
|
|
|
|
2012-12-23 06:12:38 +08:00
|
|
|
private:
|
2015-02-27 03:00:11 +08:00
|
|
|
QLocalSocket *socket;
|
|
|
|
QLocalServer *server;
|
2012-12-23 06:12:38 +08:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2015-02-27 03:00:11 +08:00
|
|
|
#endif // SINGLE_APPLICATION_H
|