Jump to content

Qt for HarmonyOS/qtohosextras doc/ShareKit Namespace

From Qt Wiki
Revision as of 08:38, 16 September 2026 by Shawn Luo (talk | contribs) (Update from qdoc output (QTFOROH-2307))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

< Qt for HarmonyOS / qtohosextras doc

ShareKit Namespace

QtOhosExtras::ShareKit

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

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

This namespace was introduced in Qt 5.12.12.

Classes

class QOhosShareControllerOptions
class QOhosShareOperationResult
class QOhosSharedRecord

Types

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

Functions

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

Detailed Description

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. More...

class QOhosShareOperationResult

ShareOperationResult wraps Ohos ShareOperationResult interface. More...

class QOhosSharedRecord

The QOhosSharedRecord class represents a record to be shared with other application. More...

Type Documentation

enum class ShareKit::ShareAbilityType

Enumerates system sharing abilities shown on the sharing panel. Used with QOhosShareControllerOptions::setExcludedAbilities() to hide selected abilities from the panel. See ShareAbilityType.

Constant Value Description
QtOhosExtras::ShareKit::ShareAbilityType::CopyToPasteboard 0 Copy the shared content to the pasteboard.
QtOhosExtras::ShareKit::ShareAbilityType::SaveToMediaAsset 1 Save the shared content to the Gallery.
QtOhosExtras::ShareKit::ShareAbilityType::SaveAsFile 2 Save the shared content as a file.
QtOhosExtras::ShareKit::ShareAbilityType::Print 3 Print the shared content.
QtOhosExtras::ShareKit::ShareAbilityType::SaveToSuperHub 4 Save the shared content to SuperHub.

This enum was introduced or modified in Qt 5.12.12.

Function Documentation

QSharedPointer<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 createFileRecord(). See SharedRecord.content

QSharedPointer<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

QSharedPointer<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 createContentRecord(). See SharedRecord.uri

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

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