aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2024-06-06 14:35:25 +0200
committerUlf Hermann <[email protected]>2024-06-11 13:20:01 +0200
commitb667b631b56ca7524b1a70b6c1ace814d1008371 (patch)
treec0b0215915e682a4f8fcb405ce2cdbfb10eeb3e0
parent37e5be6de302aa4876cc07618ea0b30c6cd5a06a (diff)
Tests: Avoid some warnings
Change-Id: I463e41352467dab7998b79843547a4a05046520c Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Olivier De Cannière <[email protected]>
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp2
-rw-r--r--tests/auto/quick/qquickitem/tst_qquickitem.cpp2
-rw-r--r--tests/auto/quick/qquickpathview/tst_qquickpathview.cpp4
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp8
-rw-r--r--tests/auto/quickcontrols/qquickmenu/tst_qquickmenu.cpp2
5 files changed, 11 insertions, 7 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index bd60093a7b..79e26b65db 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -8034,7 +8034,7 @@ public:
void init(QV4::ExecutionEngine *v4, QV4::WeakValue *weakRef, bool *resultPtr)
{
- QV4::QObjectWrapper::wrap(v4, this);
+ (void) QV4::QObjectWrapper::wrap(v4, this); // Intentionally drop the wrapper
QQmlEngine::setObjectOwnership(this, QQmlEngine::JavaScriptOwnership);
this->resultPtr = resultPtr;
diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
index e4cc434909..338070b730 100644
--- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
@@ -2622,7 +2622,7 @@ class TransformItemPrivate :public QQuickItemPrivate
protected:
Q_DECLARE_PUBLIC(TransformItem)
- bool transformChanged(QQuickItem *transformedItem) override
+ bool transformChanged(QQuickItem *) override
{
Q_Q(TransformItem);
q->transformChanged = true;
diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
index 1a471d39af..703d6e053d 100644
--- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
+++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
@@ -2943,11 +2943,11 @@ public:
m_values << 0 << 1 << 2 << 3 << 4;
}
- int rowCount(const QModelIndex &parent = QModelIndex()) const {
+ int rowCount(const QModelIndex &parent = QModelIndex()) const final {
Q_UNUSED(parent);
return m_values.count();
}
- QVariant data(const QModelIndex &index, int role) const {
+ QVariant data(const QModelIndex &index, int) const final {
if (index.row() < 0 || m_values.count() <= index.row())
return QVariant();
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index a189e84e58..a80827a663 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -3334,7 +3334,7 @@ protected:
}
private:
- static void appendEvent(QQuickItem *filter, QQuickItem *receiver, QEvent *event) {
+ static void appendEvent(QQuickItem *filter, QQuickItem *receiver, QEvent *) {
auto record = DeliveryRecord(filter ? filter->objectName() : QString(), receiver ? receiver->objectName() : QString());
int i = m_deliveryList.size();
if (m_expectedDeliveryList.size() > i && m_expectedDeliveryList[i] == record)
@@ -3384,7 +3384,11 @@ void tst_qquickwindow::testChildMouseEventFilter_data()
QTest::addColumn<InputState>("inputState");
QTest::addColumn<DeliveryRecordVector>("expectedDeliveryOrder");
- for (const QString &eventMode : {"mouse", "touch", "touchToMouse"}) {
+ for (const QString &eventMode : {
+ QStringLiteral("mouse"),
+ QStringLiteral("touch"),
+ QStringLiteral("touchToMouse")
+ }) {
#define desc(txt) qPrintable(QString("%1 events, ").arg(eventMode) + txt)
diff --git a/tests/auto/quickcontrols/qquickmenu/tst_qquickmenu.cpp b/tests/auto/quickcontrols/qquickmenu/tst_qquickmenu.cpp
index e652168002..28b8e45496 100644
--- a/tests/auto/quickcontrols/qquickmenu/tst_qquickmenu.cpp
+++ b/tests/auto/quickcontrols/qquickmenu/tst_qquickmenu.cpp
@@ -46,7 +46,7 @@ public:
tst_QQuickMenu();
private slots:
- void init();
+ void init() final;
void defaults();
void count();