diff options
Diffstat (limited to 'src/corelib/kernel')
| -rw-r--r-- | src/corelib/kernel/qassociativeiterable.h | 15 | ||||
| -rw-r--r-- | src/corelib/kernel/qeventdispatcher_wasm.cpp | 12 | ||||
| -rw-r--r-- | src/corelib/kernel/qeventdispatcher_wasm_p.h | 2 | ||||
| -rw-r--r-- | src/corelib/kernel/qsequentialiterable.h | 15 |
4 files changed, 25 insertions, 19 deletions
diff --git a/src/corelib/kernel/qassociativeiterable.h b/src/corelib/kernel/qassociativeiterable.h index 4f9bbf67bfb..c042fe4a0ec 100644 --- a/src/corelib/kernel/qassociativeiterable.h +++ b/src/corelib/kernel/qassociativeiterable.h @@ -21,9 +21,8 @@ QT_WARNING_DISABLE_DEPRECATED Q_CORE_EXPORT QT_DEPRECATED_VERSION_X_6_15(text) #endif -class -QT_CORE_DEPRECATED_EXPORT_VERSION_X_6_15("Use QMetaAssociation::Iterable::Iterator instead.") -QAssociativeIterator : public QIterator<QMetaAssociation> +// Keep this a single long line, otherwise syncqt doesn't create a class forwarding header +class QT_CORE_DEPRECATED_EXPORT_VERSION_X_6_15("Use QMetaAssociation's iterables and iterators instead.") QAssociativeIterator : public QIterator<QMetaAssociation> { public: using key_type = QVariant; @@ -42,9 +41,8 @@ public: QVariantPointer<QAssociativeIterator> operator->() const; }; -class -QT_CORE_DEPRECATED_EXPORT_VERSION_X_6_15("Use QMetaAssociation::Iterable::ConstIterator instead.") -QAssociativeConstIterator : public QConstIterator<QMetaAssociation> +// Keep this a single long line, otherwise syncqt doesn't create a class forwarding header +class QT_CORE_DEPRECATED_EXPORT_VERSION_X_6_15("Use QMetaAssociation's iterables and iterators instead.") QAssociativeConstIterator : public QConstIterator<QMetaAssociation> { public: using key_type = QVariant; @@ -63,9 +61,8 @@ public: QVariantConstPointer operator->() const; }; -class -QT_CORE_DEPRECATED_EXPORT_VERSION_X_6_15("Use QMetaAssociation::Iterable instead.") -QAssociativeIterable : public QIterable<QMetaAssociation> +// Keep this a single long line, otherwise syncqt doesn't create a class forwarding header +class QT_CORE_DEPRECATED_EXPORT_VERSION_X_6_15("Use QMetaAssociation's iterables and iterators instead.") QAssociativeIterable : public QIterable<QMetaAssociation> { public: using iterator = QTaggedIterator<QAssociativeIterator, void>; diff --git a/src/corelib/kernel/qeventdispatcher_wasm.cpp b/src/corelib/kernel/qeventdispatcher_wasm.cpp index f7edf3285f8..25a27a0c22b 100644 --- a/src/corelib/kernel/qeventdispatcher_wasm.cpp +++ b/src/corelib/kernel/qeventdispatcher_wasm.cpp @@ -150,6 +150,18 @@ bool QEventDispatcherWasm::isValidEventDispatcherPointer(QEventDispatcherWasm *e bool QEventDispatcherWasm::processEvents(QEventLoop::ProcessEventsFlags flags) { + // Accept the current event if event handling recurses / event loop is reentered, + // to prevent the browser from propagating it to other event handlers. + if (useAsyncify() && isMainThreadEventDispatcher()) { + auto control = QWasmSuspendResumeControl::get(); + auto currentEvent = control->currentEvent(); + if (!currentEvent.isUndefined() && currentEvent.instanceof(emscripten::val::global("Event"))) { + currentEvent.call<void>("preventDefault"); + currentEvent.call<void>("stopPropagation"); + control->setCurrentEvent(emscripten::val::undefined()); + } + } + emit awake(); if (!useAsyncify() && isMainThreadEventDispatcher()) diff --git a/src/corelib/kernel/qeventdispatcher_wasm_p.h b/src/corelib/kernel/qeventdispatcher_wasm_p.h index 674af85dac2..1946bf63ede 100644 --- a/src/corelib/kernel/qeventdispatcher_wasm_p.h +++ b/src/corelib/kernel/qeventdispatcher_wasm_p.h @@ -40,7 +40,6 @@ public: ~QEventDispatcherWasm(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; - bool sendAllEvents(QEventLoop::ProcessEventsFlags flag); void registerTimer(Qt::TimerId timerId, Duration interval, Qt::TimerType timerType, QObject *object) override final; @@ -69,6 +68,7 @@ protected: virtual bool sendPostedEvents(); private: + bool sendAllEvents(QEventLoop::ProcessEventsFlags flag); bool isMainThreadEventDispatcher(); bool isSecondaryThreadEventDispatcher(); bool isValidEventDispatcher(); diff --git a/src/corelib/kernel/qsequentialiterable.h b/src/corelib/kernel/qsequentialiterable.h index 76908bdae4b..b2e690ea9cf 100644 --- a/src/corelib/kernel/qsequentialiterable.h +++ b/src/corelib/kernel/qsequentialiterable.h @@ -21,9 +21,8 @@ QT_WARNING_DISABLE_DEPRECATED Q_CORE_EXPORT QT_DEPRECATED_VERSION_X_6_15(text) #endif -class -QT_CORE_DEPRECATED_EXPORT_VERSION_X_6_15("Use QMetaSequence::Iterable::Iterator instead.") -QSequentialIterator : public QIterator<QMetaSequence> +// Keep this a single long line, otherwise syncqt doesn't create a class forwarding header +class QT_CORE_DEPRECATED_EXPORT_VERSION_X_6_15("Use QMetaSequence's iterables and iterators instead.") QSequentialIterator : public QIterator<QMetaSequence> { public: using value_type = QVariant; @@ -38,9 +37,8 @@ public: QVariantPointer<QSequentialIterator> operator->() const; }; -class -QT_CORE_DEPRECATED_EXPORT_VERSION_X_6_15("Use QMetaSequence::Iterable::ConstIterator instead.") -QSequentialConstIterator : public QConstIterator<QMetaSequence> +// Keep this a single long line, otherwise syncqt doesn't create a class forwarding header +class QT_CORE_DEPRECATED_EXPORT_VERSION_X_6_15("Use QMetaSequence's iterables and iterators instead.") QSequentialConstIterator : public QConstIterator<QMetaSequence> { public: using value_type = QVariant; @@ -55,9 +53,8 @@ public: QVariantConstPointer operator->() const; }; -class -QT_CORE_DEPRECATED_EXPORT_VERSION_X_6_15("Use QMetaSequence::Iterable instead.") -QSequentialIterable : public QIterable<QMetaSequence> +// Keep this a single long line, otherwise syncqt doesn't create a class forwarding header +class QT_CORE_DEPRECATED_EXPORT_VERSION_X_6_15("Use QMetaSequence's iterables and iterators instead.") QSequentialIterable : public QIterable<QMetaSequence> { public: using iterator = QTaggedIterator<QSequentialIterator, void>; |
