Skip to content

Commit

Permalink
QtDeclarative: Fix warnings in tests.
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
Friedemann Kleint authored and Qt by Nokia committed Nov 28, 2011
1 parent d0d1217 commit 7f20428
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 15 deletions.
Expand Up @@ -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));
}


Expand Down
6 changes: 4 additions & 2 deletions tests/auto/declarative/qdeclarativeincubator/testtypes.h
Expand Up @@ -86,7 +86,8 @@ Q_PROPERTY(int value READ value WRITE setValue)

class CompletionRegisteringType : public QObject, public QDeclarativeParserStatus
{
Q_OBJECT
Q_OBJECT
Q_INTERFACES(QDeclarativeParserStatus)
public:
CompletionRegisteringType();

Expand All @@ -102,7 +103,8 @@ Q_OBJECT

class CompletionCallbackType : public QObject, public QDeclarativeParserStatus
{
Q_OBJECT
Q_OBJECT
Q_INTERFACES(QDeclarativeParserStatus)
public:
CompletionCallbackType();

Expand Down
Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions tests/auto/declarative/qdeclarativelanguage/testtypes.h
Expand Up @@ -597,6 +597,7 @@ class MyCustomParserTypeParser : public QDeclarativeCustomParser

class MyParserStatus : public QObject, public QDeclarativeParserStatus
{
Q_INTERFACES(QDeclarativeParserStatus)
Q_OBJECT
public:
MyParserStatus() : m_cbc(0), m_ccc(0) {}
Expand Down
Expand Up @@ -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; }
Expand Down
11 changes: 6 additions & 5 deletions tests/auto/declarative/qjsengine/tst_qjsengine.cpp
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -3072,6 +3072,7 @@ class Klazz : public QWidget,
public QStandardItem,
public QGraphicsItem
{
Q_INTERFACES(QGraphicsItem)
Q_OBJECT
public:
Klazz(QWidget *parent = 0) : QWidget(parent) { }
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion tests/auto/declarative/qquickcanvas/tst_qquickcanvas.cpp
Expand Up @@ -149,7 +149,7 @@ class TestTouchItem : public QQuickRectangle
event->accept();
}

virtual void mousePressEvent(QMouseEvent *event) {
virtual void mousePressEvent(QMouseEvent *) {
mousePressId = ++mousePressNum;
}

Expand Down
2 changes: 2 additions & 0 deletions tests/auto/declarative/qquickimage/tst_qquickimage.cpp
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions tests/auto/declarative/qquicklistview/tst_qquicklistview.cpp
Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down
Expand Up @@ -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);
Expand All @@ -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 {
Expand Down

0 comments on commit 7f20428

Please sign in to comment.