KDSingleApplication API Documentation 1.0
Loading...
Searching...
No Matches
kdsingleapplication.h
Go to the documentation of this file.
1/*
2 This file is part of KDSingleApplication.
3
4 SPDX-FileCopyrightText: 2019-2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5
6 SPDX-License-Identifier: MIT
7
8 Contact KDAB at <info@kdab.com> for commercial licensing options.
9*/
10#ifndef KDSINGLEAPPLICATION_H
11#define KDSINGLEAPPLICATION_H
12
13#include <QtCore/QObject>
14
15#include <memory>
16
18
19class KDSingleApplicationPrivate;
20
22{
23 Q_OBJECT
24 Q_PROPERTY(QString name READ name CONSTANT)
25 Q_PROPERTY(bool isPrimaryInstance READ isPrimaryInstance CONSTANT)
26
27public:
28 explicit KDSingleApplication(QObject *parent = nullptr);
29 explicit KDSingleApplication(const QString &name, QObject *parent = nullptr);
31
32 QString name() const;
33 bool isPrimaryInstance() const;
34
35public Q_SLOTS:
36 // avoid default arguments and overloads, as they don't mix with connections
37 bool sendMessage(const QByteArray &message);
38 bool sendMessageWithTimeout(const QByteArray &message, int timeout);
39
40Q_SIGNALS:
41 void messageReceived(const QByteArray &message);
42
43private:
44 Q_DECLARE_PRIVATE(KDSingleApplication)
45 std::unique_ptr<KDSingleApplicationPrivate> d_ptr;
46};
47
48#endif // KDSINGLEAPPLICATION_H
#define KDSINGLEAPPLICATION_EXPORT
Q_PROPERTY(...)

© 2019-2023 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDSingleApplication
A helper class for single-instance policy Qt applications
Generated on Wed Dec 20 2023 00:04:51 for KDSingleApplication API Documentation by doxygen 1.9.8