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
qohosdrageventutils.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 <qarkui/qarkuiutils.h>
5#include <render/qohosdrageventutils.h>
6
8
9Qt::DropAction mapQOhosArkUiDropOperationToQt(::ArkUI_DropOperation dropOperation)
10{
11 switch (dropOperation) {
12 case ::ARKUI_DROP_OPERATION_COPY:
13 return Qt::CopyAction;
14 case ::ARKUI_DROP_OPERATION_MOVE:
15 return Qt::MoveAction;
16 }
17 return Qt::CopyAction;
18}
19
21{
22 switch (dropAction) {
23 case Qt::CopyAction:
24 return makeQOhosOptional(::ARKUI_DROP_OPERATION_COPY);
25 case Qt::MoveAction:
26 return makeQOhosOptional(::ARKUI_DROP_OPERATION_MOVE);
27 default:
28 return {};
29 }
30}
31
33{
34 ::ArkUI_DropOperation dropOperation = ::ARKUI_DROP_OPERATION_COPY;
35 QArkUi::callArkUiOrFailOnErrorResult(
36 Q_OHOS_NAMED_FUNC(::OH_ArkUI_DragEvent_GetDropOperation),
37 dragEvent, &dropOperation);
38 return dropOperation;
39}
40
41QT_END_NAMESPACE
Combined button and popup list for selecting options.
QOhosOptional<::ArkUI_DropOperation > tryMapQOhosArkUiDropOperationFromQt(Qt::DropAction dropAction)
::ArkUI_DropOperation getQOhosDragEventDropOperation(::ArkUI_DragEvent *dragEvent)