Jump to content

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

From Qt Wiki
Created page with "< Qt for HarmonyOS / qtohosextras doc = QOhosStartOptions Class = The QOhosStartOptions class is to provide new options for new started ability or process. More... {| class="wikitable" |- ! Header: | #include <QOhosStartOptions> |- ! qmake: | QT += ohosextras |- ! Since: | Qt 5.12.12 |} * List of all members, including inherited members == Public Types == {| class="wikitable" style=..."
 
Add URLs and member functions
 
(2 intermediate revisions by the same user not shown)
Line 103: Line 103:
=== <span id="ProcessMode-enum"></span>enum QOhosStartOptions::ProcessMode ===
=== <span id="ProcessMode-enum"></span>enum QOhosStartOptions::ProcessMode ===


Enumerates the process modes.
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"
Line 115: Line 115:
=== <span id="StartupVisibility-enum"></span>enum QOhosStartOptions::StartupVisibility ===
=== <span id="StartupVisibility-enum"></span>enum QOhosStartOptions::StartupVisibility ===


Enumerates the visibility statuses of an ability after it is started.
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"
Line 127: Line 127:
=== <span id="SupportWindowMode-enum"></span>enum QOhosStartOptions::SupportWindowMode ===
=== <span id="SupportWindowMode-enum"></span>enum QOhosStartOptions::SupportWindowMode ===


Enumerates the supported window modes when the ability is started.
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"
Line 141: Line 141:
=== <span id="WindowMode-enum"></span>enum QOhosStartOptions::WindowMode ===
=== <span id="WindowMode-enum"></span>enum QOhosStartOptions::WindowMode ===


Enumerates the window mode when the ability is started.
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"
Line 162: Line 162:


=== <span id="setDisplayId"></span>[pure virtual] void QOhosStartOptions::setDisplayId(int displayId) ===
=== <span id="setDisplayId"></span>[pure virtual] void QOhosStartOptions::setDisplayId(int displayId) ===
Sets ''displayId''. The default value is 0, indicating the current display.
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) ===
=== <span id="setHideStartWindow"></span>[pure virtual] void QOhosStartOptions::setHideStartWindow(bool hideStartWindow) ===
Controls whether to hide the start window when launching the current application's UIAbility.
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="setMaxWindowHeight"></span>[pure virtual] void QOhosStartOptions::setMaxWindowHeight(int maxWindowHeight) ===
Sets ''maxWindowHeight'' as the maximum height, in px.
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 ''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) ===
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) ===
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) ===
=== <span id="setProcessMode"></span>[pure virtual] void QOhosStartOptions::setProcessMode(QtOhosExtras::QOhosStartOptions::ProcessMode processMode) ===
Sets ''processMode''.
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) ===
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].
 
=== [pure virtual] void QOhosStartOptions::setStartWindowIcon(const 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::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].
 
=== [pure virtual] void QOhosStartOptions::setSupportWindowModes(const QList<QtOhosExtras::QOhosStartOptions::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].
 
=== [pure virtual] void QOhosStartOptions::setWindowCreateParams(const QtOhosExtras::QOhosStartOptions::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].
 
=== [pure virtual] void QOhosStartOptions::setWindowFocused(bool windowFocused) ===
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].
 
=== [pure virtual] 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].


=== <span id="setWindowMode"></span>[pure virtual] void QOhosStartOptions::setWindowMode(QtOhosExtras::QOhosStartOptions::WindowMode windowMode) ===
=== <span id="setWindowMode"></span>[pure virtual] void QOhosStartOptions::setWindowMode(QtOhosExtras::QOhosStartOptions::WindowMode windowMode) ===
Sets ''windowMode'' when the ability is started.
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) ===
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) ===
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) ===
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]]

Latest revision as of 07:48, 30 January 2026

< Qt for HarmonyOS / qtohosextras doc

QOhosStartOptions Class

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

Public Types

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

Public Functions

virtual ~QOhosStartOptions()
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(QtOhosExtras::QOhosStartOptions::ProcessMode processMode) = 0
virtual void setStartWindowBackgroundColor(const QColor &startWindowBackgroundColor) = 0
virtual void setStartWindowIcon(const QImage &startWindowIcon) = 0
virtual void setStartupVisibility(QtOhosExtras::QOhosStartOptions::StartupVisibility startupVisiblity) = 0
virtual void setSupportWindowModes(const QList<QtOhosExtras::QOhosStartOptions::SupportWindowMode> &supportWindowModes) = 0
virtual void setWindowCreateParams(const QtOhosExtras::QOhosStartOptions::QOhosWindowCreateParams &windowCreateParams) = 0
virtual void setWindowFocused(bool windowFocused) = 0
virtual void setWindowHeight(int windowHeight) = 0
virtual void setWindowLeft(int windowLeft) = 0
virtual void setWindowMode(QtOhosExtras::QOhosStartOptions::WindowMode windowMode) = 0
virtual void setWindowTop(int windowTop) = 0
virtual void setWindowWidth(int windowWidth) = 0
virtual void setWithAnimation(bool withAnimation) = 0

Static Public Members

const QMetaObject staticMetaObject

Protected Functions

QOhosStartOptions()

Detailed Description

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

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

Member Type Documentation

enum QOhosStartOptions::ProcessMode

Enumerates the process modes. See Process Mode.

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

enum QOhosStartOptions::StartupVisibility

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

Constant Value Description
QtOhosExtras::QOhosStartOptions::STARTUP_HIDE 0 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.

enum QOhosStartOptions::SupportWindowMode

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

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

enum QOhosStartOptions::WindowMode

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

Constant Value Description
QtOhosExtras::QOhosStartOptions::WINDOW_MODE_SPLIT_PRIMARY 0 Primary screen in split-screen mode.
QtOhosExtras::QOhosStartOptions::WINDOW_MODE_SPLIT_SECONDARY 1 Secondary screen in split-screen mode.
QtOhosExtras::QOhosStartOptions::WINDOW_MODE_FULLSCREEN 2 Full screen mode.

Member Function Documentation

[protected] QOhosStartOptions::QOhosStartOptions()

Default constructs an instance of QOhosStartOptions.

[virtual] QOhosStartOptions::~QOhosStartOptions()

Destroys the instance of QOhosStartOptions.

[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 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(QtOhosExtras::QOhosStartOptions::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(QtOhosExtras::QOhosStartOptions::StartupVisibility startupVisiblity)

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

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

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

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

Sets windowCreateParams used when creating the window. See Window Create Params.

[pure virtual] void QOhosStartOptions::setWindowFocused(bool windowFocused)

Sets windowFocused on a launched window.

[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(QtOhosExtras::QOhosStartOptions::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.