Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qohosplatformwindow.cpp
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include <qohosplatformwindow.h>
5
6#include <QtCore/private/qohoslogger_p.h>
7#include <QtCore/qpointer.h>
8#include <QtGui/private/qguiapplication_p.h>
9#include <QtGui/private/qwindow_p.h>
10#include <algorithm>
11#include <cmath>
12#include <iterator>
13#include <memory>
14#include <qguiapplication.h>
15#include <qohosdeviceinfo_p.h>
16#include <qohosinputcontext.h>
17#include <qohosinputmethodeventhandler.h>
18#include <qohosjsmain.h>
19#include <qohosplatformintegration.h>
20#include <qohosplatformscreen.h>
21#include <qohosqpafunctions_p.h>
22#include <qohosruntimedevicetypeandmode.h>
23#include <qohossettings.h>
24#include <qohosutils.h>
25#include <qpa/qwindowsysteminterface.h>
26#include <render/qohosview.h>
27#include <private/qwindow_p.h>
28#include <utility>
29
31
32namespace
33{
34
35constexpr int defaultWindowWidth = 160;
36constexpr int defaultWindowHeight = 160;
37
38QOhosView *getWindowsViewOrNull(QWindow *targetWindow)
39{
40 auto *platformWindow = QOhosPlatformWindow::fromQWindowOrNull(targetWindow);
41 if (platformWindow == nullptr) {
42 qCWarning(QtForOhos, "%s: Target window does not contain PlatformWindow", Q_FUNC_INFO);
43 return nullptr;
44 }
45
46 auto *view = platformWindow->ownedViewOrNull();
47 if (view == nullptr) {
48 qCCritical(QtForOhos, "%s: Target window does not contain a view", Q_FUNC_INFO);
49 return nullptr;
50 }
51
52 return view;
53}
54
55}
56
70
74{
75 m_windowFlags = Qt::Widget;
76 m_windowState = window->windowStates();
77 m_windowId = QtOhos::InternalWindowId::generate();
78}
79
80void QOhosPlatformWindow::setGeometry(const QRect &rect)
81{
82 QRect adjustedRect = rect;
83 if (qt_window_private(const_cast<QWindow *>(window()))->positionPolicy
84 == QWindowPrivate::WindowFrameInclusive) {
85 const auto margins = frameMargins();
86 adjustedRect.adjust(margins.left(), margins.top(), -margins.right(), -margins.bottom());
87 }
88
89 qOhosPrintfDebug(
90 "%s: pos: %d,%d size: %d,%d",
91 Q_FUNC_INFO,
92 adjustedRect.x(), adjustedRect.y(),
93 adjustedRect.width(), adjustedRect.height());
94 m_lastRequestedWindowFrameGeometry = rect.marginsAdded(frameMargins());
95 QPlatformWindow::setGeometry(adjustedRect);
96}
97
99{
100 QRect availableGeometry = screen()->availableGeometry();
101 return geometry().width() > 0
102 && geometry().height() > 0
103 && availableGeometry.width() > 0
104 && availableGeometry.height() > 0;
105}
106
108{
110 QPlatformWindow::setVisible(visible);
111}
112
113void QOhosPlatformWindow::setCursor(const QCursor &cursor)
114{
115 auto *view = ownedViewOrNull();
116 if (view != nullptr) {
117 m_cursor = cursor;
118 view->setCursor(cursor);
119 }
120}
121
122void QOhosPlatformWindow::setWindowTitle(const QString &title)
123{
124 auto *view = ownedViewOrNull();
125 if (view != nullptr)
126 view->setTitle(title);
127}
128
129void QOhosPlatformWindow::setParent(const QPlatformWindow *newParent)
130{
131 if (newParent != nullptr && newParent->isForeignWindow())
132 qOhosReportFatalErrorAndAbort("Reparenting to foreign windows is not supported");
133
134 m_parent = parent();
135
136 auto *view = ownedViewOrNull();
137
138 if (newParent == nullptr) {
140 return;
141 }
142
143 auto *parentView = static_cast<const QOhosPlatformWindow *>(newParent)->ownedViewOrNull();
144 view->setParentOrReparent(*parentView);
145}
146
148{
149 if (!m_displayId.has_value())
150 return QPlatformWindow::screen();
151
153 auto *platformScreen = screenManager.platformScreenForDisplayIdOrNull(m_displayId.value());
154 if (platformScreen != nullptr)
155 return platformScreen;
156
157 qCWarning(QtForOhos)
158 << Q_FUNC_INFO << "window:" << window()
159 << "display id" << m_displayId.value().value()
160 << "has no platform screen. Returning QWindow associated one.";
161
162 return QPlatformWindow::screen();
163}
164
165void QOhosPlatformWindow::setWindowState(Qt::WindowStates state)
166{
167 if (m_windowState == state)
168 return;
169
170 auto oldWindowState = std::exchange(m_windowState, state);
171 onWindowStateChanged(oldWindowState, m_windowState);
172}
173
174void QOhosPlatformWindow::setWindowFlags(Qt::WindowFlags flags)
175{
176 static QSet<Qt::WindowType> disableFocusableWindowTypes{Qt::ToolTip, Qt::Popup};
177
178 auto *qWindow = window();
179 auto correctedFlags = flags;
180 bool ohosOverrideDisableFocusableFeatures = disableFocusableWindowTypes.contains(qWindow->type());
181 if (ohosOverrideDisableFocusableFeatures) {
182 qCDebug(
183 QtForOhos,
184 "Setting Qt::WindowDoesNotAcceptFocus flag on window %s(%s) because of its type",
185 qPrintable(internalWindowId().toString()),
186 qPrintable(qWindow->objectName()));
187 correctedFlags.setFlag(Qt::WindowDoesNotAcceptFocus, true);
188 }
189
190 if (correctedFlags.testFlag(Qt::FramelessWindowHint)) {
191 correctedFlags.setFlag(Qt::WindowMaximizeButtonHint, false);
192 correctedFlags.setFlag(Qt::WindowMinimizeButtonHint, false);
193 correctedFlags.setFlag(Qt::WindowCloseButtonHint, false);
194 } else if (!correctedFlags.testFlag(Qt::CustomizeWindowHint)) {
195 correctedFlags.setFlag(Qt::WindowMaximizeButtonHint, true);
196 correctedFlags.setFlag(Qt::WindowMinimizeButtonHint, true);
197 correctedFlags.setFlag(Qt::WindowCloseButtonHint, true);
198 }
199
200 auto previousWindowFlags = std::exchange(m_windowFlags, correctedFlags);
201 onWindowFlagsChanged(previousWindowFlags, m_windowFlags);
202}
203
205{
206 return m_windowFlags;
207}
208
210{
211 return static_cast<QOhosPlatformScreen *>(screen());
212}
213
215{
216 return m_lastRequestedWindowFrameGeometry;
217}
218
220{
221 auto *view = ownedViewOrNull();
222 if (view == nullptr)
223 return;
224
225 setWindowOrWidgetProperty<bool, &windowFixedSizeStateProperty>(
226 window(), windowMinimumSize() == windowMaximumSize());
227
228 view->setSizeLimits(windowMinimumSize(), windowMaximumSize());
229}
230
232{
233 return m_exposed;
234}
235
237{
238 return m_windowId;
239}
240
242{
243 return window()->isTopLevel();
244}
245
247{
248 constexpr Qt::WindowType showWithoutDecorationWindowTypes[] = {
249 Qt::WindowType::Popup,
250 Qt::WindowType::SplashScreen,
251 Qt::WindowType::ToolTip,
252 };
253
254 auto *qWindow = window();
255 bool showWithoutDecoration =
256 qWindow->parent() != nullptr
257 || std::find(
258 std::begin(showWithoutDecorationWindowTypes),
259 std::end(showWithoutDecorationWindowTypes),
260 qWindow->type()) != std::end(showWithoutDecorationWindowTypes)
261 || windowFlags().testFlag(Qt::WindowType::FramelessWindowHint)
262 || floatWindowTagValueOrFalse();
263
264 return showWithoutDecoration
267}
268
270{
271 if (m_optFrameMargins)
272 return *m_optFrameMargins;
273
274 // TODO: Read this information from the system in the future
275 // getWindowDecorHeight: https://developer.huawei.com/consumer/en/doc/harmonyos-references/arkts-apis-window-window#getwindowdecorheight11
276 // WindowProperties.drawableRect: https://developer.huawei.com/consumer/en/doc/harmonyos-references/arkts-apis-window-i#windowproperties
277 // Check if its viable and adapt the frameGeometry code in window to use getWIndowDecorHeight.
278
279 const auto *screen = platformScreen();
280 if (screen == nullptr)
281 return QMargins{};
282
284 // https://gitcode.com/openharmony/window_window_manager/tree/master/utils/include/wm_common_inner.h
285 constexpr auto predefinedWindowTitleBarHeight = 37;
286 const int titlebarHeightPixels = std::round(predefinedWindowTitleBarHeight * screen->pixelScalingCoefficient());
287 return QMargins{0, titlebarHeightPixels, 0, 0};
288 }
289
290 return QMargins{};
291}
292
294{
295 return nullptr;
296}
297
298QOhosPlatformWindow *QOhosPlatformWindow::fromQWindowOrNull(QWindow *window)
299{
300 auto *platformWindow = window->handle();
301 return platformWindow != nullptr
302 ? static_cast<QOhosPlatformWindow *>(platformWindow)
303 : nullptr;
304}
305
306QOhosPlatformWindow *QOhosPlatformWindow::fromQWindow(QWindow *window)
307{
308 QOhosPlatformWindow *platformWindow = fromQWindowOrNull(window);
309 if (platformWindow == nullptr)
310 qOhosReportFatalErrorAndAbort("QWindow %s does not have QPlatformWindow", qPrintable(window->objectName()));
311 return platformWindow;
312}
313
314void QOhosPlatformWindow::tagWindowOrWidgetAsSubWindowOf(QObject *windowOrWidgetToTag, QWindow *targetMainWindow)
315{
316 setWindowOrWidgetProperty<QWindow *, &subWindowOfTagProperty>(windowOrWidgetToTag, targetMainWindow);
317}
318
319void QOhosPlatformWindow::tagWindowOrWidgetAsMainWindow(QObject *windowOrWidgetToTag, bool forceMainWindow)
320{
321 setWindowOrWidgetProperty<bool, &mainWindowTagProperty>(windowOrWidgetToTag, forceMainWindow);
322}
323
324void QOhosPlatformWindow::tagWindowOrWidgetAsFloatWindow(
325 QObject *windowOrWidgetToTag, bool showAsFloatWindow)
326{
327 setWindowOrWidgetProperty<bool, &floatWindowTagProperty>(windowOrWidgetToTag, showAsFloatWindow);
328}
329
330void QOhosPlatformWindow::setWindowPrivacyMode(QObject *window, bool privacyModeEnabled)
331{
332 setWindowOrWidgetProperty<bool, &windowPrivacyModeSettingProperty>(window, privacyModeEnabled);
333}
334
335void QOhosPlatformWindow::setWindowCornerRadius(QObject *windowOrWidget, double radius)
336{
337 setWindowOrWidgetProperty<double, &windowCornerRadiusProperty>(windowOrWidget, radius);
338}
339
341{
342 auto *tagValue = QOhosPlatformWindow::getWindowOrWidgetAsSubWindowOfTagValue(window());
343 const auto &allWindows = QGuiApplicationPrivate::window_list;
344 bool tagValueValid = tagValue != nullptr && allWindows.contains(tagValue);
345 qCDebug(
346 QtForOhos, "Window %s(%s) - subWindowOf tag %s value: %p",
347 qPrintable(internalWindowId().toString()), qPrintable(window()->objectName()),
348 tagValueValid ? "valid" : "invalid",
349 tagValue);
350
351 return tagValueValid ? tagValue : nullptr;
352}
353
355{
356 return m_propertiesStore.tryGetProperty<bool, &mainWindowTagProperty>().value_or(false);
357}
358
360{
361 const auto showWithoutActivating = window()->property("_q_showWithoutActivating");
362 return showWithoutActivating.isValid() && showWithoutActivating.toBool() && window()->modality() == Qt::NonModal;
363}
364
365QWindow *QOhosPlatformWindow::getWindowOrWidgetAsSubWindowOfTagValue(QObject *windowOrWidget)
366{
367 return tryGetWindowOrWidgetProperty<QWindow *, &subWindowOfTagProperty>(windowOrWidget).value_or(nullptr);
368}
369
370void QOhosPlatformWindow::setWindowOrWidgetNativeNodeRenderFitPolicyHint(
371 QObject *windowOrWidget, QOhosPlatformWindow::NativeNodeRenderFitPolicy renderFitPolicy)
372{
373 setWindowOrWidgetProperty<NativeNodeRenderFitPolicy, &nativeNodeRenderFitPolicyHintProperty>(windowOrWidget, renderFitPolicy);
374}
375
376Qt::WindowFlags QOhosPlatformWindow::platformWindowFlagsForQWindow(QWindow *window)
377{
378 auto *platformWindow = QOhosPlatformWindow::fromQWindow(window);
379 return platformWindow->windowFlags();
380}
381
382void QOhosPlatformWindow::setSurfaceBackgroundColor(QObject *windowOrWidget, const QColor &color)
383{
384 setWindowOrWidgetProperty<QColor, &surfaceBackgroundColorProperty>(windowOrWidget, color);
385}
386
387void QOhosPlatformWindow::setWindowKeepScreenOn(QObject *windowOrWidget, bool keepScreenOn)
388{
389 setWindowOrWidgetProperty<bool, &windowKeepScreenOnProperty>(windowOrWidget, keepScreenOn);
390}
391
392void QOhosPlatformWindow::setWindowDragResizable(QObject *windowOrWidget, bool dragResizable)
393{
394 setWindowOrWidgetProperty<bool, &windowDragResizableProperty>(windowOrWidget, dragResizable);
395}
396
397void QOhosPlatformWindow::setBrightness(QObject *windowOrWidget, int brightness)
398{
399 setWindowOrWidgetProperty<int, &windowBrightnessProperty>(windowOrWidget, brightness);
400}
401
402void QOhosPlatformWindow::setContrast(QObject *windowOrWidget, int contrast)
403{
404 setWindowOrWidgetProperty<int, &windowContrastProperty>(windowOrWidget, contrast);
405}
406
407void QOhosPlatformWindow::setSaturation(QObject *windowOrWidget, int saturation)
408{
409 setWindowOrWidgetProperty<int, &windowSaturationProperty>(windowOrWidget, saturation);
410}
411
413{
414 auto windows = qGuiApp->allWindows();
415 for (auto *window : windows) {
416 if (window->type() == Qt::Popup && window->isVisible())
417 QWindowSystemInterface::handleCloseEvent(window);
418 }
419}
420
422{
423 return nullptr;
424}
425
427{
428 auto *qWindow = window();
429
430 setWindowFlags(qWindow->flags());
431
432 auto initialWindowGeom = windowGeometry();
433 auto initialGeom = initialGeometry(window(), initialWindowGeom, defaultWindowWidth, defaultWindowHeight);
434 m_lastRequestedWindowFrameGeometry = initialGeom;
435 QPlatformWindow::setGeometry(initialGeom);
436
437 m_parent = parent();
438}
439
441{
442 return m_windowState;
443}
444
445void QOhosPlatformWindow::setWindowStateFromOhos(Qt::WindowStates state)
446{
447 if (m_windowState != state) {
448 m_windowState = state;
449 QWindowSystemInterface::handleWindowStateChanged(window(), m_windowState);
450 }
451}
452
454{
455 if (windowFlags().testFlag(Qt::WindowDoesNotAcceptFocus))
456 return;
457
458 auto *view = ownedViewOrNull();
459 if (view != nullptr)
461}
462
463void QOhosPlatformWindow::setWindowMarginsFromOhos(const QMargins &margins)
464{
465 bool marginsChanged = !m_optFrameMargins || *m_optFrameMargins != margins;
466 if (!marginsChanged)
467 return;
468
469 if (m_optFrameMargins) {
470 *m_optFrameMargins = margins;
471 } else {
472 m_optFrameMargins = std::make_unique<QMargins>(margins);
473 }
474
475 qCDebug(QtForOhos) << "Window margins changed: " << *m_optFrameMargins;
476}
477
479{
480 m_exposed = exposed;
481 sendExposeUpdate();
482}
483
485{
486 auto *qWindow = window();
487 auto *view = ownedViewOrNull();
488 bool needsGeometryUpdate =
489 view != nullptr
490 && view->viewType() == QOhosView::ViewType::EmbeddedWindow
491 && window()->isVisible();
492 if (needsGeometryUpdate) {
493 auto scaledGeometry = window()->geometry();
494 qWindow->setGeometry(scaledGeometry);
496 }
497
498 qWindow->requestUpdate();
499 setWindowGeometryFromOhos(windowGeometry());
500}
501
502std::shared_ptr<void> QOhosPlatformWindow::setSurfaceConsumer(
503 QWindow *targetWindow, QObject *surfaceConsumerContext,
504 std::function<void(QOhosOptional<void *>)> surfaceConsumer)
505{
506 qCDebug(
507 QtForOhos,
508 "%s: %s",
509 Q_FUNC_INFO,
510 surfaceConsumerContext->metaObject()->className());
511
512 auto *view = getWindowsViewOrNull(targetWindow);
513 if (view == nullptr)
514 return nullptr;
515
516 if (surfaceConsumerContext->thread() != view->thread() || view->thread() != QThread::currentThread()) {
517 qOhosReportFatalErrorAndAbort(
518 "%s: inter-thread surface consumer connection is not supported", Q_FUNC_INFO);
519 }
520
521 auto sharedSurfaceConsumer = QtOhos::moveToSharedPtr(std::move(surfaceConsumer));
522
523 auto *surface = view->surfaceOrNull();
524 if (surface != nullptr) {
525 QMetaObject::invokeMethod(
526 surfaceConsumerContext,
527 [weakSurfaceConsumer = std::weak_ptr<decltype(surfaceConsumer)>(sharedSurfaceConsumer),
528 targetWindow = QPointer<QWindow>(targetWindow)]() {
529 auto sharedSurfaceConsumer = weakSurfaceConsumer.lock();
530 if (!sharedSurfaceConsumer || targetWindow == nullptr)
531 return;
532
533 auto *view = getWindowsViewOrNull(targetWindow);
534 if (view == nullptr)
535 return;
536
537 auto *surface = view->surfaceOrNull();
538 (*sharedSurfaceConsumer)(
539 surface != nullptr
540 ? QOhosOptional<void *>(surface->nativeWindow())
541 : makeEmptyQOhosOptional());
542 },
543 Qt::QueuedConnection);
544 }
545
546 auto surfaceStatusChangedConnectionHandle = QObject::connect(
547 view, &QOhosView::surfaceStatusChanged, surfaceConsumerContext,
548 [view = QPointer<QOhosView>(view), sharedSurfaceConsumer](const QOhosOptional<QSize> &) {
549 if (view == nullptr)
550 return;
551 auto *surface = view->surfaceOrNull();
552 (*sharedSurfaceConsumer)(
553 surface != nullptr
554 ? QOhosOptional<void *>(surface->nativeWindow())
555 : makeEmptyQOhosOptional());
556 });
557
558 if (!surfaceStatusChangedConnectionHandle) {
559 qCCritical(
560 QtForOhos,
561 "%s: Connection between ohos view and surface consumer context failed",
562 Q_FUNC_INFO);
563 return nullptr;
564 }
565
566 auto viewDestroyedConnectionHandle = QObject::connect(
567 view, &QObject::destroyed, surfaceConsumerContext,
568 [sharedSurfaceConsumer]() {
569 (*sharedSurfaceConsumer)(makeEmptyQOhosOptional());
570 },
571 Qt::QueuedConnection);
572
573 if (!viewDestroyedConnectionHandle) {
574 qCCritical(
575 QtForOhos,
576 "%s: Connecting view destroyed signal to surface consumer context failed",
577 Q_FUNC_INFO);
578 return nullptr;
579 }
580
581 return QtOhos::makeDestroyNotifier(
582 [surfaceStatusChangedConnectionHandle = std::move(surfaceStatusChangedConnectionHandle),
583 viewDestroyedConnectionHandle = std::move(viewDestroyedConnectionHandle)] () mutable {
584 QObject::disconnect(surfaceStatusChangedConnectionHandle);
585 QObject::disconnect(viewDestroyedConnectionHandle);
586 });
587}
588
590{
591 return m_propertiesStore.tryGetProperty<bool, &floatWindowTagProperty>().value_or(false);
592}
593
595{
596 return ownedViewOrNull() != nullptr ? ownedViewOrNull()->makeSnapshot() : QPixmap();
597}
598
599void QOhosPlatformWindow::setDisplayIdFromOhos(QOhosOptional<QOhosDisplayInfo::JsDisplayId> displayId)
600{
601 if (m_displayId != displayId) {
602 m_displayId = displayId;
603
604 qCDebug(QtForOhos)
605 << "Screen changed - window:" << window()
606 << "displayId:" << (displayId.has_value()
607 ? QString::number(displayId.value().value())
608 : QString::fromUtf8("<NO DISPLAY>"));
609
610 QOhosPlatformScreen *screen = m_displayId.has_value()
611 ? QOhosPlatformIntegration::instance()
612 ->screenManager()->platformScreenForDisplayIdOrNull(m_displayId.value())
613 : nullptr;
614
615 QWindowSystemInterface::handleWindowScreenChanged(
616 window(),
617 screen != nullptr
618 ? screen->screen()
619 : nullptr);
620 }
621}
622
623void QOhosPlatformWindow::setWindowGeometryFromOhos(const QRect &nativeWindowDrawGeometry)
624{
625 qCDebug(QtForOhos) << "window:" << window() << "geometry change to:" << nativeWindowDrawGeometry;
626 QWindowSystemInterface::handleGeometryChange(window(), nativeWindowDrawGeometry);
627
628 if (isExposed())
629 sendExposeUpdate();
630}
631
637
639{
640 if (active) {
641 auto *ohosInputContext = qobject_cast<QOhosInputContext *>(QOhosPlatformIntegration::instance()->inputContext());
642 if (ohosInputContext != nullptr) {
643 ohosInputContext->setLastInputTypeToTriggerSoftKeyboard(QOhosInputContext::RequestKeyboardReason::NONE);
644 }
645 } else {
646 if (QOhosPlatformIntegration::instance()->inputContext()->isInputPanelVisible())
647 QOhosPlatformIntegration::instance()->inputContext()->hideInputPanel();
648 }
649}
650
654
658
660{
661 return QOhosPropertiesProvider(m_propertiesStore);
662}
663
665{
666 qCDebug(QtForOhos) << Q_FUNC_INFO << "window:" << window() << "grab:" << grab;
667
669 if (grab)
670 inputHandler->grabMouse(window());
671 else
672 inputHandler->stopAnyMouseGrab();
673
674 return true;
675}
676
678{
679 qCDebug(QtForOhos) << Q_FUNC_INFO << "window:" << window() << "grab:" << grab;
680
682 if (grab)
683 inputHandler->grabKeyboard(window());
684 else
685 inputHandler->stopAnyKeyboardGrab();
686
687 return true;
688}
689
691{
692 auto platformWindowFlags = QOhosPlatformWindow::platformWindowFlagsForQWindow(window());
693 return !platformWindowFlags.testFlag(Qt::WindowDoesNotAcceptFocus);
694}
695
697{
698 auto platformWindowFlags = QOhosPlatformWindow::platformWindowFlagsForQWindow(window());
699 return !platformWindowFlags.testFlag(Qt::WindowTransparentForInput);
700}
701
703{
704 switch (event->type()) {
705 case QEvent::ApplicationPaletteChange:
706 if (auto *ohosView = ownedViewOrNull())
708 break;
709 case QEvent::DynamicPropertyChange: {
710 auto propertyName = static_cast<QDynamicPropertyChangeEvent *>(event)->propertyName();
711 m_propertiesStore.notifyPropertyWrite(propertyName);
712 break;
713 }
714 default: break;
715 }
716
717 return QPlatformWindow::windowEvent(event);
718}
719
720bool QOhosPlatformWindow::isWindowBeingClosedOrDestroyed(QWindow *window)
721{
722 QWindowPrivate *windowPriv = qt_window_private(window);
723 return windowPriv && (windowPriv->inClose || windowPriv->visibilityOnDestroy);
724}
725
726void QOhosPlatformWindow::sendExposeUpdate()
727{
728 auto exposedSize = m_exposed
729 ? geometry().size()
730 : QSize();
731
732 QWindowSystemInterface::handleExposeEvent(window(), QRegion(QRect(QPoint(), exposedSize)));
733}
734
735QT_END_NAMESPACE
QOhosScreenManager * screenManager() const
static QOhosPlatformIntegration * instance()
QOhosInputMethodEventHandler * inputMethodEventHandler() const
static const QOhosPropertyDescriptor< bool > windowKeepScreenOnProperty
static const QOhosPropertyDescriptor< QColor > surfaceBackgroundColorProperty
void setWindowTitle(const QString &title) override
Reimplement to set the window title to title.
QOhosPlatformScreen * platformScreen() const
bool mainWindowTagValueOrFalse() const
Qt::WindowStates windowStates() const
void setDisplayIdFromOhos(QOhosOptional< QOhosDisplayInfo::JsDisplayId > displayId)
bool setMouseGrabEnabled(bool grab) override
void setWindowStateFromOhos(Qt::WindowStates state)
static const QOhosPropertyDescriptor< int > windowBrightnessProperty
static const QOhosPropertyDescriptor< bool > mainWindowTagProperty
static const QOhosPropertyDescriptor< QWindow * > subWindowOfTagProperty
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
bool setKeyboardGrabEnabled(bool grab) override
static const QOhosPropertyDescriptor< bool > windowPrivacyModeSettingProperty
bool windowEvent(QEvent *event) override
Reimplement this method to be able to do any platform specific event handling.
static const QOhosPropertyDescriptor< double > windowCornerRadiusProperty
QRect lastRequestedWindowFrameGeometry() const
static const QOhosPropertyDescriptor< int > windowSaturationProperty
void setExposedFromOhos(bool exposed)
static const QOhosPropertyDescriptor< int > windowContrastProperty
QOhosPropertiesProvider propertiesProvider()
static const QOhosPropertyDescriptor< bool > floatWindowTagProperty
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
static const QOhosPropertyDescriptor< bool > windowDragResizableProperty
virtual void onWindowFlagsChanged(Qt::WindowFlags previousWindowFlags, Qt::WindowFlags currentWindowFlags)
static const QOhosPropertyDescriptor< NativeNodeRenderFitPolicy > nativeNodeRenderFitPolicyHintProperty
QtOhos::InternalWindowId internalWindowId() const
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
virtual QOhosSurface * ownedSurfaceOrNull() const
virtual void onWindowStateChanged(Qt::WindowStates oldWindowState, Qt::WindowStates currentWindowState)
void setParent(const QPlatformWindow *newParent) override
This function is called to enable native child window in QPA.
QOhosPlatformWindow(QWindow *window)
void setCursor(const QCursor &cursor)
bool shouldDisplayAsOhosWindow() const
void setWindowGeometryFromOhos(const QRect &nativeWindowDrawGeometry)
QMargins frameMargins() const override
void initialize() override
Called as part of QWindow::create(), after constructing the window.
QPlatformScreen * screen() const override
void setWindowFlags(Qt::WindowFlags flags) override
Requests setting the window flags of this surface to flags.
bool floatWindowTagValueOrFalse() const
void setWindowState(Qt::WindowStates state) override
Requests setting the window state of this surface to type.
void notifyInputSystemsWindowActiveStatusChanged(bool active)
static const QOhosPropertyDescriptor< bool > windowFixedSizeStateProperty
bool isExposed() const final
Returns if this window is exposed in the windowing system.
void requestActivateWindow() override
Reimplement to let Qt be able to request activation/focus for a window.
DecorationPreset decorationPreset() const
QWindow * validSubWindowOfTagValueOrNull() const
Qt::WindowFlags windowFlags() const
bool shouldShowWindowWithoutActivating() const
virtual QOhosView * ownedViewOrNull() const
void setWindowMarginsFromOhos(const QMargins &margins)
QOhosPlatformScreen * platformScreenForDisplayIdOrNull(QOhosDisplayInfo::JsDisplayId displayId) const
void setParentOrReparent(QOhosView &parentView)
void requestActivate()
void tryDetachFromEmbeddedParent()
void forceGeometryUpdate()
void handlePaletteChange()
QRect window() const
Returns the window rectangle.
Combined button and popup list for selecting options.
constexpr int defaultWindowHeight
QOhosView * getWindowsViewOrNull(QWindow *targetWindow)
constexpr int defaultWindowWidth
#define qGuiApp