Fix coding style issues
authorKent Hansen <kent.hansen@nokia.com>
Mon, 17 Oct 2011 11:03:58 +0000 (13:03 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 17 Oct 2011 11:59:29 +0000 (13:59 +0200)
Avoid Qt Sanity Bot noise when these files are moved.

Change-Id: I714e949837909883fe7e387ae336d2ffc4a1912b
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
39 files changed:
src/declarative/items/context2d/qsgcontext2d.cpp
src/declarative/items/qsganchors.cpp
src/declarative/items/qsganimatedimage.cpp
src/declarative/items/qsganimation.cpp
src/declarative/items/qsgcanvas.cpp
src/declarative/items/qsgflickable.cpp
src/declarative/items/qsgimage.cpp
src/declarative/items/qsgitem.cpp
src/declarative/items/qsgitem_p.h
src/declarative/items/qsgmousearea.cpp
src/declarative/items/qsgpathview.cpp
src/declarative/items/qsgpincharea.cpp
src/declarative/items/qsgpositioners.cpp
src/declarative/items/qsgscalegrid.cpp
src/declarative/items/qsgshadereffect.cpp
src/declarative/items/qsgshadereffect_p.h
src/declarative/items/qsgshadereffectsource.cpp
src/declarative/items/qsgspriteimage.cpp
src/declarative/items/qsgtext.cpp
src/declarative/items/qsgtextedit.cpp
src/declarative/items/qsgtextedit_p.h
src/declarative/items/qsgtextinput.cpp
src/declarative/items/qsgview.cpp
tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp
tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp
tests/auto/declarative/qsggridview/tst_qsggridview.cpp
tests/auto/declarative/qsgimage/tst_qsgimage.cpp
tests/auto/declarative/qsgitem/tst_qsgitem.cpp
tests/auto/declarative/qsgitem2/tst_qsgitem.cpp
tests/auto/declarative/qsglistview/tst_qsglistview.cpp
tests/auto/declarative/qsgloader/tst_qsgloader.cpp
tests/auto/declarative/qsgpathview/qsgpathview.pro
tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp
tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp
tests/auto/declarative/qsgrepeater/tst_qsgrepeater.cpp
tests/auto/declarative/qsgtext/tst_qsgtext.cpp
tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp
tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp
tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp

index e75713d..5944a02 100644 (file)
@@ -1648,7 +1648,7 @@ static v8::Handle<v8::Value> ctx2d_strokeRect(const v8::Arguments &args)
 
         r->context->buffer()->strokeRect(x, y, w, h);
     }
-    
+
     return args.This();
 }
 
@@ -1837,7 +1837,7 @@ static v8::Handle<v8::Value> ctx2d_clip(const v8::Arguments &args)
     else
         r->context->state.clipPath = clipPath;
     r->context->buffer()->clip(r->context->state.clipPath);
-    
+
     return args.This();
 }
 
@@ -2626,7 +2626,7 @@ static v8::Handle<v8::Value> ctx2d_imageData_filter(const v8::Arguments &args)
 
     if (args.Length() >= 1) {
         int filterFlag = args[0]->IntegerValue();
-        switch(filterFlag) {
+        switch (filterFlag) {
         case QSGCanvasItem::Mono :
         {
             r->image = r->image.convertToFormat(QImage::Format_Mono).convertToFormat(QImage::Format_ARGB32_Premultiplied);
index 6d5b5a3..67ca031 100644 (file)
@@ -76,7 +76,7 @@ static qreal vcenter(QSGItem *item)
 static qreal position(QSGItem *item, QSGAnchorLine::AnchorLine anchorLine)
 {
     qreal ret = 0.0;
-    switch(anchorLine) {
+    switch (anchorLine) {
     case QSGAnchorLine::Left:
         ret = item->x();
         break;
@@ -109,7 +109,7 @@ static qreal position(QSGItem *item, QSGAnchorLine::AnchorLine anchorLine)
 static qreal adjustedPosition(QSGItem *item, QSGAnchorLine::AnchorLine anchorLine)
 {
     qreal ret = 0.0;
-    switch(anchorLine) {
+    switch (anchorLine) {
     case QSGAnchorLine::Left:
         ret = 0.0;
         break;
@@ -253,7 +253,7 @@ void QSGAnchorsPrivate::addDepend(QSGItem *item)
 {
     if (!item)
         return;
-    
+
     QSGItemPrivate *p = QSGItemPrivate::get(item);
     p->addItemChangeListener(this, QSGItemPrivate::Geometry);
 }
@@ -887,7 +887,7 @@ void QSGAnchors::setLeftMargin(qreal offset)
     if (d->leftMargin == offset)
         return;
     d->leftMargin = offset;
-    if(d->fill)
+    if (d->fill)
         d->fillChanged();
     else
         d->updateHorizontalAnchors();
@@ -906,7 +906,7 @@ void QSGAnchors::setRightMargin(qreal offset)
     if (d->rightMargin == offset)
         return;
     d->rightMargin = offset;
-    if(d->fill)
+    if (d->fill)
         d->fillChanged();
     else
         d->updateHorizontalAnchors();
@@ -925,13 +925,13 @@ void QSGAnchors::setMargins(qreal offset)
     if (d->margins == offset)
         return;
     //###Is it significantly faster to set them directly so we can call fillChanged only once?
-    if(!d->rightMargin || d->rightMargin == d->margins)
+    if (!d->rightMargin || d->rightMargin == d->margins)
         setRightMargin(offset);
-    if(!d->leftMargin || d->leftMargin == d->margins)
+    if (!d->leftMargin || d->leftMargin == d->margins)
         setLeftMargin(offset);
-    if(!d->topMargin || d->topMargin == d->margins)
+    if (!d->topMargin || d->topMargin == d->margins)
         setTopMargin(offset);
-    if(!d->bottomMargin || d->bottomMargin == d->margins)
+    if (!d->bottomMargin || d->bottomMargin == d->margins)
         setBottomMargin(offset);
     d->margins = offset;
     emit marginsChanged();
@@ -950,7 +950,7 @@ void QSGAnchors::setHorizontalCenterOffset(qreal offset)
     if (d->hCenterOffset == offset)
         return;
     d->hCenterOffset = offset;
-    if(d->centerIn)
+    if (d->centerIn)
         d->centerInChanged();
     else
         d->updateHorizontalAnchors();
@@ -969,7 +969,7 @@ void QSGAnchors::setTopMargin(qreal offset)
     if (d->topMargin == offset)
         return;
     d->topMargin = offset;
-    if(d->fill)
+    if (d->fill)
         d->fillChanged();
     else
         d->updateVerticalAnchors();
@@ -988,7 +988,7 @@ void QSGAnchors::setBottomMargin(qreal offset)
     if (d->bottomMargin == offset)
         return;
     d->bottomMargin = offset;
-    if(d->fill)
+    if (d->fill)
         d->fillChanged();
     else
         d->updateVerticalAnchors();
@@ -1007,7 +1007,7 @@ void QSGAnchors::setVerticalCenterOffset(qreal offset)
     if (d->vCenterOffset == offset)
         return;
     d->vCenterOffset = offset;
-    if(d->centerIn)
+    if (d->centerIn)
         d->centerInChanged();
     else
         d->updateVerticalAnchors();
index e4bba51..93e0284 100644 (file)
@@ -144,7 +144,7 @@ QSGAnimatedImage::~QSGAnimatedImage()
 bool QSGAnimatedImage::isPaused() const
 {
     Q_D(const QSGAnimatedImage);
-    if(!d->_movie)
+    if (!d->_movie)
         return false;
     return d->_movie->state()==QMovie::Paused;
 }
@@ -152,10 +152,10 @@ bool QSGAnimatedImage::isPaused() const
 void QSGAnimatedImage::setPaused(bool pause)
 {
     Q_D(QSGAnimatedImage);
-    if(pause == d->paused)
+    if (pause == d->paused)
         return;
     d->paused = pause;
-    if(!d->_movie)
+    if (!d->_movie)
         return;
     d->_movie->setPaused(pause);
 }
@@ -179,7 +179,7 @@ bool QSGAnimatedImage::isPlaying() const
 void QSGAnimatedImage::setPlaying(bool play)
 {
     Q_D(QSGAnimatedImage);
-    if(play == d->playing)
+    if (play == d->playing)
         return;
     d->playing = play;
     if (!d->_movie)
@@ -282,11 +282,11 @@ void QSGAnimatedImage::load()
             connect(d->_movie, SIGNAL(frameChanged(int)),
                     this, SLOT(movieUpdate()));
             d->_movie->setCacheMode(QMovie::CacheAll);
-            if(d->playing)
+            if (d->playing)
                 d->_movie->start();
             else
                 d->_movie->jumpToFrame(0);
-            if(d->paused)
+            if (d->paused)
                 d->_movie->setPaused(true);
             d->setPixmap(d->_movie->currentPixmap());
             d->status = Ready;
@@ -347,13 +347,13 @@ void QSGAnimatedImage::movieRequestFinished()
     connect(d->_movie, SIGNAL(frameChanged(int)),
             this, SLOT(movieUpdate()));
     d->_movie->setCacheMode(QMovie::CacheAll);
-    if(d->playing)
+    if (d->playing)
         d->_movie->start();
     if (d->paused || !d->playing) {
         d->_movie->jumpToFrame(d->preset_currentframe);
         d->preset_currentframe = 0;
     }
-    if(d->paused)
+    if (d->paused)
         d->_movie->setPaused(true);
     d->setPixmap(d->_movie->currentPixmap());
     d->status = Ready;
@@ -370,11 +370,11 @@ void QSGAnimatedImage::movieUpdate()
 void QSGAnimatedImage::playingStatusChanged()
 {
     Q_D(QSGAnimatedImage);
-    if((d->_movie->state() != QMovie::NotRunning) != d->playing){
+    if ((d->_movie->state() != QMovie::NotRunning) != d->playing) {
         d->playing = (d->_movie->state() != QMovie::NotRunning);
         emit playingChanged();
     }
-    if((d->_movie->state() == QMovie::Paused) != d->paused){
+    if ((d->_movie->state() == QMovie::Paused) != d->paused) {
         d->playing = (d->_movie->state() == QMovie::Paused);
         emit pausedChanged();
     }
index b0dc820..81c8391 100644 (file)
@@ -129,7 +129,7 @@ void QSGParentAnimation::setVia(QSGItem *via)
 //### mirrors same-named function in QSGItem
 QPointF QSGParentAnimationPrivate::computeTransformOrigin(QSGItem::TransformOrigin origin, qreal width, qreal height) const
 {
-    switch(origin) {
+    switch (origin) {
     default:
     case QSGItem::TopLeft:
         return QPointF(0, 0);
index 9efd17a..879beb9 100644 (file)
@@ -992,10 +992,9 @@ bool QSGCanvasPrivate::deliverMouseEvent(QMouseEvent *event)
 
     lastMousePosition = event->windowPos();
 
-    if (!mouseGrabberItem && 
+    if (!mouseGrabberItem &&
          event->type() == QEvent::MouseButtonPress &&
          (event->button() & event->buttons()) == event->buttons()) {
-        
         return deliverInitialMousePressEvent(rootItem, event);
     }
 
@@ -1542,7 +1541,7 @@ bool QSGCanvas::sendEvent(QSGItem *item, QEvent *e)
     case QEvent::MouseButtonRelease:
     case QEvent::MouseButtonDblClick:
     case QEvent::MouseMove:
-        // XXX todo - should sendEvent be doing this?  how does it relate to forwarded events? 
+        // XXX todo - should sendEvent be doing this?  how does it relate to forwarded events?
         {
             QMouseEvent *se = static_cast<QMouseEvent *>(e);
             if (!d->sendFilteredMouseEvent(item->parentItem(), item, se)) {
@@ -1929,7 +1928,7 @@ QImage QSGCanvas::grabFrameBuffer()
 }
 
 /*!
-    Returns an incubation controller that splices incubation between frames 
+    Returns an incubation controller that splices incubation between frames
     for this canvas.  QSGView automatically installs this controller for you.
 
     The controller is owned by the canvas and will be destroyed when the canvas
index 09bb8e3..4871a43 100644 (file)
@@ -943,7 +943,7 @@ void QSGFlickablePrivate::handleMouseReleaseEvent(QMouseEvent *event)
 
     // if we drag then pause before release we should not cause a flick.
     qint64 elapsed = QSGItemPrivate::elapsed(lastPosTime);
-     
+
     vData.updateVelocity();
     hData.updateVelocity();
 
@@ -1655,7 +1655,7 @@ bool QSGFlickable::sendMouseEvent(QMouseEvent *event)
 
         mouseEvent.setAccepted(false);
 
-        switch(mouseEvent.type()) {
+        switch (mouseEvent.type()) {
         case QEvent::MouseMove:
             d->handleMouseMoveEvent(&mouseEvent);
             break;
index a23d9ed..9461de4 100644 (file)
@@ -489,7 +489,7 @@ void QSGImage::updatePaintedGeometry()
         if (widthScale <= heightScale) {
             d->paintedWidth = w;
             d->paintedHeight = widthScale * qreal(d->pix.height());
-        } else if(heightScale < widthScale) {
+        } else if (heightScale < widthScale) {
             d->paintedWidth = heightScale * qreal(d->pix.width());
             d->paintedHeight = h;
         }
@@ -510,7 +510,7 @@ void QSGImage::updatePaintedGeometry()
         qreal heightScale = height() / qreal(d->pix.height());
         if (widthScale < heightScale) {
             widthScale = heightScale;
-        } else if(heightScale < widthScale) {
+        } else if (heightScale < widthScale) {
             heightScale = widthScale;
         }
 
@@ -574,7 +574,7 @@ QSGNode *QSGImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
     }
 
     QSGImageNode *node = static_cast<QSGImageNode *>(oldNode);
-    if (!node) { 
+    if (!node) {
         d->pixmapChanged = true;
         node = d->sceneGraphContext()->createImageNode();
         node->setTexture(texture);
index 8ede2a4..bdea19b 100644 (file)
@@ -604,7 +604,7 @@ void QSGKeyNavigationAttached::setDown(QSGItem *i)
     d->downSet = true;
     QSGKeyNavigationAttached* other =
             qobject_cast<QSGKeyNavigationAttached*>(qmlAttachedPropertiesObject<QSGKeyNavigationAttached>(i));
-    if(other && !other->d_func()->upSet){
+    if (other && !other->d_func()->upSet) {
         other->d_func()->up = qobject_cast<QSGItem*>(parent());
         emit other->upChanged();
     }
@@ -626,7 +626,7 @@ void QSGKeyNavigationAttached::setTab(QSGItem *i)
     d->tabSet = true;
     QSGKeyNavigationAttached* other =
             qobject_cast<QSGKeyNavigationAttached*>(qmlAttachedPropertiesObject<QSGKeyNavigationAttached>(i));
-    if(other && !other->d_func()->backtabSet){
+    if (other && !other->d_func()->backtabSet) {
         other->d_func()->backtab = qobject_cast<QSGItem*>(parent());
         emit other->backtabChanged();
     }
@@ -648,7 +648,7 @@ void QSGKeyNavigationAttached::setBacktab(QSGItem *i)
     d->backtabSet = true;
     QSGKeyNavigationAttached* other =
             qobject_cast<QSGKeyNavigationAttached*>(qmlAttachedPropertiesObject<QSGKeyNavigationAttached>(i));
-    if(other && !other->d_func()->tabSet){
+    if (other && !other->d_func()->tabSet) {
         other->d_func()->tab = qobject_cast<QSGItem*>(parent());
         emit other->tabChanged();
     }
@@ -695,7 +695,7 @@ void QSGKeyNavigationAttached::keyPressed(QKeyEvent *event, bool post)
     }
 
     bool mirror = false;
-    switch(event->key()) {
+    switch (event->key()) {
     case Qt::Key_Left: {
         if (QSGItem *parentItem = qobject_cast<QSGItem*>(parent()))
             mirror = QSGItemPrivate::get(parentItem)->effectiveLayoutMirror;
@@ -758,7 +758,7 @@ void QSGKeyNavigationAttached::keyReleased(QKeyEvent *event, bool post)
     }
 
     bool mirror = false;
-    switch(event->key()) {
+    switch (event->key()) {
     case Qt::Key_Left:
         if (QSGItem *parentItem = qobject_cast<QSGItem*>(parent()))
             mirror = QSGItemPrivate::get(parentItem)->effectiveLayoutMirror;
@@ -2697,7 +2697,7 @@ QSGItemPrivate::AnchorLines *QSGItemPrivate::anchorLines() const
 void QSGItemPrivate::siblingOrderChanged()
 {
     Q_Q(QSGItem);
-    for(int ii = 0; ii < changeListeners.count(); ++ii) {
+    for (int ii = 0; ii < changeListeners.count(); ++ii) {
         const QSGItemPrivate::ChangeListener &change = changeListeners.at(ii);
         if (change.types & QSGItemPrivate::SiblingOrder) {
             change.listener->itemSiblingOrderChanged(q);
@@ -2758,7 +2758,7 @@ void QSGItem::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeomet
     if (d->_anchors)
         QSGAnchorsPrivate::get(d->_anchors)->updateMe();
 
-    for(int ii = 0; ii < d->changeListeners.count(); ++ii) {
+    for (int ii = 0; ii < d->changeListeners.count(); ++ii) {
         const QSGItemPrivate::ChangeListener &change = d->changeListeners.at(ii);
         if (change.types & QSGItemPrivate::Geometry)
             change.listener->itemGeometryChanged(this, newGeometry, oldGeometry);
@@ -3022,7 +3022,7 @@ void QSGItem::setBaselineOffset(qreal offset)
 
     d->baselineOffset = offset;
 
-    for(int ii = 0; ii < d->changeListeners.count(); ++ii) {
+    for (int ii = 0; ii < d->changeListeners.count(); ++ii) {
         const QSGItemPrivate::ChangeListener &change = d->changeListeners.at(ii);
         if (change.types & QSGItemPrivate::Geometry) {
             QSGAnchorsPrivate *anchor = change.listener->anchorPrivate();
@@ -3272,7 +3272,7 @@ QSGItemPrivate::AnchorLines::AnchorLines(QSGItem *q)
 
 QPointF QSGItemPrivate::computeTransformOrigin() const
 {
-    switch(origin) {
+    switch (origin) {
     default:
     case QSGItem::TopLeft:
         return QPointF(0, 0);
@@ -3377,7 +3377,7 @@ void QSGItemPrivate::deliverMouseEvent(QMouseEvent *e)
 
     Q_ASSERT(e->isAccepted());
 
-    switch(e->type()) {
+    switch (e->type()) {
     default:
         Q_ASSERT(!"Unknown event type");
     case QEvent::MouseMove:
@@ -3410,7 +3410,7 @@ void QSGItemPrivate::deliverTouchEvent(QTouchEvent *e)
 void QSGItemPrivate::deliverHoverEvent(QHoverEvent *e)
 {
     Q_Q(QSGItem);
-    switch(e->type()) {
+    switch (e->type()) {
     default:
         Q_ASSERT(!"Unknown event type");
     case QEvent::HoverEnter:
@@ -3775,7 +3775,7 @@ void QSGItemPrivate::setEffectiveVisibleRecur(bool newEffectiveVisible)
     for (int ii = 0; ii < childItems.count(); ++ii)
         QSGItemPrivate::get(childItems.at(ii))->setEffectiveVisibleRecur(newEffectiveVisible);
 
-    for(int ii = 0; ii < changeListeners.count(); ++ii) {
+    for (int ii = 0; ii < changeListeners.count(); ++ii) {
         const QSGItemPrivate::ChangeListener &change = changeListeners.at(ii);
         if (change.types & QSGItemPrivate::Visibility)
             change.listener->itemVisibilityChanged(q);
@@ -3929,12 +3929,12 @@ void QSGItemPrivate::derefFromEffectItem(bool unhide)
 void QSGItemPrivate::itemChange(QSGItem::ItemChange change, const QSGItem::ItemChangeData &data)
 {
     Q_Q(QSGItem);
-    switch(change) {
+    switch (change) {
     case QSGItem::ItemChildAddedChange:
         q->itemChange(change, data);
         if (_contents && componentComplete)
             _contents->childAdded(data.item);
-        for(int ii = 0; ii < changeListeners.count(); ++ii) {
+        for (int ii = 0; ii < changeListeners.count(); ++ii) {
             const QSGItemPrivate::ChangeListener &change = changeListeners.at(ii);
             if (change.types & QSGItemPrivate::Children) {
                 change.listener->itemChildAdded(q, data.item);
@@ -3945,7 +3945,7 @@ void QSGItemPrivate::itemChange(QSGItem::ItemChange change, const QSGItem::ItemC
         q->itemChange(change, data);
         if (_contents && componentComplete)
             _contents->childRemoved(data.item);
-        for(int ii = 0; ii < changeListeners.count(); ++ii) {
+        for (int ii = 0; ii < changeListeners.count(); ++ii) {
             const QSGItemPrivate::ChangeListener &change = changeListeners.at(ii);
             if (change.types & QSGItemPrivate::Children) {
                 change.listener->itemChildRemoved(q, data.item);
@@ -3957,7 +3957,7 @@ void QSGItemPrivate::itemChange(QSGItem::ItemChange change, const QSGItem::ItemC
         break;
     case QSGItem::ItemVisibleHasChanged:
         q->itemChange(change, data);
-        for(int ii = 0; ii < changeListeners.count(); ++ii) {
+        for (int ii = 0; ii < changeListeners.count(); ++ii) {
             const QSGItemPrivate::ChangeListener &change = changeListeners.at(ii);
             if (change.types & QSGItemPrivate::Visibility) {
                 change.listener->itemVisibilityChanged(q);
@@ -3966,7 +3966,7 @@ void QSGItemPrivate::itemChange(QSGItem::ItemChange change, const QSGItem::ItemC
         break;
     case QSGItem::ItemParentHasChanged:
         q->itemChange(change, data);
-        for(int ii = 0; ii < changeListeners.count(); ++ii) {
+        for (int ii = 0; ii < changeListeners.count(); ++ii) {
             const QSGItemPrivate::ChangeListener &change = changeListeners.at(ii);
             if (change.types & QSGItemPrivate::Parent) {
                 change.listener->itemParentChanged(q, data.item);
@@ -3975,7 +3975,7 @@ void QSGItemPrivate::itemChange(QSGItem::ItemChange change, const QSGItem::ItemC
         break;
     case QSGItem::ItemOpacityHasChanged:
         q->itemChange(change, data);
-        for(int ii = 0; ii < changeListeners.count(); ++ii) {
+        for (int ii = 0; ii < changeListeners.count(); ++ii) {
             const QSGItemPrivate::ChangeListener &change = changeListeners.at(ii);
             if (change.types & QSGItemPrivate::Opacity) {
                 change.listener->itemOpacityChanged(q);
@@ -3987,7 +3987,7 @@ void QSGItemPrivate::itemChange(QSGItem::ItemChange change, const QSGItem::ItemC
         break;
     case QSGItem::ItemRotationHasChanged:
         q->itemChange(change, data);
-        for(int ii = 0; ii < changeListeners.count(); ++ii) {
+        for (int ii = 0; ii < changeListeners.count(); ++ii) {
             const QSGItemPrivate::ChangeListener &change = changeListeners.at(ii);
             if (change.types & QSGItemPrivate::Rotation) {
                 change.listener->itemRotationChanged(q);
@@ -4468,7 +4468,7 @@ void QSGItem::setAcceptHoverEvents(bool enabled)
     d->hoverEnabled = enabled;
 }
 
-void QSGItem::grabMouse() 
+void QSGItem::grabMouse()
 {
     Q_D(QSGItem);
     if (!d->canvas)
index 02c3f87..c0ed1db 100644 (file)
@@ -670,7 +670,7 @@ private:
 };
 
 QSGTransformNode *QSGItemPrivate::itemNode()
-{ 
+{
     if (!itemNodeInstance) {
         itemNodeInstance = createTransformNode();
         itemNodeInstance->setFlag(QSGNode::OwnedByParent, false);
@@ -679,7 +679,7 @@ QSGTransformNode *QSGItemPrivate::itemNode()
         itemNodeInstance->description = QString::fromLatin1("QSGItem(%1)").arg(QString::fromLatin1(q->metaObject()->className()));
 #endif
     }
-    return itemNodeInstance; 
+    return itemNodeInstance;
 }
 
 QSGNode *QSGItemPrivate::childContainerNode()
index de7913c..4d14eaa 100644 (file)
@@ -263,7 +263,7 @@ bool QSGMouseAreaPrivate::propagateHelper(QSGMouseEvent *ev, QSGItem *item,const
 
     QSGMouseArea* ma = qobject_cast<QSGMouseArea*>(item);
     if (ma && ma != q && itemPrivate->acceptedMouseButtons & ev->button()) {
-        switch(sig){
+        switch (sig) {
         case Click:
             if (!ma->d_func()->isClickConnected())
                 return false;
@@ -282,7 +282,7 @@ bool QSGMouseAreaPrivate::propagateHelper(QSGMouseEvent *ev, QSGItem *item,const
             ev->setX(p.x());
             ev->setY(p.y());
             ev->setAccepted(true);//It is connected, they have to explicitly ignore to let it slide
-            switch(sig){
+            switch (sig) {
             case Click: emit ma->clicked(ev); break;
             case DoubleClick: emit ma->doubleClicked(ev); break;
             case PressAndHold: emit ma->pressAndHold(ev); break;
index 590fa93..5e2ad84 100644 (file)
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
 inline qreal qmlMod(qreal x, qreal y)
 {
 #ifdef QT_USE_MATH_H_FLOATS
-    if(sizeof(qreal) == sizeof(float))
+    if (sizeof(qreal) == sizeof(float))
         return fmodf(float(x), float(y));
     else
 #endif
@@ -115,7 +115,7 @@ QSGItem *QSGPathViewPrivate::getItem(int modelIndex, bool onPath)
         if (!attType) {
             // pre-create one metatype to share with all attached objects
             attType = new QDeclarativeOpenMetaObjectType(&QSGPathViewAttached::staticMetaObject, qmlEngine(q));
-            foreach(const QString &attr, path->attributes())
+            foreach (const QString &attr, path->attributes())
                 attType->createProperty(attr.toUtf8());
         }
         qPathViewAttachedType = attType;
@@ -322,7 +322,7 @@ void QSGPathViewPrivate::updateItem(QSGItem *item, qreal percent)
         if (qFuzzyCompare(att->m_percent, percent))
             return;
         att->m_percent = percent;
-        foreach(const QString &attr, path->attributes())
+        foreach (const QString &attr, path->attributes())
             att->setValue(attr.toUtf8(), path->attributeAt(attr, percent));
     }
     QPointF pf = path->pointAt(percent);
@@ -1262,7 +1262,7 @@ bool QSGPathView::sendMouseEvent(QMouseEvent *event)
                                event->button(), event->buttons(), event->modifiers());
         mouseEvent.setAccepted(false);
 
-        switch(mouseEvent.type()) {
+        switch (mouseEvent.type()) {
         case QEvent::MouseMove:
             d->handleMouseMoveEvent(&mouseEvent);
             break;
@@ -1581,7 +1581,7 @@ void QSGPathView::createdItem(int index, QSGItem *item)
         if (!d->attType) {
             // pre-create one metatype to share with all attached objects
             d->attType = new QDeclarativeOpenMetaObjectType(&QSGPathViewAttached::staticMetaObject, qmlEngine(this));
-            foreach(const QString &attr, d->path->attributes())
+            foreach (const QString &attr, d->path->attributes())
                 d->attType->createProperty(attr.toUtf8());
         }
         qPathViewAttachedType = d->attType;
index d02477e..2dbe683 100644 (file)
@@ -516,7 +516,7 @@ bool QSGPinchArea::sendMouseEvent(QMouseEvent *event)
                                event->button(), event->buttons(), event->modifiers());
         mouseEvent.setAccepted(false);
 
-        switch(mouseEvent.type()) {
+        switch (mouseEvent.type()) {
         case QEvent::MouseMove:
             mouseMoveEvent(&mouseEvent);
             break;
index 0401494..eaca210 100644 (file)
@@ -252,7 +252,7 @@ void QSGBasePositioner::prePositioning()
 void QSGBasePositioner::positionX(int x, const PositionedItem &target)
 {
     Q_D(QSGBasePositioner);
-    if(d->type == Horizontal || d->type == Both){
+    if (d->type == Horizontal || d->type == Both) {
         if (target.isNew) {
             if (!d->addTransition || !d->addTransition->enabled())
                 target.item->setX(x);
@@ -270,7 +270,7 @@ void QSGBasePositioner::positionX(int x, const PositionedItem &target)
 void QSGBasePositioner::positionY(int y, const PositionedItem &target)
 {
     Q_D(QSGBasePositioner);
-    if(d->type == Vertical || d->type == Both){
+    if (d->type == Vertical || d->type == Both) {
         if (target.isNew) {
             if (!d->addTransition || !d->addTransition->enabled())
                 target.item->setY(y);
@@ -541,7 +541,7 @@ void QSGColumn::doPositioning(QSizeF *contentSize)
         if (!child.item || !child.isVisible)
             continue;
 
-        if(child.item->y() != voffset)
+        if (child.item->y() != voffset)
             positionY(voffset, child);
 
         contentSize->setWidth(qMax(contentSize->width(), child.item->width()));
@@ -1081,8 +1081,8 @@ void QSGGrid::doPositioning(QSizeF *contentSize)
     //Is allocating the extra QPODVector too much overhead?
     QPODVector<PositionedItem, 8> visibleItems;//we aren't concerned with invisible items
     visibleItems.reserve(positionedItems.count());
-    for(int i=0; i<positionedItems.count(); i++)
-        if(positionedItems[i].item && positionedItems[i].isVisible)
+    for (int i=0; i<positionedItems.count(); i++)
+        if (positionedItems[i].item && positionedItems[i].isVisible)
             visibleItems.append(positionedItems[i]);
 
     int numVisible = visibleItems.count();
@@ -1095,7 +1095,7 @@ void QSGGrid::doPositioning(QSizeF *contentSize)
         c = (numVisible+(m_rows-1))/m_rows;
     }
 
-    if(r==0 || c==0)
+    if (r==0 || c==0)
         return; //Nothing to do
 
     QList<int> maxColWidth;
index e1b76c4..1c4ce8d 100644 (file)
@@ -129,7 +129,7 @@ QSGGridScaledImage::QSGGridScaledImage(QIODevice *data)
     QString imgFile;
 
     QByteArray raw;
-    while(raw = data->readLine(), !raw.isEmpty()) {
+    while (raw = data->readLine(), !raw.isEmpty()) {
         QString line = QString::fromUtf8(raw.trimmed());
         if (line.isEmpty() || line.startsWith(QLatin1Char('#')))
             continue;
index 81adf8d..f84d023 100644 (file)
@@ -621,7 +621,7 @@ QSGNode *QSGShaderEffect::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData
         QVector<QPair<QByteArray, QSGTextureProvider *> > textures;
         const QVector<QPair<QByteArray, QSGTextureProvider *> > &oldTextures = material->textureProviders();
 
-        for (QSet<QByteArray>::const_iterator it = m_source.uniformNames.begin(); 
+        for (QSet<QByteArray>::const_iterator it = m_source.uniformNames.begin();
              it != m_source.uniformNames.end(); ++it) {
             values.append(qMakePair(*it, property(*it)));
         }
index a8c3f08..08af5f6 100644 (file)
@@ -89,7 +89,7 @@ public:
 
     QByteArray fragmentShader() const { return m_source.fragmentCode; }
     void setFragmentShader(const QByteArray &code);
-    
+
     QByteArray vertexShader() const { return m_source.vertexCode; }
     void setVertexShader(const QByteArray &code);
 
index 3b09838..4bbabe1 100644 (file)
@@ -419,7 +419,7 @@ QImage QSGShaderEffectTexture::toImage() const
        The complex element can be rendered once into the texture, which can
        then be animated freely without the need to render the complex element
        again every frame.
-    \o an opacity layer. 
+    \o an opacity layer.
        ShaderEffectSource allows you to apply an opacity to elements as a group
        rather than each element individually.
     \endlist
index 20544ad..f6cd35f 100644 (file)
@@ -278,9 +278,9 @@ QDeclarativeListProperty<QSGSprite> QSGSpriteImage::sprites()
 void QSGSpriteImage::createEngine()
 {
     //TODO: delay until component complete
-    if(m_spriteEngine)
+    if (m_spriteEngine)
         delete m_spriteEngine;
-    if(m_sprites.count())
+    if (m_sprites.count())
         m_spriteEngine = new QSGSpriteEngine(m_sprites, this);
     else
         m_spriteEngine = 0;
@@ -308,7 +308,7 @@ QSGGeometryNode* QSGSpriteImage::buildNode()
     m_material = new QSGSpriteMaterial();
 
     QImage image = m_spriteEngine->assembledImage();
-    if(image.isNull())
+    if (image.isNull())
         return 0;
     m_material->texture = sceneGraphEngine()->createTextureFromImage(image);
     m_material->texture->setFiltering(QSGTexture::Linear);
@@ -369,7 +369,7 @@ void QSGSpriteImage::reset()
 
 QSGNode *QSGSpriteImage::updatePaintNode(QSGNode *, UpdatePaintNodeData *)
 {
-    if(m_pleaseReset){
+    if (m_pleaseReset) {
         delete m_node;
         delete m_material;
 
@@ -380,7 +380,7 @@ QSGNode *QSGSpriteImage::updatePaintNode(QSGNode *, UpdatePaintNodeData *)
 
     prepareNextFrame();
 
-    if(m_running){
+    if (m_running) {
         update();
         if (m_node)
             m_node->markDirty(QSGNode::DirtyMaterial);
index 3c525c0..6c55e82 100644 (file)
@@ -756,7 +756,7 @@ void QSGTextPrivate::invalidateImageCache()
 {
     Q_Q(QSGText);
 
-    if(richTextAsImage || cacheAllTextAsImage || (qmlDisableDistanceField() && style != QSGText::Normal)){//If actually using the image cache
+    if (richTextAsImage || cacheAllTextAsImage || (qmlDisableDistanceField() && style != QSGText::Normal)) { // If actually using the image cache
         if (imageCacheDirty)
             return;
 
@@ -1064,8 +1064,8 @@ QSGText::~QSGText()
     \list
     \o Font.MixedCase - This is the normal text rendering option where no capitalization change is applied.
     \o Font.AllUppercase - This alters the text to be rendered in all uppercase type.
-    \o Font.AllLowercase        - This alters the text to be rendered in all lowercase type.
-    \o Font.SmallCaps -        This alters the text to be rendered in small-caps type.
+    \o Font.AllLowercase - This alters the text to be rendered in all lowercase type.
+    \o Font.SmallCaps - This alters the text to be rendered in small-caps type.
     \o Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.
     \endlist
 
index cec3bd8..bbc751f 100644 (file)
@@ -231,8 +231,8 @@ QString QSGTextEdit::text() const
     \list
     \o Font.MixedCase - This is the normal text rendering option where no capitalization change is applied.
     \o Font.AllUppercase - This alters the text to be rendered in all uppercase type.
-    \o Font.AllLowercase        - This alters the text to be rendered in all lowercase type.
-    \o Font.SmallCaps -        This alters the text to be rendered in small-caps type.
+    \o Font.AllLowercase - This alters the text to be rendered in all lowercase type.
+    \o Font.SmallCaps - This alters the text to be rendered in small-caps type.
     \o Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.
     \endlist
 
@@ -361,7 +361,7 @@ void QSGTextEdit::setFont(const QFont &font)
 
     if (oldFont != d->font) {
         d->document->setDefaultFont(d->font);
-        if(d->cursor){
+        if (d->cursor) {
             d->cursor->setHeight(QFontMetrics(d->font).height());
             moveCursorDelegate();
         }
@@ -866,8 +866,8 @@ QDeclarativeComponent* QSGTextEdit::cursorDelegate() const
 void QSGTextEdit::setCursorDelegate(QDeclarativeComponent* c)
 {
     Q_D(QSGTextEdit);
-    if(d->cursorComponent){
-        if(d->cursor){
+    if (d->cursorComponent) {
+        if (d->cursor) {
             d->control->setCursorWidth(-1);
             updateCursor();
             delete d->cursor;
@@ -875,10 +875,10 @@ void QSGTextEdit::setCursorDelegate(QDeclarativeComponent* c)
         }
     }
     d->cursorComponent = c;
-    if(c && c->isReady()){
+    if (c && c->isReady()) {
         loadCursorDelegate();
-    }else{
-        if(c)
+    } else {
+        if (c)
             connect(c, SIGNAL(statusChanged()),
                     this, SLOT(loadCursorDelegate()));
     }
@@ -889,12 +889,12 @@ void QSGTextEdit::setCursorDelegate(QDeclarativeComponent* c)
 void QSGTextEdit::loadCursorDelegate()
 {
     Q_D(QSGTextEdit);
-    if(d->cursorComponent->isLoading())
+    if (d->cursorComponent->isLoading())
         return;
     QDeclarativeContext *creationContext = d->cursorComponent->creationContext();
     QObject *object = d->cursorComponent->create(creationContext ? creationContext : qmlContext(this));
     d->cursor = qobject_cast<QSGItem*>(object);
-    if(d->cursor){
+    if (d->cursor) {
         d->control->setCursorWidth(0);
         updateCursor();
         QDeclarative_setParent_noEvent(d->cursor, this);
@@ -1665,7 +1665,7 @@ void QSGTextEdit::moveCursorDelegate()
     d->determineHorizontalAlignment();
     updateMicroFocus();
     emit cursorRectangleChanged();
-    if(!d->cursor)
+    if (!d->cursor)
         return;
     QRectF cursorRect = cursorRectangle();
     d->cursor->setX(cursorRect.x());
@@ -1683,20 +1683,20 @@ void QSGTextEditPrivate::updateSelection()
     cursor.setPosition(lastSelectionEnd, QTextCursor::KeepAnchor);
     cursor.endEditBlock();
     control->setTextCursor(cursor);
-    if(startChange)
+    if (startChange)
         q->selectionStartChanged();
-    if(endChange)
+    if (endChange)
         q->selectionEndChanged();
 }
 
 void QSGTextEdit::updateSelectionMarkers()
 {
     Q_D(QSGTextEdit);
-    if(d->lastSelectionStart != d->control->textCursor().selectionStart()){
+    if (d->lastSelectionStart != d->control->textCursor().selectionStart()) {
         d->lastSelectionStart = d->control->textCursor().selectionStart();
         emit selectionStartChanged();
     }
-    if(d->lastSelectionEnd != d->control->textCursor().selectionEnd()){
+    if (d->lastSelectionEnd != d->control->textCursor().selectionEnd()) {
         d->lastSelectionEnd = d->control->textCursor().selectionEnd();
         emit selectionEndChanged();
     }
@@ -1707,9 +1707,9 @@ QRectF QSGTextEdit::boundingRect() const
     Q_D(const QSGTextEdit);
     QRectF r = QSGImplicitSizeItem::boundingRect();
     int cursorWidth = 1;
-    if(d->cursor)
+    if (d->cursor)
         cursorWidth = d->cursor->width();
-    if(!d->document->isEmpty())
+    if (!d->document->isEmpty())
         cursorWidth += 3;// ### Need a better way of accounting for space between char and cursor
 
     // Could include font max left/right bearings to either side of rectangle.
@@ -1951,7 +1951,7 @@ void QSGTextEdit::openSoftwareInputPanel()
     \endcode
 */
 void QSGTextEdit::closeSoftwareInputPanel()
-{  
+{
     if (qGuiApp)
         qGuiApp->inputPanel()->hide();
 }
@@ -1969,7 +1969,7 @@ void QSGTextEdit::q_canPasteChanged()
     Q_D(QSGTextEdit);
     bool old = d->canPaste;
     d->canPaste = d->control->canPaste();
-    if(old!=d->canPaste)
+    if (old!=d->canPaste)
         emit canPasteChanged();
 }
 
index b07292b..fced118 100644 (file)
@@ -274,7 +274,7 @@ private:
     void updateImageCache(const QRectF &rect = QRectF());
 
 protected:
-    virtual void geometryChanged(const QRectF &newGeometry, 
+    virtual void geometryChanged(const QRectF &newGeometry,
                                  const QRectF &oldGeometry);
 
     bool event(QEvent *);
index e6e2d21..1eddbde 100644 (file)
@@ -103,7 +103,7 @@ QString QSGTextInput::text() const
 void QSGTextInput::setText(const QString &s)
 {
     Q_D(QSGTextInput);
-    if(s == text())
+    if (s == text())
         return;
     d->control->setText(s);
 }
@@ -203,8 +203,8 @@ void QSGTextInput::setText(const QString &s)
     \list
     \o Font.MixedCase - This is the normal text rendering option where no capitalization change is applied.
     \o Font.AllUppercase - This alters the text to be rendered in all uppercase type.
-    \o Font.AllLowercase        - This alters the text to be rendered in all lowercase type.
-    \o Font.SmallCaps -        This alters the text to be rendered in small-caps type.
+    \o Font.AllLowercase - This alters the text to be rendered in all lowercase type.
+    \o Font.SmallCaps - This alters the text to be rendered in small-caps type.
     \o Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.
     \endlist
 
@@ -237,7 +237,7 @@ void QSGTextInput::setFont(const QFont &font)
         d->control->setFont(d->font);
         updateSize();
         updateCursorRectangle();
-        if(d->cursorItem){
+        if (d->cursorItem) {
             d->cursorItem->setHeight(QFontMetrics(d->font).height());
         }
     }
@@ -795,7 +795,7 @@ void QSGTextInput::setValidator(QValidator* v)
         return;
 
     d->control->setValidator(v);
-    if(!d->control->hasAcceptableInput()){
+    if (!d->control->hasAcceptableInput()) {
         d->oldValidity = false;
         emit acceptableInputChanged();
     }
@@ -935,10 +935,10 @@ void QSGTextInput::setCursorDelegate(QDeclarativeComponent* c)
         return;
 
     d->cursorComponent = c;
-    if(!c){
+    if (!c) {
         //note that the components are owned by something else
         delete d->cursorItem;
-    }else{
+    } else {
         d->startCreatingCursor();
     }
 
@@ -948,12 +948,12 @@ void QSGTextInput::setCursorDelegate(QDeclarativeComponent* c)
 void QSGTextInputPrivate::startCreatingCursor()
 {
     Q_Q(QSGTextInput);
-    if(cursorComponent->isReady()){
+    if (cursorComponent->isReady()) {
         q->createCursor();
-    }else if(cursorComponent->isLoading()){
+    } else if (cursorComponent->isLoading()) {
         q->connect(cursorComponent, SIGNAL(statusChanged(int)),
                 q, SLOT(createCursor()));
-    }else {//isError
+    } else { // isError
         qmlInfo(q, cursorComponent->errors()) << QSGTextInput::tr("Could not load cursor delegate");
     }
 }
@@ -961,20 +961,20 @@ void QSGTextInputPrivate::startCreatingCursor()
 void QSGTextInput::createCursor()
 {
     Q_D(QSGTextInput);
-    if(d->cursorComponent->isError()){
+    if (d->cursorComponent->isError()) {
         qmlInfo(this, d->cursorComponent->errors()) << tr("Could not load cursor delegate");
         return;
     }
 
-    if(!d->cursorComponent->isReady())
+    if (!d->cursorComponent->isReady())
         return;
 
-    if(d->cursorItem)
+    if (d->cursorItem)
         delete d->cursorItem;
     QDeclarativeContext *creationContext = d->cursorComponent->creationContext();
     QObject *object = d->cursorComponent->create(creationContext ? creationContext : qmlContext(this));
     d->cursorItem = qobject_cast<QSGItem*>(object);
-    if(!d->cursorItem){
+    if (!d->cursorItem) {
         delete object;
         qmlInfo(this, d->cursorComponent->errors()) << tr("Could not instantiate cursor delegate");
         return;
@@ -1105,7 +1105,7 @@ void QSGTextInput::mousePressEvent(QMouseEvent *event)
     Q_D(QSGTextInput);
     if (d->sendMouseEventToInputContext(event))
         return;
-    if(d->focusOnPress){
+    if (d->focusOnPress) {
         bool hadActiveFocus = hasActiveFocus();
         forceActiveFocus();
         // re-open input panel on press if already focused
@@ -1197,7 +1197,7 @@ bool QSGTextInput::event(QEvent* ev)
     Q_D(QSGTextInput);
     //Anything we don't deal with ourselves, pass to the control
     bool handled = false;
-    switch(ev->type()){
+    switch (ev->type()) {
         case QEvent::KeyPress:
         case QEvent::KeyRelease://###Should the control be doing anything with release?
         case QEvent::InputMethod:
@@ -1209,7 +1209,7 @@ bool QSGTextInput::event(QEvent* ev)
         default:
             handled = d->control->processEvent(ev);
     }
-    if(!handled)
+    if (!handled)
         handled = QSGImplicitSizeItem::event(ev);
     return handled;
 }
@@ -1347,7 +1347,7 @@ QSGNode *QSGTextInput::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *da
 QVariant QSGTextInput::inputMethodQuery(Qt::InputMethodQuery property) const
 {
     Q_D(const QSGTextInput);
-    switch(property) {
+    switch (property) {
     case Qt::ImEnabled:
         return QVariant((bool)(flags() & ItemAcceptsInputMethod));
     case Qt::ImHints:
@@ -1499,7 +1499,7 @@ QString QSGTextInput::passwordCharacter() const
 void QSGTextInput::setPasswordCharacter(const QString &str)
 {
     Q_D(QSGTextInput);
-    if(str.length() < 1)
+    if (str.length() < 1)
         return;
     d->control->setPasswordCharacter(str.constData()[0]);
     EchoMode echoMode_ = echoMode();
@@ -1795,7 +1795,7 @@ void QSGTextInput::itemChange(ItemChange change, const ItemChangeData &value)
         bool hasFocus = value.boolValue;
         d->focused = hasFocus;
         setCursorVisible(hasFocus); // ### refactor:  && d->canvas && d->canvas->hasFocus()
-        if(echoMode() == QSGTextInput::PasswordEchoOnEdit && !hasFocus)
+        if (echoMode() == QSGTextInput::PasswordEchoOnEdit && !hasFocus)
             d->control->updatePasswordEchoEditing(false);//QLineControl sets it on key events, but doesn't deal with focus events
         if (!hasFocus)
             d->control->deselect();
@@ -1881,12 +1881,12 @@ void QSGTextInput::cursorPosChanged()
     d->control->resetCursorBlinkTimer();
 #endif
 
-    if(!d->control->hasSelectedText()){
-        if(d->lastSelectionStart != d->control->cursor()){
+    if (!d->control->hasSelectedText()) {
+        if (d->lastSelectionStart != d->control->cursor()) {
             d->lastSelectionStart = d->control->cursor();
             emit selectionStartChanged();
         }
-        if(d->lastSelectionEnd != d->control->cursor()){
+        if (d->lastSelectionEnd != d->control->cursor()) {
             d->lastSelectionEnd = d->control->cursor();
             emit selectionEndChanged();
         }
@@ -1911,15 +1911,15 @@ void QSGTextInput::selectionChanged()
     updateRect();//TODO: Only update rect in selection
     emit selectedTextChanged();
 
-    if(d->lastSelectionStart != d->control->selectionStart()){
+    if (d->lastSelectionStart != d->control->selectionStart()) {
         d->lastSelectionStart = d->control->selectionStart();
-        if(d->lastSelectionStart == -1)
+        if (d->lastSelectionStart == -1)
             d->lastSelectionStart = d->control->cursor();
         emit selectionStartChanged();
     }
-    if(d->lastSelectionEnd != d->control->selectionEnd()){
+    if (d->lastSelectionEnd != d->control->selectionEnd()) {
         d->lastSelectionEnd = d->control->selectionEnd();
-        if(d->lastSelectionEnd == -1)
+        if (d->lastSelectionEnd == -1)
             d->lastSelectionEnd = d->control->cursor();
         emit selectionEndChanged();
     }
@@ -1934,7 +1934,7 @@ void QSGTextInput::q_textChanged()
     d->determineHorizontalAlignment();
     d->updateHorizontalScroll();
     updateMicroFocus();
-    if(hasAcceptableInput() != d->oldValidity){
+    if (hasAcceptableInput() != d->oldValidity) {
         d->oldValidity = hasAcceptableInput();
         emit acceptableInputChanged();
     }
@@ -1985,7 +1985,7 @@ void QSGTextInput::updateSize(bool needsRedraw)
     int h = height();
     setImplicitHeight(d->control->height()-1); // -1 to counter QLineControl's +1 which is not consistent with Text.
     setImplicitWidth(d->calculateTextWidth());
-    if(w==width() && h==height() && needsRedraw)
+    if (w==width() && h==height() && needsRedraw)
         update();
 }
 
@@ -1996,7 +1996,7 @@ void QSGTextInput::q_canPasteChanged()
 #ifndef QT_NO_CLIPBOARD
     d->canPaste = !d->control->isReadOnly() && QGuiApplication::clipboard()->text().length() != 0;
 #endif
-    if(d->canPaste != old)
+    if (d->canPaste != old)
         emit canPasteChanged();
 }
 
index 7d9a451..cd20f6c 100644 (file)
@@ -268,7 +268,7 @@ void QSGView::continueExecute()
 
     QObject *obj = d->component->create();
 
-    if(d->component->isError()) {
+    if (d->component->isError()) {
         QList<QDeclarativeError> errorList = d->component->errors();
         foreach (const QDeclarativeError &error, errorList) {
             qWarning() << error;
index b359ba6..817738a 100644 (file)
@@ -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);
     }
 }
index 7777b5c..0920f0f 100644 (file)
@@ -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)) {
index 5d6cd47..de19113 100644 (file)
@@ -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);
index 81f00e8..fd22f48 100644 (file)
@@ -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)) {
index 5949b7b..c914d31 100644 (file)
@@ -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()
index fd1f9cd..08a3071 100644 (file)
@@ -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);
 
index fc1b755..c2a6920 100644 (file)
@@ -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);
index 4b0921f..7f307e0 100644 (file)
@@ -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);
 
index 9152067..d4c237d 100644 (file)
@@ -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
index 691a115..c464860 100644 (file)
@@ -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))
index 84225ca..3afc7df 100644 (file)
@@ -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;
index cb8b81e..40d7b77 100644 (file)
@@ -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)) {
index a59b000..8dc32b2 100644 (file)
@@ -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());
 
index 6ab4b93..945b2d2 100644 (file)
@@ -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);
index 5cc0f8e..6189151 100644 (file)
@@ -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);
index 33558fe..d9fec3f 100644 (file)
@@ -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)) {