Allow configuring WASM without draganddrop
Pick-to: 6.9 6.8 Fixes: QTBUG-135874 Change-Id: I84459af06d34682ca3bed1e2e1dab773c77bbcae Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
parent
0bf2fafd38
commit
a66c73d95e
@ -33,7 +33,6 @@ qt_internal_add_plugin(QWasmIntegrationPlugin
|
|||||||
qwasmwindownonclientarea.cpp qwasmwindownonclientarea.h
|
qwasmwindownonclientarea.cpp qwasmwindownonclientarea.h
|
||||||
qwasminputcontext.cpp qwasminputcontext.h
|
qwasminputcontext.cpp qwasminputcontext.h
|
||||||
qwasmwindowstack.cpp qwasmwindowstack.h
|
qwasmwindowstack.cpp qwasmwindowstack.h
|
||||||
qwasmdrag.cpp qwasmdrag.h
|
|
||||||
DEFINES
|
DEFINES
|
||||||
QT_EGL_NO_X11
|
QT_EGL_NO_X11
|
||||||
QT_NO_FOREACH
|
QT_NO_FOREACH
|
||||||
@ -67,6 +66,11 @@ qt_internal_extend_target(QWasmIntegrationPlugin CONDITION QT_FEATURE_clipboard
|
|||||||
qwasmclipboard.cpp qwasmclipboard.h
|
qwasmclipboard.cpp qwasmclipboard.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
qt_internal_extend_target(QWasmIntegrationPlugin CONDITION QT_FEATURE_draganddrop
|
||||||
|
SOURCES
|
||||||
|
qwasmdrag.cpp qwasmdrag.h
|
||||||
|
)
|
||||||
|
|
||||||
qt_internal_extend_target(QWasmIntegrationPlugin CONDITION QT_FEATURE_opengl
|
qt_internal_extend_target(QWasmIntegrationPlugin CONDITION QT_FEATURE_opengl
|
||||||
SOURCES
|
SOURCES
|
||||||
qwasmbackingstore.cpp qwasmbackingstore.h
|
qwasmbackingstore.cpp qwasmbackingstore.h
|
||||||
|
@ -16,7 +16,9 @@
|
|||||||
#include "qwasmwindow.h"
|
#include "qwasmwindow.h"
|
||||||
#include "qwasmbackingstore.h"
|
#include "qwasmbackingstore.h"
|
||||||
#include "qwasmfontdatabase.h"
|
#include "qwasmfontdatabase.h"
|
||||||
|
#if QT_CONFIG(draganddrop)
|
||||||
#include "qwasmdrag.h"
|
#include "qwasmdrag.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <qpa/qplatformwindow.h>
|
#include <qpa/qplatformwindow.h>
|
||||||
#include <QtGui/qscreen.h>
|
#include <QtGui/qscreen.h>
|
||||||
@ -31,7 +33,9 @@
|
|||||||
|
|
||||||
// this is where EGL headers are pulled in, make sure it is last
|
// this is where EGL headers are pulled in, make sure it is last
|
||||||
#include "qwasmscreen.h"
|
#include "qwasmscreen.h"
|
||||||
|
#if QT_CONFIG(draganddrop)
|
||||||
#include <private/qsimpledrag_p.h>
|
#include <private/qsimpledrag_p.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -148,7 +152,9 @@ QWasmIntegration::QWasmIntegration()
|
|||||||
visualViewport.call<void>("addEventListener", val("resize"),
|
visualViewport.call<void>("addEventListener", val("resize"),
|
||||||
val::module_property("qtResizeAllScreens"));
|
val::module_property("qtResizeAllScreens"));
|
||||||
}
|
}
|
||||||
|
#if QT_CONFIG(draganddrop)
|
||||||
m_drag = std::make_unique<QWasmDrag>();
|
m_drag = std::make_unique<QWasmDrag>();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QWasmIntegration::~QWasmIntegration()
|
QWasmIntegration::~QWasmIntegration()
|
||||||
|
@ -23,7 +23,9 @@
|
|||||||
#include "qwasmevent.h"
|
#include "qwasmevent.h"
|
||||||
#include "qwasmeventdispatcher.h"
|
#include "qwasmeventdispatcher.h"
|
||||||
#include "qwasmaccessibility.h"
|
#include "qwasmaccessibility.h"
|
||||||
|
#if QT_CONFIG(draganddrop)
|
||||||
#include "qwasmdrag.h"
|
#include "qwasmdrag.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -143,6 +145,7 @@ void QWasmWindow::registerEventHandlers()
|
|||||||
[this](emscripten::val event) { this->handlePointerEnterLeaveEvent(PointerEvent(EventType::PointerLeave, event)); }
|
[this](emscripten::val event) { this->handlePointerEnterLeaveEvent(PointerEvent(EventType::PointerLeave, event)); }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#if QT_CONFIG(draganddrop)
|
||||||
m_window.call<void>("setAttribute", emscripten::val("draggable"), emscripten::val("true"));
|
m_window.call<void>("setAttribute", emscripten::val("draggable"), emscripten::val("true"));
|
||||||
m_dragStartCallback = QWasmEventHandler(m_window, "dragstart",
|
m_dragStartCallback = QWasmEventHandler(m_window, "dragstart",
|
||||||
[this](emscripten::val event) {
|
[this](emscripten::val event) {
|
||||||
@ -174,6 +177,7 @@ void QWasmWindow::registerEventHandlers()
|
|||||||
QWasmDrag::instance()->onNativeDragLeave(&dragEvent);
|
QWasmDrag::instance()->onNativeDragLeave(&dragEvent);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
#endif // QT_CONFIG(draganddrop)
|
||||||
|
|
||||||
m_wheelEventCallback = QWasmEventHandler(m_window, "wheel",
|
m_wheelEventCallback = QWasmEventHandler(m_window, "wheel",
|
||||||
[this](emscripten::val event) { this->handleWheelEvent(event); });
|
[this](emscripten::val event) { this->handleWheelEvent(event); });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user