Qt for HarmonyOS/qtohosextras doc/QOhosSharedRecord Class: Difference between revisions
Created page with "(QtOhosExtras::ShareKit::QOhosSharedRecord) The QOhosSharedRecord class represents a record to be shared with other application. A record can be created using. More... {| class="wikitable" |Header: |#include <QOhosSharedRecord> |- |qmake: |QT += ohosextras |- |Since: |Qt 5.12.12 |} * List of all members, including inherited members == Public Functions == {| class="wikitable" |virtual |'''~QOhosSharedRecord'''() |- |virtual QString |'''content'''() const = 0 |- |virtua..." |
Drop manual breadcrumb, MediaWiki renders it automatically (QTFOROH-2307) |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
= QOhosSharedRecord Class = | |||
class [[Qt_for_HarmonyOS/qtohosextras_doc/Qt_Ohos_Extras_C++_Classes|QtOhosExtras]]::[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace|ShareKit]]::QOhosSharedRecord | |||
The QOhosSharedRecord class represents a record to be shared with other application. [[#details|More...]] | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
|qmake: | | Header: | ||
|QT += ohosextras | | #include <QOhosSharedRecord> | ||
|- | |||
| qmake: | |||
| QT += ohosextras | |||
|- | |- | ||
|Since: | | Since: | ||
|Qt 5.12.12 | | Qt 5.12.12 | ||
|} | |} | ||
* List of all members, including inherited members | This class was introduced in Qt 5.12.12. | ||
* [[Qt_for_HarmonyOS/qtohosextras_doc/List_of_All_Members_for_QOhosSharedRecord|List of all members, including inherited members]] | |||
== Public Functions == | == Public Functions == | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
|virtual QString | | virtual QString | ||
|'''content'''() const = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#content|content]]'''() const = 0 | ||
|- | |- | ||
|virtual QString | | virtual QString | ||
|'''description'''() const = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#description|description]]'''() const = 0 | ||
|- | |- | ||
|virtual QVariantMap | | virtual QVariantMap | ||
|'''extraData'''() const = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#extraData|extraData]]'''() const = 0 | ||
|- | |- | ||
|virtual QString | | virtual QString | ||
|'''filePath'''() const = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#filePath|filePath]]'''() const = 0 | ||
|- | |- | ||
|virtual bool | | virtual bool | ||
|'''isUrlContent'''() const = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#isUrlContent|isUrlContent]]'''() const = 0 | ||
|- | |- | ||
|virtual QString | | virtual QString | ||
|'''label'''() const = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#label|label]]'''() const = 0 | ||
|- | |- | ||
|virtual QMimeType | | virtual QMimeType | ||
|'''mimeType'''() const = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#mimeType|mimeType]]'''() const = 0 | ||
|- | |- | ||
|virtual void | | virtual void | ||
|'''setDescription'''(const QString &''description'') = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#setDescription|setDescription]]'''(const QString &''description'') = 0 | ||
|- | |- | ||
|virtual void | | virtual void | ||
|'''setExtraData'''(const QVariantMap &''extraData'') = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#setExtraData|setExtraData]]'''(const QVariantMap &''extraData'') = 0 | ||
|- | |- | ||
|virtual void | | virtual void | ||
|'''setLabel'''(const QString &''label'') = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#setLabel|setLabel]]'''(const QString &''label'') = 0 | ||
|- | |- | ||
|virtual void | | virtual void | ||
|'''setThumbnail'''(const QByteArray &''thumbnail'') = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#setThumbnail|setThumbnail]]'''(const QByteArray &''thumbnail'') = 0 | ||
|- | |- | ||
|virtual void | | virtual void | ||
|'''setThumbnailFilePath'''(const QString &''thumbnailFilePath'') = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#setThumbnailFilePath|setThumbnailFilePath]]'''(const QString &''thumbnailFilePath'') = 0 | ||
|- | |- | ||
|virtual void | | virtual void | ||
|'''setTitle'''(const QString &''title'') = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#setTitle|setTitle]]'''(const QString &''title'') = 0 | ||
|- | |- | ||
|virtual QByteArray | | virtual QByteArray | ||
|'''thumbnail'''() const = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#thumbnail|thumbnail]]'''() const = 0 | ||
|- | |- | ||
|virtual QString | | virtual QString | ||
|'''thumbnailFilePath'''() const = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#thumbnailFilePath|thumbnailFilePath]]'''() const = 0 | ||
|- | |- | ||
|virtual QString | | virtual QString | ||
|'''title'''() const = 0 | | '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#title|title]]'''() const = 0 | ||
|} | |} | ||
== | == Detailed Description == | ||
| | A record can be created using [[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createContentRecord|createContentRecord]](), [[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createFileRecord|createFileRecord]]() or [[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace#createUrlRecord|createUrlRecord]](). See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord]. | ||
== Member Function Documentation == | |||
=== <span id="content"></span><code>[pure virtual] </code>[https://doc.qt.io/qt-5/qstring.html QString] QOhosSharedRecord::content() const === | |||
Gets the shared record optional content. Either content or file path must be set. If there is no content null string is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.content] | |||
=== <span id="description"></span><code>[pure virtual] </code>[https://doc.qt.io/qt-5/qstring.html QString] QOhosSharedRecord::description() const === | |||
Gets the optional description of the shared record. If there is no description null string is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.description] | |||
'''See also '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#setDescription|setDescription]](). | |||
=== <span id="extraData"></span><code>[pure virtual] </code>[https://doc.qt.io/qt-5/qvariant.html#QVariantMap-typedef QVariantMap] QOhosSharedRecord::extraData() const === | |||
Gets the optional extra data of the shared record. If there is no extra data empty variant map is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.extraData] | |||
'''See also '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#setExtraData|setExtraData]](). | |||
=== <span id="filePath"></span><code>[pure virtual] </code>[https://doc.qt.io/qt-5/qstring.html QString] QOhosSharedRecord::filePath() const === | |||
Gets the shared record optional file path. Either content or file path must be set. If there is no file path null string is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.content] | |||
=== <span id="isUrlContent"></span><code>[pure virtual] </code>bool QOhosSharedRecord::isUrlContent() const === | |||
Returns <code>true</code> if [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#content|content]]() contains a URL string, <code>false</code> otherwise. For URL content the [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#mimeType|mimeType]]() should not be used. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.content] | |||
=== <span id="label"></span><code>[pure virtual] </code>[https://doc.qt.io/qt-5/qstring.html QString] QOhosSharedRecord::label() const === | |||
Gets the optional label of the shared record. If there is no label null string is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.label] | |||
'''See also '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#setLabel|setLabel]](). | |||
=== | === <span id="mimeType"></span><code>[pure virtual] </code>[https://doc.qt.io/qt-5/qmimetype.html QMimeType] QOhosSharedRecord::mimeType() const === | ||
Gets the shared record associated mime type. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.utd] | |||
=== | === <span id="setDescription"></span><code>[pure virtual] </code>void QOhosSharedRecord::setDescription(const [https://doc.qt.io/qt-5/qstring.html QString] &''description'') === | ||
Sets data record description with a given ''description''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.description] | |||
'''See also''' | '''See also '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#description|description]](). | ||
=== | === <span id="setExtraData"></span><code>[pure virtual] </code>void QOhosSharedRecord::setExtraData(const [https://doc.qt.io/qt-5/qvariant.html#QVariantMap-typedef QVariantMap] &''extraData'') === | ||
'''See | Sets exatra data for sharing with a given ''extraData''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.extraData] | ||
'''See also '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#extraData|extraData]](). | |||
=== | === <span id="setLabel"></span><code>[pure virtual] </code>void QOhosSharedRecord::setLabel(const [https://doc.qt.io/qt-5/qstring.html QString] &''label'') === | ||
Sets the label indicating the current data record type with a given ''label''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.label] | |||
'''See also''' | '''See also '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#label|label]](). | ||
=== | === <span id="setThumbnail"></span><code>[pure virtual] </code>void QOhosSharedRecord::setThumbnail(const [https://doc.qt.io/qt-5/qbytearray.html QByteArray] &''thumbnail'') === | ||
Sets data record thumbnail with a given ''thumbnail''. The thumbnail is an image file content. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.thumbnail] | |||
Sets data record | |||
'''See also''' | '''See also '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#thumbnail|thumbnail]](). | ||
=== | === <span id="setThumbnailFilePath"></span><code>[pure virtual] </code>void QOhosSharedRecord::setThumbnailFilePath(const [https://doc.qt.io/qt-5/qstring.html QString] &''thumbnailFilePath'') === | ||
'''See | Sets data record thumbnail uri with a given ''thumbnailFilePath''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.thumbnailUri] | ||
'''See also '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#thumbnailFilePath|thumbnailFilePath]](). | |||
'' | === <span id="setTitle"></span><code>[pure virtual] </code>void QOhosSharedRecord::setTitle(const [https://doc.qt.io/qt-5/qstring.html QString] &''title'') === | ||
Sets the title of shared content with a given ''title''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.title] | |||
Sets | |||
'''See also''' | '''See also '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#title|title]](). | ||
=== | === <span id="thumbnail"></span><code>[pure virtual] </code>[https://doc.qt.io/qt-5/qbytearray.html QByteArray] QOhosSharedRecord::thumbnail() const === | ||
Gets the optional thumbnail content of the shared record. If there is no thumbnail empty byte array is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.thumbnail] | |||
'''See also '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#setThumbnail|setThumbnail]](). | |||
=== <span id="thumbnailFilePath"></span><code>[pure virtual] </code>[https://doc.qt.io/qt-5/qstring.html QString] QOhosSharedRecord::thumbnailFilePath() const === | |||
Gets the optional thumbnail file path of the shared record. If there is no thumbnail file path null string is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.thumbnailFilePath] | |||
Gets the optional thumbnail | |||
'''See also''' | '''See also '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#setThumbnailFilePath|setThumbnailFilePath]](). | ||
=== | === <span id="title"></span><code>[pure virtual] </code>[https://doc.qt.io/qt-5/qstring.html QString] QOhosSharedRecord::title() const === | ||
Gets the optional title of the shared record. If there is no title null string is provided. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/share-system-share#section20696483813 SharedRecord.title] | |||
'''See also '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosSharedRecord_Class#setTitle|setTitle]](). | |||
[[Category:Qt for HarmonyOS]] | |||
Latest revision as of 06:22, 17 September 2026
class QtOhosExtras::ShareKit::QOhosSharedRecord
The QOhosSharedRecord class represents a record to be shared with other application. More...
| Header: | #include <QOhosSharedRecord> |
| qmake: | QT += ohosextras |
| Since: | Qt 5.12.12 |
This class was introduced in Qt 5.12.12.
Public Functions
| virtual QString | content() const = 0 |
| virtual QString | description() const = 0 |
| virtual QVariantMap | extraData() const = 0 |
| virtual QString | filePath() const = 0 |
| virtual bool | isUrlContent() const = 0 |
| virtual QString | label() const = 0 |
| virtual QMimeType | mimeType() const = 0 |
| virtual void | setDescription(const QString &description) = 0 |
| virtual void | setExtraData(const QVariantMap &extraData) = 0 |
| virtual void | setLabel(const QString &label) = 0 |
| virtual void | setThumbnail(const QByteArray &thumbnail) = 0 |
| virtual void | setThumbnailFilePath(const QString &thumbnailFilePath) = 0 |
| virtual void | setTitle(const QString &title) = 0 |
| virtual QByteArray | thumbnail() const = 0 |
| virtual QString | thumbnailFilePath() const = 0 |
| virtual QString | title() const = 0 |
Detailed Description
A record can be created using createContentRecord(), createFileRecord() or createUrlRecord(). See SharedRecord.
Member Function Documentation
Gets the shared record optional content. Either content or file path must be set. If there is no content null string is provided. See SharedRecord.content
Gets the optional description of the shared record. If there is no description null string is provided. See SharedRecord.description
See also setDescription().
Gets the optional extra data of the shared record. If there is no extra data empty variant map is provided. See SharedRecord.extraData
See also setExtraData().
Gets the shared record optional file path. Either content or file path must be set. If there is no file path null string is provided. See SharedRecord.content
Returns true if content() contains a URL string, false otherwise. For URL content the mimeType() should not be used. See SharedRecord.content
Gets the optional label of the shared record. If there is no label null string is provided. See SharedRecord.label
See also setLabel().
Gets the shared record associated mime type. See SharedRecord.utd
Sets data record description with a given description. See SharedRecord.description
See also description().
Sets exatra data for sharing with a given extraData. See SharedRecord.extraData
See also extraData().
Sets the label indicating the current data record type with a given label. See SharedRecord.label
See also label().
Sets data record thumbnail with a given thumbnail. The thumbnail is an image file content. See SharedRecord.thumbnail
See also thumbnail().
Sets data record thumbnail uri with a given thumbnailFilePath. See SharedRecord.thumbnailUri
See also thumbnailFilePath().
Sets the title of shared content with a given title. See SharedRecord.title
See also title().
Gets the optional thumbnail content of the shared record. If there is no thumbnail empty byte array is provided. See SharedRecord.thumbnail
See also setThumbnail().
Gets the optional thumbnail file path of the shared record. If there is no thumbnail file path null string is provided. See SharedRecord.thumbnailFilePath
See also setThumbnailFilePath().
Gets the optional title of the shared record. If there is no title null string is provided. See SharedRecord.title
See also setTitle().