summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@edeltech.ch>2015-12-13 00:06:41 +0100
committerSamuel Gaist <samuel.gaist@edeltech.ch>2015-12-24 00:26:40 +0000
commitca1402fce3e7d48e005db06efcb05b53ced540b3 (patch)
tree2d22901d802009666ddbf02a0dcbdab0b89e1b33
parent3fd05d917938c92cd1e4b919672b400de93d237f (diff)
downloadqtdoc-ca1402fce3e7d48e005db06efcb05b53ced540b3.tar.gz
Doc: session management documentation update
The session management documentation is still written for Qt 4 and reference functions that have moved from QApplication to QGuiApplication. The logic has also changed which is now fixed. Change-Id: I13f3ff7a13cfc67b8f70775dc9212cc1555ca362 Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com>
-rw-r--r--doc/src/howtos/session.qdoc28
1 files changed, 14 insertions, 14 deletions
diff --git a/doc/src/howtos/session.qdoc b/doc/src/howtos/session.qdoc
index 90329ada..f2ff7c08 100644
--- a/doc/src/howtos/session.qdoc
+++ b/doc/src/howtos/session.qdoc
@@ -69,17 +69,17 @@
restored when the machine is restarted.) They do support graceful
logouts where applications have the opportunity to cancel the process
after getting confirmation from the user. This is the functionality
- that corresponds to the QApplication::commitData() method.
+ that corresponds to the QGuiApplication::commitDataRequest() signal.
X11 has supported complete session management since X11R6.
\section1 Getting Session Management to Work with Qt
- Start by reimplementing QApplication::commitData() to
- enable your application to take part in the graceful logout process. If
- you are only targeting the Microsoft Windows platform, this is all you can
- and must provide. Ideally, your application should provide a shutdown
- dialog similar to the following:
+ Start by connecting a slot to the QGuiApplication::commitDataRequest()
+ signal to enable your application to take part in the graceful logout
+ process. If you are only targeting the Microsoft Windows platform, this
+ is all you can and must provide. Ideally, your application should provide
+ a shutdown dialog similar to the following:
\img session.png A typical dialog on shutdown
@@ -89,18 +89,18 @@
For complete session management (only supported on X11R6 at present),
you must also take care of saving the application's state, and
potentially of restoring the state in the next life cycle of the
- session. This saving is done by reimplementing
- QApplication::saveState(). All state data you are saving in this
- function, should be marked with the session identifier
- QApplication::sessionId(). This application specific identifier is
+ session. This saving is done by implementing a slot connected to the
+ QGuiApplication::saveStateRequest() signal. All state data you are saving in
+ this function, should be marked with the session identifier
+ QGuiApplication::sessionId(). This application specific identifier is
globally unique, so no clashes will occur. (See QSessionManager for
information on saving/restoring the state of a particular Qt
application.)
Restoration is usually done in the application's main()
- function. Check if QApplication::isSessionRestored() is \c true. If
+ function. Check if QGuiApplication::isSessionRestored() is \c true. If
that's the case, use the session identifier
- QApplication::sessionId() again to access your state data and restore
+ QGuiApplication::sessionId() again to access your state data and restore
the state of the application.
\b{Important:} In order to allow the window manager to
@@ -153,10 +153,10 @@
\li Use the session manager's \e Checkpoint and \e Shutdown buttons
with different settings and see how your application behaves. The save
type \e local means that the clients should save their state. It
- corresponds to the QApplication::saveState() function. The \e
+ corresponds to the QGuiApplication::saveStateRequest() signal. The \e
global save type asks applications to save their unsaved changes in
permanent, globally accessible storage. It invokes
- QApplication::commitData().
+ QGuiApplication::commitDataRequest().
\li Whenever something crashes, blame \c xsm and not Qt. \c xsm is far
from being a usable session manager on a user's desktop. It is,
however, stable and useful enough to serve as testing environment.