summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreevent.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-11-16 15:21:40 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-11-19 03:16:48 +0000
commit19f9b0d5f54379151eb71e98555b203ad6756276 (patch)
tree226f5dc2b77292146a0e42dba6fda6a807df7174 /src/corelib/kernel/qcoreevent.cpp
parentc149fd232daa4c62b0c39d603fe660104ceb92b5 (diff)
Disable copying and assigning of QEvent
Polymorphic classes should not be copied. However, we do rely on event copying in our propagation logic. So, make the members protected, don't delete them, using a dedicated macro. This way, QMutable*Event classes can be used to make copies. Remove some last usage of copying of QInputMethod(Query)Events. Change-Id: Ia0a8ae4ca9de97dcd7788ca3c6ed930b6460c43a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/kernel/qcoreevent.cpp')
-rw-r--r--src/corelib/kernel/qcoreevent.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 1bafb85c93..7491f8e539 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -302,10 +302,10 @@ QEvent::QEvent(Type type)
}
/*!
+ \fn QEvent::QEvent(const QEvent &other)
\internal
Copies the \a other event.
*/
-QEvent::QEvent(const QEvent &other) = default;
/*!
\internal
@@ -334,13 +334,13 @@ QEvent::QEvent(const QEvent &other) = default;
*/
/*!
+ \fn QEvent &QEvent::operator=(const QEvent &other)
\internal
Attempts to copy the \a other event.
Copying events is a bad idea, yet some Qt 4 code does it (notably,
QApplication and the state machine).
*/
-QEvent &QEvent::operator=(const QEvent &other) = default;
/*!
Destroys the event. If it was \l{QCoreApplication::postEvent()}{posted},