6#include <QtCore/qvariant.h>
7#include <QtGui/private/qguiapplication_p.h>
8#include <QtGui/private/qohoswindowhints_p.h>
9#include <QtGui/qcolor.h>
10#include <QtGui/qpa/qplatformintegration.h>
11#include <QtGui/qpa/qplatformscreen_p.h>
12#include <QtGui/qpa/qplatformwindow_p.h>
13#include <QtGui/qscreen.h>
14#include <QtGui/qwindow.h>
15#include <QtWidgets/qwidget.h>
22
23
24
25
26
27
28
35
36
37
38
39
40
41
42
43
44
47 window->setProperty(QOhosWindowHints::floatWindowKey, QVariant::fromValue(showAsFloatWindow));
53 widget->setProperty(QOhosWindowHints::floatWindowKey, QVariant::fromValue(showAsFloatWindow));
57
58
59
60
61
64 window->setProperty(QOhosWindowHints::privacyModeKey, QVariant::fromValue(privacyModeEnabled));
68
69
70
73 window->setProperty(QOhosWindowHints::surfaceBackgroundColorKey, QVariant::fromValue(color));
77
78
79
80
81
84 widget->setProperty(QOhosWindowHints::surfaceBackgroundColorKey, QVariant::fromValue(color));
88
89
90
91
92
93
97 qWarning(
"QtOhosAppKit::Window::setWindowCornerRadius: radius must not be negative");
100 window->setProperty(QOhosWindowHints::cornerRadiusKey, QVariant::fromValue(radius));
104
105
106
107
108
112 qWarning(
"QtOhosAppKit::Window::setWindowCornerRadius: radius must not be negative");
115 widget->setProperty(QOhosWindowHints::cornerRadiusKey, QVariant::fromValue(radius));
119
120
121
124 window->setProperty(QOhosWindowHints::keepScreenOnKey, QVariant::fromValue(keepScreenOn));
128
129
130
131
132
135 widget->setProperty(QOhosWindowHints::keepScreenOnKey, QVariant::fromValue(keepScreenOn));
139
140
141
142
145 window->setProperty(QOhosWindowHints::dragResizableKey, QVariant::fromValue(dragResizable));
149
150
151
152
153
154
155
158 widget->setProperty(QOhosWindowHints::dragResizableKey, QVariant::fromValue(dragResizable));
162
163
164
165
166
169 std::optional<
bool> enabled;
181 using QOhosIntegration = QNativeInterface::Private::QOhosIntegration;
182 auto *integration = QGuiApplicationPrivate::platformIntegration();
183 integration->call<&QOhosIntegration::setMainWindowGeometryPersistenceEnabled>(enabled);
190 auto *ohosWindow = window->nativeInterface<QNativeInterface::Private::QOhosWindow>();
194 return ohosWindow->windowId();
199 auto *ohosScreen = screen->nativeInterface<QNativeInterface::Private::QOhosScreen>();
203 return ohosScreen->displayId();
Combined button and popup list for selecting options.
WindowGeometryPersistenceHint
void setWindowKeepScreenOn(QWindow *window, bool keepScreenOn)
Sets or unsets a given window to keep the screen on according to keepScreenOn.
void setSurfaceBackgroundColor(QWindow *window, const QColor &color)
Sets a given color as the background color of the window inner native layer.
void setShowWindowAsFloatWindowHint(QWindow *window, bool showAsFloatWindow)
Sets or unsets a given window as a floating window according to showAsFloatWindow.
void setWindowPrivacyMode(QWindow *window, bool privacyModeEnabled)
Changes the privacy mode of window according to privacyModeEnabled.
void setWindowCornerRadius(QWindow *window, double radius)
Sets the corner radius of a window.
void setMainWindowGeometryPersistenceHint(WindowGeometryPersistenceHint hint)
Sets whether the application's main window restores its last geometry on startup according to hint.
void setWindowDragResizable(QWindow *window, bool dragResizable)
Enables or disables resizing of window by dragging its edges according to dragResizable.
std::optional< double > tryGetNativeWindowId(QWindow *window)
std::optional< double > tryGetScreenDisplayId(QScreen *screen)