QtDeclarative: Fix warnings in tests.
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>
Fri, 25 Nov 2011 07:49:45 +0000 (08:49 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 28 Nov 2011 08:06:52 +0000 (09:06 +0100)
- Unused parameters
- Missing interfaces
- tst_QQuickListView: Fix call canvas->rootContext()->setContextProperty
  to use a QVariant (instead of implicitly converting to QObject*)
  which was apparently intended.

Change-Id: Idc95d9408051e6f5b7005a7eccd764ac218ff867
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>

tests/auto/declarative/qdeclarativechangeset/tst_qdeclarativechangeset.cpp
tests/auto/declarative/qdeclarativeincubator/testtypes.h
tests/auto/declarative/qdeclarativeincubator/tst_qdeclarativeincubator.cpp
tests/auto/declarative/qdeclarativelanguage/testtypes.h
tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/plugin.cpp
tests/auto/declarative/qjsengine/tst_qjsengine.cpp
tests/auto/declarative/qquickcanvas/tst_qquickcanvas.cpp
tests/auto/declarative/qquickimage/tst_qquickimage.cpp
tests/auto/declarative/qquicklistview/tst_qquicklistview.cpp
tests/auto/declarative/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp

index 8da3d9b..d5b4306 100644 (file)
@@ -137,7 +137,7 @@ bool operator ==(const tst_qdeclarativemodelchange::Signal &left, const tst_qdec
     return left.index == right.index
             && left.count == right.count
             && left.to == right.to
-            && ((left.moveId == -1 && right.moveId == -1) || left.moveId != -1 && right.moveId != -1);
+            && ((left.moveId == -1 && right.moveId == -1) || (left.moveId != -1 && right.moveId != -1));
 }
 
 
index 8d9968d..d7d3149 100644 (file)
@@ -86,7 +86,8 @@ private:
 
 class CompletionRegisteringType : public QObject, public QDeclarativeParserStatus
 {
-Q_OBJECT
+    Q_OBJECT
+    Q_INTERFACES(QDeclarativeParserStatus)
 public:
     CompletionRegisteringType();
 
@@ -102,7 +103,8 @@ private:
 
 class CompletionCallbackType : public QObject, public QDeclarativeParserStatus
 {
-Q_OBJECT
+    Q_OBJECT
+    Q_INTERFACES(QDeclarativeParserStatus)
 public:
     CompletionCallbackType();
 
index efa4626..74a6b83 100644 (file)
@@ -811,7 +811,7 @@ void tst_qdeclarativeincubator::chainedAsynchronousIfNestedOnCompleted()
         QDeclarativeComponent *component;
         MyIncubator *incubator;
         QDeclarativeContext *ctxt;
-        static void callback(CompletionCallbackType *o, void *data) {
+        static void callback(CompletionCallbackType *, void *data) {
             CallbackData *d = (CallbackData *)data;
             d->component->create(*d->incubator, 0, d->ctxt);
         }
index dad0e23..6e325b3 100644 (file)
@@ -597,6 +597,7 @@ public:
 
 class MyParserStatus : public QObject, public QDeclarativeParserStatus
 {
+    Q_INTERFACES(QDeclarativeParserStatus)
     Q_OBJECT
 public:
     MyParserStatus() : m_cbc(0), m_ccc(0) {}
index 977a60c..3a6ccc9 100644 (file)
@@ -46,7 +46,7 @@
 class BarPluginType : public QObject
 {
     Q_OBJECT
-    Q_PROPERTY(int value READ value);
+    Q_PROPERTY(int value READ value)
 
 public:
     int value() const { return 16; }
index 8517850..1c29391 100644 (file)
@@ -793,7 +793,7 @@ void tst_QJSEngine::newVariant_promoteNonQScriptObject()
 
 void tst_QJSEngine::newRegExp()
 {
-    QSKIP("Test failing - QTBUG-22238", SkipAll);
+    QSKIP("Test failing - QTBUG-22238");
     QJSEngine eng;
     for (int x = 0; x < 2; ++x) {
         QJSValue rexp;
@@ -817,7 +817,7 @@ void tst_QJSEngine::newRegExp()
 
 void tst_QJSEngine::jsRegExp()
 {
-    QSKIP("Test failing - QTBUG-22238", SkipAll);
+    QSKIP("Test failing - QTBUG-22238");
 
     // See ECMA-262 Section 15.10, "RegExp Objects".
     // These should really be JS-only tests, as they test the implementation's
@@ -1463,7 +1463,7 @@ static QScriptValue getSetFoo(QScriptContext *ctx, QScriptEngine *)
 
 void tst_QJSEngine::globalObjectProperties()
 {
-    QSKIP("Test failing - QTBUG-22238", SkipAll);
+    QSKIP("Test failing - QTBUG-22238");
     // See ECMA-262 Section 15.1, "The Global Object".
 
     QJSEngine eng;
@@ -1552,7 +1552,7 @@ void tst_QJSEngine::globalObjectEquals()
 
 void tst_QJSEngine::globalObjectProperties_enumerate()
 {
-    QSKIP("Test failing - QTBUG-22238", SkipAll);
+    QSKIP("Test failing - QTBUG-22238");
     QJSEngine eng;
     QJSValue global = eng.globalObject();
 
@@ -3072,6 +3072,7 @@ class Klazz : public QWidget,
               public QStandardItem,
               public QGraphicsItem
 {
+    Q_INTERFACES(QGraphicsItem)
     Q_OBJECT
 public:
     Klazz(QWidget *parent = 0) : QWidget(parent) { }
@@ -6080,7 +6081,7 @@ void tst_QJSEngine::qRegExpInport_data()
 
 void tst_QJSEngine::qRegExpInport()
 {
-    QSKIP("Test failing - QTBUG-22238", SkipAll);
+    QSKIP("Test failing - QTBUG-22238");
     QFETCH(QRegExp, rx);
     QFETCH(QString, string);
 
index 640b4b4..95fcd82 100644 (file)
@@ -149,7 +149,7 @@ protected:
         event->accept();
     }
 
-    virtual void mousePressEvent(QMouseEvent *event) {
+    virtual void mousePressEvent(QMouseEvent *) {
         mousePressId = ++mousePressNum;
     }
 
index 5106e3f..1dd88ca 100644 (file)
@@ -339,6 +339,8 @@ void tst_qquickimage::mirror()
             p_e.setTransform(transform);
             p_e.drawTiledPixmap(QRect(0, 0, width, height), srcPixmap);
             break;
+        case QQuickImage::Pad:
+            break;
         }
 
         QImage img = expected.toImage();
index a39082d..b12bf3e 100644 (file)
@@ -911,7 +911,7 @@ void tst_QQuickListView::insertBeforeVisible_data()
 }
 
 template <class T>
-void tst_QQuickListView::removed(bool animated)
+void tst_QQuickListView::removed(bool /* animated */)
 {
     QQuickView *canvas = createView();
 
@@ -3027,7 +3027,7 @@ void tst_QQuickListView::header_delayItemCreation()
 
     TestModel model;
 
-    canvas->rootContext()->setContextProperty("setCurrentToZero", false);
+    canvas->rootContext()->setContextProperty("setCurrentToZero", QVariant(false));
     canvas->setSource(QUrl::fromLocalFile(TESTDATA("fillModelOnComponentCompleted.qml")));
     qApp->processEvents();
 
index e382a01..0278b0c 100644 (file)
@@ -80,7 +80,7 @@ class SingleRoleModel : public QAbstractListModel
     Q_OBJECT
 
 public:
-    SingleRoleModel(const QByteArray &role = "name", QObject *parent = 0) {
+    SingleRoleModel(const QByteArray &role = "name", QObject * /* parent */ = 0) {
         QHash<int, QByteArray> roles;
         roles.insert(Qt::DisplayRole , role);
         setRoleNames(roles);
@@ -101,7 +101,7 @@ public slots:
     }
 
 protected:
-    int rowCount(const QModelIndex &parent = QModelIndex()) const {
+    int rowCount(const QModelIndex & /* parent */ = QModelIndex()) const {
         return list.count();
     }
     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const {