Qt for HarmonyOS/qtohosextras doc/Start Ability For Result Example: Difference between revisions
Add example documentation from qdoc output (QTFOROH-2307) |
Fix example page conversion (QTFOROH-2307) |
||
| Line 11: | Line 11: | ||
'''Note: '''Requests are asynchronous and several can be outstanding, so results must be correlated with the returned request identifier; there is no blocking variant of startAbilityForResult(). At minimum the bundle name and the ability name must be set on the want. | '''Note: '''Requests are asynchronous and several can be outstanding, so results must be correlated with the returned request identifier; there is no blocking variant of startAbilityForResult(). At minimum the bundle name and the ability name must be set on the want. | ||
* [[Qt_for_HarmonyOS/qtohosextras_doc/Start_Ability_For_Result_Example|abilitycontext/startabilityforresult/startabilityforresult.pro]] | * [[Qt_for_HarmonyOS/qtohosextras_doc/Start_Ability_For_Result_Example|abilitycontext/startabilityforresult/startabilityforresult.pro]] | ||
[[Category:Qt for HarmonyOS]] | [[Category:Qt for HarmonyOS]] | ||
Revision as of 09:28, 16 September 2026
< Qt for HarmonyOS / qtohosextras doc
Start Ability For Result Example
Demonstrates starting another UIAbility and receiving its result asynchronously.
Three buttons start a target ability with QOhosAbilityContext::startAbilityForResult(): with a want only, with a want and start options built via QtOhosExtras::createStartOptions(), and with an intentionally empty want to exercise the error path. A dialog collects the target bundle and ability names. Every call returns a request identifier which is logged; results arrive through the startAbilityForResultResponseReceived() signal with the result code and an optional returned want, and failures through startAbilityForResultErrorResponseReceived().
Note: Requests are asynchronous and several can be outstanding, so results must be correlated with the returned request identifier; there is no blocking variant of startAbilityForResult(). At minimum the bundle name and the ability name must be set on the want.