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
qohosnativeinterface.cpp
Go to the documentation of this file.
1// Copyright (C) 2026 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// Qt-Security score:significant reason:default
4
5#include <QtGui/qwindow.h>
6#include <QtGui/qpa/qplatformscreen_p.h>
7#include <QtGui/qpa/qplatformwindow_p.h>
8#include <QtGui/qpa/qplatformintegration.h>
9#include <QtGui/private/qguiapplication_p.h>
10
11QT_BEGIN_NAMESPACE
12
13using namespace QNativeInterface::Private;
14
15/*!
16 \class QNativeInterface::Private::QOhosScreen
17 \since 6.12
18 \internal
19 \brief Native interface to a screen on OpenHarmony.
20 \inmodule QtGui
21 \ingroup native-interfaces
22*/
24
25/*!
26 \class QNativeInterface::Private::QOhosWindow
27 \since 6.12
28 \internal
29 \brief Native interface to a window on OpenHarmony.
30 \inmodule QtGui
31 \ingroup native-interfaces
32*/
35
36QWindow *QOhosWindow::fromNative(ArkUI_NodeHandle content)
37{
38 if (!content)
39 return nullptr;
40
41 auto *integration = QGuiApplicationPrivate::platformIntegration();
42 const WId id = integration->call<&QOhosIntegration::windowHandle>(content);
43 return id ? QWindow::fromWinId(id) : nullptr;
44}
45
46QT_END_NAMESPACE
QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QOhosWindow)
QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QOhosIntegration)
QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QOhosScreen)