diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2015-12-14 14:47:01 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@theqtcompany.com> | 2016-01-28 19:17:32 +0000 |
commit | 8c843712da2510beb7f510c1885df819edbdf058 (patch) | |
tree | 161d8cc7997f95e29af68a5ef01b749e69a2584d /src/gui/kernel/qguiapplication.cpp | |
parent | e6de387ea0d2bf479caf7216f206ff35241faa3b (diff) |
Doc: a QScreen can be a placeholder if there are no screens attached
As of change a094af001795c9651b299d700a992150d1aba33a, X11 now joins
other platforms in having a fake screen if no physical screens are
attached, rather than ever allowing QGuiApplication::screens() to
return an empty list or QGuiApplication::primaryScreen() to return
null. This is more consistent across platforms and helps to prevent
bugs in applications which want to use QScreen in some context but
fail to check whether it exists.
[ChangeLog][X11] In case there are no physical screens attached,
QGuiApplication::screens() and QGuiApplication::primaryScreen() will
return a placeholder QScreen object.
Task-number: QTBUG-42985
Change-Id: I0f58afbfe2a034fb9e872a5d1dbdabad2c7dbf9e
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index a19abccb37..8352c95457 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -921,15 +921,10 @@ QList<QScreen *> QGuiApplication::screens() /*! \property QGuiApplication::primaryScreen - \brief the primary (or default) screen of the application, or null if there is none. + \brief the primary (or default) screen of the application. This will be the screen where QWindows are initially shown, unless otherwise specified. - On some platforms, it may be null when there are actually no screens connected. - It is not possible to start a new QGuiApplication while there are no screens. - Applications which were running at the time the primary screen was removed - will stop rendering graphics until one or more screens are restored. - The primaryScreenChanged signal was introduced in Qt 5.6. \sa screens() |