summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <[email protected]>2025-06-25 17:20:33 +0200
committerMarc Mutz <[email protected]>2025-06-27 17:06:15 +0000
commit06eb3bcf083857e32aaef96fad3e7f274d4dfe9f (patch)
tree9988a19a4ae388cc933352dfe14d9eee56503020
parentafae4957d675c733cd06185194f72624096b29bd (diff)
Q*Application: deprecate compressEvents()HEADdev
Give users that may have overridden this function a heads-up that it will be removed in Qt 7. Go for immediate deprecation, since there's no replacement, anyway. In the unlikely case that there's a user of this undocumented feature, they can use QT_IGNORE_DEPRECATIONS to selectively silence the warning, the same way we do. Amends 438b2f2d604133349777c670590b27a82832e290. Found in API-review. Pick-to: 6.10 Change-Id: I064e80250ab7a405cc8abef144b6c7bc7bbf29fd Reviewed-by: Ivan Solovev <[email protected]>
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp3
-rw-r--r--src/corelib/kernel/qcoreapplication.h1
-rw-r--r--src/gui/kernel/qguiapplication.cpp2
-rw-r--r--src/gui/kernel/qguiapplication.h1
-rw-r--r--src/widgets/kernel/qapplication.h1
5 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 8f37d86c1bb..a19e39685f1 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -1644,12 +1644,15 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority)
QThreadData *data = locker.threadData;
+ QT_WARNING_PUSH
+ QT_WARNING_DISABLE_DEPRECATED // compressEvent()
// if this is one of the compressible events, do compression
if (receiver->d_func()->postedEvents.loadAcquire()
&& self && self->compressEvent(event, receiver, &data->postEventList)) {
Q_TRACE(QCoreApplication_postEvent_event_compressed, receiver, event);
return;
}
+ QT_WARNING_POP
// delete the event on exceptions to protect against memory leaks till the event is
// properly owned in the postEventList
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index 105bd7a291a..0c8e78170ee 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -211,6 +211,7 @@ protected:
bool event(QEvent *) override;
# if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
+ QT_DEPRECATED_VERSION_X_6_10("This feature will be removed in Qt 7")
virtual bool compressEvent(QEvent *, QObject *receiver, QPostEventList *);
# endif
#endif // QT_NO_QOBJECT
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 7a35f4c1845..99b416d4fd5 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -2106,7 +2106,9 @@ bool QGuiApplication::event(QEvent *e)
*/
bool QGuiApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventList *postedEvents)
{
+ QT_IGNORE_DEPRECATIONS(
return QCoreApplication::compressEvent(event, receiver, postedEvents);
+ )
}
#endif
diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h
index 0af6489428e..717b2e6e8cc 100644
--- a/src/gui/kernel/qguiapplication.h
+++ b/src/gui/kernel/qguiapplication.h
@@ -164,6 +164,7 @@ Q_SIGNALS:
protected:
bool event(QEvent *) override;
# if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
+ QT_DEPRECATED_VERSION_X_6_10("This feature will be removed in Qt 7")
bool compressEvent(QEvent *, QObject *receiver, QPostEventList *) override;
# endif
diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h
index 83dfdc50bcd..c2c5f7264d4 100644
--- a/src/widgets/kernel/qapplication.h
+++ b/src/widgets/kernel/qapplication.h
@@ -141,6 +141,7 @@ public Q_SLOTS:
protected:
bool event(QEvent *) override;
# if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
+ QT_DEPRECATED_VERSION_X_6_10("This feature will be removed in Qt 7")
bool compressEvent(QEvent *, QObject *receiver, QPostEventList *) override;
# endif