Jump to content

Qt for HarmonyOS/qtohosextras doc/QOhosStartOptions Class: Difference between revisions

From Qt Wiki
Add URLs and member functions
Update from qdoc output (QTFOROH-2307)
Line 3: Line 3:
= QOhosStartOptions Class =
= QOhosStartOptions Class =


The QOhosStartOptions class is to provide new options for new started ability or process. More...
class [[Qt_for_HarmonyOS/qtohosextras_doc/Qt_Ohos_Extras_C++_Classes|QtOhosExtras]]::QOhosStartOptions
 
The QOhosStartOptions class is to provide new options for new started ability or process. [[#details|More...]]


{| class="wikitable"
{| class="wikitable"
|-
|-
! Header:
| Header:
| #include <QOhosStartOptions>
| #include <QOhosStartOptions>
|-
|-
! qmake:
| qmake:
| QT += ohosextras
| QT += ohosextras
|-
|-
! Since:
| Since:
| Qt 5.12.12
| Qt 5.12.12
|}
|}


* [[List_of_All_Members_for_QOhosStartOptions|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_QOhosStartOptions|List of all members, including inherited members]]
* [[Qt_for_HarmonyOS/qtohosextras_doc/Obsolete_Members_for_QOhosStartOptions|Obsolete members]]


== Public Types ==
== Public Types ==


{| class="wikitable" style="width:100%"
{| class="wikitable"
|-
| class || '''[[QOhosWindowCreateParams_Class|QOhosWindowCreateParams]]'''
|-
|-
| enum || '''[[#ProcessMode-enum|ProcessMode]]''' { NEW_PROCESS_ATTACH_TO_PARENT, NEW_PROCESS_ATTACH_TO_STATUS_BAR_ITEM }
| enum class
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#ProcessMode-enum|ProcessMode]]''' { NEW_PROCESS_ATTACH_TO_PARENT, NEW_PROCESS_ATTACH_TO_STATUS_BAR_ITEM }
|-
|-
| enum || '''[[#StartupVisibility-enum|StartupVisibility]]''' { STARTUP_HIDE, STARTUP_SHOW }
| enum class
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#StartupVisibility-enum|StartupVisibility]]''' { STARTUP_HIDE, STARTUP_SHOW }
|-
|-
| enum || '''[[#SupportWindowMode-enum|SupportWindowMode]]''' { FULL_SCREEN, SPLIT, FLOATING }
| enum class
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#SupportWindowMode-enum|SupportWindowMode]]''' { FULL_SCREEN, SPLIT, FLOATING }
|-
|-
| enum || '''[[#WindowMode-enum|WindowMode]]''' { WINDOW_MODE_SPLIT_PRIMARY, WINDOW_MODE_SPLIT_SECONDARY, WINDOW_MODE_FULLSCREEN }
| enum class
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#WindowMode-enum|WindowMode]]''' { WINDOW_MODE_SPLIT_PRIMARY, WINDOW_MODE_SPLIT_SECONDARY, WINDOW_MODE_FULLSCREEN }
|}
|}


== Public Functions ==
== Public Functions ==


{| class="wikitable" style="width:100%"
{| class="wikitable"
|-
| virtual || '''[[#dtor.QOhosStartOptions|~QOhosStartOptions]]'''()
|-
| virtual void || '''[[#setDisplayId|setDisplayId]]'''(int ''displayId'') = 0
|-
| virtual void || '''[[#setHideStartWindow|setHideStartWindow]]'''(bool ''hideStartWindow'') = 0
|-
| virtual void || '''[[#setMaxWindowHeight|setMaxWindowHeight]]'''(int ''maxWindowHeight'') = 0
|-
|-
| virtual void || '''[[#setMaxWindowWidth|setMaxWindowWidth]]'''(int ''maxWindowWidth'') = 0
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setDisplayId|setDisplayId]]'''(int ''displayId'') = 0
|-
|-
| virtual void || '''[[#setMinWindowHeight|setMinWindowHeight]]'''(int ''minWindowHeight'') = 0
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setHideStartWindow|setHideStartWindow]]'''(bool ''hideStartWindow'') = 0
|-
|-
| virtual void || '''[[#setMinWindowWidth|setMinWindowWidth]]'''(int ''minWindowWidth'') = 0
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setMaxWindowHeight|setMaxWindowHeight]]'''(int ''maxWindowHeight'') = 0
|-
|-
| virtual void || '''[[#setProcessMode|setProcessMode]]'''(QtOhosExtras::QOhosStartOptions::ProcessMode ''processMode'') = 0
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setMaxWindowWidth|setMaxWindowWidth]]'''(int ''maxWindowWidth'') = 0
|-
|-
| virtual void || '''[[#setStartWindowBackgroundColor|setStartWindowBackgroundColor]]'''(const QColor &''startWindowBackgroundColor'') = 0
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setMinWindowHeight|setMinWindowHeight]]'''(int ''minWindowHeight'') = 0
|-
|-
| virtual void || '''[[#setStartWindowIcon|setStartWindowIcon]]'''(const QImage &''startWindowIcon'') = 0
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setMinWindowWidth|setMinWindowWidth]]'''(int ''minWindowWidth'') = 0
|-
|-
| virtual void || '''[[#setStartupVisibility|setStartupVisibility]]'''(QtOhosExtras::QOhosStartOptions::StartupVisibility ''startupVisiblity'') = 0
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setProcessMode|setProcessMode]]'''(ProcessMode ''processMode'') = 0
|-
|-
| virtual void || '''[[#setSupportWindowModes|setSupportWindowModes]]'''(const QList<QtOhosExtras::QOhosStartOptions::SupportWindowMode> &''supportWindowModes'') = 0
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setStartWindowBackgroundColor|setStartWindowBackgroundColor]]'''(const QColor &''startWindowBackgroundColor'') = 0
|-
|-
| virtual void || '''[[#setWindowCreateParams|setWindowCreateParams]]'''(const QtOhosExtras::QOhosStartOptions::QOhosWindowCreateParams &''windowCreateParams'') = 0
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setStartWindowIcon|setStartWindowIcon]]'''(const QImage &''startWindowIcon'') = 0
|-
|-
| virtual void || '''[[#setWindowFocused|setWindowFocused]]'''(bool ''windowFocused'') = 0
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setStartupVisibility|setStartupVisibility]]'''(StartupVisibility ''startupVisiblity'') = 0
|-
|-
| virtual void || '''[[#setWindowHeight|setWindowHeight]]'''(int ''windowHeight'') = 0
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setSupportWindowModes|setSupportWindowModes]]'''(const QList<SupportWindowMode> &''supportWindowModes'') = 0
|-
|-
| virtual void || '''[[#setWindowLeft|setWindowLeft]]'''(int ''windowLeft'') = 0
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setWindowCreateParams|setWindowCreateParams]]'''(const QOhosWindowCreateParams &''windowCreateParams'') = 0
|-
|-
| virtual void || '''[[#setWindowMode|setWindowMode]]'''(QtOhosExtras::QOhosStartOptions::WindowMode ''windowMode'') = 0
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setWindowHeight|setWindowHeight]]'''(int ''windowHeight'') = 0
|-
|-
| virtual void || '''[[#setWindowTop|setWindowTop]]'''(int ''windowTop'') = 0
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setWindowLeft|setWindowLeft]]'''(int ''windowLeft'') = 0
|-
|-
| virtual void || '''[[#setWindowWidth|setWindowWidth]]'''(int ''windowWidth'') = 0
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setWindowMode|setWindowMode]]'''(WindowMode ''windowMode'') = 0
|-
|-
| virtual void || '''[[#setWithAnimation|setWithAnimation]]'''(bool ''withAnimation'') = 0
| virtual void
|}
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setWindowTop|setWindowTop]]'''(int ''windowTop'') = 0
 
== Static Public Members ==
 
{| class="wikitable" style="width:100%"
|-
|-
| const QMetaObject || '''staticMetaObject'''
| virtual void
|}
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setWindowWidth|setWindowWidth]]'''(int ''windowWidth'') = 0
 
== Protected Functions ==
 
{| class="wikitable" style="width:100%"
|-
|-
| || '''[[#QOhosStartOptions|QOhosStartOptions]]'''()
| virtual void
| '''[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#setWithAnimation|setWithAnimation]]'''(bool ''withAnimation'') = 0
|}
|}


== Detailed Description ==
== Detailed Description ==


The QOhosStartOptions class is to provide new options for new started ability or process.
'''See also '''[[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#createStartOptions|createStartOptions]](), [[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#startAbility|startAbility]](), and [[Qt_for_HarmonyOS/qtohosextras_doc/QtOhosExtras_Namespace#startAppProcess|startAppProcess]]().
 
'''See also '''[[QtOhosExtras_Namespace#createStartOptions|createStartOptions()]], [[QtOhosExtras_Namespace#startAbility|startAbility()]], and [[QtOhosExtras_Namespace#startAppProcess|startAppProcess()]].


== Member Type Documentation ==
== Member Type Documentation ==


=== <span id="ProcessMode-enum"></span>enum QOhosStartOptions::ProcessMode ===
=== <span id="ProcessMode-enum"></span>enum class QOhosStartOptions::ProcessMode ===


Enumerates the process modes. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V13/js-apis-app-ability-contextconstant-V13#processmode12 Process Mode].
Enumerates the process modes. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V13/js-apis-app-ability-contextconstant-V13#processmode12 Process Mode].


{| class="wikitable"
{| class="wikitable"
! Constant !! Value !! Description
|-
|-
| QtOhosExtras::QOhosStartOptions::NEW_PROCESS_ATTACH_TO_PARENT || 0 || A new process is created, the ability is started on the process, and the process exits along with the parent process.
! Constant
! Value
! Description
|-
|-
| QtOhosExtras::QOhosStartOptions::NEW_PROCESS_ATTACH_TO_STATUS_BAR_ITEM || 1 || A new process is created, the ability is started on the process, and the process is bound to the status bar icon.
| <code>QtOhosExtras::QOhosStartOptions::ProcessMode::NEW_PROCESS_ATTACH_TO_PARENT</code>
| <code>0</code>
| A new process is created, the ability is started on the process, and the process exits along with the parent process.
|-
| <code>QtOhosExtras::QOhosStartOptions::ProcessMode::NEW_PROCESS_ATTACH_TO_STATUS_BAR_ITEM</code>
| <code>1</code>
| A new process is created, the ability is started on the process, and the process is bound to the status bar icon.
|}
|}


=== <span id="StartupVisibility-enum"></span>enum QOhosStartOptions::StartupVisibility ===
This enum was introduced or modified in Qt 5.12.12.
 
=== <span id="StartupVisibility-enum"></span>enum class QOhosStartOptions::StartupVisibility ===


Enumerates the visibility statuses of an ability after it is started. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V13/js-apis-app-ability-contextconstant-V13#startupvisibility12 Startup Visibility].
Enumerates the visibility statuses of an ability after it is started. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V13/js-apis-app-ability-contextconstant-V13#startupvisibility12 Startup Visibility].


{| class="wikitable"
{| class="wikitable"
! Constant !! Value !! Description
|-
|-
| QtOhosExtras::QOhosStartOptions::STARTUP_HIDE || 0 || The target ability is hidden after it is started in the new process.
! Constant
! Value
! Description
|-
| <code>QtOhosExtras::QOhosStartOptions::StartupVisibility::STARTUP_HIDE</code>
| <code>0</code>
| The target ability is hidden after it is started in the new process.
|-
|-
| QtOhosExtras::QOhosStartOptions::STARTUP_SHOW || 1 || The target ability is displayed normally after it is started in the new process.
| <code>QtOhosExtras::QOhosStartOptions::StartupVisibility::STARTUP_SHOW</code>
| <code>1</code>
| The target ability is displayed normally after it is started in the new process.
|}
|}


=== <span id="SupportWindowMode-enum"></span>enum QOhosStartOptions::SupportWindowMode ===
This enum was introduced or modified in Qt 5.12.12.
 
=== <span id="SupportWindowMode-enum"></span>enum class QOhosStartOptions::SupportWindowMode ===


Enumerates the supported window modes when the ability is started. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-bundlemanager#supportwindowmode Support Window Mode].
Enumerates the supported window modes when the ability is started. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-bundlemanager#supportwindowmode Support Window Mode].


{| class="wikitable"
{| class="wikitable"
! Constant !! Value !! Description
|-
|-
| QtOhosExtras::QOhosStartOptions::FULL_SCREEN || 0 || Indicates support for full screen mode.
! Constant
! Value
! Description
|-
| <code>QtOhosExtras::QOhosStartOptions::SupportWindowMode::FULL_SCREEN</code>
| <code>0</code>
| Indicates support for full screen mode.
|-
|-
| QtOhosExtras::QOhosStartOptions::SPLIT || 1 || Indicates support for split mode.
| <code>QtOhosExtras::QOhosStartOptions::SupportWindowMode::SPLIT</code>
| <code>1</code>
| Indicates support for split mode.
|-
|-
| QtOhosExtras::QOhosStartOptions::FLOATING || 2 || Indicates support for floating mode.
| <code>QtOhosExtras::QOhosStartOptions::SupportWindowMode::FLOATING</code>
| <code>2</code>
| Indicates support for floating mode.
|}
|}


=== <span id="WindowMode-enum"></span>enum QOhosStartOptions::WindowMode ===
This enum was introduced or modified in Qt 5.12.12.
 
=== <span id="WindowMode-enum"></span>enum class QOhosStartOptions::WindowMode ===


Enumerates the window mode when the ability is started. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V13/js-apis-app-ability-abilityconstant-V13#windowmode12 Window Mode].
Enumerates the window mode when the ability is started. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V13/js-apis-app-ability-abilityconstant-V13#windowmode12 Window Mode].


{| class="wikitable"
{| class="wikitable"
! Constant !! Value !! Description
|-
|-
| QtOhosExtras::QOhosStartOptions::WINDOW_MODE_SPLIT_PRIMARY || 0 || Primary screen in split-screen mode.
! Constant
! Value
! Description
|-
|-
| QtOhosExtras::QOhosStartOptions::WINDOW_MODE_SPLIT_SECONDARY || 1 || Secondary screen in split-screen mode.
| <code>QtOhosExtras::QOhosStartOptions::WindowMode::WINDOW_MODE_SPLIT_PRIMARY</code>
| <code>0</code>
| Primary screen (left screen in the case of horizontal orientation) in split-screen mode.
|-
|-
| QtOhosExtras::QOhosStartOptions::WINDOW_MODE_FULLSCREEN || 2 || Full screen mode.
| <code>QtOhosExtras::QOhosStartOptions::WindowMode::WINDOW_MODE_SPLIT_SECONDARY</code>
| <code>1</code>
| Secondary screen (right screen in the case of horizontal orientation) in split-screen mode.
|-
| <code>QtOhosExtras::QOhosStartOptions::WindowMode::WINDOW_MODE_FULLSCREEN</code>
| <code>2</code>
| Full screen mode.
|}
|}
This enum was introduced or modified in Qt 5.12.12.


== Member Function Documentation ==
== Member Function Documentation ==


=== <span id="QOhosStartOptions"></span>[protected] QOhosStartOptions::QOhosStartOptions() ===
=== <span id="setDisplayId"></span><code>[pure virtual] </code>void QOhosStartOptions::setDisplayId(int ''displayId'') ===
Default constructs an instance of QOhosStartOptions.
 
Sets ''displayId''. The default value is 0, indicating the current display. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5#properties Display Id].
 
=== <span id="setHideStartWindow"></span><code>[pure virtual] </code>void QOhosStartOptions::setHideStartWindow(bool ''hideStartWindow'') ===
 
Controls whether to hide the start window (''hideStartWindow'') when launching the current application's UIAbility.
 
See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Hide Start Window].
 
=== <span id="setMaxWindowHeight"></span><code>[pure virtual] </code>void QOhosStartOptions::setMaxWindowHeight(int ''maxWindowHeight'') ===
 
Sets ''maxWindowHeight'' as the maximum height, in px.
 
See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Maximum Window Height].
 
=== <span id="setMaxWindowWidth"></span><code>[pure virtual] </code>void QOhosStartOptions::setMaxWindowWidth(int ''maxWindowWidth'') ===
 
Sets ''maxWindowWidth'' as the maximum width, in px.
 
See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Maximum Window Width].


=== <span id="dtor.QOhosStartOptions"></span>[virtual] QOhosStartOptions::~QOhosStartOptions() ===
=== <span id="setMinWindowHeight"></span><code>[pure virtual] </code>void QOhosStartOptions::setMinWindowHeight(int ''minWindowHeight'') ===
Destroys the instance of QOhosStartOptions.


=== <span id="setDisplayId"></span>[pure virtual] void QOhosStartOptions::setDisplayId(int displayId) ===
Sets ''minWindowHeight'' as the minimum height, in px.
Sets ''displayId''. The default value is 0, indicating the current display. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V13/js-apis-app-ability-abilityconstant-V13#windowmode12 Display Id].


=== <span id="setHideStartWindow"></span>[pure virtual] void QOhosStartOptions::setHideStartWindow(bool hideStartWindow) ===
See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Minimum Window Height].
Controls whether to hide the start window when launching the current application's UIAbility. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Hide Start Window].


=== <span id="setMaxWindowHeight"></span>[pure virtual] void QOhosStartOptions::setMaxWindowHeight(int maxWindowHeight) ===
=== <span id="setMinWindowWidth"></span><code>[pure virtual] </code>void QOhosStartOptions::setMinWindowWidth(int ''minWindowWidth'') ===
Sets ''maxWindowHeight'' as the maximum height, in px. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Maximum Window Height].


=== [pure virtual] void QOhosStartOptions::setMaxWindowWidth(int maxWindowWidth) ===
Sets ''minWindowWidth'' as the minimum width, in px.
Sets ''maxWindowWidth'' as the maximum width, in px. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Maximum Window Width].


=== [pure virtual] void QOhosStartOptions::setMinWindowHeight(int minWindowHeight) ===
See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Minimum Window Width].
Sets ''minWindowHeight'' as the minimum height, in px. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Minimum Window Height].


=== [pure virtual] void QOhosStartOptions::setMinWindowWidth(int minWindowWidth) ===
=== <span id="setProcessMode"></span><code>[pure virtual] </code>void QOhosStartOptions::setProcessMode([[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#ProcessMode-enum|ProcessMode]] ''processMode'') ===
Sets ''minWindowWidth'' as the minimum width, in px. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Minimum Window Width].


=== <span id="setProcessMode"></span>[pure virtual] void QOhosStartOptions::setProcessMode(QtOhosExtras::QOhosStartOptions::ProcessMode processMode) ===
Sets ''processMode''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5 Process Mode].
Sets ''processMode''. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5 Process Mode].


=== [pure virtual] void QOhosStartOptions::setStartWindowBackgroundColor(const QColor &startWindowBackgroundColor) ===
=== <span id="setStartWindowBackgroundColor"></span><code>[pure virtual] </code>void QOhosStartOptions::setStartWindowBackgroundColor(const [https://doc.qt.io/qt-5/qcolor.html QColor] &''startWindowBackgroundColor'') ===
Sets ''startWindowBackgroundColor'' for the start window. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Start Window Background Color].
 
Sets ''startWindowBackgroundColor'' for the start window.
 
See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Start Window Background Color].
 
=== <span id="setStartWindowIcon"></span><code>[pure virtual] </code>void QOhosStartOptions::setStartWindowIcon(const [https://doc.qt.io/qt-5/qimage.html QImage] &''startWindowIcon'') ===
 
Sets ''startWindowIcon'' for the start window.
 
See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Start Window Icon].


=== [pure virtual] void QOhosStartOptions::setStartWindowIcon(const QImage &startWindowIcon) ===
=== <span id="setStartupVisibility"></span><code>[pure virtual] </code>void QOhosStartOptions::setStartupVisibility([[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#StartupVisibility-enum|StartupVisibility]] ''startupVisiblity'') ===
Sets ''startWindowIcon'' for the start window. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Start Window Icon].


=== [pure virtual] void QOhosStartOptions::setStartupVisibility(QtOhosExtras::QOhosStartOptions::StartupVisibility ''startupVisiblity'') ===
Sets ''startupVisiblity'' of the ability after it is started. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5 Startup Visiblity].
Sets ''startupVisiblity'' of the ability after it is started. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5 Startup Visiblity].


=== [pure virtual] void QOhosStartOptions::setSupportWindowModes(const QList<QtOhosExtras::QOhosStartOptions::SupportWindowMode> &''supportWindowModes'') ===
=== <span id="setSupportWindowModes"></span><code>[pure virtual] </code>void QOhosStartOptions::setSupportWindowModes(const [https://doc.qt.io/qt-5/qlist.html QList]<[[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#SupportWindowMode-enum|SupportWindowMode]]> &''supportWindowModes'') ===
 
Sets ''supportWindowModes'' when the ability is started. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Support Window Modes].
Sets ''supportWindowModes'' when the ability is started. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Support Window Modes].


=== [pure virtual] void QOhosStartOptions::setWindowCreateParams(const QtOhosExtras::QOhosStartOptions::QOhosWindowCreateParams &windowCreateParams) ===
=== <span id="setWindowCreateParams"></span><code>[pure virtual] </code>void QOhosStartOptions::setWindowCreateParams(const [[Qt_for_HarmonyOS/qtohosextras_doc/QOhosWindowCreateParams_Class|QOhosWindowCreateParams]] &''windowCreateParams'') ===
Sets ''windowCreateParams'' used when creating the window. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/js-apis-app-ability-startoptions Window Create Params].
 
Sets ''windowCreateParams'' used when creating the window.
 
See [https://developer.huawei.com/consumer/en/doc/harmonyos-references/arkts-apis-window-i#windowcreateparams20 Window Create Params].


=== [pure virtual] void QOhosStartOptions::setWindowFocused(bool windowFocused) ===
=== <span id="setWindowHeight"></span><code>[pure virtual] </code>void QOhosStartOptions::setWindowHeight(int ''windowHeight'') ===
Sets ''windowFocused'' on a launched window.


=== [pure virtual] void QOhosStartOptions::setWindowHeight(int ''windowHeight'') ===
Sets ''windowHeight'' height of of the window. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5 Window Height].
Sets ''windowHeight'' height of of the window. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5 Window Height].


=== [pure virtual] void QOhosStartOptions::setWindowLeft(int windowLeft) ===
=== <span id="setWindowLeft"></span><code>[pure virtual] </code>void QOhosStartOptions::setWindowLeft(int ''windowLeft'') ===
 
Sets ''windowLeft'' left position of the window. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5 Window Left].
Sets ''windowLeft'' left position of the window. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5 Window Left].


=== <span id="setWindowMode"></span>[pure virtual] void QOhosStartOptions::setWindowMode(QtOhosExtras::QOhosStartOptions::WindowMode windowMode) ===
=== <span id="setWindowMode"></span><code>[pure virtual] </code>void QOhosStartOptions::setWindowMode([[Qt_for_HarmonyOS/qtohosextras_doc/QOhosStartOptions_Class#WindowMode-enum|WindowMode]] ''windowMode'') ===
 
Sets ''windowMode'' when the ability is started. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5#properties Window Mode].
Sets ''windowMode'' when the ability is started. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5#properties Window Mode].


=== [pure virtual] void QOhosStartOptions::setWindowTop(int windowTop) ===
=== <span id="setWindowTop"></span><code>[pure virtual] </code>void QOhosStartOptions::setWindowTop(int ''windowTop'') ===
 
Sets ''windowTop'' top position of the window. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5 Window Top].
Sets ''windowTop'' top position of the window. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5 Window Top].


=== [pure virtual] void QOhosStartOptions::setWindowWidth(int windowWidth) ===
=== <span id="setWindowWidth"></span><code>[pure virtual] </code>void QOhosStartOptions::setWindowWidth(int ''windowWidth'') ===
 
Sets ''windowWidth'' width of of the window. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5 Window Width].
Sets ''windowWidth'' width of of the window. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5 Window Width].


=== [pure virtual] void QOhosStartOptions::setWithAnimation(bool withAnimation) ===
=== <span id="setWithAnimation"></span><code>[pure virtual] </code>void QOhosStartOptions::setWithAnimation(bool ''withAnimation'') ===
 
Sets ''withAnimation'' whether the ability has the animation effect. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5 With Animation].
Sets ''withAnimation'' whether the ability has the animation effect. See [https://developer.huawei.com/consumer/en/doc/harmonyos-references-V5/js-apis-app-ability-startoptions-V5 With Animation].
[[Category:Qt for HarmonyOS]]
[[Category:Qt for HarmonyOS]]

Revision as of 08:30, 16 September 2026

< Qt for HarmonyOS / qtohosextras doc

QOhosStartOptions Class

class QtOhosExtras::QOhosStartOptions

The QOhosStartOptions class is to provide new options for new started ability or process. More...

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

This class was introduced in Qt 5.12.12.

Public Types

enum class ProcessMode { NEW_PROCESS_ATTACH_TO_PARENT, NEW_PROCESS_ATTACH_TO_STATUS_BAR_ITEM }
enum class StartupVisibility { STARTUP_HIDE, STARTUP_SHOW }
enum class SupportWindowMode { FULL_SCREEN, SPLIT, FLOATING }
enum class WindowMode { WINDOW_MODE_SPLIT_PRIMARY, WINDOW_MODE_SPLIT_SECONDARY, WINDOW_MODE_FULLSCREEN }

Public Functions

virtual void setDisplayId(int displayId) = 0
virtual void setHideStartWindow(bool hideStartWindow) = 0
virtual void setMaxWindowHeight(int maxWindowHeight) = 0
virtual void setMaxWindowWidth(int maxWindowWidth) = 0
virtual void setMinWindowHeight(int minWindowHeight) = 0
virtual void setMinWindowWidth(int minWindowWidth) = 0
virtual void setProcessMode(ProcessMode processMode) = 0
virtual void setStartWindowBackgroundColor(const QColor &startWindowBackgroundColor) = 0
virtual void setStartWindowIcon(const QImage &startWindowIcon) = 0
virtual void setStartupVisibility(StartupVisibility startupVisiblity) = 0
virtual void setSupportWindowModes(const QList<SupportWindowMode> &supportWindowModes) = 0
virtual void setWindowCreateParams(const QOhosWindowCreateParams &windowCreateParams) = 0
virtual void setWindowHeight(int windowHeight) = 0
virtual void setWindowLeft(int windowLeft) = 0
virtual void setWindowMode(WindowMode windowMode) = 0
virtual void setWindowTop(int windowTop) = 0
virtual void setWindowWidth(int windowWidth) = 0
virtual void setWithAnimation(bool withAnimation) = 0

Detailed Description

See also createStartOptions(), startAbility(), and startAppProcess().

Member Type Documentation

enum class QOhosStartOptions::ProcessMode

Enumerates the process modes. See Process Mode.

Constant Value Description
QtOhosExtras::QOhosStartOptions::ProcessMode::NEW_PROCESS_ATTACH_TO_PARENT 0 A new process is created, the ability is started on the process, and the process exits along with the parent process.
QtOhosExtras::QOhosStartOptions::ProcessMode::NEW_PROCESS_ATTACH_TO_STATUS_BAR_ITEM 1 A new process is created, the ability is started on the process, and the process is bound to the status bar icon.

This enum was introduced or modified in Qt 5.12.12.

enum class QOhosStartOptions::StartupVisibility

Enumerates the visibility statuses of an ability after it is started. See Startup Visibility.

Constant Value Description
QtOhosExtras::QOhosStartOptions::StartupVisibility::STARTUP_HIDE 0 The target ability is hidden after it is started in the new process.
QtOhosExtras::QOhosStartOptions::StartupVisibility::STARTUP_SHOW 1 The target ability is displayed normally after it is started in the new process.

This enum was introduced or modified in Qt 5.12.12.

enum class QOhosStartOptions::SupportWindowMode

Enumerates the supported window modes when the ability is started. See Support Window Mode.

Constant Value Description
QtOhosExtras::QOhosStartOptions::SupportWindowMode::FULL_SCREEN 0 Indicates support for full screen mode.
QtOhosExtras::QOhosStartOptions::SupportWindowMode::SPLIT 1 Indicates support for split mode.
QtOhosExtras::QOhosStartOptions::SupportWindowMode::FLOATING 2 Indicates support for floating mode.

This enum was introduced or modified in Qt 5.12.12.

enum class QOhosStartOptions::WindowMode

Enumerates the window mode when the ability is started. See Window Mode.

Constant Value Description
QtOhosExtras::QOhosStartOptions::WindowMode::WINDOW_MODE_SPLIT_PRIMARY 0 Primary screen (left screen in the case of horizontal orientation) in split-screen mode.
QtOhosExtras::QOhosStartOptions::WindowMode::WINDOW_MODE_SPLIT_SECONDARY 1 Secondary screen (right screen in the case of horizontal orientation) in split-screen mode.
QtOhosExtras::QOhosStartOptions::WindowMode::WINDOW_MODE_FULLSCREEN 2 Full screen mode.

This enum was introduced or modified in Qt 5.12.12.

Member Function Documentation

[pure virtual] void QOhosStartOptions::setDisplayId(int displayId)

Sets displayId. The default value is 0, indicating the current display. See Display Id.

[pure virtual] void QOhosStartOptions::setHideStartWindow(bool hideStartWindow)

Controls whether to hide the start window (hideStartWindow) when launching the current application's UIAbility.

See Hide Start Window.

[pure virtual] void QOhosStartOptions::setMaxWindowHeight(int maxWindowHeight)

Sets maxWindowHeight as the maximum height, in px.

See Maximum Window Height.

[pure virtual] void QOhosStartOptions::setMaxWindowWidth(int maxWindowWidth)

Sets maxWindowWidth as the maximum width, in px.

See Maximum Window Width.

[pure virtual] void QOhosStartOptions::setMinWindowHeight(int minWindowHeight)

Sets minWindowHeight as the minimum height, in px.

See Minimum Window Height.

[pure virtual] void QOhosStartOptions::setMinWindowWidth(int minWindowWidth)

Sets minWindowWidth as the minimum width, in px.

See Minimum Window Width.

[pure virtual] void QOhosStartOptions::setProcessMode(ProcessMode processMode)

Sets processMode. See Process Mode.

[pure virtual] void QOhosStartOptions::setStartWindowBackgroundColor(const QColor &startWindowBackgroundColor)

Sets startWindowBackgroundColor for the start window.

See Start Window Background Color.

[pure virtual] void QOhosStartOptions::setStartWindowIcon(const QImage &startWindowIcon)

Sets startWindowIcon for the start window.

See Start Window Icon.

[pure virtual] void QOhosStartOptions::setStartupVisibility(StartupVisibility startupVisiblity)

Sets startupVisiblity of the ability after it is started. See Startup Visiblity.

[pure virtual] void QOhosStartOptions::setSupportWindowModes(const QList<SupportWindowMode> &supportWindowModes)

Sets supportWindowModes when the ability is started. See Support Window Modes.

[pure virtual] void QOhosStartOptions::setWindowCreateParams(const QOhosWindowCreateParams &windowCreateParams)

Sets windowCreateParams used when creating the window.

See Window Create Params.

[pure virtual] void QOhosStartOptions::setWindowHeight(int windowHeight)

Sets windowHeight height of of the window. See Window Height.

[pure virtual] void QOhosStartOptions::setWindowLeft(int windowLeft)

Sets windowLeft left position of the window. See Window Left.

[pure virtual] void QOhosStartOptions::setWindowMode(WindowMode windowMode)

Sets windowMode when the ability is started. See Window Mode.

[pure virtual] void QOhosStartOptions::setWindowTop(int windowTop)

Sets windowTop top position of the window. See Window Top.

[pure virtual] void QOhosStartOptions::setWindowWidth(int windowWidth)

Sets windowWidth width of of the window. See Window Width.

[pure virtual] void QOhosStartOptions::setWithAnimation(bool withAnimation)

Sets withAnimation whether the ability has the animation effect. See With Animation.