QApplication subclass enforcing single-instance behavior via IPC.
More...
#include <singleapplication.h>
|
|
void | receiveMessage () |
| | Slot invoked when an incoming IPC message arrives.
|
|
| void | messageAvailable (const QString &message) |
| | messageAvailable notification from commandline
|
|
| | SingleApplication (int &argc, char *argv[], QString uniqueKey) |
| | Construct a SingleApplication with a unique instance key.
|
| auto | isRunning () -> bool |
| | Query whether another instance is already running.
|
| auto | sendMessage (const QString &message) -> bool |
| | Send a message to the running instance.
|
QApplication subclass enforcing single-instance behavior via IPC.
Detects whether another instance with the same unique key is running and enables forwarding messages (e.g., command-line arguments) to it.
Definition at line 17 of file singleapplication.h.
◆ SingleApplication()
| SingleApplication::SingleApplication |
( |
int & | argc, |
|
|
char * | argv[], |
|
|
QString | uniqueKey ) |
Construct a SingleApplication with a unique instance key.
- Parameters
-
| argc | Reference to program argc forwarded to QApplication. |
| argv | Program argv forwarded to QApplication. |
| uniqueKey | Key used to identify and scope the single instance. |
◆ isRunning()
| auto SingleApplication::isRunning |
( |
| ) |
-> bool |
Query whether another instance is already running.
- Returns
- true if another instance with the same key is running.
◆ messageAvailable
| void SingleApplication::messageAvailable |
( |
const QString & | message | ) |
|
|
signal |
messageAvailable notification from commandline
- Parameters
-
| message | args sent to qtpass executable |
◆ sendMessage()
| auto SingleApplication::sendMessage |
( |
const QString & | message | ) |
-> bool |
Send a message to the running instance.
- Parameters
-
| message | Text to deliver (typically forwarded command-line args). |
- Returns
- true if the message was successfully delivered.
The documentation for this class was generated from the following file: