Use Q_DECL_UNUSED_MEMBER instead of Q_UNUSED
Task-number: QTBUG-82978 Change-Id: I7ff71e10b61cf5c2528ebef81cc49c648385fc33 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
9e733622a6
commit
4d661884d9
@ -58,6 +58,11 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifdef QT_WIDGETS_LIB
|
||||
# define QT_ONLY_WIDGETLIB_USES
|
||||
#else
|
||||
# define QT_ONLY_WIDGETLIB_USES Q_DECL_UNUSED_MEMBER
|
||||
#endif
|
||||
|
||||
class QTestEvent
|
||||
{
|
||||
@ -103,10 +108,7 @@ class QTestKeyClicksEvent: public QTestEvent
|
||||
{
|
||||
public:
|
||||
inline QTestKeyClicksEvent(const QString &keys, Qt::KeyboardModifiers modifiers, int delay)
|
||||
: _keys(keys), _modifiers(modifiers), _delay(delay)
|
||||
{
|
||||
Q_UNUSED(_delay) // Silence -Werror,-Wunused-private-field
|
||||
}
|
||||
: _keys(keys), _modifiers(modifiers), _delay(delay) {}
|
||||
inline QTestEvent *clone() const override { return new QTestKeyClicksEvent(*this); }
|
||||
|
||||
#ifdef QT_WIDGETS_LIB
|
||||
@ -117,9 +119,9 @@ public:
|
||||
#endif
|
||||
|
||||
private:
|
||||
QString _keys;
|
||||
Qt::KeyboardModifiers _modifiers;
|
||||
int _delay;
|
||||
QT_ONLY_WIDGETLIB_USES QString _keys;
|
||||
QT_ONLY_WIDGETLIB_USES Qt::KeyboardModifiers _modifiers;
|
||||
QT_ONLY_WIDGETLIB_USES int _delay;
|
||||
};
|
||||
|
||||
class QTestMouseEvent: public QTestEvent
|
||||
@ -127,12 +129,7 @@ class QTestMouseEvent: public QTestEvent
|
||||
public:
|
||||
inline QTestMouseEvent(QTest::MouseAction action, Qt::MouseButton button,
|
||||
Qt::KeyboardModifiers modifiers, QPoint position, int delay)
|
||||
: _action(action), _button(button), _modifiers(modifiers), _pos(position), _delay(delay)
|
||||
{
|
||||
Q_UNUSED(_action)
|
||||
Q_UNUSED(_button)
|
||||
Q_UNUSED(_delay)
|
||||
}
|
||||
: _action(action), _button(button), _modifiers(modifiers), _pos(position), _delay(delay) {}
|
||||
inline QTestEvent *clone() const override { return new QTestMouseEvent(*this); }
|
||||
|
||||
#ifdef QT_WIDGETS_LIB
|
||||
@ -143,11 +140,11 @@ public:
|
||||
#endif
|
||||
|
||||
private:
|
||||
QTest::MouseAction _action;
|
||||
Qt::MouseButton _button;
|
||||
Qt::KeyboardModifiers _modifiers;
|
||||
QPoint _pos;
|
||||
int _delay;
|
||||
QT_ONLY_WIDGETLIB_USES QTest::MouseAction _action;
|
||||
QT_ONLY_WIDGETLIB_USES Qt::MouseButton _button;
|
||||
QT_ONLY_WIDGETLIB_USES Qt::KeyboardModifiers _modifiers;
|
||||
QT_ONLY_WIDGETLIB_USES QPoint _pos;
|
||||
QT_ONLY_WIDGETLIB_USES int _delay;
|
||||
};
|
||||
#endif //QT_GUI_LIB
|
||||
|
||||
@ -155,10 +152,7 @@ private:
|
||||
class QTestDelayEvent: public QTestEvent
|
||||
{
|
||||
public:
|
||||
inline QTestDelayEvent(int msecs): _delay(msecs)
|
||||
{
|
||||
Q_UNUSED(_delay)
|
||||
}
|
||||
inline QTestDelayEvent(int msecs): _delay(msecs) {}
|
||||
inline QTestEvent *clone() const override { return new QTestDelayEvent(*this); }
|
||||
|
||||
#ifdef QT_WIDGETS_LIB
|
||||
@ -166,7 +160,7 @@ public:
|
||||
#endif
|
||||
|
||||
private:
|
||||
int _delay;
|
||||
QT_ONLY_WIDGETLIB_USES int _delay;
|
||||
};
|
||||
|
||||
class QTestEventList: public QList<QTestEvent *>
|
||||
@ -230,6 +224,8 @@ public:
|
||||
#endif
|
||||
};
|
||||
|
||||
#undef QT_ONLY_WIDGETLIB_USES
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
Q_DECLARE_METATYPE(QTestEventList)
|
||||
|
Loading…
x
Reference in New Issue
Block a user