QtPass 1.7.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
SingleApplication Class Reference

QApplication subclass enforcing single-instance behavior via IPC. More...

#include <singleapplication.h>

Inheritance diagram for SingleApplication:
Collaboration diagram for SingleApplication:

Public Slots

void receiveMessage ()
 Slot invoked when an incoming IPC message arrives.

Signals

void messageAvailable (const QString &message)
 messageAvailable notification from commandline

Public Member Functions

 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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ SingleApplication()

SingleApplication::SingleApplication ( int & argc,
char * argv[],
QString uniqueKey )

Construct a SingleApplication with a unique instance key.

Parameters
argcReference to program argc forwarded to QApplication.
argvProgram argv forwarded to QApplication.
uniqueKeyKey used to identify and scope the single instance.

Member Function Documentation

◆ 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
messageargs sent to qtpass executable

◆ sendMessage()

auto SingleApplication::sendMessage ( const QString & message) -> bool

Send a message to the running instance.

Parameters
messageText 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: