wasm: disable text drag for text edits

Disable text drag if asyncify is not enabled.

Fixes: QTBUG-131256
Pick-to: 6.8
Change-Id: I6589f11dda42c2f41db610e7cfece8a3db6573db
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 665acc02cf106071d57d012bb68250c2ea5d0a2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Morten Sørvig 2024-11-22 12:42:55 +01:00 committed by Qt Cherry-pick Bot
parent e2129f6548
commit a1a872e2d2

View File

@ -57,6 +57,9 @@
#endif
#include <QtGui/qaccessible.h>
#include <QtCore/qmetaobject.h>
#ifdef Q_OS_WASM
#include <QtCore/private/qstdweb_p.h>
#endif
#include <private/qoffsetstringarray_p.h>
@ -505,6 +508,13 @@ void QWidgetTextControlPrivate::setContent(Qt::TextFormat format, const QString
void QWidgetTextControlPrivate::startDrag()
{
#ifdef Q_OS_WASM
// QDrag::exec() will crash without asyncify; disable drag instead.
if (!qstdweb::haveAsyncify())
return;
#endif
#if QT_CONFIG(draganddrop)
Q_Q(QWidgetTextControl);
mousePressed = false;