git-svn-id: svn://db.shs.com.ru/libs@1 a8b55f48-bf90-11e4-a774-851b48703e85
31 lines
502 B
C++
31 lines
502 B
C++
#ifndef QSINGLEAPPLICATION_H
|
|
#define QSINGLEAPPLICATION_H
|
|
|
|
#include <QThread>
|
|
#include <QSharedMemory>
|
|
|
|
class QSingleApplication: public QThread
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
QSingleApplication(const QString & app_name = QString("qapp"));
|
|
~QSingleApplication();
|
|
|
|
bool isFirst() const {return first;}
|
|
|
|
private:
|
|
void run();
|
|
|
|
QSharedMemory shm;
|
|
bool first, exiting;
|
|
|
|
public slots:
|
|
void sendMessage(const QByteArray & m);
|
|
|
|
signals:
|
|
void messageReceived(QByteArray);
|
|
|
|
};
|
|
|
|
#endif // QSINGLEAPPLICATION_H
|