Cleanup qtestspontaneevent.h for Qt 6
This change is motivated by the comment from bc087db59: Qt 6: remove everything except QSpontaneKeyEvent::setSpontaneous() Task-number: QTBUG-82978 Change-Id: I5f46ca366c193c06235f88022ec22c6848fbb7b0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
4d661884d9
commit
cd67fe5821
@ -49,54 +49,13 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QTEST_NO_SIZEOF_CHECK
|
||||
template <int>
|
||||
class QEventSizeOfChecker
|
||||
{
|
||||
private:
|
||||
QEventSizeOfChecker() {}
|
||||
};
|
||||
|
||||
template <>
|
||||
class QEventSizeOfChecker<sizeof(QEvent)>
|
||||
{
|
||||
public:
|
||||
QEventSizeOfChecker() {}
|
||||
};
|
||||
#endif
|
||||
|
||||
class QSpontaneKeyEvent
|
||||
{
|
||||
public:
|
||||
void setSpontaneous() { spont = 1; Q_UNUSED(posted) Q_UNUSED(m_accept) Q_UNUSED(reserved) }
|
||||
bool spontaneous() { return spont; }
|
||||
virtual void dummyFunc() {}
|
||||
virtual ~QSpontaneKeyEvent() {}
|
||||
|
||||
#ifndef QTEST_NO_SIZEOF_CHECK
|
||||
inline void ifYouGetCompileErrorHereYouUseWrongQt()
|
||||
{
|
||||
// this is a static assert in case QEvent changed in Qt
|
||||
QEventSizeOfChecker<sizeof(QSpontaneKeyEvent)> dummy;
|
||||
}
|
||||
#endif
|
||||
|
||||
// ### Qt 6: remove everything except this function:
|
||||
static inline void setSpontaneous(QEvent *ev)
|
||||
{
|
||||
ev->setSpontaneous();
|
||||
}
|
||||
|
||||
protected:
|
||||
void *d;
|
||||
ushort t;
|
||||
|
||||
private:
|
||||
ushort posted : 1;
|
||||
ushort spont : 1;
|
||||
ushort m_accept : 1;
|
||||
ushort reserved : 13;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
Loading…
x
Reference in New Issue
Block a user