Jump to content

Qt for HarmonyOS/qtohosextras doc/QOhosWant Class: Difference between revisions

From Qt Wiki
Created page with "< Qt for HarmonyOS / qtohosextras doc = QOhosWant Class = QOhosWant wraps Ohos [https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/want-V5 Want] class. More... {| class="wikitable" |- ! Header: | #include <QOhosWant> |- ! qmake: | QT += ohosextras |- ! Since: | Qt 5.12.12 |} * List of all members, including inherited members == Public Variables == {| class="wikitable" style="w..."
 
Update from qdoc output (QTFOROH-2307)
Line 1: Line 1:
< [[Qt_for_HarmonyOS/qtohosextras_doc|Qt for HarmonyOS / qtohosextras doc]]
< [[Qt_for_HarmonyOS/qtohosextras_doc|Qt for HarmonyOS / qtohosextras doc]]


= QOhosWant Class =
= QOhosWant Struct =


QOhosWant wraps Ohos [https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/want-V5 Want] class. More...
struct [[Qt_for_HarmonyOS/qtohosextras_doc/Qt_Ohos_Extras_C++_Classes|QtOhosExtras]]::QOhosWant
 
QOhosWant wraps Ohos [https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/want-V5 Want] class. [[#details|More...]]


{| class="wikitable"
{| class="wikitable"
|-
|-
! Header:
| Header:
| #include <QOhosWant>
| #include <QOhosWant>
|-
|-
! qmake:
| qmake:
| QT += ohosextras
| QT += ohosextras
|-
|-
! Since:
| Since:
| Qt 5.12.12
| Qt 5.12.12
|}
|}


* [[List_of_All_Members_for_QOhosWant|List of all members, including inherited members]]
This struct was introduced in Qt 5.12.12.
 
* [[Qt_for_HarmonyOS/qtohosextras_doc/List_of_All_Members_for_QOhosWant|List of all members, including inherited members]]


== Public Variables ==
== Public Variables ==


{| class="wikitable" style="width:100%"
{| class="wikitable"
|-
|-
! Type !! Variable
| QString
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class#abilityName-var|abilityName]]'''
|-
|-
| QString || '''[[#abilityName-var|abilityName]]'''
| QString
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class#action-var|action]]'''
|-
|-
| QString || '''[[#action-var|action]]'''
| QString
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class#bundleName-var|bundleName]]'''
|-
|-
| QString || '''[[#bundleName-var|bundleName]]'''
| QString
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class#deviceId-var|deviceId]]'''
|-
|-
| QString || '''[[#deviceId-var|deviceId]]'''
| QStringList
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class#entities-var|entities]]'''
|-
|-
| QStringList || '''[[#entities-var|entities]]'''
| QHash<QString, int>
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class#fds-var|fds]]'''
|-
|-
| QHash<QString, int> || '''[[#fds-var|fds]]'''
| QOhosWantFlags
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class#flags-var|flags]]'''
|-
|-
| QtOhosExtras::QOhosWantFlags || '''[[#flags-var|flags]]'''
| QString
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class#moduleName-var|moduleName]]'''
|-
|-
| QString || '''[[#moduleName-var|moduleName]]'''
| QJsonObject
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class#parameters-var|parameters]]'''
|-
|-
| QJsonObject || '''[[#parameters-var|parameters]]'''
| QString
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class#type-var|type]]'''
|-
|-
| QString || '''[[#type-var|type]]'''
| QString
|-
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class#uri-var|uri]]'''
| QString || '''[[#uri-var|uri]]'''
|}
|}


== Detailed Description ==
== Detailed Description ==
QOhosWant wraps Ohos [https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/want-V5 Want] class.


It keeps information that can be transmitted between applications. One of the usage scenarios of QOhosWant is a parameter of starting an ability or starting application process.
It keeps information that can be transmitted between applications. One of the usage scenarios of QOhosWant is a parameter of starting an ability or starting application process.


'''See also '''[[QtOhosExtras_Namespace#startAbility|startAbility()]] and [[QtOhosExtras_Namespace#startAppProcess|startAppProcess()]].
'''See also '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#startAbility|startAbility]]() and [[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#startAppProcess|startAppProcess]]().


== Member Variable Documentation ==
== Member Variable Documentation ==


=== <span id="abilityName-var"></span>QString QOhosWant::abilityName ===
=== <span id="abilityName-var"></span>[https://doc.qt.io/qt-5/qstring.html QString] QOhosWant::abilityName ===
 
Represents the name of Ability to be started. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Ability Name].
Represents the name of Ability to be started. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Ability Name].


=== <span id="action-var"></span>QString QOhosWant::action ===
=== <span id="action-var"></span>[https://doc.qt.io/qt-5/qstring.html QString] QOhosWant::action ===
 
Represents the general operations to be performed, for example: viewing, sharing, application details. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Action].
Represents the general operations to be performed, for example: viewing, sharing, application details. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Action].


=== <span id="bundleName-var"></span>QString QOhosWant::bundleName ===
=== <span id="bundleName-var"></span>[https://doc.qt.io/qt-5/qstring.html QString] QOhosWant::bundleName ===
 
Represents an application bundle name. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Bundle Name].
Represents an application bundle name. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Bundle Name].


=== <span id="deviceId-var"></span>QString QOhosWant::deviceId ===
=== <span id="deviceId-var"></span>[https://doc.qt.io/qt-5/qstring.html QString] QOhosWant::deviceId ===
 
Represents the device Id on which Ability is to be performed. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Device Id].
Represents the device Id on which Ability is to be performed. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Device Id].


=== <span id="entities-var"></span>QStringList QOhosWant::entities ===
=== <span id="entities-var"></span>[https://doc.qt.io/qt-5/qstringlist.html QStringList] QOhosWant::entities ===
 
Represents the additional category information of the target Ability for example: browser, video player. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Entities].
Represents the additional category information of the target Ability for example: browser, video player. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Entities].


=== <span id="fds-var"></span>QHash<QString, int> QOhosWant::fds ===
=== <span id="fds-var"></span>[https://doc.qt.io/qt-5/qhash.html QHash]<[https://doc.qt.io/qt-5/qstring.html QString], int> QOhosWant::fds ===
Represents the file descriptor map in the Want object. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-want Fds].
 
Represents the file descriptor map in the Want object. When serialized for [[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#startAbility|startAbility]](), each entry is passed to the platform using the fixed HarmonyOS file descriptor parameter format:
 
<syntaxhighlight lang="cpp">
 
parameters[key] = { "type": "FD", "value": fd }
 
</syntaxhighlight>
 
Use application-specific keys, for example a reverse-DNS prefix, and avoid using the same key in both fds and parameters. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-want Fds].
 
=== <span id="flags-var"></span>[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#QOhosWantFlag-enum|QOhosWantFlags]] QOhosWant::flags ===


=== <span id="flags-var"></span>QtOhosExtras::QOhosWantFlags QOhosWant::flags ===
Represents the way to deal with Want. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Flags].
Represents the way to deal with Want. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Flags].


'''See also '''[[QtOhosExtras_Namespace#QOhosWantFlag-enum|QOhosWantFlag]].
'''See also '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#QOhosWantFlag-enum|QOhosWantFlag]].
 
=== <span id="moduleName-var"></span>[https://doc.qt.io/qt-5/qstring.html QString] QOhosWant::moduleName ===


=== <span id="moduleName-var"></span>QString QOhosWant::moduleName ===
Represents the module name. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Module Name].
Represents the module name. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Module Name].


=== <span id="parameters-var"></span>QJsonObject QOhosWant::parameters ===
=== <span id="parameters-var"></span>[https://doc.qt.io/qt-5/qjsonobject.html QJsonObject] QOhosWant::parameters ===
 
Represents the list of parameters in the Want object. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Parameters].
Represents the list of parameters in the Want object. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Parameters].


=== <span id="type-var"></span>QString QOhosWant::type ===
=== <span id="type-var"></span>[https://doc.qt.io/qt-5/qstring.html QString] QOhosWant::type ===
Represents the MIME type of the file to open for example 'text/xml', 'image/*', etc. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Type].
 
Represents the MIME type of the file to open for example 'text/xml', 'image/ * ', etc. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Type].
 
=== <span id="uri-var"></span>[https://doc.qt.io/qt-5/qstring.html QString] QOhosWant::uri ===


=== <span id="uri-var"></span>QString QOhosWant::uri ===
Represents the type of pending data. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Uri].
Represents the type of pending data. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-want-V5 Uri].


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

Revision as of 08:31, 16 September 2026

< Qt for HarmonyOS / qtohosextras doc

QOhosWant Struct

struct QtOhosExtras::QOhosWant

QOhosWant wraps Ohos Want class. More...

Header: #include <QOhosWant>
qmake: QT += ohosextras
Since: Qt 5.12.12

This struct was introduced in Qt 5.12.12.

Public Variables

QString abilityName
QString action
QString bundleName
QString deviceId
QStringList entities
QHash<QString, int> fds
QOhosWantFlags flags
QString moduleName
QJsonObject parameters
QString type
QString uri

Detailed Description

It keeps information that can be transmitted between applications. One of the usage scenarios of QOhosWant is a parameter of starting an ability or starting application process.

See also startAbility() and startAppProcess().

Member Variable Documentation

QString QOhosWant::abilityName

Represents the name of Ability to be started. See Ability Name.

QString QOhosWant::action

Represents the general operations to be performed, for example: viewing, sharing, application details. See Action.

QString QOhosWant::bundleName

Represents an application bundle name. See Bundle Name.

QString QOhosWant::deviceId

Represents the device Id on which Ability is to be performed. See Device Id.

QStringList QOhosWant::entities

Represents the additional category information of the target Ability for example: browser, video player. See Entities.

QHash<QString, int> QOhosWant::fds

Represents the file descriptor map in the Want object. When serialized for startAbility(), each entry is passed to the platform using the fixed HarmonyOS file descriptor parameter format:

 parameters[key] = { "type": "FD", "value": fd }

Use application-specific keys, for example a reverse-DNS prefix, and avoid using the same key in both fds and parameters. See Fds.

QOhosWantFlags QOhosWant::flags

Represents the way to deal with Want. See Flags.

See also QOhosWantFlag.

QString QOhosWant::moduleName

Represents the module name. See Module Name.

QJsonObject QOhosWant::parameters

Represents the list of parameters in the Want object. See Parameters.

QString QOhosWant::type

Represents the MIME type of the file to open for example 'text/xml', 'image/ * ', etc. See Type.

QString QOhosWant::uri

Represents the type of pending data. See Uri.