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// Qt-Security score:significant reason:default
4
5#ifndef QWINDOWSDRAG_H
6#define QWINDOWSDRAG_H
7
8#include <private/qstdweb_p.h>
9#include <private/qsimpledrag_p.h>
10
11#include <qpa/qplatformdrag.h>
12#include <QtGui/qdrag.h>
13
14#include <memory>
15
16QT_BEGIN_NAMESPACE
17
18struct DragEvent;
19
20class QWasmScreen;
21class QWasmDrag final : public QSimpleDrag
22{
23public:
26 QWasmDrag(const QWasmDrag &other) = delete;
27 QWasmDrag(QWasmDrag &&other) = delete;
28 QWasmDrag &operator=(const QWasmDrag &other) = delete;
29 QWasmDrag &operator=(QWasmDrag &&other) = delete;
30
31 static QWasmDrag *instance();
32
33 void onNativeDragOver(DragEvent *event);
34 void onNativeDrop(DragEvent *event);
35 void onNativeDragStarted(DragEvent *event);
36 void onNativeDragFinished(DragEvent *event, QWasmScreen *platformScreen);
37 void onNativeDragEnter(DragEvent *event);
38 void onNativeDragLeave(DragEvent *event);
39
40 // QPlatformDrag:
41 Qt::DropAction drag(QDrag *drag) final;
42
43private:
44 struct DragState;
45 bool m_isInEnterDrag = false;
46 std::shared_ptr<DragState> m_dragState;
47};
48
49QT_END_NAMESPACE
50
51#endif // QWINDOWSDRAG_H
\inmodule QtCore\reentrant
Definition qpoint.h:30
DragImage(const QPixmap &pixmap, const QMimeData *mimeData, QWindow *window)
emscripten::val htmlElement()
Definition qwasmdrag.cpp:59
QWasmDrag(QWasmDrag &&other)=delete
QWasmDrag & operator=(QWasmDrag &&other)=delete
Qt::DropAction drag(QDrag *drag) final
Definition qwasmdrag.cpp:96
void onNativeDrop(DragEvent *event)
QWasmDrag(const QWasmDrag &other)=delete
void onNativeDragEnter(DragEvent *event)
void onNativeDragLeave(DragEvent *event)
QWasmDrag & operator=(const QWasmDrag &other)=delete
void onNativeDragOver(DragEvent *event)
~QWasmDrag() override
static QWasmDrag * instance()
Definition qwasmdrag.cpp:91
void onNativeDragStarted(DragEvent *event)
void onNativeDragFinished(DragEvent *event, QWasmScreen *platformScreen)
static QWasmIntegration * get()
emscripten::val element() const
QRect geometry() const override
Reimplement in subclass to return the pixel geometry of the screen.
static QWasmWindow * fromWindow(const QWindow *window)
friend class QWasmCompositor
QWasmScreen * platformScreen() const
Combined button and popup list for selecting options.
QWindow * windowForDrag(QDrag *drag)
Definition qwasmdrag.cpp:34
Definition qwasmdom.h:30
EventType
Definition qwasmevent.h:23
void acceptDrop()
void acceptDragOver()
void cancelDragStart()
QWindow * targetWindow
Definition qwasmevent.h:152
DragState(QWasmDrag &&other)=delete
std::function< void()> quitEventLoopClosure
Definition qwasmdrag.cpp:82
DragState(QDrag *drag, QWindow *window, std::function< void()> quitEventLoopClosure)
std::unique_ptr< DragImage > dragImage
Definition qwasmdrag.cpp:83
Qt::DropAction dropAction
Definition qwasmdrag.cpp:84
DragState(const QWasmDrag &other)=delete
DragState & operator=(QWasmDrag &&other)=delete
DragState & operator=(const QWasmDrag &other)=delete