Jump to content

Qt for HarmonyOS/qtohosextras doc/ShareKit Namespace: Difference between revisions

From Qt Wiki
Created page with "<!-- Source: qtohosextras-sharekit.html --> <span id="sharekit-namespace"></span> = ShareKit Namespace = <span class="small-subtitle">(QtOhosExtras::ShareKit)<br /> </span> The ShareKit to expose Share Kit API. More... <div class="table"> {| class="wikitable alignedsummary" |- | class="memItemLeft rightAlign topAlign"| Header: | class="memIte..."
 
No edit summary
Line 13: Line 13:
|-
|-
| class="memItemLeft rightAlign topAlign"| Header:
| class="memItemLeft rightAlign topAlign"| Header:
| class="memItemRight bottomAlign"| <span class="preprocessor">#include </span>
| class="memItemRight bottomAlign"| <span class="preprocessor">#include <ShareKit></span>
|-
|-
| class="memItemLeft rightAlign topAlign"| qmake:
| class="memItemLeft rightAlign topAlign"| qmake:
Line 23: Line 23:




</div>
</div><span id="classes"></span>
 
 
<span id="classes"></span>
 
<span id="classes"></span>
== Classes ==
== Classes ==


Line 43: Line 38:




</div>
</div><span id="types"></span>
<span id="types"></span>
 
<span id="types"></span>
== Types ==
== Types ==


Line 58: Line 50:




</div>
</div><span id="functions"></span>
<span id="functions"></span>
 
<span id="functions"></span>
== Functions ==
== Functions ==


Line 68: Line 57:
{| class="wikitable alignedsummary"
{| class="wikitable alignedsummary"
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| class="memItemLeft rightAlign topAlign"| QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord>
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createContentRecord|createContentRecord]]'''(const QMimeType &amp;''mimeType'', const QString &amp;''content'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createContentRecord|createContentRecord]]'''(const QMimeType &amp;''mimeType'', const QString &amp;''content'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| class="memItemLeft rightAlign topAlign"| QSharedPointer<QtOhosExtras::ShareKit::QOhosShareControllerOptions>
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createControllerOptions|createControllerOptions]]'''()
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createControllerOptions|createControllerOptions]]'''()
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| class="memItemLeft rightAlign topAlign"| QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord>
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createFileRecord|createFileRecord]]'''(const QFileInfo &amp;''fileInfo'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createFileRecord|createFileRecord]]'''(const QFileInfo &amp;''fileInfo'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer
| class="memItemLeft rightAlign topAlign"| QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord>
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createUrlRecord|createUrlRecord]]'''(const QUrl &amp;''url'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createUrlRecord|createUrlRecord]]'''(const QUrl &amp;''url'')
|}
|}
Line 91: Line 80:


The [[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace|ShareKit]] to expose Share Kit API.
The [[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace|ShareKit]] to expose Share Kit API.
</div>
<div class="classes">


<span id="classes-1"></span>
<span id="classes-1"></span>
== Classes ==
== Classes ==


<span id="class-qohossharecontrolleroptions"></span>
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class|QOhosShareControllerOptions]] ===
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class|QOhosShareControllerOptions]] ===


The [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class|QOhosShareControllerOptions]] class is to configure items, such as the preview mode of the shared content, selection mode, and other information, and pop-up window anchor. It determines the display style of the sharing panel. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section107934816010 ShareControllerOptions]. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class#details|More...]]
The [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class|QOhosShareControllerOptions]] class is to configure items, such as the preview mode of the shared content, selection mode, and other information, and pop-up window anchor. It determines the display style of the sharing panel. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section107934816010 ShareControllerOptions]. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosShareControllerOptions_Class#details|More...]]


<span id="class-qohossharedrecord"></span>
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class|QOhosSharedRecord]] ===
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class|QOhosSharedRecord]] ===


The [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class|QOhosSharedRecord]] class represents a record to be shared with other application. A record can be created using. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#details|More...]]
The [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class|QOhosSharedRecord]] class represents a record to be shared with other application. A record can be created using. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#details|More...]]


</div>
</div>
Line 118: Line 100:
<span id="ShareAbilityType-enum"></span>
<span id="ShareAbilityType-enum"></span>
=== <span id="ShareAbilityType-enum"></span>enum ShareKit::<span class="name">ShareAbilityType</span> ===
=== <span id="ShareAbilityType-enum"></span>enum ShareKit::<span class="name">ShareAbilityType</span> ===
</div>
<div class="func">


<span id="function-documentation"></span>
<span id="function-documentation"></span>
== Function Documentation ==
== Function Documentation ==


<span id="createContentRecord"></span>
=== createContentRecord ===
=== createContentRecord ===


Line 140: Line 117:
'''See also''' QtOhosExtras::ShareKit::createFileRecord() and ..
'''See also''' QtOhosExtras::ShareKit::createFileRecord() and ..


<span id="createControllerOptions"></span>
=== createControllerOptions ===
=== createControllerOptions ===


Line 150: Line 126:
Creates a controller options instnace. Controller options can be used to configure preview mode, selection mode and pop-up window anchor. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section107934816010 ShareControllerOptions]
Creates a controller options instnace. Controller options can be used to configure preview mode, selection mode and pop-up window anchor. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section107934816010 ShareControllerOptions]


<span id="createFileRecord"></span>
=== createFileRecord ===
=== createFileRecord ===


Line 164: Line 139:
'''See also''' QtOhosExtras::ShareKit::createContentRecord() and ..
'''See also''' QtOhosExtras::ShareKit::createContentRecord() and ..


<span id="createUrlRecord"></span>
=== createUrlRecord ===
=== createUrlRecord ===



Revision as of 08:38, 28 January 2026

ShareKit Namespace

(QtOhosExtras::ShareKit)

The ShareKit to expose Share Kit API. More...

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


Classes

Types

enum ShareAbilityType { CopyToPasteboard, SaveToMediaAsset, SaveAsFile, Print, SaveToSuperHub }


Functions

QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> createContentRecord(const QMimeType &mimeType, const QString &content)
QSharedPointer<QtOhosExtras::ShareKit::QOhosShareControllerOptions> createControllerOptions()
QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> createFileRecord(const QFileInfo &fileInfo)
QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> createUrlRecord(const QUrl &url)


Detailed Description

The ShareKit to expose Share Kit API.

Classes

class QOhosShareControllerOptions

The QOhosShareControllerOptions class is to configure items, such as the preview mode of the shared content, selection mode, and other information, and pop-up window anchor. It determines the display style of the sharing panel. See ShareControllerOptions. More...

class QOhosSharedRecord

The QOhosSharedRecord class represents a record to be shared with other application. A record can be created using. More...

Type Documentation

enum ShareKit::ShareAbilityType

Function Documentation

createContentRecord

QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord>
ShareKit::createContentRecord(const QMimeType &mimeType, const QString &content)

Creates a shared "content" record with a given mimeType and content. Shared record can be created with content (this function) or as a file shared record

See SharedRecord.content

See also QtOhosExtras::ShareKit::createFileRecord() and ..

createControllerOptions

QSharedPointer<QtOhosExtras::ShareKit::QOhosShareControllerOptions>
ShareKit::createControllerOptions()

Creates a controller options instnace. Controller options can be used to configure preview mode, selection mode and pop-up window anchor. See ShareControllerOptions

createFileRecord

QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord>
ShareKit::createFileRecord(const QFileInfo &fileInfo)

Creates a shared "file" record with a given fileInfo. Shared record can be created with file (this function) or as a content record

See SharedRecord.uri

See also QtOhosExtras::ShareKit::createContentRecord() and ..

createUrlRecord

QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord>
ShareKit::createUrlRecord(const QUrl &url)

Creates a shared record with a given url. See SharedRecord.content