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/qplatformwindow_p.h>
7#include <QtGui/qpa/qplatformintegration.h>
8#include <QtGui/private/qguiapplication_p.h>
9
10QT_BEGIN_NAMESPACE
11
12using namespace QNativeInterface::Private;
13
14/*!
15 \class QNativeInterface::Private::QOhosWindow
16 \since 6.12
17 \internal
18 \brief Native interface for wrapping a native ArkUI node in a QWindow on OpenHarmony.
19 \inmodule QtGui
20 \ingroup native-interfaces
21*/
24
25QWindow *QOhosWindow::fromNative(ArkUI_NodeHandle content)
26{
27 if (!content)
28 return nullptr;
29
30 auto *integration = QGuiApplicationPrivate::platformIntegration();
31 const WId id = integration->call<&QOhosIntegration::windowHandle>(content);
32 return id ? QWindow::fromWinId(id) : nullptr;
33}
34
35QT_END_NAMESPACE
QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QOhosWindow)
QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QOhosIntegration)