KDSingleApplication API Documentation
1.0
Loading...
Searching...
No Matches
source
src
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
17
#include "
kdsingleapplication_lib.h
"
18
19
class
KDSingleApplicationPrivate;
20
21
class
KDSINGLEAPPLICATION_EXPORT
KDSingleApplication
:
public
QObject
22
{
23
Q_OBJECT
24
Q_PROPERTY
(
QString
name READ name CONSTANT)
25
Q_PROPERTY(
bool
isPrimaryInstance READ isPrimaryInstance CONSTANT)
26
27
public:
28
explicit
KDSingleApplication
(
QObject
*parent =
nullptr
);
29
explicit
KDSingleApplication
(const
QString
&name,
QObject
*parent =
nullptr
);
30
~
KDSingleApplication
();
31
32
QString
name() const;
33
bool
isPrimaryInstance() const;
34
35
public 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
40
Q_SIGNALS:
41
void
messageReceived(const
QByteArray
&message);
42
43
private:
44
Q_DECLARE_PRIVATE(
KDSingleApplication
)
45
std::unique_ptr<KDSingleApplicationPrivate> d_ptr;
46
};
47
48
#endif
// KDSINGLEAPPLICATION_H
KDSingleApplication
Definition
kdsingleapplication.h:22
kdsingleapplication_lib.h
KDSINGLEAPPLICATION_EXPORT
#define KDSINGLEAPPLICATION_EXPORT
Definition
kdsingleapplication_lib.h:20
QByteArray
QObject
QObject::Q_PROPERTY
Q_PROPERTY(...)
QString
© 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