提供 X 顯示配置的有關信息。 更多...
| 頭: | #include <QX11Info> |
| qmake: | QT += x11extras |
| Since: | Qt 5.1 |
| int | appDpiX (int screen = -1) |
| int | appDpiY (int screen = -1) |
| unsigned long | appRootWindow (int screen = -1) |
| int | appScreen () |
| unsigned long | appTime () |
| unsigned long | appUserTime () |
| xcb_connection_t * | connection () |
| Display * | display () |
| unsigned long | getTimestamp () |
| bool | isCompositingManagerRunning (int screen = -1) |
| bool | isPlatformX11 () |
| QByteArray | nextStartupId () |
| void | setAppTime (unsigned long time ) |
| void | setAppUserTime (unsigned long time ) |
| void | setNextStartupId (const QByteArray & id ) |
提供 X 顯示配置的有關信息。
The class provides two APIs: a set of non-static functions that provide information about a specific widget or pixmap, and a set of static functions that provide the default information for the application.
警告: This class is only available on X11. For querying per-screen information in a portable way, use QDesktopWidget .
[static]
int
QX11Info::
appDpiX
(
int
screen
= -1)
Returns the horizontal resolution of the given screen in terms of the number of dots per inch.
The screen argument is an X screen number. Be aware that if the user's system uses Xinerama (as opposed to traditional X11 multiscreen), there is only one X screen. Use QDesktopWidget to query for information about Xinerama screens.
另請參閱 appDpiY ().
[static]
int
QX11Info::
appDpiY
(
int
screen
= -1)
Returns the vertical resolution of the given screen in terms of the number of dots per inch.
The screen argument is an X screen number. Be aware that if the user's system uses Xinerama (as opposed to traditional X11 multiscreen), there is only one X screen. Use QDesktopWidget to query for information about Xinerama screens.
另請參閱 appDpiX ().
[static]
unsigned
long
QX11Info::
appRootWindow
(
int
screen
= -1)
Returns a handle for the applications root window on the given screen .
The screen argument is an X screen number. Be aware that if the user's system uses Xinerama (as opposed to traditional X11 multiscreen), there is only one X screen. Use QDesktopWidget to query for information about Xinerama screens.
另請參閱 QApplication::desktop ().
[static]
int
QX11Info::
appScreen
()
Returns the number of the screen where the application is being displayed.
This method refers to screens in the original X11 meaning with a different DISPLAY environment variable per screen. This information is only useful if your application needs to know on which X screen it is running.
In a typical multi-head configuration, multiple physical monitors are combined in one X11 screen. This means this method returns the same number for each of the physical monitors. In such a setup you are interested in the monitor information as provided by the X11 RandR extension. This is available through QDesktopWidget and QScreen .
另請參閱 display ().
[static]
unsigned
long
QX11Info::
appTime
()
返迴 X11 時間。
另請參閱 setAppTime () 和 appUserTime ().
[static]
unsigned
long
QX11Info::
appUserTime
()
返迴 X11 用戶時間。
另請參閱 setAppUserTime () 和 appTime ().
[static]
xcb_connection_t
*QX11Info::
connection
()
Returns the default XCB connection for the application.
另請參閱 display ().
[static]
顯示
*QX11Info::
display
()
返迴應用程序的默認顯示。
另請參閱 appScreen ().
[static]
unsigned
long
QX11Info::
getTimestamp
()
從 X 服務器抓取當前 X11 時間戳。
This method creates a property notify event and blocks till it is received back from the X Server.
該函數在 Qt 5.2 引入。
[static]
bool
QX11Info::
isCompositingManagerRunning
(
int
screen
= -1)
Returns true if there is a compositing manager running for the connection attached to screen .
若 screen equals -1, the application's primary screen is used.
該函數在 Qt 5.7 引入。
[static]
bool
QX11Info::
isPlatformX11
()
Returns true if the application is currently running on X11.
該函數在 Qt 5.2 引入。
[static]
QByteArray
QX11Info::
nextStartupId
()
Returns the startup ID that will be used for the next window to be shown by this process.
After the next window is shown, the next startup ID will be empty.
http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt
該函數在 Qt 5.4 引入。
另請參閱 setNextStartupId ().
[static]
void
QX11Info::
setAppTime
(
unsigned
long
time
)
Sets the X11 time to the value specified by time .
另請參閱 appTime () 和 setAppUserTime ().
[static]
void
QX11Info::
setAppUserTime
(
unsigned
long
time
)
Sets the X11 user time as specified by time .
另請參閱 appUserTime () 和 setAppTime ().
[static]
void
QX11Info::
setNextStartupId
(const
QByteArray
&
id
)
Sets the next startup ID to id .
This is the startup ID that will be used for the next window to be shown by this process.
The startup ID of the first window comes from the environment variable DESKTOP_STARTUP_ID. This method is useful for subsequent windows, when the request comes from another process (e.g. via DBus).
該函數在 Qt 5.4 引入。
另請參閱 nextStartupId ().