Doc: a QScreen can be a placeholder if there are no screens attached
As of change a094af0017, 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>
bb10
parent
e6de387ea0
commit
8c843712da
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -238,11 +238,6 @@
|
|||
\property QDesktopWidget::screenCount
|
||||
\brief the number of screens currently available on the system.
|
||||
|
||||
Note that on some platforms, screenCount will be zero if there are actually
|
||||
no screens connected. Applications which were running at the time the
|
||||
screenCount went to zero will stop rendering graphics until one or more
|
||||
screens are restored.
|
||||
|
||||
\since 4.6
|
||||
*/
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue