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
qwasmdrag.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QWINDOWSDRAG_H
5#define QWINDOWSDRAG_H
6
7#include <private/qstdweb_p.h>
8#include <private/qsimpledrag_p.h>
9
10#include <qpa/qplatformdrag.h>
11#include <QtGui/qdrag.h>
12
13#include <memory>
14
15QT_BEGIN_NAMESPACE
16
17struct DragEvent;
18
19class QWasmDrag final : public QSimpleDrag
20{
21public:
24 QWasmDrag(const QWasmDrag &other) = delete;
25 QWasmDrag(QWasmDrag &&other) = delete;
26 QWasmDrag &operator=(const QWasmDrag &other) = delete;
27 QWasmDrag &operator=(QWasmDrag &&other) = delete;
28
29 static QWasmDrag *instance();
30
31 void onNativeDragOver(DragEvent *event);
32 void onNativeDrop(DragEvent *event);
33 void onNativeDragStarted(DragEvent *event);
35 void onNativeDragLeave(DragEvent *event);
36
37 // QPlatformDrag:
38 Qt::DropAction drag(QDrag *drag) final;
39
40private:
41 struct DragState;
42
43 std::unique_ptr<DragState> m_dragState;
44};
45
46QT_END_NAMESPACE
47
48#endif // QWINDOWSDRAG_H
\inmodule QtCore\reentrant
Definition qpoint.h:29
DragImage(const QPixmap &pixmap, const QMimeData *mimeData, QWindow *window)
QWasmDrag(QWasmDrag &&other)=delete
void onNativeDragFinished(DragEvent *event)
QWasmDrag & operator=(QWasmDrag &&other)=delete
Qt::DropAction drag(QDrag *drag) final
Definition qwasmdrag.cpp:85
void onNativeDrop(DragEvent *event)
QWasmDrag(const QWasmDrag &other)=delete
void onNativeDragLeave(DragEvent *event)
QWasmDrag & operator=(const QWasmDrag &other)=delete
void onNativeDragOver(DragEvent *event)
~QWasmDrag() override
static QWasmDrag * instance()
Definition qwasmdrag.cpp:80
void onNativeDragStarted(DragEvent *event)
static QWasmIntegration * get()
emscripten::val element() const
static QWasmWindow * fromWindow(const QWindow *window)
friend class QWasmCompositor
QWasmScreen * platformScreen() const
QWindow * windowForDrag(QDrag *drag)
Definition qwasmdrag.cpp:27
void acceptDrop()
void acceptDragOver()
void cancelDragStart()
QWindow * targetWindow
Definition qwasmevent.h:150
DragState(QWasmDrag &&other)=delete
std::function< void()> quitEventLoopClosure
Definition qwasmdrag.cpp:71
DragState(QDrag *drag, QWindow *window, std::function< void()> quitEventLoopClosure)
std::unique_ptr< DragImage > dragImage
Definition qwasmdrag.cpp:72
Qt::DropAction dropAction
Definition qwasmdrag.cpp:73
DragState(const QWasmDrag &other)=delete
DragState & operator=(QWasmDrag &&other)=delete
DragState & operator=(const QWasmDrag &other)=delete