Jump to content

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

From Qt Wiki
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!-- Source: qtohosextras.html -->
< [[Qt_for_HarmonyOS/qtohosextras_doc|Qt for HarmonyOS / qtohosextras doc]]
<span id="qtohosextras-namespace"></span>
 
= QtOhosExtras Namespace =
= QtOhosExtras Namespace =


The [[Qt_for_HarmonyOS/qtohosextras_doc/Qt_Ohos_Extras_C++_Classes|QtOhosExtras]] namespace provides miscellaneous functions to aid Ohos development. [[#details|More...]]
The QtOhosExtras namespace provides miscellaneous functions to aid Ohos development. [[#details|More...]]
 
<div class="table">


{| class="wikitable alignedsummary"
{| class="wikitable"
|-
|-
| class="memItemLeft rightAlign topAlign"| Header:
! Header:
| class="memItemRight bottomAlign"| <span class="preprocessor">#include <QtOhosExtras></span>
| #include <QtOhosExtras>
|-
|-
| class="memItemLeft rightAlign topAlign"| qmake:
! qmake:
| class="memItemRight bottomAlign"| QT += ohosextras
| QT += ohosextras
|-
|-
| class="memItemLeft rightAlign topAlign"| Since:
! Since:
| class="memItemRight bottomAlign"| Qt 5.12.12
| Qt 5.12.12
|}
|}


</div><span id="namespaces"></span>
== Namespaces ==
== Namespaces ==


<div class="table">
{| class="wikitable" style="width:100%"
 
{| class="wikitable alignedsummary"
|-
|-
| class="memItemLeft rightAlign topAlign"| namespace
| namespace || '''[[FileShare_Namespace|FileShare]]''' || The FileShare to expose file permission API.
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/FileShare_Namespace|FileShare]]'''
|-
|-
| class="memItemLeft rightAlign topAlign"| namespace
| namespace || '''[[Qt for HarmonyOS/qtohosextras doc/QOhosPasteboard Namespace|QOhosPasteboard]]''' || The QOhosPasteboard class is to manage native pasteboard.
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosPasteboard_Namespace|QOhosPasteboard]]'''
|-
|-
| class="memItemLeft rightAlign topAlign"| namespace
| namespace || '''[[ShareKit_Namespace|ShareKit]]''' || The ShareKit to expose Share Kit API.
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace|ShareKit]]'''
|}
|}


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


<div class="table">
{| class="wikitable" style="width:100%"
 
{| class="wikitable alignedsummary"
|-
|-
| class="memItemLeft rightAlign topAlign"| class
| class || '''[[QOhosAbilityContext_Class|QOhosAbilityContext]]''' || The QOhosAbilityContext class is to manage native UI Ability context.
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosAbilityContext_Class|QOhosAbilityContext]]'''
|-
|-
| class="memItemLeft rightAlign topAlign"| class
| class || '''[[QOhosAppContext_Class|QOhosAppContext]]''' || The QOhosAppContext class contains API to manage native application context.
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosAppContext_Class|QOhosAppContext]]'''
|-
|-
| class="memItemLeft rightAlign topAlign"| class
| class || '''[[QOhosBundleInfo_Class|QOhosBundleInfo]]''' || The QOhosBundleInfo class contains API to provide native application bundle info.
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosBundleInfo_Class|QOhosBundleInfo]]'''
|-
|-
| class="memItemLeft rightAlign topAlign"| class
| class || '''[[QOhosOnContinueContext_Class|QOhosOnContinueContext]]''' || The QOhosOnContinueContext class manages onContinue context.
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosOnContinueContext_Class|QOhosOnContinueContext]]'''
|-
|-
| class="memItemLeft rightAlign topAlign"| class
| class || '''[[QOhosOpenLinkOptions_Class|QOhosOpenLinkOptions]]''' || (No description)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosOpenLinkOptions_Class|QOhosOpenLinkOptions]]'''
|-
|-
| class="memItemLeft rightAlign topAlign"| class
| class || '''[[QOhosOperationStatus_Class|QOhosOperationStatus]]''' || The QOhosOperationStatus class provides interface to get an opertaion status.
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosOperationStatus_Class|QOhosOperationStatus]]'''
|-
|-
| class="memItemLeft rightAlign topAlign"| class
| class || '''[[QOhosStartOptions_Class|QOhosStartOptions]]''' || The QOhosStartOptions class is to provide new options for new started ability or process.
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class|QOhosStartOptions]]'''
|-
|-
| class="memItemLeft rightAlign topAlign"| class
| class || '''[[Qt for HarmonyOS/qtohosextras doc/QOhosWant Class|QOhosWant]]''' || QOhosWant wraps Ohos Want class.
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class|QOhosWant]]'''
|-
|-
| class="memItemLeft rightAlign topAlign"| class
| class || '''[[QOhosWantInfo_Class|QOhosWantInfo]]''' || The QOhosWantInfo class is to represent Ohos want type.
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWantInfo_Class|QOhosWantInfo]]'''
|}
|}


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


<div class="table">
{| class="wikitable" style="width:100%"
 
{| class="wikitable alignedsummary"
|-
|-
| class="memItemLeft rightAlign topAlign"| enum
| enum || '''[[#CloseEventRootCause-enum|CloseEventRootCause]]''' || { InternalClose, AbilityClose, WindowStageClose }
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#CloseEventRootCause-enum|CloseEventRootCause]]''' { InternalClose, AbilityClose, WindowStageClose }
|-
|-
| class="memItemLeft rightAlign topAlign"| enum
| enum || '''[[#QOhosWantFlag-enum|QOhosWantFlag]]''' || { AuthReadUriPermission, AuthWriteUriPermission, InstallOnDemand }
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#QOhosWantFlag-enum|QOhosWantFlag]]''' { AuthReadUriPermission, AuthWriteUriPermission, InstallOnDemand }
|-
|-
| class="memItemLeft rightAlign topAlign"| flags
| flags || '''[[#QOhosWantFlag-enum|QOhosWantFlag]]''' || (Typedef for QFlags<QOhosWantFlag>)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#QOhosWantFlag-enum|QOhosWantFlags]]'''
|-
|-
| class="memItemLeft rightAlign topAlign"| enum
| enum || '''[[#WindowGeometryPersistenceHint-enum|WindowGeometryPersistenceHint]]''' || { Disabled, Enabled, FollowSystemSetting }
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#WindowGeometryPersistenceHint-enum|WindowGeometryPersistenceHint]]''' { Disabled, Enabled, FollowSystemSetting }
|}
|}


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


<div class="table">
{| class="wikitable" style="width:100%"
 
{| class="wikitable alignedsummary"
|-
|-
| class="memItemLeft rightAlign topAlign"| bool
| bool || '''[[#authorizeFilePath|authorizeFilePath]]'''(QWindow *''parentWindow'', const QString &''filePath'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#authorizeFilePath|authorizeFilePath]]'''(QWindow *''parentWindow'', const QString &amp;''filePath'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer<QtOhosExtras::QOhosWantInfo>
| QSharedPointer<QtOhosExtras::QOhosWantInfo> || '''[[#convertToOhosExtrasWantInfo|convertToOhosExtrasWantInfo]]'''(int ''wantInfo'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#convertToOhosExtrasWantInfo|convertToOhosExtrasWantInfo]]'''(int ''wantInfo'')
|-
|-
| class="memItemLeft rightAlign topAlign"| int
| int || '''[[#convertToQpaWantInfo|convertToQpaWantInfo]]'''(QSharedPointer<QtOhosExtras::QOhosWantInfo>)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#convertToQpaWantInfo|convertToQpaWantInfo]]'''(''QSharedPointer<QtOhosExtras::QOhosWantInfo>'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QtOhosExtras::QOhosWant
| QtOhosExtras::QOhosWant || '''[[#convertWantFromJsonObject|convertWantFromJsonObject]]'''(const QJsonObject &''jsonWant'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#convertWantFromJsonObject|convertWantFromJsonObject]]'''(const QJsonObject &amp;''jsonWant'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QJsonObject
| QJsonObject || '''[[#convertWantToJsonObject|convertWantToJsonObject]]'''(const QtOhosExtras::QOhosWant &''want'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#convertWantToJsonObject|convertWantToJsonObject]]'''(const QtOhosExtras::QOhosWant &amp;''want'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer<QtOhosExtras::QOhosOpenLinkOptions>
| QSharedPointer<QtOhosExtras::QOhosOpenLinkOptions> || '''[[#createOpenLinkOptions|createOpenLinkOptions]]'''()
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#createOpenLinkOptions|createOpenLinkOptions]]'''()
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer<QtOhosExtras::QOhosStartOptions>
| QSharedPointer<QtOhosExtras::QOhosStartOptions> || '''[[#createStartOptions|createStartOptions]]'''()
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#createStartOptions|createStartOptions]]'''()
|-
|-
| class="memItemLeft rightAlign topAlign"| QtOhosExtras::CloseEventRootCause
| QtOhosExtras::CloseEventRootCause || '''[[#getCloseEventRootCause|getCloseEventRootCause]]'''(QCloseEvent *''closeEvent'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#getCloseEventRootCause|getCloseEventRootCause]]'''(QCloseEvent *''closeEvent'')
|-
|-
| class="memItemLeft rightAlign topAlign"| bool
| bool || '''[[#moveFileToTrash|moveFileToTrash]]'''(const QString &''filePath'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#moveFileToTrash|moveFileToTrash]]'''(const QString &amp;''filePath'')
|-
|-
| class="memItemLeft rightAlign topAlign"| const QMetaObject *
| const QMetaObject * || '''qt_getEnumMetaObject'''(QtOhosExtras::QOhosAppContext::ColorThemeMode)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#qt_getEnumMetaObject|qt_getEnumMetaObject]]'''(''QtOhosExtras::QOhosAppContext::ColorThemeMode'')
|-
|-
| class="memItemLeft rightAlign topAlign"| const QMetaObject *
| const QMetaObject * || '''qt_getEnumMetaObject'''(QtOhosExtras::QOhosStartOptions::ProcessMode)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#qt_getEnumMetaObject-1|qt_getEnumMetaObject]]'''(''QtOhosExtras::QOhosStartOptions::ProcessMode'')
|-
|-
| class="memItemLeft rightAlign topAlign"| const QMetaObject *
| const QMetaObject * || '''qt_getEnumMetaObject'''(QtOhosExtras::QOhosStartOptions::StartupVisibility)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#qt_getEnumMetaObject-2|qt_getEnumMetaObject]]'''(''QtOhosExtras::QOhosStartOptions::StartupVisibility'')
|-
|-
| class="memItemLeft rightAlign topAlign"| const QMetaObject *
| const QMetaObject * || '''qt_getEnumMetaObject'''(QtOhosExtras::QOhosStartOptions::WindowMode)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#qt_getEnumMetaObject-3|qt_getEnumMetaObject]]'''(''QtOhosExtras::QOhosStartOptions::WindowMode'')
|-
|-
| class="memItemLeft rightAlign topAlign"| const QMetaObject *
| const QMetaObject * || '''qt_getEnumMetaObject'''(QtOhosExtras::QOhosStartOptions::SupportWindowMode)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#qt_getEnumMetaObject-4|qt_getEnumMetaObject]]'''(''QtOhosExtras::QOhosStartOptions::SupportWindowMode'')
|-
|-
| class="memItemLeft rightAlign topAlign"| const QMetaObject *
| const QMetaObject * || '''qt_getEnumMetaObject'''(QtOhosExtras::CloseEventRootCause)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#qt_getEnumMetaObject-5|qt_getEnumMetaObject]]'''(''QtOhosExtras::CloseEventRootCause'')
|-
|-
| class="memItemLeft rightAlign topAlign"| const QMetaObject *
| const QMetaObject * || '''qt_getEnumMetaObject'''(QtOhosExtras::WindowGeometryPersistenceHint)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#qt_getEnumMetaObject-6|qt_getEnumMetaObject]]'''(''QtOhosExtras::WindowGeometryPersistenceHint'')
|-
|-
| class="memItemLeft rightAlign topAlign"| const char *
| const char * || '''qt_getEnumName'''(QtOhosExtras::QOhosAppContext::ColorThemeMode)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#qt_getEnumName|qt_getEnumName]]'''(''QtOhosExtras::QOhosAppContext::ColorThemeMode'')
|-
|-
| class="memItemLeft rightAlign topAlign"| const char *
| const char * || '''qt_getEnumName'''(QtOhosExtras::QOhosStartOptions::ProcessMode)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#qt_getEnumName-1|qt_getEnumName]]'''(''QtOhosExtras::QOhosStartOptions::ProcessMode'')
|-
|-
| class="memItemLeft rightAlign topAlign"| const char *
| const char * || '''qt_getEnumName'''(QtOhosExtras::QOhosStartOptions::StartupVisibility)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#qt_getEnumName-2|qt_getEnumName]]'''(''QtOhosExtras::QOhosStartOptions::StartupVisibility'')
|-
|-
| class="memItemLeft rightAlign topAlign"| const char *
| const char * || '''qt_getEnumName'''(QtOhosExtras::QOhosStartOptions::WindowMode)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#qt_getEnumName-3|qt_getEnumName]]'''(''QtOhosExtras::QOhosStartOptions::WindowMode'')
|-
|-
| class="memItemLeft rightAlign topAlign"| const char *
| const char * || '''qt_getEnumName'''(QtOhosExtras::QOhosStartOptions::SupportWindowMode)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#qt_getEnumName-4|qt_getEnumName]]'''(''QtOhosExtras::QOhosStartOptions::SupportWindowMode'')
|-
|-
| class="memItemLeft rightAlign topAlign"| const char *
| const char * || '''qt_getEnumName'''(QtOhosExtras::CloseEventRootCause)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#qt_getEnumName-5|qt_getEnumName]]'''(''QtOhosExtras::CloseEventRootCause'')
|-
|-
| class="memItemLeft rightAlign topAlign"| const char *
| const char * || '''qt_getEnumName'''(QtOhosExtras::WindowGeometryPersistenceHint)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#qt_getEnumName-6|qt_getEnumName]]'''(''QtOhosExtras::WindowGeometryPersistenceHint'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#requestQOhosPermissionFromUserIfNeeded|requestQOhosPermissionFromUserIfNeeded]]'''(QObject *''resultConsumerQtContext'', QWindow *''optInstanceMainWindow'', const QString &''permissionName'', int ''resultConsumer'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#requestQOhosPermissionFromUserIfNeeded|requestQOhosPermissionFromUserIfNeeded]]'''(QObject *''resultConsumerQtContext'', QWindow *''optInstanceMainWindow'', const QString &amp;''permissionName'', int ''resultConsumer'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#requestQOhosPermissionOnSettingIfNeeded|requestQOhosPermissionOnSettingIfNeeded]]'''(QObject *''resultConsumerQtContext'', QWindow *''optInstanceMainWindow'', int ''permission'', int ''resultConsumer'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#requestQOhosPermissionOnSettingIfNeeded|requestQOhosPermissionOnSettingIfNeeded]]'''(QObject *''resultConsumerQtContext'', QWindow *''optInstanceMainWindow'', int ''permission'', int ''resultConsumer'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#setAbilityInstanceDestroyEnabled|setAbilityInstanceDestroyEnabled]]'''(QWindow *''instanceWindow'', bool ''destroyEnabled'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#setAbilityInstanceDestroyEnabled|setAbilityInstanceDestroyEnabled]]'''(QWindow *''instanceWindow'', bool ''destroyEnabled'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#setBundledAbilityAndQWindowBindingKeyForQWindow|setBundledAbilityAndQWindowBindingKeyForQWindow]]'''(QWindow *''window'', const QString &''qAbilityQWindowBindingKey'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#setBundledAbilityAndQWindowBindingKeyForQWindow|setBundledAbilityAndQWindowBindingKeyForQWindow]]'''(QWindow *''window'', const QString &amp;''qAbilityQWindowBindingKey'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#setMainWindowGeometryPersistenceHint|setMainWindowGeometryPersistenceHint]]'''(QtOhosExtras::WindowGeometryPersistenceHint ''geometryPersistenceHint'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#setMainWindowGeometryPersistenceHint|setMainWindowGeometryPersistenceHint]]'''(QtOhosExtras::WindowGeometryPersistenceHint ''geometryPersistenceHint'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#setShowWindowAsFloatWindowHint|setShowWindowAsFloatWindowHint]]'''(QWindow *''window'', bool ''showAsFloatWindow'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#setShowWindowAsFloatWindowHint|setShowWindowAsFloatWindowHint]]'''(QWindow *''window'', bool ''showAsFloatWindow'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#setShowWindowAsFloatWindowHint-1|setShowWindowAsFloatWindowHint]]'''(QWidget *''widget'', bool ''showAsFloatWindow'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#setShowWindowAsFloatWindowHint-1|setShowWindowAsFloatWindowHint]]'''(QWidget *''widget'', bool ''showAsFloatWindow'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#setSurfaceBackgroundColor|setSurfaceBackgroundColor]]'''(QWindow *''window'', const QColor &''color'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#setSurfaceBackgroundColor|setSurfaceBackgroundColor]]'''(QWindow *''window'', const QColor &amp;''color'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#setSurfaceBackgroundColor-1|setSurfaceBackgroundColor]]'''(QWidget *''widget'', const QColor &''color'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#setSurfaceBackgroundColor-1|setSurfaceBackgroundColor]]'''(QWidget *''widget'', const QColor &amp;''color'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#setWindowCornerRadius|setWindowCornerRadius]]'''(QWindow *''window'', double ''radius'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#setWindowCornerRadius|setWindowCornerRadius]]'''(QWindow *''window'', double ''radius'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#setWindowCornerRadius-1|setWindowCornerRadius]]'''(QWidget *''widget'', double ''radius'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#setWindowCornerRadius-1|setWindowCornerRadius]]'''(QWidget *''widget'', double ''radius'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#setWindowKeepScreenOn|setWindowKeepScreenOn]]'''(QWindow *''window'', bool ''keepScreenOn'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#setWindowKeepScreenOn|setWindowKeepScreenOn]]'''(QWindow *''window'', bool ''keepScreenOn'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#setWindowKeepScreenOn-1|setWindowKeepScreenOn]]'''(QWidget *''widget'', bool ''keepScreenOn'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#setWindowKeepScreenOn-1|setWindowKeepScreenOn]]'''(QWidget *''widget'', bool ''keepScreenOn'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#setWindowPrivacyMode|setWindowPrivacyMode]]'''(QWindow *''window'', bool ''privacyModeEnabled'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#setWindowPrivacyMode|setWindowPrivacyMode]]'''(QWindow *''window'', bool ''privacyModeEnabled'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer<QtOhosExtras::QOhosOperationStatus>
| QSharedPointer<QtOhosExtras::QOhosOperationStatus> || '''[[#startAbility|startAbility]]'''(const QtOhosExtras::QOhosWant &''want'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#startAbility|startAbility]]'''(const QtOhosExtras::QOhosWant &amp;''want'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer<QtOhosExtras::QOhosOperationStatus>
| QSharedPointer<QtOhosExtras::QOhosOperationStatus> || '''[[#startAbility-1|startAbility]]'''(const QtOhosExtras::QOhosWant &''want'', const QtOhosExtras::QOhosStartOptions &''options'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#startAbility-1|startAbility]]'''(const QtOhosExtras::QOhosWant &amp;''want'', const QtOhosExtras::QOhosStartOptions &amp;''options'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer<QtOhosExtras::QOhosOperationStatus>
| QSharedPointer<QtOhosExtras::QOhosOperationStatus> || '''[[#startAbilityByType|startAbilityByType]]'''(const QString &''appType'', const QJsonObject &''wantParameters'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#startAbilityByType|startAbilityByType]]'''(const QString &amp;''appType'', const QJsonObject &amp;''wantParameters'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#startAppProcess|startAppProcess]]'''(const QString &''processId'', const QtOhosExtras::QOhosWant &''requestWant'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#startAppProcess|startAppProcess]]'''(const QString &amp;''processId'', const QtOhosExtras::QOhosWant &amp;''requestWant'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#startAppProcess-1|startAppProcess]]'''(const QString &''processId'', const QtOhosExtras::QOhosWant &''requestWant'', const QtOhosExtras::QOhosStartOptions &''options'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#startAppProcess-1|startAppProcess]]'''(const QString &amp;''processId'', const QtOhosExtras::QOhosWant &amp;''requestWant'', const QtOhosExtras::QOhosStartOptions &amp;''options'')
|-
|-
| class="memItemLeft rightAlign topAlign"| void
| void || '''[[#startNewAbilityInstance|startNewAbilityInstance]]'''(QWidget *''instanceWidget'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#startNewAbilityInstance|startNewAbilityInstance]]'''(QWidget *''instanceWidget'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer<double>
| QSharedPointer<double> || '''[[#tryGetNativeWindowId|tryGetNativeWindowId]]'''(QWindow *''window'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#tryGetNativeWindowId|tryGetNativeWindowId]]'''(QWindow *''window'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer<QByteArray>
| QSharedPointer<QByteArray> || '''[[#tryGetOnContinueData|tryGetOnContinueData]]'''(const QtOhosExtras::QOhosWant &''want'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#tryGetOnContinueData|tryGetOnContinueData]]'''(const QtOhosExtras::QOhosWant &amp;''want'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QSharedPointer<double>
| QSharedPointer<double> || '''[[#tryGetScreenDisplayId|tryGetScreenDisplayId]]'''(QScreen *''screen'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#tryGetScreenDisplayId|tryGetScreenDisplayId]]'''(QScreen *''screen'')
|-
|-
| class="memItemLeft rightAlign topAlign"| int
| int || '''[[#tryMapQOhosPermissionFromName|tryMapQOhosPermissionFromName]]'''(const QString &)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#tryMapQOhosPermissionFromName|tryMapQOhosPermissionFromName]]'''(''const QString &amp;'')
|-
|-
| class="memItemLeft rightAlign topAlign"| int
| int || '''[[#tryMapQOhosPermissionToName|tryMapQOhosPermissionToName]]'''(int)
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#tryMapQOhosPermissionToName|tryMapQOhosPermissionToName]]'''(''int'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QFlags<QOhosWantFlags::enum_type>
| QFlags<QOhosWantFlags::enum_type> || '''[[#operator-7c|operator\|]]'''(QOhosWantFlags::enum_type ''f1'', QOhosWantFlags::enum_type ''f2'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#operator-7c|operator|]]'''(QOhosWantFlags::enum_type ''f1'', QOhosWantFlags::enum_type ''f2'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QFlags<QOhosWantFlags::enum_type>
| QFlags<QOhosWantFlags::enum_type> || '''[[#operator-7c-1|operator\|]]'''(QOhosWantFlags::enum_type ''f1'', QFlags<QOhosWantFlags::enum_type> ''f2'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#operator-7c-1|operator|]]'''(QOhosWantFlags::enum_type ''f1'', QFlags<QOhosWantFlags::enum_type> ''f2'')
|-
|-
| class="memItemLeft rightAlign topAlign"| QIncompatibleFlag
| QIncompatibleFlag || '''[[#operator-7c-2|operator\|]]'''(QOhosWantFlags::enum_type ''f1'', int ''f2'')
| class="memItemRight bottomAlign"| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#operator-7c-2|operator|]]'''(QOhosWantFlags::enum_type ''f1'', int ''f2'')
|}
|}


 
== Detailed Description ==
</div>
<span id="details"></span>
 
<div class="descr">


<span id="details"></span>
<span id="details"></span>
== Detailed Description ==
The QtOhosExtras namespace provides miscellaneous functions to aid Ohos development.
 
The [[Qt_for_HarmonyOS/qtohosextras_doc/Qt_Ohos_Extras_C++_Classes|QtOhosExtras]] namespace provides miscellaneous functions to aid Ohos development.
</div>
<div class="nmspace">
 
<span id="namespaces-1"></span>
== Namespaces ==
 
<span id="namespace-qtohosextrasfileshare"></span>
=== <span></span>namespace QtOhosExtras::<span class="name">FileShare</span> ===
 
The [[Qt_for_HarmonyOS/qtohosextras_doc/FileShare_Namespace|FileShare]] to expose file permission API.
 
This API uses file system paths, which differ from the URIs used internally by HarmonyOS. For example, the path <code>/data/storage/el1/bundle/entry/resources/resfile/test.txt</code> will be converted to the URI <code>file://com.your.example/data/storage/el1/bundle/entry/resources/resfile/test.txt</code> , where <code>com.your.example</code> is app bundle name.


To learn more about file paths and URIs in HarmonyOS, see [https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/app-sandbox-directory-V5 sandbox documentation].
'''Warning:''' This API relies on the underlying OHOS implementation. The following functions: [[Qt_for_HarmonyOS/qtohosextras_doc/FileShare_Namespace#persistPermission|persistPermission]](), [[Qt_for_HarmonyOS/qtohosextras_doc/FileShare_Namespace#revokePermission|revokePermission]](), [[Qt_for_HarmonyOS/qtohosextras_doc/FileShare_Namespace#activatePermission|activatePermission]](), [[Qt_for_HarmonyOS/qtohosextras_doc/FileShare_Namespace#deactivatePermission|deactivatePermission]](), and [[Qt_for_HarmonyOS/qtohosextras_doc/FileShare_Namespace#checkPersistent|checkPersistent]]() may be unavailable on some devices. Additionally, there may be limitations on the maximum number of policies, and certain permissions may need to be explicitly granted to the application.
For more details and limitations, refer to the [https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V14/native-fileshare-guidelines-V14 API documentation].
This namespace was introduced in Qt 5.12.12.
<span id="namespace-qtohosextrasqohospasteboard"></span>
=== <span></span>namespace QtOhosExtras::<span class="name">QOhosPasteboard</span> ===
The [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosPasteboard_Namespace|QOhosPasteboard]] class is to manage native pasteboard.
This namespace was introduced in Qt 5.12.12.
<span id="namespace-qtohosextrassharekit"></span>
=== <span></span>namespace QtOhosExtras::<span class="name">ShareKit</span> ===
The [[Qt_for_HarmonyOS/qtohosextras_doc/ShareKit_Namespace|ShareKit]] to expose Share Kit API.
This namespace was introduced in Qt 5.12.12.
<span id="classes-1"></span>
== Classes ==
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosAbilityContext_Class|QOhosAbilityContext]] ===
The [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosAbilityContext_Class|QOhosAbilityContext]] class is to manage native UI Ability context. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-inner-application-uiabilitycontext-V5 UIAbilityContext]. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosAbilityContext_Class#details|More...]]
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosAppContext_Class|QOhosAppContext]] ===
The [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosAppContext_Class|QOhosAppContext]] class contains API to manage native application context. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosAppContext_Class#details|More...]]
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosBundleInfo_Class|QOhosBundleInfo]] ===
The [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosBundleInfo_Class|QOhosBundleInfo]] class contains API to provide native application bundle info. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosBundleInfo_Class#details|More...]]
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosOnContinueContext_Class|QOhosOnContinueContext]] ===
The [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosOnContinueContext_Class|QOhosOnContinueContext]] class manages onContinue context. It provides system data, like source application version code and set the onContinue result that is requested by the system. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V13/js-apis-app-ability-uiability-V13#uiabilityoncontinue UIAbility onContinue]. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosOnContinueContext_Class#details|More...]]
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosOpenLinkOptions_Class|QOhosOpenLinkOptions]] ===
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosOperationStatus_Class|QOhosOperationStatus]] ===
The [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosOperationStatus_Class|QOhosOperationStatus]] class provides interface to get an opertaion status. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosOperationStatus_Class#details|More...]]
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class|QOhosStartOptions]] ===
The [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class|QOhosStartOptions]] class is to provide new options for new started ability or process. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#details|More...]]
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class|QOhosWant]] ===
[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class|QOhosWant]] wraps Ohos [https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/want-V5 Want] class. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class#details|More...]]
=== class [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWantInfo_Class|QOhosWantInfo]] ===
The [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWantInfo_Class|QOhosWantInfo]] class is to represent Ohos want type. [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWantInfo_Class#details|More...]]
</div>
<div class="types">
<span id="type-documentation"></span>
== Type Documentation ==
== Type Documentation ==


<span id="CloseEventRootCause-enum"></span>
=== <span id="CloseEventRootCause-enum"></span>enum QtOhosExtras::CloseEventRootCause ===
=== <span id="CloseEventRootCause-enum"></span>enum QtOhosExtras::<span class="name">CloseEventRootCause</span> ===


Enumerates the close event root cause.
Enumerates the close event root cause.


<div class="table">
{| class="wikitable"
 
! Constant !! Value !! Description
{| class="wikitable valuelist"
|- class="odd" valign="top"
! class="tblConst" | Constant
! class="tblval" | Value
! class="tbldscr" | Description
|-
|-
| class="topAlign" | <code>QtOhosExtras::InternalClose</code>
| QtOhosExtras::InternalClose || 0 || Close root cause not specified or unknown.
| class="topAlign tblval" | <code>0</code>
| class="topAlign" | Close root cause not specified or unknown.
|-
|-
| class="topAlign" | <code>QtOhosExtras::AbilityClose</code>
| QtOhosExtras::AbilityClose || 1 || Close root cause of preparing to terminate.
| class="topAlign tblval" | <code>1</code>
| class="topAlign" | Close root cause of preparing to terminate.
|-
|-
| class="topAlign" | <code>QtOhosExtras::WindowStageClose</code>
| QtOhosExtras::WindowStageClose || 2 || Close root cause of native Window Stage or Sub-Window close.
| class="topAlign tblval" | <code>2</code>
| class="topAlign" | Close root cause of native Window Stage or Sub-Window close.
|}
|}


</div>
This enum was introduced or modified in Qt 5.12.12.
This enum was introduced or modified in Qt 5.12.12.


enum QtOhosExtras::<span class="name">QOhosWantFlag</span><br />flags QtOhosExtras::<span class="name">QOhosWantFlags</span>
=== <span id="QOhosWantFlag-enum"></span>enum QtOhosExtras::QOhosWantFlag<br/>flags QtOhosExtras::QOhosWantFlags ===


QOhosWantFlag specifies how the Want will be handled. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-ability-wantconstant-V5#flags Flags].
QOhosWantFlag specifies how the Want will be handled. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-ability-wantconstant-V5#flags Flags].


<div class="table">
{| class="wikitable"
 
! Constant !! Value !! Description
{| class="wikitable valuelist"
|- class="odd" valign="top"
! class="tblConst" | Constant
! class="tblval" | Value
! class="tbldscr" | Description
|-
|-
| class="topAlign" | <code>QtOhosExtras::AuthReadUriPermission</code>
| QtOhosExtras::AuthReadUriPermission || 1 << 0 || Grants the permission to read the URI.
| class="topAlign tblval" | <code>1 << 0</code>
| class="topAlign" | Grants the permission to read the URI.
|-
|-
| class="topAlign" | <code>QtOhosExtras::AuthWriteUriPermission</code>
| QtOhosExtras::AuthWriteUriPermission || 1 << 1 || Grants the permission to write data to the URI.
| class="topAlign tblval" | <code>1 << 1</code>
| class="topAlign" | Grants the permission to write data to the URI.
|-
|-
| class="topAlign" | <code>QtOhosExtras::InstallOnDemand</code>
| QtOhosExtras::InstallOnDemand || 1 << 2 || Ability will be installed if it has not been installed.
| class="topAlign tblval" | <code>1 << 2</code>
| class="topAlign" | Ability will be installed if it has not been installed.
|}
|}


</div>
This enum was introduced or modified in Qt 5.12.12.
This enum was introduced or modified in Qt 5.12.12.


The QOhosWantFlags type is a typedef for [[../qtcore/qflags.html|QFlags]] <QOhosWantFlag>. It stores an OR combination of QOhosWantFlag values.
The QOhosWantFlags type is a typedef for QFlags<QOhosWantFlag>. It stores an OR combination of QOhosWantFlag values.


<span id="WindowGeometryPersistenceHint-enum"></span>
=== <span id="WindowGeometryPersistenceHint-enum"></span>enum QtOhosExtras::WindowGeometryPersistenceHint ===
=== <span id="WindowGeometryPersistenceHint-enum"></span>enum QtOhosExtras::<span class="name">WindowGeometryPersistenceHint</span> ===


Enumerates the policy for window geometry persistence support. Specifies how a window’s geometry (the size and position) is determined when it is shown.
Enumerates the policy for window geometry persistence support. Specifies how a window’s geometry (the size and position) is determined when it is shown.


<div class="table">
{| class="wikitable"
 
! Constant !! Value !! Description
{| class="wikitable valuelist"
|- class="odd" valign="top"
! class="tblConst" | Constant
! class="tblval" | Value
! class="tbldscr" | Description
|-
|-
| class="topAlign" | <code>QtOhosExtras::Disabled</code>
| QtOhosExtras::Disabled || 0 || Use default window's geometry.
| class="topAlign tblval" | <code>0</code>
| class="topAlign" | Use default window's geometry.
|-
|-
| class="topAlign" | <code>QtOhosExtras::Enabled</code>
| QtOhosExtras::Enabled || 1 || Restore previous window's geometry (position and size when before window was closed).
| class="topAlign tblval" | <code>1</code>
| class="topAlign" | Restore previous window's geometry (position and size when before window was closed).
|-
|-
| class="topAlign" | <code>QtOhosExtras::FollowSystemSetting</code>
| QtOhosExtras::FollowSystemSetting || 2 || Let the system decide whether to use Disabled or Enabled value.
| class="topAlign tblval" | <code>2</code>
| class="topAlign" | Let the system decide whether to use <code>Disabled</code> or <code>Enabled</code> value.
|}
|}


</div>
This enum was introduced or modified in Qt 5.12.12.
This enum was introduced or modified in Qt 5.12.12.


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


<span id="authorizeFilePath"></span>
=== <span id="authorizeFilePath"></span>bool QtOhosExtras::authorizeFilePath(QWindow *parentWindow, const QString &filePath) ===
=== <span id="authorizeFilePath"></span><span class="type">bool</span> QtOhosExtras::<span class="name">authorizeFilePath</span>(<span class="type">[[../qtgui/qwindow.html|QWindow]]</span> *''parentWindow'', const <span class="type">[[../qtcore/qstring.html|QString]]</span> &amp;''filePath'') ===


Request authorization on the User selected ''parentWindow'' for a given ''filePath''. The system File Dialog in authorization mode will be presented to the User. According to User choice returns true if file path is authorized, false otherwise. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-file-picker#documentselectoptions authMode]
Request authorization on the User selected ''parentWindow'' for a given ''filePath''. The system File Dialog in authorization mode will be presented to the User. According to User choice returns true if file path is authorized, false otherwise. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-file-picker#documentselectoptions authMode].


This function was introduced in Qt 5.12.12.
This function was introduced in Qt 5.12.12.


<span id="convertToOhosExtrasWantInfo"></span>
=== <span id="convertToOhosExtrasWantInfo"></span>QSharedPointer<QtOhosExtras::QOhosWantInfo> QtOhosExtras::convertToOhosExtrasWantInfo(int wantInfo) ===
=== convertToOhosExtrasWantInfo ===
(No description provided in source)
 
<syntaxhighlight lang="cpp">
QSharedPointer<QtOhosExtras::QOhosWantInfo> QtOhosExtras::convertToOhosExtrasWantInfo(int wantInfo)
</syntaxhighlight>
 
<span id="convertToQpaWantInfo"></span>
 
=== <span class="type">int</span> QtOhosExtras::<span class="name">convertToQpaWantInfo</span>(''QSharedPointer<QtOhosExtras::QOhosWantInfo>'') ===
 
<span id="convertWantFromJsonObject"></span>
=== <span class="type">[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class|QtOhosExtras::QOhosWant]]</span> ===
=== QtOhosExtras::<span class="name">convertWantFromJsonObject</span>(const <span class="type">[[../qtcore/qjsonobject.html|QJsonObject]]</span> &amp;''jsonWant'') ===


<span id="convertWantToJsonObject"></span>
=== <span id="createStartOptions"></span>QSharedPointer<QtOhosExtras::QOhosStartOptions> QtOhosExtras::createStartOptions() ===
=== <span id="convertWantToJsonObject"></span><span class="type">[[../qtcore/qjsonobject.html|QJsonObject]]</span> QtOhosExtras::<span class="name">convertWantToJsonObject</span>(const <span class="type">[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class|QtOhosExtras::QOhosWant]]</span> &amp;''want'') ===
 
<span id="createOpenLinkOptions"></span>
=== createOpenLinkOptions ===
 
<syntaxhighlight lang="cpp">
QSharedPointer<QtOhosExtras::QOhosOpenLinkOptions> QtOhosExtras::createOpenLinkOptions()
</syntaxhighlight>
 
<span id="createStartOptions"></span>
=== createStartOptions ===
 
<syntaxhighlight lang="cpp">
QSharedPointer<QtOhosExtras::QOhosStartOptions> QtOhosExtras::createStartOptions()
</syntaxhighlight>


Creates [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class|QOhosStartOptions]] instance.
Creates QOhosStartOptions instance.


<span id="getCloseEventRootCause"></span>
=== <span id="getCloseEventRootCause"></span>QtOhosExtras::CloseEventRootCause QtOhosExtras::getCloseEventRootCause(QCloseEvent *closeEvent) ===
=== <span class="type">[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#CloseEventRootCause-enum|QtOhosExtras::CloseEventRootCause]]</span> ===
=== QtOhosExtras::<span class="name">getCloseEventRootCause</span>(<span class="type">[[../qtgui/qcloseevent.html|QCloseEvent]]</span> *''closeEvent'') ===


Converts a given ''closeEvent'' to [[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#CloseEventRootCause-enum|QtOhosExtras::CloseEventRootCause]].
Converts a given ''closeEvent'' to QtOhosExtras::CloseEventRootCause.


Returns related [[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#CloseEventRootCause-enum|QtOhosExtras::CloseEventRootCause]] value.
Returns related QtOhosExtras::CloseEventRootCause value.


<span id="moveFileToTrash"></span>
=== <span id="moveFileToTrash"></span>bool QtOhosExtras::moveFileToTrash(const QString &filePath) ===
=== <span id="moveFileToTrash"></span><span class="type">bool</span> QtOhosExtras::<span class="name">moveFileToTrash</span>(const <span class="type">[[../qtcore/qstring.html|QString]]</span> &amp;''filePath'') ===


Moves the file specified by ''filePath'' to the trash. Returns true if successful, false otherwise.
Moves the file specified by ''filePath'' to the trash. Returns true if successful, false otherwise.
Line 502: Line 255:
This function provides functionality of QFile::moveToTrash() from Qt 5.15.
This function provides functionality of QFile::moveToTrash() from Qt 5.15.


<span id="qt_getEnumMetaObject"></span>
=== <span id="setAbilityInstanceDestroyEnabled"></span>void QtOhosExtras::setAbilityInstanceDestroyEnabled(QWindow *instanceWindow, bool destroyEnabled) ===
=== <span id="qt_getEnumMetaObject"></span>const <span class="type">[[../qtcore/qmetaobject.html|QMetaObject]]</span> *QtOhosExtras::<span class="name">qt_getEnumMetaObject</span>(''QtOhosExtras::QOhosAppContext::ColorThemeMode'') ===
 
<span id="qt_getEnumMetaObject-1"></span>
=== <span id="qt_getEnumMetaObject-1"></span>const <span class="type">[[../qtcore/qmetaobject.html|QMetaObject]]</span> *QtOhosExtras::<span class="name">qt_getEnumMetaObject</span>(''QtOhosExtras::QOhosStartOptions::ProcessMode'') ===
 
<span id="qt_getEnumMetaObject-2"></span>
=== <span id="qt_getEnumMetaObject-2"></span>const <span class="type">[[../qtcore/qmetaobject.html|QMetaObject]]</span> *QtOhosExtras::<span class="name">qt_getEnumMetaObject</span>(''QtOhosExtras::QOhosStartOptions::StartupVisibility'') ===
 
<span id="qt_getEnumMetaObject-3"></span>
=== <span id="qt_getEnumMetaObject-3"></span>const <span class="type">[[../qtcore/qmetaobject.html|QMetaObject]]</span> *QtOhosExtras::<span class="name">qt_getEnumMetaObject</span>(''QtOhosExtras::QOhosStartOptions::WindowMode'') ===
 
<span id="qt_getEnumMetaObject-4"></span>
=== <span id="qt_getEnumMetaObject-4"></span>const <span class="type">[[../qtcore/qmetaobject.html|QMetaObject]]</span> *QtOhosExtras::<span class="name">qt_getEnumMetaObject</span>(''QtOhosExtras::QOhosStartOptions::SupportWindowMode'') ===
 
<span id="qt_getEnumMetaObject-5"></span>
=== <span id="qt_getEnumMetaObject-5"></span>const <span class="type">[[../qtcore/qmetaobject.html|QMetaObject]]</span> *QtOhosExtras::<span class="name">qt_getEnumMetaObject</span>(''QtOhosExtras::CloseEventRootCause'') ===
 
<span id="qt_getEnumMetaObject-6"></span>
=== <span id="qt_getEnumMetaObject-6"></span>const <span class="type">[[../qtcore/qmetaobject.html|QMetaObject]]</span> *QtOhosExtras::<span class="name">qt_getEnumMetaObject</span>(''QtOhosExtras::WindowGeometryPersistenceHint'') ===
 
<span id="qt_getEnumName"></span>
=== <span id="qt_getEnumName"></span>const <span class="type">char</span> *QtOhosExtras::<span class="name">qt_getEnumName</span>(''QtOhosExtras::QOhosAppContext::ColorThemeMode'') ===


<span id="qt_getEnumName-1"></span>
Sets whether the Ability related with ''instanceWindow'' can be automatically destroyed by the system when the user clicks on the window's "close" button. If ''destroyEnabled'' is true, the system destroys the Ability automatically (and Qt needs to adapt to this). If ''destroyEnabled'' = false, the window is not automatically destroyed, but instead standard Qt path for window close is triggered, i.e. QWindow::close().
=== <span id="qt_getEnumName-1"></span>const <span class="type">char</span> *QtOhosExtras::<span class="name">qt_getEnumName</span>(''QtOhosExtras::QOhosStartOptions::ProcessMode'') ===


<span id="qt_getEnumName-2"></span>
By default, the flag is set to false.
=== <span id="qt_getEnumName-2"></span>const <span class="type">char</span> *QtOhosExtras::<span class="name">qt_getEnumName</span>(''QtOhosExtras::QOhosStartOptions::StartupVisibility'') ===


<span id="qt_getEnumName-3"></span>
'''See also:''' QtOhosExtras::QOhosAbilityContext::setDestroyFromSystemEnabled().
=== <span id="qt_getEnumName-3"></span>const <span class="type">char</span> *QtOhosExtras::<span class="name">qt_getEnumName</span>(''QtOhosExtras::QOhosStartOptions::WindowMode'') ===


<span id="qt_getEnumName-4"></span>
=== <span id="setMainWindowGeometryPersistenceHint"></span>void QtOhosExtras::setMainWindowGeometryPersistenceHint(QtOhosExtras::WindowGeometryPersistenceHint geometryPersistenceHint) ===
=== <span id="qt_getEnumName-4"></span>const <span class="type">char</span> *QtOhosExtras::<span class="name">qt_getEnumName</span>(''QtOhosExtras::QOhosStartOptions::SupportWindowMode'') ===
 
<span id="qt_getEnumName-5"></span>
=== <span id="qt_getEnumName-5"></span>const <span class="type">char</span> *QtOhosExtras::<span class="name">qt_getEnumName</span>(''QtOhosExtras::CloseEventRootCause'') ===
 
<span id="qt_getEnumName-6"></span>
=== <span id="qt_getEnumName-6"></span>const <span class="type">char</span> *QtOhosExtras::<span class="name">qt_getEnumName</span>(''QtOhosExtras::WindowGeometryPersistenceHint'') ===
 
<span id="requestQOhosPermissionFromUserIfNeeded"></span>
=== <span id="requestQOhosPermissionFromUserIfNeeded"></span><span class="type">void</span> QtOhosExtras::<span class="name">requestQOhosPermissionFromUserIfNeeded</span>(<span class="type">[[../qtcore/qobject.html|QObject]]</span> *''resultConsumerQtContext'', <span class="type">[[../qtgui/qwindow.html|QWindow]]</span> *''optInstanceMainWindow'', const <span class="type">[[../qtcore/qstring.html|QString]]</span> &amp;''permissionName'', <span class="type">int</span> ''resultConsumer'') ===
 
<span id="requestQOhosPermissionOnSettingIfNeeded"></span>
=== <span id="requestQOhosPermissionOnSettingIfNeeded"></span><span class="type">void</span> QtOhosExtras::<span class="name">requestQOhosPermissionOnSettingIfNeeded</span>(<span class="type">[[../qtcore/qobject.html|QObject]]</span> *''resultConsumerQtContext'', <span class="type">[[../qtgui/qwindow.html|QWindow]]</span> *''optInstanceMainWindow'', <span class="type">int</span> ''permission'', <span class="type">int</span> ''resultConsumer'') ===
 
<span id="setAbilityInstanceDestroyEnabled"></span>
=== <span id="setAbilityInstanceDestroyEnabled"></span><span class="type">void</span> QtOhosExtras::<span class="name">setAbilityInstanceDestroyEnabled</span>(<span class="type">[[../qtgui/qwindow.html|QWindow]]</span> *''instanceWindow'', <span class="type">bool</span> ''destroyEnabled'') ===
 
Sets whether the Ability related with ''instanceWindow'' can be automatically destroyed by the system when the user clicks on the window's &quot;close&quot; button. If ''destroyEnabled'' is <code>true</code>, the system destroys the Ability automatically (and Qt needs to adapt to this). If ''destroyEnabled'' = <code>false</code>, the window is not automatically destroyed, but instead standard Qt path for window close is triggered, i.e. [[../qtgui/qwindow.html#close|QWindow::close]]().
 
By default, the flag is set to <code>false</code>.
 
'''See also''' QtOhosExtras::QOhosAbilityContext::setDestroyFromSystemEnabled().
 
<span id="setBundledAbilityAndQWindowBindingKeyForQWindow"></span>
=== <span id="setBundledAbilityAndQWindowBindingKeyForQWindow"></span><span class="type">void</span> QtOhosExtras::<span class="name">setBundledAbilityAndQWindowBindingKeyForQWindow</span>(<span class="type">[[../qtgui/qwindow.html|QWindow]]</span> *''window'', const <span class="type">[[../qtcore/qstring.html|QString]]</span> &amp;''qAbilityQWindowBindingKey'') ===
 
<span id="setMainWindowGeometryPersistenceHint"></span>
=== <span id="setMainWindowGeometryPersistenceHint"></span><span class="type">void</span> QtOhosExtras::<span class="name">setMainWindowGeometryPersistenceHint</span>(<span class="type">[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#WindowGeometryPersistenceHint-enum|QtOhosExtras::WindowGeometryPersistenceHint]]</span> ''geometryPersistenceHint'') ===


Sets a given ''geometryPersistenceHint'' on first main window shown.
Sets a given ''geometryPersistenceHint'' on first main window shown.
Line 575: Line 275:
Read about details in [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-window#setwindowrectautosave here].
Read about details in [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-window#setwindowrectautosave here].


<span id="setShowWindowAsFloatWindowHint"></span>
=== <span id="setShowWindowAsFloatWindowHint"></span>void QtOhosExtras::setShowWindowAsFloatWindowHint(QWindow *window, bool showAsFloatWindow) ===
=== <span id="setShowWindowAsFloatWindowHint"></span><span class="type">void</span> QtOhosExtras::<span class="name">setShowWindowAsFloatWindowHint</span>(<span class="type">[[../qtgui/qwindow.html|QWindow]]</span> *''window'', <span class="type">bool</span> ''showAsFloatWindow'') ===


Sets or unsets a given ''window'' as floating window according to ''showAsFloatWindow'' flag. Read more about floating window type [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-window-V5 here].
Sets or unsets a given ''window'' as floating window according to ''showAsFloatWindow'' flag. Read more about floating window type [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-window-V5 here].
Line 583: Line 282:
  auto window = std::make_unique<MainWindow>();
  auto window = std::make_unique<MainWindow>();
  QtOhosExtras::setShowWindowAsFloatWindowHint(window.get(), true);
  QtOhosExtras::setShowWindowAsFloatWindowHint(window.get(), true);
  window->show();</syntaxhighlight>
  window->show();
<span id="setShowWindowAsFloatWindowHint-1"></span>
</syntaxhighlight>
=== <span id="setShowWindowAsFloatWindowHint-1"></span><span class="type">void</span> QtOhosExtras::<span class="name">setShowWindowAsFloatWindowHint</span>(<span class="type">[[../qtwidgets/qwidget.html|QWidget]]</span> *''widget'', <span class="type">bool</span> ''showAsFloatWindow'') ===
 
=== <span id="setShowWindowAsFloatWindowHint-1"></span>void QtOhosExtras::setShowWindowAsFloatWindowHint(QWidget *widget, bool showAsFloatWindow) ===


Sets or unsets a given ''widget'' as floating window according to ''showAsFloatWindow'' flag. Read more about floating window type [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-window-V5 here].
Sets or unsets a given ''widget'' as floating window according to ''showAsFloatWindow'' flag. Read more about floating window type [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-window-V5 here].


<span id="setSurfaceBackgroundColor"></span>
=== <span id="setSurfaceBackgroundColor"></span>void QtOhosExtras::setSurfaceBackgroundColor(QWindow *window, const QColor &color) ===
=== <span id="setSurfaceBackgroundColor"></span><span class="type">void</span> QtOhosExtras::<span class="name">setSurfaceBackgroundColor</span>(<span class="type">[[../qtgui/qwindow.html|QWindow]]</span> *''window'', const <span class="type">[[../qtgui/qcolor.html|QColor]]</span> &amp;''color'') ===


Sets a given ''color'' as background color on the ''window'' inner native layer.
Sets a given ''color'' as background color on the ''window'' inner native layer.


<span id="setSurfaceBackgroundColor-1"></span>
=== <span id="setSurfaceBackgroundColor-1"></span>void QtOhosExtras::setSurfaceBackgroundColor(QWidget *widget, const QColor &color) ===
=== <span id="setSurfaceBackgroundColor-1"></span><span class="type">void</span> QtOhosExtras::<span class="name">setSurfaceBackgroundColor</span>(<span class="type">[[../qtwidgets/qwidget.html|QWidget]]</span> *''widget'', const <span class="type">[[../qtgui/qcolor.html|QColor]]</span> &amp;''color'') ===


Sets a given ''color'' as background color on the ''widget'' inner native layer.
Sets a given ''color'' as background color on the ''widget'' inner native layer.
Line 601: Line 299:
'''Warning:''' Currently, dynamic color change on a widget is not supported yet.
'''Warning:''' Currently, dynamic color change on a widget is not supported yet.


<span id="setWindowCornerRadius"></span>
=== <span id="setWindowCornerRadius"></span>void QtOhosExtras::setWindowCornerRadius(QWindow *window, double radius) ===
=== <span id="setWindowCornerRadius"></span><span class="type">void</span> QtOhosExtras::<span class="name">setWindowCornerRadius</span>(<span class="type">[[../qtgui/qwindow.html|QWindow]]</span> *''window'', <span class="type">double</span> ''radius'') ===


Sets corner ''radius'' for a ''window''. Given ''window'' has to be a sub or floating window type. It can be achieved for example: - by setting [[../qtcore/qt.html#WindowType-enum|Qt::WindowFlags]], like: [[../qtcore/qt.html#WindowType-enum|Qt::Window]], [[../qtcore/qt.html#WindowType-enum|Qt::Popup]], [[../qtcore/qt.html#WindowType-enum|Qt::Dialog]] etc. - explicitly using QtOhosExtras::setShowWindowAsFloatWindowHint() function. More on windows in: [https://doc.qt.io/archives/qt-5.15/qwindow.html Qt official docs]. The ''radius'' must not be a negative number. There's no upper limit in value, although visually OHOS uses maximum achievable value. In order for this function to work properly, it has to be called before the window is shown.
Sets corner ''radius'' for a ''window''. Given ''window'' has to be a sub or floating window type. It can be achieved for example: - by setting Qt::WindowFlags, like: Qt::Window, Qt::Popup, Qt::Dialog etc. - explicitly using QtOhosExtras::setShowWindowAsFloatWindowHint() function. More on windows in: [https://doc.qt.io/archives/qt-5.15/qwindow.html Qt official docs]. The ''radius'' must not be a negative number. There's no upper limit in value, although visually OHOS uses maximum achievable value. In order for this function to work properly, it has to be called before the window is shown.


Read more: [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-window here].
Read more: [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-window here].


<span id="setWindowCornerRadius-1"></span>
=== <span id="setWindowCornerRadius-1"></span>void QtOhosExtras::setWindowCornerRadius(QWidget *widget, double radius) ===
=== <span id="setWindowCornerRadius-1"></span><span class="type">void</span> QtOhosExtras::<span class="name">setWindowCornerRadius</span>(<span class="type">[[../qtwidgets/qwidget.html|QWidget]]</span> *''widget'', <span class="type">double</span> ''radius'') ===


Sets corner ''radius'' for a ''widget''. Given ''widget'' has to be formed as a new window, it means it cannot be embedded in a parent widget. It can be achieved for example: - by setting [[../qtcore/qt.html#WindowType-enum|Qt::WindowFlags]], like: [[../qtcore/qt.html#WindowType-enum|Qt::Window]], [[../qtcore/qt.html#WindowType-enum|Qt::Popup]], [[../qtcore/qt.html#WindowType-enum|Qt::Dialog]] etc. - explicitly using QtOhosExtras::setShowWindowAsFloatWindowHint() function. More on widgets as windows in: [https://doc.qt.io/archives/qt-5.15/qwidget.html Qt official docs]. The ''radius'' must not be a negative number. There's no upper limit in value, although visually OHOS uses maximum achievable value. In order for this function to work properly, it has to be called before the widget is shown.
Sets corner ''radius'' for a ''widget''. Given ''widget'' has to be formed as a new window, it means it cannot be embedded in a parent widget. It can be achieved for example: - by setting Qt::WindowFlags, like: Qt::Window, Qt::Popup, Qt::Dialog etc. - explicitly using QtOhosExtras::setShowWindowAsFloatWindowHint() function. More on widgets as windows in: [https://doc.qt.io/archives/qt-5.15/qwidget.html Qt official docs]. The ''radius'' must not be a negative number. There's no upper limit in value, although visually OHOS uses maximum achievable value. In order for this function to work properly, it has to be called before the widget is shown.


Read more: [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-window here].
Read more: [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-window here].


<span id="setWindowKeepScreenOn"></span>
=== <span id="setWindowKeepScreenOn"></span>void QtOhosExtras::setWindowKeepScreenOn(QWindow *window, bool keepScreenOn) ===
=== <span id="setWindowKeepScreenOn"></span><span class="type">void</span> QtOhosExtras::<span class="name">setWindowKeepScreenOn</span>(<span class="type">[[../qtgui/qwindow.html|QWindow]]</span> *''window'', <span class="type">bool</span> ''keepScreenOn'') ===


Sets or unsets a given ''window'' to keep the screen on according to ''keepScreenOn'' flag.
Sets or unsets a given ''window'' to keep the screen on according to ''keepScreenOn'' flag.
Line 622: Line 317:
Read more: [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-window-V5#setwindowkeepscreenon here].
Read more: [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-window-V5#setwindowkeepscreenon here].


<span id="setWindowKeepScreenOn-1"></span>
=== <span id="setWindowKeepScreenOn-1"></span>void QtOhosExtras::setWindowKeepScreenOn(QWidget *widget, bool keepScreenOn) ===
=== <span id="setWindowKeepScreenOn-1"></span><span class="type">void</span> QtOhosExtras::<span class="name">setWindowKeepScreenOn</span>(<span class="type">[[../qtwidgets/qwidget.html|QWidget]]</span> *''widget'', <span class="type">bool</span> ''keepScreenOn'') ===


Sets or unsets a given ''widget'' to keep the screen on according to ''keepScreenOn'' flag.
Sets or unsets a given ''widget'' to keep the screen on according to ''keepScreenOn'' flag.
Line 629: Line 323:
Read more: [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-window-V5#setwindowkeepscreenon here].
Read more: [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-window-V5#setwindowkeepscreenon here].


<span id="setWindowPrivacyMode"></span>
=== <span id="setWindowPrivacyMode"></span>void QtOhosExtras::setWindowPrivacyMode(QWindow *window, bool privacyModeEnabled) ===
=== <span id="setWindowPrivacyMode"></span><span class="type">void</span> QtOhosExtras::<span class="name">setWindowPrivacyMode</span>(<span class="type">[[../qtgui/qwindow.html|QWindow]]</span> *''window'', <span class="type">bool</span> ''privacyModeEnabled'') ===


Change window privacy mode according to a given ''window'' and ''privacyModeEnabled''. Read more about window privacy mode [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-window-V5#setwindowprivacymode9 here]
Change window privacy mode according to a given ''window'' and ''privacyModeEnabled''. Read more about window privacy mode [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-window-V5#setwindowprivacymode9 here]


<span id="startAbility"></span>
=== <span id="startAbility"></span>QSharedPointer<QtOhosExtras::QOhosOperationStatus> QtOhosExtras::startAbility(const QtOhosExtras::QOhosWant &want) ===
=== startAbility ===
 
<syntaxhighlight lang="cpp">
QSharedPointer<QtOhosExtras::QOhosOperationStatus>  
QtOhosExtras::startAbility(const QtOhosExtras::QOhosWant &want)
 
</syntaxhighlight>


Starts an Ability for a given ''want''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-inner-application-uiabilitycontext-V5#uiabilitycontextstartability Start Ability].
Starts an Ability for a given ''want''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-inner-application-uiabilitycontext-V5#uiabilitycontextstartability Start Ability].


'''Warning:''' Currently, operation status result is hardcoded as &quot;successful&quot; (even if ability were not started).
'''Warning:''' Currently, operation status result is hardcoded as "successful" (even if ability were not started).


<span id="startAbility-1"></span>
=== <span id="startAbility-1"></span>QSharedPointer<QtOhosExtras::QOhosOperationStatus> QtOhosExtras::startAbility(const QtOhosExtras::QOhosWant &want, const QtOhosExtras::QOhosStartOptions &options) ===
=== startAbility ===
 
<syntaxhighlight lang="cpp">
QSharedPointer<QtOhosExtras::QOhosOperationStatus>  
QtOhosExtras::startAbility(const QtOhosExtras::QOhosWant &want, const QtOhosExtras::QOhosStartOptions &options)
</syntaxhighlight>


Starts an Ability for a given ''want'' and ''options''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-inner-application-uiabilitycontext-V5#uiabilitycontextstartability-1 Start Ability].
Starts an Ability for a given ''want'' and ''options''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-inner-application-uiabilitycontext-V5#uiabilitycontextstartability-1 Start Ability].


'''Warning:''' Currently, operation status result is hardcoded as &quot;successful&quot; (even if ability were not started).
'''Warning:''' Currently, operation status result is hardcoded as "successful" (even if ability were not started).


<span id="startAbilityByType"></span>
=== <span id="startAbilityByType"></span>QSharedPointer<QtOhosExtras::QOhosOperationStatus> QtOhosExtras::startAbilityByType(const QString &appType, const QJsonObject &wantParameters) ===
=== startAbilityByType ===
 
<syntaxhighlight lang="cpp">
QSharedPointer<QtOhosExtras::QOhosOperationStatus>  
QtOhosExtras::startAbilityByType(const QString &appType, const QJsonObject &wantParameters)
</syntaxhighlight>


Starts an Ability for a given ''appType'' and ''wantParameters''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-inner-application-uiabilitycontext-V5#uiabilitycontextstartabilitybytype11-1 Start Ability].
Starts an Ability for a given ''appType'' and ''wantParameters''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-inner-application-uiabilitycontext-V5#uiabilitycontextstartabilitybytype11-1 Start Ability].


Returns true on success
Returns true on success.


<span id="startAppProcess"></span>
=== <span id="startAppProcess"></span>void QtOhosExtras::startAppProcess(const QString &processId, const QtOhosExtras::QOhosWant &requestWant) ===
=== <span id="startAppProcess"></span><span class="type">void</span> QtOhosExtras::<span class="name">startAppProcess</span>(const <span class="type">[[../qtcore/qstring.html|QString]]</span> &amp;''processId'', const <span class="type">[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class|QtOhosExtras::QOhosWant]]</span> &amp;''requestWant'') ===


Starts application process for a given ''processId'' and ''requestWant''.
Starts application process for a given ''processId'' and ''requestWant''.


<span id="startAppProcess-1"></span>
=== <span id="startAppProcess-1"></span>void QtOhosExtras::startAppProcess(const QString &processId, const QtOhosExtras::QOhosWant &requestWant, const QtOhosExtras::QOhosStartOptions &options) ===
=== <span id="startAppProcess-1"></span><span class="type">void</span> QtOhosExtras::<span class="name">startAppProcess</span>(const <span class="type">[[../qtcore/qstring.html|QString]]</span> &amp;''processId'', const <span class="type">[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWant_Class|QtOhosExtras::QOhosWant]]</span> &amp;''requestWant'', const <span class="type">[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class|QtOhosExtras::QOhosStartOptions]]</span> &amp;''options'') ===


Starts application process for a given ''processId'', ''requestWant'' and ''options''.
Starts application process for a given ''processId'', ''requestWant'' and ''options''.


<span id="startNewAbilityInstance"></span>
=== <span id="startNewAbilityInstance"></span>void QtOhosExtras::startNewAbilityInstance(QWidget *instanceWidget) ===
=== <span id="startNewAbilityInstance"></span><span class="type">void</span> QtOhosExtras::<span class="name">startNewAbilityInstance</span>(<span class="type">[[../qtwidgets/qwidget.html|QWidget]]</span> *''instanceWidget'') ===


Starts another instance of the UIAbility used by the Qt app with specified widget inside
Starts another instance of the UIAbility used by the Qt app with specified widget inside.


The caller should pass newly created [[../qtwidgets/qwidget.html|QWidget]] ''instanceWidget'', without any setting any parent, calling show() or winId() on it.
The caller should pass newly created QWidget ''instanceWidget'', without any setting any parent, calling show() or winId() on it.


<span id="tryGetNativeWindowId"></span>
=== <span id="tryGetNativeWindowId"></span>QSharedPointer<double> QtOhosExtras::tryGetNativeWindowId(QWindow *window) ===
=== tryGetNativeWindowId ===


<syntaxhighlight lang="cpp">
Function tries to obtain native window ID (ID associated with system window object) of given ''window''. The failure of the operation is indicated by returned value equal to `nullptr`.
QSharedPointer<double>
QtOhosExtras::tryGetNativeWindowId(QWindow *window)
</syntaxhighlight>
 
Function tries to obtain native window ID (ID associated with system window object) of given ''window''. The failure of the operation is indicated by returned value equal to <code>nullptr</code>.


'''Note:''' This function must be called only after the ''window'' has been shown.
'''Note:''' This function must be called only after the ''window'' has been shown.
Line 702: Line 367:
'''Warning:''' Returned native window ID isn't guaranteed to be valid throughout the lifetime of application. Application stability and performance may be poor after using this function, use it at your own risk!
'''Warning:''' Returned native window ID isn't guaranteed to be valid throughout the lifetime of application. Application stability and performance may be poor after using this function, use it at your own risk!


Read more on native window ID (WindowProperties.id): [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-window-V5#windowproperties here]
Read more on native window ID (WindowProperties.id): [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-window-V5#windowproperties here].
 
<span id="tryGetOnContinueData"></span>
=== tryGetOnContinueData ===
 
<syntaxhighlight lang="cpp">
QSharedPointer<QByteArray>
QtOhosExtras::tryGetOnContinueData(const QtOhosExtras::QOhosWant &want)
</syntaxhighlight>
 
<span id="tryGetScreenDisplayId"></span>
=== tryGetScreenDisplayed ===


<syntaxhighlight lang="cpp">
=== <span id="tryGetOnContinueData"></span>QSharedPointer<QByteArray> QtOhosExtras::tryGetOnContinueData(const QtOhosExtras::QOhosWant &want) ===
QSharedPointer<double>  
(No description provided in source)
QtOhosExtras::tryGetScreenDisplayId(QScreen *screen)
</syntaxhighlight>


Function tries to obtain native display ID of given ''screen''. The failure of the operation is indicated by returning <code>nullptr</code> .
=== <span id="tryGetScreenDisplayId"></span>QSharedPointer<double> QtOhosExtras::tryGetScreenDisplayId(QScreen *screen) ===


Read more on display ID (Display.id): [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-display-V5#display here]
Function tries to obtain native display ID of given ''screen''. The failure of the operation is indicated by returning `nullptr`.


<span id="tryMapQOhosPermissionFromName"></span>
Read more on display ID (Display.id): [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-display-V5#display here].
=== <span id="tryMapQOhosPermissionFromName"></span><span class="type">int</span> QtOhosExtras::<span class="name">tryMapQOhosPermissionFromName</span>(''const QString &amp;'') ===


<span id="tryMapQOhosPermissionToName"></span>
=== <span id="tryMapQOhosPermissionFromName"></span>int QtOhosExtras::tryMapQOhosPermissionFromName(const QString &) ===
=== <span id="tryMapQOhosPermissionToName"></span><span class="type">int</span> QtOhosExtras::<span class="name">tryMapQOhosPermissionToName</span>(''int'') ===


<span id="operator-7c"></span>
=== <span id="tryMapQOhosPermissionToName"></span>int QtOhosExtras::tryMapQOhosPermissionToName(int) ===
=== Function ===


<syntaxhighlight lang="cpp">
=== <span id="operator-7c"></span>QFlags<QOhosWantFlags::enum_type> QtOhosExtras::operator|(QOhosWantFlags::enum_type f1, QOhosWantFlags::enum_type f2) ===
QFlags<QOhosWantFlags::enum_type> QtOhosExtras::operator|(QOhosWantFlags::enum_type f1, QOhosWantFlags::enum_type f2)
</syntaxhighlight>


<span id="operator-7c-1"></span>
=== <span id="operator-7c-1"></span>QFlags<QOhosWantFlags::enum_type> QtOhosExtras::operator|(QOhosWantFlags::enum_type f1, QFlags<QOhosWantFlags::enum_type> f2) ===
=== Function ===
 
<syntaxhighlight lang="cpp">
QFlags<QOhosWantFlags::enum_type> QtOhosExtras::operator|(QOhosWantFlags::enum_type f1, QFlags<QOhosWantFlags::enum_type> f2)
</syntaxhighlight>


<syntaxhighlight>
=== <span id="operator-7c-2"></span>QIncompatibleFlag QtOhosExtras::operator|(QOhosWantFlags::enum_type f1, int f2) ===
QIncompatibleFlag QtOhosExtras::operator|(QOhosWantFlags::enum_type f1, int f2)
</syntaxhighlight><span id="operator-7c-2"></span>




</div>
[[Category:Qt for HarmonyOS]]

Latest revision as of 08:17, 29 January 2026

< Qt for HarmonyOS / qtohosextras doc

QtOhosExtras Namespace

The QtOhosExtras namespace provides miscellaneous functions to aid Ohos development. More...

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

Namespaces

namespace FileShare The FileShare to expose file permission API.
namespace QOhosPasteboard The QOhosPasteboard class is to manage native pasteboard.
namespace ShareKit The ShareKit to expose Share Kit API.

Classes

class QOhosAbilityContext The QOhosAbilityContext class is to manage native UI Ability context.
class QOhosAppContext The QOhosAppContext class contains API to manage native application context.
class QOhosBundleInfo The QOhosBundleInfo class contains API to provide native application bundle info.
class QOhosOnContinueContext The QOhosOnContinueContext class manages onContinue context.
class QOhosOpenLinkOptions (No description)
class QOhosOperationStatus The QOhosOperationStatus class provides interface to get an opertaion status.
class QOhosStartOptions The QOhosStartOptions class is to provide new options for new started ability or process.
class QOhosWant QOhosWant wraps Ohos Want class.
class QOhosWantInfo The QOhosWantInfo class is to represent Ohos want type.

Types

enum CloseEventRootCause { InternalClose, AbilityClose, WindowStageClose }
enum QOhosWantFlag { AuthReadUriPermission, AuthWriteUriPermission, InstallOnDemand }
flags QOhosWantFlag (Typedef for QFlags<QOhosWantFlag>)
enum WindowGeometryPersistenceHint { Disabled, Enabled, FollowSystemSetting }

Functions

bool authorizeFilePath(QWindow *parentWindow, const QString &filePath)
QSharedPointer<QtOhosExtras::QOhosWantInfo> convertToOhosExtrasWantInfo(int wantInfo)
int convertToQpaWantInfo(QSharedPointer<QtOhosExtras::QOhosWantInfo>)
QtOhosExtras::QOhosWant convertWantFromJsonObject(const QJsonObject &jsonWant)
QJsonObject convertWantToJsonObject(const QtOhosExtras::QOhosWant &want)
QSharedPointer<QtOhosExtras::QOhosOpenLinkOptions> createOpenLinkOptions()
QSharedPointer<QtOhosExtras::QOhosStartOptions> createStartOptions()
QtOhosExtras::CloseEventRootCause getCloseEventRootCause(QCloseEvent *closeEvent)
bool moveFileToTrash(const QString &filePath)
const QMetaObject * qt_getEnumMetaObject(QtOhosExtras::QOhosAppContext::ColorThemeMode)
const QMetaObject * qt_getEnumMetaObject(QtOhosExtras::QOhosStartOptions::ProcessMode)
const QMetaObject * qt_getEnumMetaObject(QtOhosExtras::QOhosStartOptions::StartupVisibility)
const QMetaObject * qt_getEnumMetaObject(QtOhosExtras::QOhosStartOptions::WindowMode)
const QMetaObject * qt_getEnumMetaObject(QtOhosExtras::QOhosStartOptions::SupportWindowMode)
const QMetaObject * qt_getEnumMetaObject(QtOhosExtras::CloseEventRootCause)
const QMetaObject * qt_getEnumMetaObject(QtOhosExtras::WindowGeometryPersistenceHint)
const char * qt_getEnumName(QtOhosExtras::QOhosAppContext::ColorThemeMode)
const char * qt_getEnumName(QtOhosExtras::QOhosStartOptions::ProcessMode)
const char * qt_getEnumName(QtOhosExtras::QOhosStartOptions::StartupVisibility)
const char * qt_getEnumName(QtOhosExtras::QOhosStartOptions::WindowMode)
const char * qt_getEnumName(QtOhosExtras::QOhosStartOptions::SupportWindowMode)
const char * qt_getEnumName(QtOhosExtras::CloseEventRootCause)
const char * qt_getEnumName(QtOhosExtras::WindowGeometryPersistenceHint)
void requestQOhosPermissionFromUserIfNeeded(QObject *resultConsumerQtContext, QWindow *optInstanceMainWindow, const QString &permissionName, int resultConsumer)
void requestQOhosPermissionOnSettingIfNeeded(QObject *resultConsumerQtContext, QWindow *optInstanceMainWindow, int permission, int resultConsumer)
void setAbilityInstanceDestroyEnabled(QWindow *instanceWindow, bool destroyEnabled)
void setBundledAbilityAndQWindowBindingKeyForQWindow(QWindow *window, const QString &qAbilityQWindowBindingKey)
void setMainWindowGeometryPersistenceHint(QtOhosExtras::WindowGeometryPersistenceHint geometryPersistenceHint)
void setShowWindowAsFloatWindowHint(QWindow *window, bool showAsFloatWindow)
void setShowWindowAsFloatWindowHint(QWidget *widget, bool showAsFloatWindow)
void setSurfaceBackgroundColor(QWindow *window, const QColor &color)
void setSurfaceBackgroundColor(QWidget *widget, const QColor &color)
void setWindowCornerRadius(QWindow *window, double radius)
void setWindowCornerRadius(QWidget *widget, double radius)
void setWindowKeepScreenOn(QWindow *window, bool keepScreenOn)
void setWindowKeepScreenOn(QWidget *widget, bool keepScreenOn)
void setWindowPrivacyMode(QWindow *window, bool privacyModeEnabled)
QSharedPointer<QtOhosExtras::QOhosOperationStatus> startAbility(const QtOhosExtras::QOhosWant &want)
QSharedPointer<QtOhosExtras::QOhosOperationStatus> startAbility(const QtOhosExtras::QOhosWant &want, const QtOhosExtras::QOhosStartOptions &options)
QSharedPointer<QtOhosExtras::QOhosOperationStatus> startAbilityByType(const QString &appType, const QJsonObject &wantParameters)
void startAppProcess(const QString &processId, const QtOhosExtras::QOhosWant &requestWant)
void startAppProcess(const QString &processId, const QtOhosExtras::QOhosWant &requestWant, const QtOhosExtras::QOhosStartOptions &options)
void startNewAbilityInstance(QWidget *instanceWidget)
QSharedPointer<double> tryGetNativeWindowId(QWindow *window)
QSharedPointer<QByteArray> tryGetOnContinueData(const QtOhosExtras::QOhosWant &want)
QSharedPointer<double> tryGetScreenDisplayId(QScreen *screen)
int tryMapQOhosPermissionFromName(const QString &)
int tryMapQOhosPermissionToName(int)
QFlags<QOhosWantFlags::enum_type> operator\|(QOhosWantFlags::enum_type f1, QOhosWantFlags::enum_type f2)
QFlags<QOhosWantFlags::enum_type> operator\|(QOhosWantFlags::enum_type f1, QFlags<QOhosWantFlags::enum_type> f2)
QIncompatibleFlag operator\|(QOhosWantFlags::enum_type f1, int f2)

Detailed Description

The QtOhosExtras namespace provides miscellaneous functions to aid Ohos development.

Type Documentation

enum QtOhosExtras::CloseEventRootCause

Enumerates the close event root cause.

Constant Value Description
QtOhosExtras::InternalClose 0 Close root cause not specified or unknown.
QtOhosExtras::AbilityClose 1 Close root cause of preparing to terminate.
QtOhosExtras::WindowStageClose 2 Close root cause of native Window Stage or Sub-Window close.

This enum was introduced or modified in Qt 5.12.12.

enum QtOhosExtras::QOhosWantFlag
flags QtOhosExtras::QOhosWantFlags

QOhosWantFlag specifies how the Want will be handled. See Flags.

Constant Value Description
QtOhosExtras::AuthReadUriPermission 1 << 0 Grants the permission to read the URI.
QtOhosExtras::AuthWriteUriPermission 1 << 1 Grants the permission to write data to the URI.
QtOhosExtras::InstallOnDemand 1 << 2 Ability will be installed if it has not been installed.

This enum was introduced or modified in Qt 5.12.12.

The QOhosWantFlags type is a typedef for QFlags<QOhosWantFlag>. It stores an OR combination of QOhosWantFlag values.

enum QtOhosExtras::WindowGeometryPersistenceHint

Enumerates the policy for window geometry persistence support. Specifies how a window’s geometry (the size and position) is determined when it is shown.

Constant Value Description
QtOhosExtras::Disabled 0 Use default window's geometry.
QtOhosExtras::Enabled 1 Restore previous window's geometry (position and size when before window was closed).
QtOhosExtras::FollowSystemSetting 2 Let the system decide whether to use Disabled or Enabled value.

This enum was introduced or modified in Qt 5.12.12.

Function Documentation

bool QtOhosExtras::authorizeFilePath(QWindow *parentWindow, const QString &filePath)

Request authorization on the User selected parentWindow for a given filePath. The system File Dialog in authorization mode will be presented to the User. According to User choice returns true if file path is authorized, false otherwise. See authMode.

This function was introduced in Qt 5.12.12.

QSharedPointer<QtOhosExtras::QOhosWantInfo> QtOhosExtras::convertToOhosExtrasWantInfo(int wantInfo)

(No description provided in source)

QSharedPointer<QtOhosExtras::QOhosStartOptions> QtOhosExtras::createStartOptions()

Creates QOhosStartOptions instance.

QtOhosExtras::CloseEventRootCause QtOhosExtras::getCloseEventRootCause(QCloseEvent *closeEvent)

Converts a given closeEvent to QtOhosExtras::CloseEventRootCause.

Returns related QtOhosExtras::CloseEventRootCause value.

bool QtOhosExtras::moveFileToTrash(const QString &filePath)

Moves the file specified by filePath to the trash. Returns true if successful, false otherwise.

This function provides functionality of QFile::moveToTrash() from Qt 5.15.

void QtOhosExtras::setAbilityInstanceDestroyEnabled(QWindow *instanceWindow, bool destroyEnabled)

Sets whether the Ability related with instanceWindow can be automatically destroyed by the system when the user clicks on the window's "close" button. If destroyEnabled is true, the system destroys the Ability automatically (and Qt needs to adapt to this). If destroyEnabled = false, the window is not automatically destroyed, but instead standard Qt path for window close is triggered, i.e. QWindow::close().

By default, the flag is set to false.

See also: QtOhosExtras::QOhosAbilityContext::setDestroyFromSystemEnabled().

void QtOhosExtras::setMainWindowGeometryPersistenceHint(QtOhosExtras::WindowGeometryPersistenceHint geometryPersistenceHint)

Sets a given geometryPersistenceHint on first main window shown.

If this function is called with geometryPersistenceHint `Enabled`, the first main window's geometry will be saved when the window is closed and restored on the next application launch. By default this feature is disabled.

This method must be called before first main window is shown. Otherwise geometry persistence policy will not be updated.

Only supported on 2-in-1 devices.

Read about details in here.

void QtOhosExtras::setShowWindowAsFloatWindowHint(QWindow *window, bool showAsFloatWindow)

Sets or unsets a given window as floating window according to showAsFloatWindow flag. Read more about floating window type here.

 auto window = std::make_unique<MainWindow>();
 QtOhosExtras::setShowWindowAsFloatWindowHint(window.get(), true);
 window->show();

void QtOhosExtras::setShowWindowAsFloatWindowHint(QWidget *widget, bool showAsFloatWindow)

Sets or unsets a given widget as floating window according to showAsFloatWindow flag. Read more about floating window type here.

void QtOhosExtras::setSurfaceBackgroundColor(QWindow *window, const QColor &color)

Sets a given color as background color on the window inner native layer.

void QtOhosExtras::setSurfaceBackgroundColor(QWidget *widget, const QColor &color)

Sets a given color as background color on the widget inner native layer.

Warning: Currently, dynamic color change on a widget is not supported yet.

void QtOhosExtras::setWindowCornerRadius(QWindow *window, double radius)

Sets corner radius for a window. Given window has to be a sub or floating window type. It can be achieved for example: - by setting Qt::WindowFlags, like: Qt::Window, Qt::Popup, Qt::Dialog etc. - explicitly using QtOhosExtras::setShowWindowAsFloatWindowHint() function. More on windows in: Qt official docs. The radius must not be a negative number. There's no upper limit in value, although visually OHOS uses maximum achievable value. In order for this function to work properly, it has to be called before the window is shown.

Read more: here.

void QtOhosExtras::setWindowCornerRadius(QWidget *widget, double radius)

Sets corner radius for a widget. Given widget has to be formed as a new window, it means it cannot be embedded in a parent widget. It can be achieved for example: - by setting Qt::WindowFlags, like: Qt::Window, Qt::Popup, Qt::Dialog etc. - explicitly using QtOhosExtras::setShowWindowAsFloatWindowHint() function. More on widgets as windows in: Qt official docs. The radius must not be a negative number. There's no upper limit in value, although visually OHOS uses maximum achievable value. In order for this function to work properly, it has to be called before the widget is shown.

Read more: here.

void QtOhosExtras::setWindowKeepScreenOn(QWindow *window, bool keepScreenOn)

Sets or unsets a given window to keep the screen on according to keepScreenOn flag.

Read more: here.

void QtOhosExtras::setWindowKeepScreenOn(QWidget *widget, bool keepScreenOn)

Sets or unsets a given widget to keep the screen on according to keepScreenOn flag.

Read more: here.

void QtOhosExtras::setWindowPrivacyMode(QWindow *window, bool privacyModeEnabled)

Change window privacy mode according to a given window and privacyModeEnabled. Read more about window privacy mode here

QSharedPointer<QtOhosExtras::QOhosOperationStatus> QtOhosExtras::startAbility(const QtOhosExtras::QOhosWant &want)

Starts an Ability for a given want. See Start Ability.

Warning: Currently, operation status result is hardcoded as "successful" (even if ability were not started).

QSharedPointer<QtOhosExtras::QOhosOperationStatus> QtOhosExtras::startAbility(const QtOhosExtras::QOhosWant &want, const QtOhosExtras::QOhosStartOptions &options)

Starts an Ability for a given want and options. See Start Ability.

Warning: Currently, operation status result is hardcoded as "successful" (even if ability were not started).

QSharedPointer<QtOhosExtras::QOhosOperationStatus> QtOhosExtras::startAbilityByType(const QString &appType, const QJsonObject &wantParameters)

Starts an Ability for a given appType and wantParameters. See Start Ability.

Returns true on success.

void QtOhosExtras::startAppProcess(const QString &processId, const QtOhosExtras::QOhosWant &requestWant)

Starts application process for a given processId and requestWant.

void QtOhosExtras::startAppProcess(const QString &processId, const QtOhosExtras::QOhosWant &requestWant, const QtOhosExtras::QOhosStartOptions &options)

Starts application process for a given processId, requestWant and options.

void QtOhosExtras::startNewAbilityInstance(QWidget *instanceWidget)

Starts another instance of the UIAbility used by the Qt app with specified widget inside.

The caller should pass newly created QWidget instanceWidget, without any setting any parent, calling show() or winId() on it.

QSharedPointer<double> QtOhosExtras::tryGetNativeWindowId(QWindow *window)

Function tries to obtain native window ID (ID associated with system window object) of given window. The failure of the operation is indicated by returned value equal to `nullptr`.

Note: This function must be called only after the window has been shown.

Warning: Returned native window ID isn't guaranteed to be valid throughout the lifetime of application. Application stability and performance may be poor after using this function, use it at your own risk!

Read more on native window ID (WindowProperties.id): here.

QSharedPointer<QByteArray> QtOhosExtras::tryGetOnContinueData(const QtOhosExtras::QOhosWant &want)

(No description provided in source)

QSharedPointer<double> QtOhosExtras::tryGetScreenDisplayId(QScreen *screen)

Function tries to obtain native display ID of given screen. The failure of the operation is indicated by returning `nullptr`.

Read more on display ID (Display.id): here.

int QtOhosExtras::tryMapQOhosPermissionFromName(const QString &)

int QtOhosExtras::tryMapQOhosPermissionToName(int)

QFlags<QOhosWantFlags::enum_type> QtOhosExtras::operator|(QOhosWantFlags::enum_type f1, QOhosWantFlags::enum_type f2)

QFlags<QOhosWantFlags::enum_type> QtOhosExtras::operator|(QOhosWantFlags::enum_type f1, QFlags<QOhosWantFlags::enum_type> f2)

QIncompatibleFlag QtOhosExtras::operator|(QOhosWantFlags::enum_type f1, int f2)