diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qcoreapplication_p.h | 1 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreevent.h | 6 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qwidgetwindow.cpp | 2 |
4 files changed, 3 insertions, 8 deletions
diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h index d784267a65..f0c9e4e1c2 100644 --- a/src/corelib/kernel/qcoreapplication_p.h +++ b/src/corelib/kernel/qcoreapplication_p.h @@ -96,6 +96,7 @@ public: bool sendThroughApplicationEventFilters(QObject *, QEvent *); bool sendThroughObjectEventFilters(QObject *, QEvent *); bool notify_helper(QObject *, QEvent *); + static inline void setEventSpontaneous(QEvent *e, bool spontaneous) { e->spont = spontaneous; } virtual void createEventDispatcher(); virtual void eventDispatcherReady(); diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h index a498afbb04..cd7689f842 100644 --- a/src/corelib/kernel/qcoreevent.h +++ b/src/corelib/kernel/qcoreevent.h @@ -318,16 +318,10 @@ private: friend class QCoreApplicationPrivate; friend class QThreadData; friend class QApplication; - friend class QApplicationPrivate; friend class QShortcutMap; friend class QGraphicsView; - friend class QGraphicsViewPrivate; friend class QGraphicsScene; friend class QGraphicsScenePrivate; - friend class QWidgetWindow; -#ifndef QT_NO_GESTURES - friend class QGestureManager; -#endif }; class Q_CORE_EXPORT QTimerEvent : public QEvent diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 9c2c2bab16..703b748a56 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -3505,7 +3505,7 @@ bool QApplicationPrivate::notify_helper(QObject *receiver, QEvent * e) // deliver the event bool consumed = receiver->event(e); - e->spont = false; + QCoreApplicationPrivate::setEventSpontaneous(e, false); return consumed; } diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index fc328e7af0..06a4d8c960 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -443,7 +443,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) // Use postEvent() to ensure the local QEventLoop terminates when called from QMenu::exec() const QPoint localPos = win->mapFromGlobal(event->globalPos()); QMouseEvent *e = new QMouseEvent(QEvent::MouseButtonPress, localPos, localPos, event->globalPos(), event->button(), event->buttons(), event->modifiers()); - e->spont = 1; + QCoreApplicationPrivate::setEventSpontaneous(e, true); QGuiApplicationPrivate::setMouseEventSource(e, QGuiApplicationPrivate::mouseEventSource(event)); e->setTimestamp(event->timestamp()); QCoreApplication::postEvent(win, e); |