Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qohosplatformnativeinterface.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
"qohosplatformnativeinterface.h"
5
#
include
"qohosplatformclipboard.h"
6
#
include
"qohosplatformintegration.h"
7
#
include
"qohosplatformwindow.h"
8
9
#
if
QT_CONFIG
(
vulkan
)
10
#
include
"render/qohossurface.h"
11
#
include
<
QtGui
/
qvulkaninstance
.
h
>
12
#
endif
13
14
#
include
<
QtCore
/
qmutex
.
h
>
15
#
include
<
QtGui
/
private
/
qguiapplication_p
.
h
>
16
17
QT_BEGIN_NAMESPACE
18
19
void
*QOhosPlatformNativeInterface::nativeResourceForWindow(
const
QByteArray &resource, QWindow *window)
20
{
21
#
if
QT_CONFIG
(
vulkan
)
22
if
(resource ==
"vkSurface"
) {
23
if
(window && window->surfaceType() == QSurface::VulkanSurface) {
24
auto
*platformWindow =
static_cast
<QOhosPlatformWindow *>(window->handle());
25
QOhosSurface *surface = platformWindow ? platformWindow->ownedSurfaceOrNull() :
nullptr
;
26
if
(!surface) {
27
qWarning(
"QOhosPlatformNativeInterface: No QOhosSurface available for Vulkan window"
);
28
return
nullptr
;
29
}
30
QVulkanInstance *vulkanInstance = window->vulkanInstance();
31
if
(!vulkanInstance) {
32
qWarning(
"QOhosPlatformNativeInterface: No Vulkan instance; was QWindow::setVulkanInstance() called?"
);
33
return
nullptr
;
34
}
35
return
surface->tryGetOrCreateVulkanWindowSurface(vulkanInstance);
36
}
37
}
38
#
else
39
Q_UNUSED(resource);
40
Q_UNUSED(window);
41
#
endif
42
return
nullptr
;
43
}
44
45
void
QOhosPlatformNativeInterface::customEvent(QEvent *event)
46
{
47
auto
__dbg = make_QCScopedDebug(
"QOhosPlatformNativeInterface::customEvent"
);
48
if
(event->type() != QEvent::User)
49
return
;
50
}
51
52
QFunctionPointer QOhosPlatformNativeInterface::platformFunction(
const
QByteArray &functionName)
const
53
{
54
if
(functionName ==
"tagWindowOrWidgetAsSubWindowOf"
) {
55
return
reinterpret_cast
<QFunctionPointer>(&QOhosPlatformWindow::tagWindowOrWidgetAsSubWindowOf);
56
}
else
if
(functionName ==
"getWindowOrWidgetAsSubWindowOfTagValue"
) {
57
return
reinterpret_cast
<QFunctionPointer>(&QOhosPlatformWindow::getWindowOrWidgetAsSubWindowOfTagValue);
58
}
else
if
(functionName ==
"tagWindowOrWidgetAsMainWindow"
) {
59
return
reinterpret_cast
<QFunctionPointer>(&QOhosPlatformWindow::tagWindowOrWidgetAsMainWindow);
60
}
else
if
(functionName ==
"setInAppOnlyPasteboardShareOption"
) {
61
return
reinterpret_cast
<QFunctionPointer>(
62
&
QOhosPlatformClipboard
::
setInAppOnlyPasteboardShareOption
);
63
}
else
if
(functionName ==
"setSurfaceConsumer"
) {
64
return
reinterpret_cast
<QFunctionPointer>(&QOhosPlatformWindow::setSurfaceConsumer);
65
}
66
67
return
QPlatformNativeInterface::platformFunction(functionName);
68
}
69
70
QT_END_NAMESPACE
QOhosPlatformClipboard
Definition
qohosplatformclipboard.h:19
QOhosPlatformClipboard::setInAppOnlyPasteboardShareOption
static void setInAppOnlyPasteboardShareOption(bool shareInAppOnly)
Definition
qohosplatformclipboard.cpp:81
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtbase
src
plugins
platforms
ohos
qohosplatformnativeinterface.cpp
Generated on
for Qt by
1.18.0