diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2011-10-17 13:03:58 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-17 13:59:29 +0200 |
commit | f713037bf192748837f6075b2c60b19ccf3f9ab1 (patch) | |
tree | 3fda988997268c2a96729b1a7baa96583d453397 /tests | |
parent | 830c69803e45daad2115498a8d5a6faeb75fe2a5 (diff) |
Fix coding style issues
Avoid Qt Sanity Bot noise when these files are moved.
Change-Id: I714e949837909883fe7e387ae336d2ffc4a1912b
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'tests')
16 files changed, 90 insertions, 90 deletions
diff --git a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp index b359ba6722..817738ad8a 100644 --- a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp +++ b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp @@ -408,13 +408,13 @@ void tst_qdeclarativeimageprovider::threadTest() QList<QSGImage *> images = obj->findChildren<QSGImage *>(); QCOMPARE(images.count(), 4); QTest::qWait(100); - foreach(QSGImage *img, images) { + foreach (QSGImage *img, images) { QCOMPARE(img->status(), QSGImage::Loading); } provider->ok = true; provider->cond.wakeAll(); QTest::qWait(250); - foreach(QSGImage *img, images) { + foreach (QSGImage *img, images) { QTRY_VERIFY(img->status() == QSGImage::Ready); } } diff --git a/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp b/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp index 7777b5c3b5..0920f0f65c 100644 --- a/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp +++ b/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp @@ -644,7 +644,7 @@ T *tst_qsgflickable::findItem(QSGItem *parent, const QString &objectName) //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); - if(!item) + if (!item) continue; //qDebug() << "try" << item; if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { diff --git a/tests/auto/declarative/qsggridview/tst_qsggridview.cpp b/tests/auto/declarative/qsggridview/tst_qsggridview.cpp index 5d6cd47a6f..de191130a2 100644 --- a/tests/auto/declarative/qsggridview/tst_qsggridview.cpp +++ b/tests/auto/declarative/qsggridview/tst_qsggridview.cpp @@ -2066,14 +2066,14 @@ void tst_QSGGridView::mirroring() QCOMPARE(gridviewA->layoutDirection(), gridviewA->effectiveLayoutDirection()); // LTR != RTL - foreach(const QString objectName, objectNames) + foreach (const QString objectName, objectNames) QVERIFY(findItem<QSGItem>(gridviewA, objectName)->x() != findItem<QSGItem>(gridviewB, objectName)->x()); gridviewA->setProperty("layoutDirection", Qt::LeftToRight); gridviewB->setProperty("layoutDirection", Qt::LeftToRight); // LTR == LTR - foreach(const QString objectName, objectNames) + foreach (const QString objectName, objectNames) QCOMPARE(findItem<QSGItem>(gridviewA, objectName)->x(), findItem<QSGItem>(gridviewB, objectName)->x()); QVERIFY(gridviewB->layoutDirection() == gridviewB->effectiveLayoutDirection()); @@ -2081,25 +2081,25 @@ void tst_QSGGridView::mirroring() QVERIFY(gridviewB->layoutDirection() != gridviewB->effectiveLayoutDirection()); // LTR != LTR+mirror - foreach(const QString objectName, objectNames) + foreach (const QString objectName, objectNames) QVERIFY(findItem<QSGItem>(gridviewA, objectName)->x() != findItem<QSGItem>(gridviewB, objectName)->x()); gridviewA->setProperty("layoutDirection", Qt::RightToLeft); // RTL == LTR+mirror - foreach(const QString objectName, objectNames) + foreach (const QString objectName, objectNames) QCOMPARE(findItem<QSGItem>(gridviewA, objectName)->x(), findItem<QSGItem>(gridviewB, objectName)->x()); gridviewB->setProperty("layoutDirection", Qt::RightToLeft); // RTL != RTL+mirror - foreach(const QString objectName, objectNames) + foreach (const QString objectName, objectNames) QVERIFY(findItem<QSGItem>(gridviewA, objectName)->x() != findItem<QSGItem>(gridviewB, objectName)->x()); gridviewA->setProperty("layoutDirection", Qt::LeftToRight); // LTR == RTL+mirror - foreach(const QString objectName, objectNames) + foreach (const QString objectName, objectNames) QCOMPARE(findItem<QSGItem>(gridviewA, objectName)->x(), findItem<QSGItem>(gridviewB, objectName)->x()); delete canvasA; @@ -3290,7 +3290,7 @@ T *tst_QSGGridView::findItem(QSGItem *parent, const QString &objectName, int ind //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); - if(!item) + if (!item) continue; //qDebug() << "try" << item; if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { @@ -3321,7 +3321,7 @@ QList<T*> tst_QSGGridView::findItems(QSGItem *parent, const QString &objectName) //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); - if(!item) + if (!item) continue; //qDebug() << "try" << item; if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { @@ -3339,7 +3339,7 @@ void tst_QSGGridView::dumpTree(QSGItem *parent, int depth) static QString padding(" "); for (int i = 0; i < parent->childItems().count(); ++i) { QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); - if(!item) + if (!item) continue; QDeclarativeContext *context = QDeclarativeEngine::contextForObject(item); qDebug() << padding.left(depth*2) << item << (context ? context->contextProperty("index").toInt() : -1); diff --git a/tests/auto/declarative/qsgimage/tst_qsgimage.cpp b/tests/auto/declarative/qsgimage/tst_qsgimage.cpp index 81f00e8aa4..fd22f48684 100644 --- a/tests/auto/declarative/qsgimage/tst_qsgimage.cpp +++ b/tests/auto/declarative/qsgimage/tst_qsgimage.cpp @@ -669,7 +669,7 @@ T *tst_qsgimage::findItem(QSGItem *parent, const QString &objectName, int index) //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); - if(!item) + if (!item) continue; //qDebug() << "try" << item; if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { diff --git a/tests/auto/declarative/qsgitem/tst_qsgitem.cpp b/tests/auto/declarative/qsgitem/tst_qsgitem.cpp index 5949b7b76d..c914d31783 100644 --- a/tests/auto/declarative/qsgitem/tst_qsgitem.cpp +++ b/tests/auto/declarative/qsgitem/tst_qsgitem.cpp @@ -84,7 +84,7 @@ protected: } public slots: - void doPolish() { + void doPolish() { polish(); } }; @@ -227,13 +227,13 @@ struct FocusState : public QHash<QSGItem *, FocusData> } else { \ QCOMPARE(canvas.activeFocusItem(), canvas.rootItem()); \ } \ - for(QHash<QSGItem *, FocusData>::Iterator iter = focusState.begin(); \ + for (QHash<QSGItem *, FocusData>::Iterator iter = focusState.begin(); \ iter != focusState.end(); \ iter++) { \ QCOMPARE(iter.key()->hasFocus(), iter.value().focus); \ QCOMPARE(iter.key()->hasActiveFocus(), iter.value().activeFocus); \ } \ - } while(false) + } while (false) // Tests a simple set of top-level scoped items void tst_qsgitem::simpleFocus() @@ -632,7 +632,7 @@ void tst_qsgitem::changeParent() focusState[item].set(false, false); FVERIFY(); } - + } void tst_qsgitem::constructor() diff --git a/tests/auto/declarative/qsgitem2/tst_qsgitem.cpp b/tests/auto/declarative/qsgitem2/tst_qsgitem.cpp index fd1f9cd373..08a3071e51 100644 --- a/tests/auto/declarative/qsgitem2/tst_qsgitem.cpp +++ b/tests/auto/declarative/qsgitem2/tst_qsgitem.cpp @@ -97,7 +97,7 @@ T *findItem(QSGItem *parent, const QString &objectName) //qDebug() << parent->QSGItem::children().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); - if(!item) + if (!item) continue; //qDebug() << "try" << item; if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) @@ -496,7 +496,7 @@ void tst_QSGItem::layoutMirroring() QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritedLayoutMirror, true); QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritedLayoutMirror, true); QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritedLayoutMirror, true); - + // // dynamic parenting // @@ -526,7 +526,7 @@ void tst_QSGItem::layoutMirroring() childItem2->setParentItem(parentItem2); QCOMPARE(QSGItemPrivate::get(childItem2)->effectiveLayoutMirror, false); QCOMPARE(QSGItemPrivate::get(childItem2)->inheritMirrorFromParent, false); - + delete parentItem1; delete parentItem2; } @@ -1024,7 +1024,7 @@ void tst_QSGItem::transforms() void tst_QSGItem::childrenProperty() { QDeclarativeComponent component(&engine, TESTDATA("childrenProperty.qml")); - + QObject *o = component.create(); QVERIFY(o != 0); @@ -1039,7 +1039,7 @@ void tst_QSGItem::childrenProperty() void tst_QSGItem::resourcesProperty() { QDeclarativeComponent component(&engine, TESTDATA("resourcesProperty.qml")); - + QObject *o = component.create(); QVERIFY(o != 0); diff --git a/tests/auto/declarative/qsglistview/tst_qsglistview.cpp b/tests/auto/declarative/qsglistview/tst_qsglistview.cpp index fc1b7551ed..c2a6920b48 100644 --- a/tests/auto/declarative/qsglistview/tst_qsglistview.cpp +++ b/tests/auto/declarative/qsglistview/tst_qsglistview.cpp @@ -258,7 +258,7 @@ public: QList<int> roles() const { return QList<int>() << Name << Number; } QString toString(int role) const { - switch(role) { + switch (role) { case Name: return "name"; case Number: @@ -282,7 +282,7 @@ public: for (int i = 0; i < roles.size(); ++i) { int role = roles.at(i); QVariant info; - switch(role) { + switch (role) { case Name: info = list.at(index).first; break; @@ -3736,14 +3736,14 @@ void tst_QSGListView::test_mirroring() QCOMPARE(listviewA->layoutDirection(), listviewA->effectiveLayoutDirection()); // LTR != RTL - foreach(const QString objectName, objectNames) + foreach (const QString objectName, objectNames) QVERIFY(findItem<QSGItem>(listviewA, objectName)->x() != findItem<QSGItem>(listviewB, objectName)->x()); listviewA->setProperty("layoutDirection", Qt::LeftToRight); listviewB->setProperty("layoutDirection", Qt::LeftToRight); // LTR == LTR - foreach(const QString objectName, objectNames) + foreach (const QString objectName, objectNames) QCOMPARE(findItem<QSGItem>(listviewA, objectName)->x(), findItem<QSGItem>(listviewB, objectName)->x()); QVERIFY(listviewB->layoutDirection() == listviewB->effectiveLayoutDirection()); @@ -3751,25 +3751,25 @@ void tst_QSGListView::test_mirroring() QVERIFY(listviewB->layoutDirection() != listviewB->effectiveLayoutDirection()); // LTR != LTR+mirror - foreach(const QString objectName, objectNames) + foreach (const QString objectName, objectNames) QVERIFY(findItem<QSGItem>(listviewA, objectName)->x() != findItem<QSGItem>(listviewB, objectName)->x()); listviewA->setProperty("layoutDirection", Qt::RightToLeft); // RTL == LTR+mirror - foreach(const QString objectName, objectNames) + foreach (const QString objectName, objectNames) QCOMPARE(findItem<QSGItem>(listviewA, objectName)->x(), findItem<QSGItem>(listviewB, objectName)->x()); listviewB->setProperty("layoutDirection", Qt::RightToLeft); // RTL != RTL+mirror - foreach(const QString objectName, objectNames) + foreach (const QString objectName, objectNames) QVERIFY(findItem<QSGItem>(listviewA, objectName)->x() != findItem<QSGItem>(listviewB, objectName)->x()); listviewA->setProperty("layoutDirection", Qt::LeftToRight); // LTR == RTL+mirror - foreach(const QString objectName, objectNames) + foreach (const QString objectName, objectNames) QCOMPARE(findItem<QSGItem>(listviewA, objectName)->x(), findItem<QSGItem>(listviewB, objectName)->x()); delete canvasA; @@ -3799,7 +3799,7 @@ void tst_QSGListView::margins() QCOMPARE(listview->contentY(), -30.); QCOMPARE(listview->yOrigin(), 0.); - + // check end bound listview->positionViewAtEnd(); qreal pos = listview->contentY(); @@ -3821,7 +3821,7 @@ void tst_QSGListView::margins() listview->setTopMargin(20); QCOMPARE(listview->yOrigin(), 20.); QTRY_COMPARE(listview->contentY(), 0.); - + // check end bound listview->positionViewAtEnd(); pos = listview->contentY(); @@ -4096,7 +4096,7 @@ T *tst_QSGListView::findItem(QSGItem *parent, const QString &objectName, int ind //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); - if(!item) + if (!item) continue; //qDebug() << "try" << item; if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { @@ -4124,7 +4124,7 @@ QList<T*> tst_QSGListView::findItems(QSGItem *parent, const QString &objectName) //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); - if(!item || !item->isVisible()) + if (!item || !item->isVisible()) continue; //qDebug() << "try" << item; if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) @@ -4140,7 +4140,7 @@ void tst_QSGListView::dumpTree(QSGItem *parent, int depth) static QString padding(" "); for (int i = 0; i < parent->childItems().count(); ++i) { QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); - if(!item) + if (!item) continue; qDebug() << padding.left(depth*2) << item; dumpTree(item, depth+1); diff --git a/tests/auto/declarative/qsgloader/tst_qsgloader.cpp b/tests/auto/declarative/qsgloader/tst_qsgloader.cpp index 4b0921f526..7f307e01bd 100644 --- a/tests/auto/declarative/qsgloader/tst_qsgloader.cpp +++ b/tests/auto/declarative/qsgloader/tst_qsgloader.cpp @@ -248,7 +248,7 @@ void tst_QSGLoader::clear() QSGItem *item = qobject_cast<QSGItem*>(component.create()); QVERIFY(item); - QSGLoader *loader = qobject_cast<QSGLoader*>(item->QSGItem::childItems().at(0)); + QSGLoader *loader = qobject_cast<QSGLoader*>(item->QSGItem::childItems().at(0)); QVERIFY(loader); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); @@ -294,7 +294,7 @@ void tst_QSGLoader::componentToUrl() QSGItem *item = qobject_cast<QSGItem*>(component.create()); QVERIFY(item); - QSGLoader *loader = qobject_cast<QSGLoader*>(item->QSGItem::childItems().at(0)); + QSGLoader *loader = qobject_cast<QSGLoader*>(item->QSGItem::childItems().at(0)); QVERIFY(loader); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); @@ -455,7 +455,7 @@ void tst_QSGLoader::networkComponent() QSGItem *item = qobject_cast<QSGItem*>(component.create()); QVERIFY(item); - QSGLoader *loader = qobject_cast<QSGLoader*>(item->QSGItem::children().at(1)); + QSGLoader *loader = qobject_cast<QSGLoader*>(item->QSGItem::children().at(1)); QVERIFY(loader); QTRY_VERIFY(loader->status() == QSGLoader::Ready); diff --git a/tests/auto/declarative/qsgpathview/qsgpathview.pro b/tests/auto/declarative/qsgpathview/qsgpathview.pro index 91520673f7..d4c237d168 100644 --- a/tests/auto/declarative/qsgpathview/qsgpathview.pro +++ b/tests/auto/declarative/qsgpathview/qsgpathview.pro @@ -8,5 +8,5 @@ testDataFiles.files = data testDataFiles.path = . DEPLOYMENT += testDataFiles -CONFIG += parallel_test +CONFIG += parallel_test QT += core-private gui-private v8-private declarative-private widgets testlib diff --git a/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp b/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp index 691a115cf5..c4648603cb 100644 --- a/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp +++ b/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp @@ -514,7 +514,7 @@ void tst_QSGPathView::pathMoved() QCOMPARE(firstItem->pos() + offset, start); pathview->setOffset(1.0); - for(int i=0; i<model.count(); i++){ + for (int i=0; i<model.count(); i++) { QSGRectangle *curItem = findItem<QSGRectangle>(pathview, "wrapper", i); QPointF itemPos(path->pointAt(0.25 + i*0.25)); QCOMPARE(curItem->pos() + offset, QPointF(qRound(itemPos.x()), qRound(itemPos.y()))); @@ -1101,7 +1101,7 @@ T *tst_QSGPathView::findItem(QSGItem *parent, const QString &objectName, int ind //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); - if(!item) + if (!item) continue; //qDebug() << "try" << item; if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { @@ -1129,7 +1129,7 @@ QList<T*> tst_QSGPathView::findItems(QSGItem *parent, const QString &objectName) //qDebug() << parent->QSGItem::children().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); - if(!item) + if (!item) continue; //qDebug() << "try" << item; if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) diff --git a/tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp b/tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp index 84225ca02a..3afc7dfb27 100644 --- a/tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp +++ b/tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp @@ -1283,7 +1283,7 @@ void tst_qsgpositioners::test_mirroring() QList<QString> objectNames; objectNames << "one" << "two" << "three" << "four" << "five"; - foreach(const QString qmlFile, qmlFiles) { + foreach (const QString qmlFile, qmlFiles) { QSGView *canvasA = createView(TESTDATA(qmlFile)); QSGItem *rootA = qobject_cast<QSGItem*>(canvasA->rootObject()); @@ -1293,7 +1293,7 @@ void tst_qsgpositioners::test_mirroring() rootA->setProperty("testRightToLeft", true); // layoutDirection: Qt.RightToLeft // LTR != RTL - foreach(const QString objectName, objectNames) { + foreach (const QString objectName, objectNames) { // horizontal.qml only has three items if (qmlFile == QString("horizontal.qml") && objectName == QString("four")) break; @@ -1310,7 +1310,7 @@ void tst_qsgpositioners::test_mirroring() rootPrivateB->resolveLayoutMirror(); // RTL == mirror - foreach(const QString objectName, objectNames) { + foreach (const QString objectName, objectNames) { // horizontal.qml only has three items if (qmlFile == QString("horizontal.qml") && objectName == QString("four")) break; @@ -1323,7 +1323,7 @@ void tst_qsgpositioners::test_mirroring() rootB->setProperty("testRightToLeft", true); // layoutDirection: Qt.RightToLeft // LTR == RTL + mirror - foreach(const QString objectName, objectNames) { + foreach (const QString objectName, objectNames) { // horizontal.qml only has three items if (qmlFile == QString("horizontal.qml") && objectName == QString("four")) break; diff --git a/tests/auto/declarative/qsgrepeater/tst_qsgrepeater.cpp b/tests/auto/declarative/qsgrepeater/tst_qsgrepeater.cpp index cb8b81e699..40d7b77827 100644 --- a/tests/auto/declarative/qsgrepeater/tst_qsgrepeater.cpp +++ b/tests/auto/declarative/qsgrepeater/tst_qsgrepeater.cpp @@ -215,7 +215,7 @@ void tst_QSGRepeater::objectList() { QSGView *canvas = createView(); QObjectList data; - for(int i=0; i<100; i++) + for (int i=0; i<100; i++) data << new MyObject(i); QDeclarativeContext *ctxt = canvas->rootContext(); @@ -651,7 +651,7 @@ T *tst_QSGRepeater::findItem(QObject *parent, const QString &objectName, int ind //qDebug() << parent->children().count() << "children"; for (int i = 0; i < parent->children().count(); ++i) { QSGItem *item = qobject_cast<QSGItem*>(parent->children().at(i)); - if(!item) + if (!item) continue; //qDebug() << "try" << item; if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { diff --git a/tests/auto/declarative/qsgtext/tst_qsgtext.cpp b/tests/auto/declarative/qsgtext/tst_qsgtext.cpp index a59b00072a..8dc32b2cc0 100644 --- a/tests/auto/declarative/qsgtext/tst_qsgtext.cpp +++ b/tests/auto/declarative/qsgtext/tst_qsgtext.cpp @@ -83,7 +83,7 @@ private slots: void lineCount(); void lineHeight(); - // ### these tests may be trivial + // ### these tests may be trivial void horizontalAlignment(); void horizontalAlignment_RightToLeft(); void verticalAlignment(); @@ -781,7 +781,7 @@ void tst_qsgtext::font() delete textObject; } - { + { QString componentStr = "import QtQuick 2.0\nText { font.bold: true; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); @@ -793,7 +793,7 @@ void tst_qsgtext::font() delete textObject; } - { + { QString componentStr = "import QtQuick 2.0\nText { font.italic: true; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); @@ -805,7 +805,7 @@ void tst_qsgtext::font() delete textObject; } - { + { QString componentStr = "import QtQuick 2.0\nText { font.family: \"Helvetica\"; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); @@ -818,7 +818,7 @@ void tst_qsgtext::font() delete textObject; } - { + { QString componentStr = "import QtQuick 2.0\nText { font.family: \"\"; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); @@ -834,7 +834,7 @@ void tst_qsgtext::style() { //test style for (int i = 0; i < styles.size(); i++) - { + { QString componentStr = "import QtQuick 2.0\nText { style: \"" + styleStrings.at(i) + "\"; styleColor: \"white\"; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); @@ -864,7 +864,7 @@ void tst_qsgtext::color() { //test style for (int i = 0; i < colorStrings.size(); i++) - { + { QString componentStr = "import QtQuick 2.0\nText { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); @@ -877,7 +877,7 @@ void tst_qsgtext::color() } for (int i = 0; i < colorStrings.size(); i++) - { + { QString componentStr = "import QtQuick 2.0\nText { styleColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); @@ -889,9 +889,9 @@ void tst_qsgtext::color() delete textObject; } - + for (int i = 0; i < colorStrings.size(); i++) - { + { for (int j = 0; j < colorStrings.size(); j++) { QString componentStr = "import QtQuick 2.0\nText { color: \"" + colorStrings.at(i) + "\"; styleColor: \"" + colorStrings.at(j) + "\"; text: \"Hello World\" }"; @@ -1288,7 +1288,7 @@ void tst_qsgtext::embeddedImages() if (!error.isEmpty()) QTest::ignoreMessage(QtWarningMsg, error.toLatin1()); - + QDeclarativeComponent textComponent(&engine, qmlfile); QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); diff --git a/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp b/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp index 6ab4b93a23..945b2d2c45 100644 --- a/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp +++ b/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp @@ -108,7 +108,7 @@ private slots: void alignments(); void alignments_data(); - // ### these tests may be trivial + // ### these tests may be trivial void hAlign(); void hAlign_RightToLeft(); void vAlign(); @@ -223,7 +223,7 @@ tst_qsgtextedit::tst_qsgtextedit() // need a different test to do alpha channel test // << "#AA0011DD" // << "#00F16B11"; - // + // } void tst_qsgtextedit::text() @@ -642,7 +642,7 @@ void tst_qsgtextedit::vAlign() void tst_qsgtextedit::font() { //test size, then bold, then italic, then family - { + { QString componentStr = "import QtQuick 2.0\nTextEdit { font.pointSize: 40; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); @@ -654,7 +654,7 @@ void tst_qsgtextedit::font() QCOMPARE(textEditObject->font().italic(), false); } - { + { QString componentStr = "import QtQuick 2.0\nTextEdit { font.bold: true; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); @@ -665,7 +665,7 @@ void tst_qsgtextedit::font() QCOMPARE(textEditObject->font().italic(), false); } - { + { QString componentStr = "import QtQuick 2.0\nTextEdit { font.italic: true; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); @@ -676,7 +676,7 @@ void tst_qsgtextedit::font() QCOMPARE(textEditObject->font().bold(), false); } - { + { QString componentStr = "import QtQuick 2.0\nTextEdit { font.family: \"Helvetica\"; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); @@ -688,7 +688,7 @@ void tst_qsgtextedit::font() QCOMPARE(textEditObject->font().italic(), false); } - { + { QString componentStr = "import QtQuick 2.0\nTextEdit { font.family: \"\"; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); @@ -720,7 +720,7 @@ void tst_qsgtextedit::color() } //test normal for (int i = 0; i < colorStrings.size(); i++) - { + { QString componentStr = "import QtQuick 2.0\nTextEdit { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); @@ -769,7 +769,7 @@ void tst_qsgtextedit::color() void tst_qsgtextedit::textMargin() { - for(qreal i=0; i<=10; i+=0.3){ + for (qreal i=0; i<=10; i+=0.3) { QString componentStr = "import QtQuick 2.0\nTextEdit { textMargin: " + QString::number(i) + "; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); @@ -832,7 +832,7 @@ void tst_qsgtextedit::selection() //Test selection follows cursor - for(int i=0; i<= testStr.size(); i++) { + for (int i=0; i<= testStr.size(); i++) { textEditObject->setCursorPosition(i); QCOMPARE(textEditObject->cursorPosition(), i); QCOMPARE(textEditObject->selectionStart(), i); @@ -860,11 +860,11 @@ void tst_qsgtextedit::selection() QVERIFY(textEditObject->selectedText().isNull()); //Test selection - for(int i=0; i<= testStr.size(); i++) { + for (int i=0; i<= testStr.size(); i++) { textEditObject->select(0,i); QCOMPARE(testStr.mid(0,i), textEditObject->selectedText()); } - for(int i=0; i<= testStr.size(); i++) { + for (int i=0; i<= testStr.size(); i++) { textEditObject->select(i,testStr.size()); QCOMPARE(testStr.mid(i,testStr.size()-i), textEditObject->selectedText()); } @@ -1591,7 +1591,7 @@ void tst_qsgtextedit::cursorDelegate() QVERIFY(delegateObject); QCOMPARE(delegateObject->property("localProperty").toString(), QString("Hello")); //Test Delegate gets moved - for(int i=0; i<= textEditObject->text().length(); i++){ + for (int i=0; i<= textEditObject->text().length(); i++) { textEditObject->setCursorPosition(i); QCOMPARE(textEditObject->cursorRectangle().x(), qRound(delegateObject->x())); QCOMPARE(textEditObject->cursorRectangle().y(), qRound(delegateObject->y())); @@ -1899,7 +1899,7 @@ void tst_qsgtextedit::readOnly() QTRY_VERIFY(edit->hasActiveFocus() == true); QVERIFY(edit->isReadOnly() == true); QString initial = edit->text(); - for(int k=Qt::Key_0; k<=Qt::Key_Z; k++) + for (int k=Qt::Key_0; k<=Qt::Key_Z; k++) simulateKey(&canvas, k); simulateKey(&canvas, Qt::Key_Return); simulateKey(&canvas, Qt::Key_Space); diff --git a/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp b/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp index 5cc0f8ee62..618915134c 100644 --- a/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp +++ b/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp @@ -276,7 +276,7 @@ void tst_qsgtextinput::width() void tst_qsgtextinput::font() { //test size, then bold, then italic, then family - { + { QString componentStr = "import QtQuick 2.0\nTextInput { font.pointSize: 40; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); @@ -290,7 +290,7 @@ void tst_qsgtextinput::font() delete textinputObject; } - { + { QString componentStr = "import QtQuick 2.0\nTextInput { font.bold: true; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); @@ -303,7 +303,7 @@ void tst_qsgtextinput::font() delete textinputObject; } - { + { QString componentStr = "import QtQuick 2.0\nTextInput { font.italic: true; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); @@ -315,8 +315,8 @@ void tst_qsgtextinput::font() delete textinputObject; } - - { + + { QString componentStr = "import QtQuick 2.0\nTextInput { font.family: \"Helvetica\"; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); @@ -330,7 +330,7 @@ void tst_qsgtextinput::font() delete textinputObject; } - { + { QString componentStr = "import QtQuick 2.0\nTextInput { font.family: \"\"; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); @@ -347,7 +347,7 @@ void tst_qsgtextinput::color() { //test color for (int i = 0; i < colorStrings.size(); i++) - { + { QString componentStr = "import QtQuick 2.0\nTextInput { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); @@ -373,7 +373,7 @@ void tst_qsgtextinput::color() //test selected text color for (int i = 0; i < colorStrings.size(); i++) - { + { QString componentStr = "import QtQuick 2.0\nTextInput { selectedTextColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); @@ -412,7 +412,7 @@ void tst_qsgtextinput::selection() //Test selection follows cursor - for(int i=0; i<= testStr.size(); i++) { + for (int i=0; i<= testStr.size(); i++) { textinputObject->setCursorPosition(i); QCOMPARE(textinputObject->cursorPosition(), i); QCOMPARE(textinputObject->selectionStart(), i); @@ -440,11 +440,11 @@ void tst_qsgtextinput::selection() QVERIFY(textinputObject->selectedText().isNull()); //Test selection - for(int i=0; i<= testStr.size(); i++) { + for (int i=0; i<= testStr.size(); i++) { textinputObject->select(0,i); QCOMPARE(testStr.mid(0,i), textinputObject->selectedText()); } - for(int i=0; i<= testStr.size(); i++) { + for (int i=0; i<= testStr.size(); i++) { textinputObject->select(i,testStr.size()); QCOMPARE(testStr.mid(i,testStr.size()-i), textinputObject->selectedText()); } @@ -1324,7 +1324,7 @@ void tst_qsgtextinput::maxLength() QVERIFY(textinputObject != 0); QVERIFY(textinputObject->text().isEmpty()); QVERIFY(textinputObject->maxLength() == 10); - foreach(const QString &str, standard){ + foreach (const QString &str, standard) { QVERIFY(textinputObject->text().length() <= 10); textinputObject->setText(str); QVERIFY(textinputObject->text().length() <= 10); @@ -1332,7 +1332,7 @@ void tst_qsgtextinput::maxLength() textinputObject->setText(""); QTRY_VERIFY(textinputObject->hasActiveFocus() == true); - for(int i=0; i<20; i++){ + for (int i=0; i<20; i++) { QTRY_COMPARE(textinputObject->text().length(), qMin(i,10)); //simulateKey(&canvas, Qt::Key_A); QTest::keyPress(&canvas, Qt::Key_A); @@ -1354,7 +1354,7 @@ void tst_qsgtextinput::masks() QTRY_VERIFY(textinputObject->hasActiveFocus() == true); QVERIFY(textinputObject->text().length() == 0); QCOMPARE(textinputObject->inputMask(), QString("HHHHhhhh; ")); - for(int i=0; i<10; i++){ + for (int i=0; i<10; i++) { QTRY_COMPARE(qMin(i,8), textinputObject->text().length()); QCOMPARE(i>=4, textinputObject->hasAcceptableInput()); //simulateKey(&canvas, Qt::Key_A); @@ -1745,7 +1745,7 @@ void tst_qsgtextinput::cursorDelegate() QVERIFY(delegateObject); QCOMPARE(delegateObject->property("localProperty").toString(), QString("Hello")); //Test Delegate gets moved - for(int i=0; i<= textInputObject->text().length(); i++){ + for (int i=0; i<= textInputObject->text().length(); i++) { textInputObject->setCursorPosition(i); QCOMPARE(textInputObject->cursorRectangle().x(), qRound(delegateObject->x())); QCOMPARE(textInputObject->cursorRectangle().y(), qRound(delegateObject->y())); @@ -1890,7 +1890,7 @@ void tst_qsgtextinput::readOnly() QTRY_VERIFY(input->hasActiveFocus() == true); QVERIFY(input->isReadOnly() == true); QString initial = input->text(); - for(int k=Qt::Key_0; k<=Qt::Key_Z; k++) + for (int k=Qt::Key_0; k<=Qt::Key_Z; k++) simulateKey(&canvas, k); simulateKey(&canvas, Qt::Key_Return); simulateKey(&canvas, Qt::Key_Space); diff --git a/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp b/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp index 33558fe8a2..d9fec3f8b3 100644 --- a/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp +++ b/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp @@ -1531,7 +1531,7 @@ T *tst_qsgvisualdatamodel::findItem(QSGItem *parent, const QString &objectName, //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); - if(!item) + if (!item) continue; //qDebug() << "try" << item; if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { |