Jump to content

Qt for HarmonyOS/qtohosextras doc/Open Link 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 window offers a URL field, an '''App Linking Only''' checkbox and an '''Open App Link''' button. On click the example obtains the default context via QOhosAbilityContext::getDefaultInstance(), creates options with QtOhosExtras::createOpenLinkOptions(), applies QOhosOpenLinkOptions::setAppLinkingOnly() from the checkbox and calls QOhosAbilityContext::tryOpenLink(). A failed call is reported in a warning box.
The window offers a URL field, an '''App Linking Only''' checkbox and an '''Open App Link''' button. On click the example obtains the default context via QOhosAbilityContext::getDefaultInstance(), creates options with QtOhosExtras::createOpenLinkOptions(), applies QOhosOpenLinkOptions::setAppLinkingOnly() from the checkbox and calls QOhosAbilityContext::tryOpenLink(). A failed call is reported in a warning box.


Files:
* [[Qt_for_HarmonyOS/qtohosextras_doc/Open_Link_Example|abilitycontext/openlink/main.cpp]]
* [[Qt_for_HarmonyOS/qtohosextras_doc/Open_Link_Example|abilitycontext/openlink/openlink.pro]]
* [[Qt_for_HarmonyOS/qtohosextras_doc/Open_Link_Example|abilitycontext/openlink/openlink.pro]]


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

Revision as of 09:24, 16 September 2026

< Qt for HarmonyOS / qtohosextras doc

Open Link Example

Demonstrates opening a link with optional App Linking enforcement.


The window offers a URL field, an App Linking Only checkbox and an Open App Link button. On click the example obtains the default context via QOhosAbilityContext::getDefaultInstance(), creates options with QtOhosExtras::createOpenLinkOptions(), applies QOhosOpenLinkOptions::setAppLinkingOnly() from the checkbox and calls QOhosAbilityContext::tryOpenLink(). A failed call is reported in a warning box.