Compress UpdateLater events

Handle UpdateLater events in QApplication::compressEvents

Change-Id: I0c63f88d8ed90fc56c093c534394461797d1336b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit cb42c940787cf8c44e11f2b650d81c3d1eff1580)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Allan Sandfeld Jensen 2023-09-13 08:57:03 +02:00 committed by Qt Cherry-pick Bot
parent 29d20a781c
commit 13f83f8e0c
2 changed files with 6 additions and 0 deletions

View File

@ -792,6 +792,7 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis
const QEvent::Type type = event->type();
switch (type) {
case QEvent::UpdateRequest:
case QEvent::UpdateLater:
case QEvent::LayoutRequest:
case QEvent::Resize:
case QEvent::Move:
@ -820,6 +821,10 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis
static_cast<QMoveEvent *>(postedEvent.event)->m_pos =
static_cast<const QMoveEvent *>(event)->pos();
break;
case QEvent::UpdateLater:
static_cast<QUpdateLaterEvent *>(postedEvent.event)->m_region +=
static_cast<const QUpdateLaterEvent *>(event)->region();
break;
case QEvent::UpdateRequest:
case QEvent::LanguageChange:
case QEvent::LayoutRequest:

View File

@ -82,6 +82,7 @@ public:
inline const QRegion &region() const { return m_region; }
protected:
friend class QApplication;
QRegion m_region;
};