Jump to content

Qt for HarmonyOS/qtohosextras doc/Keep Screen On Example: Difference between revisions

From Qt Wiki
Add example documentation from qdoc output (QTFOROH-2307)
 
Fix example page conversion (QTFOROH-2307)
Line 9: Line 9:
The main window contains a checkbox. Toggling it calls QtOhosExtras::setWindowKeepScreenOn() with the window and the checkbox state, so the screen stays awake while the box is checked and the request is released when it is unchecked. The setting is tied to the given window.
The main window contains a checkbox. Toggling it calls QtOhosExtras::setWindowKeepScreenOn() with the window and the checkbox state, so the screen stays awake while the box is checked and the request is released when it is unchecked. The setting is tied to the given window.


Files:
* [[Qt_for_HarmonyOS/qtohosextras_doc/Keep_Screen_On_Example|keepscreenon/keepscreenon.pro]]
* [[Qt_for_HarmonyOS/qtohosextras_doc/Keep_Screen_On_Example|keepscreenon/main.cpp]]
* [[Qt_for_HarmonyOS/qtohosextras_doc/Keep_Screen_On_Example|keepscreenon/main.cpp]]


[[Category:Qt for HarmonyOS]]
[[Category:Qt for HarmonyOS]]

Revision as of 09:23, 16 September 2026

< Qt for HarmonyOS / qtohosextras doc

Keep Screen On Example

Demonstrates keeping the screen on while a window is displayed.


The main window contains a checkbox. Toggling it calls QtOhosExtras::setWindowKeepScreenOn() with the window and the checkbox state, so the screen stays awake while the box is checked and the request is released when it is unchecked. The setting is tied to the given window.