Allow running only one instance of application.
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user