diff options
author | Lars Schmertmann <Lars.Schmertmann@governikus.de> | 2020-07-02 15:56:26 +0200 |
---|---|---|
committer | Lars Schmertmann <Lars.Schmertmann@governikus.de> | 2020-07-03 21:10:09 +0200 |
commit | ae890390e523f0f435190654b081764df88d7b94 (patch) | |
tree | 9c19ed0c78a11c2fc875cb4b8d4c2087e251cf4b /tests/auto | |
parent | af3f5b8746a31caf8457590293e3e28101ef85e3 (diff) |
Avoid use of Q_UNUSED by eliminating the parameter names
This change only happens to files touched
by the commit to add missing ; to Q_UNUSED.
Task-number: QTBUG-82978
Change-Id: I10e6993a2bb3952cf9a262708b8573550e0dbe63
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto')
6 files changed, 22 insertions, 25 deletions
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 9416796c6c..b81ed67764 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -2207,8 +2207,7 @@ public: uint ownerId(FileOwner) const { return 0; } QString owner(FileOwner) const { return QString(); } QDateTime fileTime(FileTime) const { return QDateTime(); } - bool setFileTime(const QDateTime &newDate, FileTime time) - { Q_UNUSED(newDate) Q_UNUSED(time) return false; } + bool setFileTime(const QDateTime &, FileTime) { return false; } private: int number; diff --git a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp index 893479843f..a3dd5e05e1 100644 --- a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp +++ b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp @@ -121,7 +121,7 @@ private slots: protected slots: Q_SCRIPTABLE void slot4(int) {} - void slot5(int a, const QString& b) { Q_UNUSED(a); Q_UNUSED(b); } + void slot5(int, const QString &) {} signals: void sig1(); diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 74725c8f18..231cccc38d 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -207,7 +207,11 @@ protected: Q_INVOKABLE QT_MOC_COMPAT void invoke2(int){} Q_SCRIPTABLE QT_MOC_COMPAT void sinvoke2(){} private: - Q_INVOKABLE void invoke3(int hinz = 0, int kunz = 0){Q_UNUSED(hinz) Q_UNUSED(kunz)} + Q_INVOKABLE void invoke3(int hinz = 0, int kunz = 0) + { + Q_UNUSED(hinz); + Q_UNUSED(kunz); + } Q_SCRIPTABLE void sinvoke3(){} int recursionCount; @@ -426,15 +430,12 @@ public: public slots: void on_Sender_signalNoParams() { called_slots << 1; } - void on_Sender_signalWithParams(int i = 0) { called_slots << 2; Q_UNUSED(i); } - void on_Sender_signalWithParams(int i, QString string) { called_slots << 3; Q_UNUSED(i);Q_UNUSED(string); } + void on_Sender_signalWithParams(int = 0) { called_slots << 2; } + void on_Sender_signalWithParams(int, QString) { called_slots << 3; } void on_Sender_signalManyParams() { called_slots << 4; } - void on_Sender_signalManyParams(int i1, int i2, int i3, QString string, bool onoff) - { called_slots << 5; Q_UNUSED(i1);Q_UNUSED(i2);Q_UNUSED(i3);Q_UNUSED(string);Q_UNUSED(onoff); } - void on_Sender_signalManyParams(int i1, int i2, int i3, QString string, bool onoff, bool dummy) - { called_slots << 6; Q_UNUSED(i1);Q_UNUSED(i2);Q_UNUSED(i3);Q_UNUSED(string);Q_UNUSED(onoff); Q_UNUSED(dummy);} - void on_Sender_signalManyParams2(int i1, int i2, int i3, QString string, bool onoff) - { called_slots << 7; Q_UNUSED(i1);Q_UNUSED(i2);Q_UNUSED(i3);Q_UNUSED(string);Q_UNUSED(onoff); } + void on_Sender_signalManyParams(int, int, int, QString, bool) { called_slots << 5; } + void on_Sender_signalManyParams(int, int, int, QString, bool, bool) { called_slots << 6; } + void on_Sender_signalManyParams2(int, int, int, QString, bool) { called_slots << 7; } void slotLoopBack() { called_slots << 8; } void on_Receiver_signalNoParams() { called_slots << 9; } void on_Receiver_signal_with_underscore() { called_slots << 10; } diff --git a/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp b/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp index c90fc28bcb..8ed9858087 100644 --- a/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp +++ b/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp @@ -79,7 +79,7 @@ public: public slots: void slotWithoutParameters() {} - void slotWithParameters(int i, char c) { Q_UNUSED(i); Q_UNUSED(c); } + void slotWithParameters(int, char) {} void emitSecondSignal() { emit nestedSignal(); } signals: diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 2bc0cf1800..01d207b080 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -1804,16 +1804,14 @@ signals: class QTBUG12260_defaultTemplate_Object : public QObject { Q_OBJECT public slots: - void doSomething(QHash<QString, QVariant> values = QHash<QString, QVariant>() ) { Q_UNUSED(values); } - void doSomethingElse(QSharedPointer<QVarLengthArray<QString, (16 >> 2)> > val - = QSharedPointer<QVarLengthArray<QString, (16 >> 2)> >() ) - { Q_UNUSED(val); } + void doSomething(QHash<QString, QVariant> = QHash<QString, QVariant>() ) {} + void doSomethingElse(QSharedPointer<QVarLengthArray<QString, (16 >> 2)> > + = QSharedPointer<QVarLengthArray<QString, (16 >> 2)> >() ) {} - void doAnotherThing(bool a = (1 < 3), bool b = (1 > 4)) { Q_UNUSED(a); Q_UNUSED(b); } + void doAnotherThing(bool = (1 < 3), bool = (1 > 4)) {} - void performSomething(QList<QList<QString>> e = QList<QList<QString>>(8 < 1), - QHash<int, QList<QString>> h = QHash<int, QList<QString>>()) - { Q_UNUSED(e); Q_UNUSED(h); } + void performSomething(QList<QList<QString>> = QList<QList<QString>>(8 < 1), + QHash<int, QList<QString>> = QHash<int, QList<QString>>()) {} }; diff --git a/tests/auto/widgets/graphicsview/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp b/tests/auto/widgets/graphicsview/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp index 5b0ceabe62..af21b9f391 100644 --- a/tests/auto/widgets/graphicsview/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp @@ -72,12 +72,11 @@ public: { return QRectF(); } // QGraphicsLayoutItem::setGeometry is a pure virtual function - void setGeometry(QRectF const& rect) - { Q_UNUSED(rect); } + void setGeometry(QRectF const&) {} // QGraphicsLayoutItem::sizeHint is a pure virtual function - QSizeF sizeHint(Qt::SizeHint which, QSizeF const& constraint = QSizeF()) const - { Q_UNUSED(which); Q_UNUSED(constraint); return QSizeF(); } + QSizeF sizeHint(Qt::SizeHint, QSizeF const& = QSizeF()) const + { return QSizeF(); } void updateGeometry() { updateGeometryCalled++; QGraphicsLayoutItem::updateGeometry(); } |