Jump to content

Qt for HarmonyOS/qtohosextras doc/Screen Display ID Example

From Qt Wiki
Revision as of 09:10, 16 September 2026 by Shawn Luo (talk | contribs) (Add example documentation from qdoc output (QTFOROH-2307))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

< Qt for HarmonyOS / qtohosextras doc

Screen Display ID Example

Demonstrates obtaining the native display ID of the screen a window is shown on.


The window shows the current display ID and a refresh button. The value is queried with QtOhosExtras::tryGetScreenDisplayId() for the screen of the window, once after the window is shown and again on every button click, so the window can be moved to another display and re-queried. A null result is shown as <invalid>.

Files: