From 4f0365107283ce321da713baeab4d2aad0456baf Mon Sep 17 00:00:00 2001 From: Itay Grudev Date: Mon, 2 Oct 2017 12:17:41 +0100 Subject: Primary PID support (#36) * Added the ability to bring the primary application window to the foreground on Windows systems by adding an option flag. THis option can only be used in Windows development and in applications derived from QApplication with a QMainWindow object. Because the primary application needs to be instructed to go to the foreground, the option SecondaryNotification must also be set to use this functionality * Changed the ability to bring the primary application window to the front as discussed in itay-grudev/SingleApplication#31. Now the process ID of the primary application get stored and is accessible for other instances of the application. It is to the developer to bring the applications windows to the front. For convenience the accompanying readme now contains a paragraph with example of how to do this on Windows systems. * v3.0.9 Added SingleApplicationPrivate::primaryPid() --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index e003ab4..82e7a5b 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,11 @@ Using `SingleApplication::instance()` is a neat way to get the `SingleApplication` instance for binding to it's signals anywhere in your program. +__Note:__ On Windows the ability to bring the application windows to the +foreground is restricted. See [Windows specific implementations](Windows.md) +for a workaround and an example implementation. + + Secondary Instances ------------------- @@ -177,7 +182,15 @@ Returns if the instance is a secondary instance. quint32 SingleApplication::instanceId() ``` -Returns a unique identifier for the current instance +Returns a unique identifier for the current instance. + +--- + +```cpp +qint64 SingleApplication::primaryPid() +``` + +Returns the process ID (PID) of the primary instance. ### Signals -- cgit v1.2.1