aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2011-10-17 13:03:58 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-17 13:59:29 +0200
commitf713037bf192748837f6075b2c60b19ccf3f9ab1 (patch)
tree3fda988997268c2a96729b1a7baa96583d453397 /src/declarative
parent830c69803e45daad2115498a8d5a6faeb75fe2a5 (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 'src/declarative')
-rw-r--r--src/declarative/items/context2d/qsgcontext2d.cpp6
-rw-r--r--src/declarative/items/qsganchors.cpp26
-rw-r--r--src/declarative/items/qsganimatedimage.cpp20
-rw-r--r--src/declarative/items/qsganimation.cpp2
-rw-r--r--src/declarative/items/qsgcanvas.cpp7
-rw-r--r--src/declarative/items/qsgflickable.cpp4
-rw-r--r--src/declarative/items/qsgimage.cpp6
-rw-r--r--src/declarative/items/qsgitem.cpp40
-rw-r--r--src/declarative/items/qsgitem_p.h4
-rw-r--r--src/declarative/items/qsgmousearea.cpp4
-rw-r--r--src/declarative/items/qsgpathview.cpp10
-rw-r--r--src/declarative/items/qsgpincharea.cpp2
-rw-r--r--src/declarative/items/qsgpositioners.cpp12
-rw-r--r--src/declarative/items/qsgscalegrid.cpp2
-rw-r--r--src/declarative/items/qsgshadereffect.cpp2
-rw-r--r--src/declarative/items/qsgshadereffect_p.h2
-rw-r--r--src/declarative/items/qsgshadereffectsource.cpp2
-rw-r--r--src/declarative/items/qsgspriteimage.cpp10
-rw-r--r--src/declarative/items/qsgtext.cpp6
-rw-r--r--src/declarative/items/qsgtextedit.cpp38
-rw-r--r--src/declarative/items/qsgtextedit_p.h2
-rw-r--r--src/declarative/items/qsgtextinput.cpp60
-rw-r--r--src/declarative/items/qsgview.cpp2
23 files changed, 134 insertions, 135 deletions
diff --git a/src/declarative/items/context2d/qsgcontext2d.cpp b/src/declarative/items/context2d/qsgcontext2d.cpp
index e75713de8a..5944a02658 100644
--- a/src/declarative/items/context2d/qsgcontext2d.cpp
+++ b/src/declarative/items/context2d/qsgcontext2d.cpp
@@ -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);
diff --git a/src/declarative/items/qsganchors.cpp b/src/declarative/items/qsganchors.cpp
index 6d5b5a3d83..67ca0317c4 100644
--- a/src/declarative/items/qsganchors.cpp
+++ b/src/declarative/items/qsganchors.cpp
@@ -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();
diff --git a/src/declarative/items/qsganimatedimage.cpp b/src/declarative/items/qsganimatedimage.cpp
index e4bba512af..93e0284417 100644
--- a/src/declarative/items/qsganimatedimage.cpp
+++ b/src/declarative/items/qsganimatedimage.cpp
@@ -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();
}
diff --git a/src/declarative/items/qsganimation.cpp b/src/declarative/items/qsganimation.cpp
index b0dc820763..81c83913c1 100644
--- a/src/declarative/items/qsganimation.cpp
+++ b/src/declarative/items/qsganimation.cpp
@@ -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);
diff --git a/src/declarative/items/qsgcanvas.cpp b/src/declarative/items/qsgcanvas.cpp
index 9efd17ae11..879beb9310 100644
--- a/src/declarative/items/qsgcanvas.cpp
+++ b/src/declarative/items/qsgcanvas.cpp
@@ -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
diff --git a/src/declarative/items/qsgflickable.cpp b/src/declarative/items/qsgflickable.cpp
index 09bb8e3c2e..4871a43e8d 100644
--- a/src/declarative/items/qsgflickable.cpp
+++ b/src/declarative/items/qsgflickable.cpp
@@ -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;
diff --git a/src/declarative/items/qsgimage.cpp b/src/declarative/items/qsgimage.cpp
index a23d9ede1b..9461de4278 100644
--- a/src/declarative/items/qsgimage.cpp
+++ b/src/declarative/items/qsgimage.cpp
@@ -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);
diff --git a/src/declarative/items/qsgitem.cpp b/src/declarative/items/qsgitem.cpp
index 8ede2a490e..bdea19b3e0 100644
--- a/src/declarative/items/qsgitem.cpp
+++ b/src/declarative/items/qsgitem.cpp
@@ -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)
diff --git a/src/declarative/items/qsgitem_p.h b/src/declarative/items/qsgitem_p.h
index 02c3f8772f..c0ed1dbc8b 100644
--- a/src/declarative/items/qsgitem_p.h
+++ b/src/declarative/items/qsgitem_p.h
@@ -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()
diff --git a/src/declarative/items/qsgmousearea.cpp b/src/declarative/items/qsgmousearea.cpp
index de7913c3d1..4d14eaa565 100644
--- a/src/declarative/items/qsgmousearea.cpp
+++ b/src/declarative/items/qsgmousearea.cpp
@@ -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;
diff --git a/src/declarative/items/qsgpathview.cpp b/src/declarative/items/qsgpathview.cpp
index 590fa93782..5e2ad84e3b 100644
--- a/src/declarative/items/qsgpathview.cpp
+++ b/src/declarative/items/qsgpathview.cpp
@@ -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;
diff --git a/src/declarative/items/qsgpincharea.cpp b/src/declarative/items/qsgpincharea.cpp
index d02477ee34..2dbe683f26 100644
--- a/src/declarative/items/qsgpincharea.cpp
+++ b/src/declarative/items/qsgpincharea.cpp
@@ -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;
diff --git a/src/declarative/items/qsgpositioners.cpp b/src/declarative/items/qsgpositioners.cpp
index 0401494d3b..eaca2101e2 100644
--- a/src/declarative/items/qsgpositioners.cpp
+++ b/src/declarative/items/qsgpositioners.cpp
@@ -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;
diff --git a/src/declarative/items/qsgscalegrid.cpp b/src/declarative/items/qsgscalegrid.cpp
index e1b76c4158..1c4ce8d289 100644
--- a/src/declarative/items/qsgscalegrid.cpp
+++ b/src/declarative/items/qsgscalegrid.cpp
@@ -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;
diff --git a/src/declarative/items/qsgshadereffect.cpp b/src/declarative/items/qsgshadereffect.cpp
index 81adf8d705..f84d023906 100644
--- a/src/declarative/items/qsgshadereffect.cpp
+++ b/src/declarative/items/qsgshadereffect.cpp
@@ -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)));
}
diff --git a/src/declarative/items/qsgshadereffect_p.h b/src/declarative/items/qsgshadereffect_p.h
index a8c3f084e4..08af5f6bff 100644
--- a/src/declarative/items/qsgshadereffect_p.h
+++ b/src/declarative/items/qsgshadereffect_p.h
@@ -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);
diff --git a/src/declarative/items/qsgshadereffectsource.cpp b/src/declarative/items/qsgshadereffectsource.cpp
index 3b0983863f..4bbabe1701 100644
--- a/src/declarative/items/qsgshadereffectsource.cpp
+++ b/src/declarative/items/qsgshadereffectsource.cpp
@@ -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
diff --git a/src/declarative/items/qsgspriteimage.cpp b/src/declarative/items/qsgspriteimage.cpp
index 20544ad28b..f6cd35f4f3 100644
--- a/src/declarative/items/qsgspriteimage.cpp
+++ b/src/declarative/items/qsgspriteimage.cpp
@@ -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);
diff --git a/src/declarative/items/qsgtext.cpp b/src/declarative/items/qsgtext.cpp
index 3c525c0f21..6c55e82802 100644
--- a/src/declarative/items/qsgtext.cpp
+++ b/src/declarative/items/qsgtext.cpp
@@ -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
diff --git a/src/declarative/items/qsgtextedit.cpp b/src/declarative/items/qsgtextedit.cpp
index cec3bd8b20..bbc751f99c 100644
--- a/src/declarative/items/qsgtextedit.cpp
+++ b/src/declarative/items/qsgtextedit.cpp
@@ -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();
}
diff --git a/src/declarative/items/qsgtextedit_p.h b/src/declarative/items/qsgtextedit_p.h
index b07292b296..fced11808f 100644
--- a/src/declarative/items/qsgtextedit_p.h
+++ b/src/declarative/items/qsgtextedit_p.h
@@ -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 *);
diff --git a/src/declarative/items/qsgtextinput.cpp b/src/declarative/items/qsgtextinput.cpp
index e6e2d21773..1eddbde608 100644
--- a/src/declarative/items/qsgtextinput.cpp
+++ b/src/declarative/items/qsgtextinput.cpp
@@ -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();
}
diff --git a/src/declarative/items/qsgview.cpp b/src/declarative/items/qsgview.cpp
index 7d9a451e33..cd20f6c973 100644
--- a/src/declarative/items/qsgview.cpp
+++ b/src/declarative/items/qsgview.cpp
@@ -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;