summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-11-17 10:43:35 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-11-17 11:48:28 +0100
commit2e3b8b36f7aa43991b44bc6b048c713b0a013a57 (patch)
tree67f870a74814a9242220bbf849f9c0bffce952ad /src/gui
parentf92e1953699b2529cc6ea2fd399fe4f2b887e83c (diff)
Consolidate static_asserts for event sizes
The assertion for size of QMouseEvent and Q(Mutable)SinglePointEvent being equal was previously in QtDeclarative; qtbase should already fail to build if they ever diverge. Having the checks in a single translation unit is enough, qevent.cpp is the obvious choice. Change-Id: I80ad24273738dfde8b165323ac1e790c320c707c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qevent.cpp4
-rw-r--r--src/gui/kernel/qevent_p.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index c459ca3b6a..ff67d64cd3 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -61,6 +61,10 @@
QT_BEGIN_NAMESPACE
+static_assert(sizeof(QMutableTouchEvent) == sizeof(QTouchEvent));
+static_assert(sizeof(QMutableSinglePointEvent) == sizeof(QSinglePointEvent));
+static_assert(sizeof(QMouseEvent) == sizeof(QSinglePointEvent));
+
/*!
\class QEnterEvent
\ingroup events
diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h
index a776b957a5..227b1a4303 100644
--- a/src/gui/kernel/qevent_p.h
+++ b/src/gui/kernel/qevent_p.h
@@ -79,8 +79,6 @@ public:
void addPoint(const QEventPoint &point);
};
-static_assert(sizeof(QMutableTouchEvent) == sizeof(QTouchEvent));
-
class Q_GUI_EXPORT QMutableSinglePointEvent : public QSinglePointEvent
{
public:
@@ -104,8 +102,6 @@ public:
void setDoubleClick(bool d = true) { m_doubleClick = d; }
};
-static_assert(sizeof(QMutableSinglePointEvent) == sizeof(QSinglePointEvent));
-
QT_END_NAMESPACE
#endif // QEVENT_P_H