Allow running only one instance of application.

This commit is contained in:
2017-08-22 12:33:57 +02:00
parent 6f30949343
commit 5ebea2f7c9
4 changed files with 66 additions and 3 deletions
+21
View File
@@ -0,0 +1,21 @@
#ifndef APPLICATION_H
#define APPLICATION_H
#include <QApplication>
#include <QSharedMemory>
class Application : public QApplication
{
Q_OBJECT
public:
Application(int &argc, char **argv);
~Application();
bool lock();
private:
QSharedMemory *m_single;
};
#endif // APPLICATION_H