ShareKit Namespace: Difference between revisions
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="memItemRight bottomAlign"| <span class="preprocessor">#include </span> |-..." |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 127: | Line 127: | ||
<span id="createContentRecord"></span> | <span id="createContentRecord"></span> | ||
=== | === createContentRecord === | ||
<syntaxhighlight lang="cpp"> | |||
QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> | |||
ShareKit::createContentRecord(const QMimeType &mimeType, const QString &content) | |||
</syntaxhighlight> | |||
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 | 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 | ||
| Line 136: | Line 141: | ||
<span id="createControllerOptions"></span> | <span id="createControllerOptions"></span> | ||
=== | === createControllerOptions === | ||
<syntaxhighlight lang="cpp"> | |||
QSharedPointer<QtOhosExtras::ShareKit::QOhosShareControllerOptions> | |||
ShareKit::createControllerOptions() | |||
</syntaxhighlight> | |||
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> | <span id="createFileRecord"></span> | ||
=== | === createFileRecord === | ||
<syntaxhighlight lang="cpp"> | |||
QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> | |||
ShareKit::createFileRecord(const QFileInfo &fileInfo) | |||
</syntaxhighlight> | |||
Creates a shared "file" record with a given ''fileInfo''. Shared record can be created with file (this function) or as a content record | Creates a shared "file" record with a given ''fileInfo''. Shared record can be created with file (this function) or as a content record | ||
| Line 150: | Line 165: | ||
<span id="createUrlRecord"></span> | <span id="createUrlRecord"></span> | ||
=== | === createUrlRecord === | ||
<syntaxhighlight lang="cpp"> | |||
QSharedPointer<QtOhosExtras::ShareKit::QOhosSharedRecord> | |||
ShareKit::createUrlRecord(const QUrl &url) | |||
</syntaxhighlight> | |||
Creates a shared record with a given ''url''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.content] | Creates a shared record with a given ''url''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.content] | ||
Latest revision as of 06:02, 28 January 2026
The ShareKit to expose Share Kit API. More...
| Header: | #include |
| qmake: | QT += ohosextras |
| Since: | Qt 5.12.12 |
Classes
| class | QOhosShareControllerOptions |
| class | QOhosSharedRecord |
Types
| enum | ShareAbilityType { CopyToPasteboard, SaveToMediaAsset, SaveAsFile, Print, SaveToSuperHub } |
Functions
| QSharedPointer | createContentRecord(const QMimeType &mimeType, const QString &content) |
| QSharedPointer | createControllerOptions() |
| QSharedPointer | createFileRecord(const QFileInfo &fileInfo) |
| QSharedPointer | createUrlRecord(const QUrl &url) |
Classes
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...
The QOhosSharedRecord class represents a record to be shared with other application. A record can be created using. More...
Type Documentation
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 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