Krita Source Code Documentation
Loading...
Searching...
No Matches
qtsingleapplication.h
Go to the documentation of this file.
1// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
2// SPDX-License-Identifier: BSD-3-Clause
3
4#ifndef QTSINGLEAPPLICATION_H
5#define QTSINGLEAPPLICATION_H
6
7#include <kritaui_export.h>
8#include <QApplication>
9
10class QtLocalPeer;
11
12class KRITAUI_EXPORT QtSingleApplication : public QApplication
13{
14 Q_OBJECT
15
16public:
17 QtSingleApplication(int &argc, char **argv, bool GUIenabled = true);
18 QtSingleApplication(const QString &id, int &argc, char **argv);
19#if QT_VERSION < 0x050000
20 QtSingleApplication(int &argc, char **argv, Type type);
21# if defined(Q_WS_X11)
22 QtSingleApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
23 QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0);
24 QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
25# endif // Q_WS_X11
26#endif // QT_VERSION < 0x050000
27
28 bool isRunning();
29 QString id() const;
30
31 void setActivationWindow(QWidget* aw, bool activateOnMessage = true);
32 QWidget* activationWindow() const;
33
34 // Obsolete:
35 void initialize(bool dummy = true)
36 { isRunning(); Q_UNUSED(dummy) }
37
38 void setSingleApplicationReady();
39
40public Q_SLOTS:
41 bool sendMessage(const QString &message, int timeout = 5000);
42 void activateWindow();
43
44
45Q_SIGNALS:
46 void messageReceived(const QString &message);
47
48
49private:
50 void sysInit(const QString &appId = QString());
52 QWidget *actWin;
53};
54
55#endif // QTSINGLEAPPLICATION_H
The QtSingleApplication class provides an API to detect and communicate with running instances of an ...
void initialize(bool dummy=true)
void messageReceived(const QString &message)