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>
This commit is contained in:
parent
f92e195369
commit
2e3b8b36f7
@ -61,6 +61,10 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
static_assert(sizeof(QMutableTouchEvent) == sizeof(QTouchEvent));
|
||||||
|
static_assert(sizeof(QMutableSinglePointEvent) == sizeof(QSinglePointEvent));
|
||||||
|
static_assert(sizeof(QMouseEvent) == sizeof(QSinglePointEvent));
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class QEnterEvent
|
\class QEnterEvent
|
||||||
\ingroup events
|
\ingroup events
|
||||||
|
@ -79,8 +79,6 @@ public:
|
|||||||
void addPoint(const QEventPoint &point);
|
void addPoint(const QEventPoint &point);
|
||||||
};
|
};
|
||||||
|
|
||||||
static_assert(sizeof(QMutableTouchEvent) == sizeof(QTouchEvent));
|
|
||||||
|
|
||||||
class Q_GUI_EXPORT QMutableSinglePointEvent : public QSinglePointEvent
|
class Q_GUI_EXPORT QMutableSinglePointEvent : public QSinglePointEvent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -104,8 +102,6 @@ public:
|
|||||||
void setDoubleClick(bool d = true) { m_doubleClick = d; }
|
void setDoubleClick(bool d = true) { m_doubleClick = d; }
|
||||||
};
|
};
|
||||||
|
|
||||||
static_assert(sizeof(QMutableSinglePointEvent) == sizeof(QSinglePointEvent));
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QEVENT_P_H
|
#endif // QEVENT_P_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user