mirror of
https://github.com/itay-grudev/SingleApplication.git
synced 2025-01-15 17:02:06 +08:00
bf00721b9c
Now it can be defined in the cpp file that include it (usually main.cpp).
37 lines
757 B
C++
37 lines
757 B
C++
#ifndef SINGLE_APPLICATION_H
|
|
#define SINGLE_APPLICATION_H
|
|
|
|
// Change this to inherit from QGuiApplication or QCoreApplication
|
|
#ifndef QAPPLICATION_CLASS
|
|
#define QAPPLICATION_CLASS QCoreApplication
|
|
#endif
|
|
|
|
#define QUOTE(C) #C
|
|
#define INCLUDE_FILE(C) QUOTE(C)
|
|
#include INCLUDE_FILE(QAPPLICATION_CLASS)
|
|
|
|
class SingleApplicationPrivate;
|
|
|
|
/**
|
|
* @brief The SingleApplication class handles multipe instances of the same Application
|
|
* @see QApplication
|
|
*/
|
|
class SingleApplication : public QAPPLICATION_CLASS
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit SingleApplication(int&, char *[]);
|
|
~SingleApplication();
|
|
|
|
signals:
|
|
void showUp();
|
|
|
|
private slots:
|
|
void slotConnectionEstablished();
|
|
|
|
private:
|
|
SingleApplicationPrivate *d_ptr;
|
|
};
|
|
|
|
#endif // SINGLE_APPLICATION_H
|