diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-04-29 01:21:33 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-04-29 01:21:33 (GMT) |
commit | cc50b86dba171f9d63cdfbc9044cafc2766b0b15 (patch) | |
tree | a972e4fcb8fc263b287e2eab39491e7d36da58fa | |
parent | 6ba666275f7f6a2e64b1cd4f3f5ec7477150c392 (diff) | |
parent | dc5a2f46bd9676e69ed81d0b83199a533d1fca21 (diff) | |
download | Qt-cc50b86dba171f9d63cdfbc9044cafc2766b0b15.zip Qt-cc50b86dba171f9d63cdfbc9044cafc2766b0b15.tar.gz Qt-cc50b86dba171f9d63cdfbc9044cafc2766b0b15.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r-- | src/declarative/fx/qfxgridview.cpp | 4 | ||||
-rw-r--r-- | src/declarative/fx/qfximageitem.cpp | 15 | ||||
-rw-r--r-- | src/declarative/fx/qfxitem.cpp | 34 | ||||
-rw-r--r-- | src/declarative/fx/qfxlistview.cpp | 5 | ||||
-rw-r--r-- | src/declarative/fx/qfxpathview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/util/qmlanimation.cpp | 2 | ||||
-rw-r--r-- | src/declarative/util/qmlconnection.cpp | 2 | ||||
-rw-r--r-- | src/declarative/util/qmllistmodel.cpp | 2 |
8 files changed, 37 insertions, 29 deletions
diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp index a45c28f..c8b8d27 100644 --- a/src/declarative/fx/qfxgridview.cpp +++ b/src/declarative/fx/qfxgridview.cpp @@ -1330,8 +1330,8 @@ void QFxGridView::itemsInserted(int modelIndex, int count) } } // everything is in order now - emit add() signal - foreach(FxGridItem *item, added) - item->attached->emitAdd(); + for (int j = 0; j < added.count(); ++j) + added.at(j)->attached->emitAdd(); d->layout(); emit countChanged(); } diff --git a/src/declarative/fx/qfximageitem.cpp b/src/declarative/fx/qfximageitem.cpp index 2a33a92..52ab009 100644 --- a/src/declarative/fx/qfximageitem.cpp +++ b/src/declarative/fx/qfximageitem.cpp @@ -119,8 +119,7 @@ void QFxImageItem::dirtyCache(const QRect& rect) void QFxImageItem::clearCache() { Q_D(QFxImageItem); - foreach (QFxImageItemPrivate::ImageCacheItem* i, d->imagecache) - delete i; + qDeleteAll(d->imagecache); d->imagecache.clear(); } @@ -232,8 +231,9 @@ void QFxImageItem::paintGLContents(GLPainter &p) return; #if defined(QFX_RENDER_QPAINTER) + bool oldAntiAliasing = p.testRenderHint(QPainter::Antialiasing); + bool oldSmoothPixmap = p.testRenderHint(QPainter::SmoothPixmapTransform); if (d->smooth) { - p.save(); p.setRenderHints(QPainter::Antialiasing, true); p.setRenderHints(QPainter::SmoothPixmapTransform, true); } @@ -303,7 +303,8 @@ void QFxImageItem::paintGLContents(GLPainter &p) } const QRegion bigger = QRegion(biggerrect) & uncached; const QVector<QRect> rects = bigger.rects(); - foreach (QRect r, rects) { + for (int i = 0; i < rects.count(); ++i) { + const QRect &r = rects.at(i); #if defined(QFX_RENDER_QPAINTER) QImage img(r.size(),QImage::Format_ARGB32_Premultiplied); #else @@ -335,8 +336,10 @@ void QFxImageItem::paintGLContents(GLPainter &p) glDisableClientState(GL_TEXTURE_COORD_ARRAY); #endif #if defined(QFX_RENDER_QPAINTER) - if (d->smooth) - p.restore(); + if (d->smooth) { + p.setRenderHints(QPainter::Antialiasing, oldAntiAliasing); + p.setRenderHints(QPainter::SmoothPixmapTransform, oldSmoothPixmap); + } #endif } diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index e06a426..11b7dd3 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -151,12 +151,15 @@ void QFxContents::calcHeight() int top = INT_MAX; int bottom = 0; - foreach(const QSimpleCanvasItem *child, - _item->QSimpleCanvasItem::children()) { - if (child->y() + child->height() > bottom) - bottom = (int)child->y() + child->height(); - if (child->y() < top) - top = (int)child->y(); + + const QList<QSimpleCanvasItem *> &children = _item->QSimpleCanvasItem::children(); + for (int i = 0; i < children.count(); ++i) { + const QSimpleCanvasItem *child = children.at(i); + int y = int(child->y()); + if (y + child->height() > bottom) + bottom = y + child->height(); + if (y < top) + top = y; } _height = bottom - top; @@ -171,12 +174,14 @@ void QFxContents::calcWidth() int left = INT_MAX; int right = 0; - foreach(const QSimpleCanvasItem *child, - _item->QSimpleCanvasItem::children()) { - if (child->x() + child->width() > right) - right = (int)child->x() + child->width(); - if (child->x() < left) - left = (int)child->x(); + const QList<QSimpleCanvasItem *> &children = _item->QSimpleCanvasItem::children(); + for (int i = 0; i < children.count(); ++i) { + const QSimpleCanvasItem *child = children.at(i); + int x = int(child->x()); + if (x + child->width() > right) + right = x + child->width(); + if (x < left) + left = x; } _width = right - left; @@ -188,8 +193,9 @@ void QFxContents::setItem(QFxItem *item) { _item = item; - foreach(const QSimpleCanvasItem *child, - _item->QSimpleCanvasItem::children()) { + const QList<QSimpleCanvasItem *> &children = _item->QSimpleCanvasItem::children(); + for (int i = 0; i < children.count(); ++i) { + const QSimpleCanvasItem *child = children.at(i); connect(child, SIGNAL(bottomChanged()), this, SLOT(calcHeight())); connect(child, SIGNAL(rightChanged()), this, SLOT(calcWidth())); } diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp index d8a293f..0724e3a 100644 --- a/src/declarative/fx/qfxlistview.cpp +++ b/src/declarative/fx/qfxlistview.cpp @@ -1546,9 +1546,8 @@ void QFxListView::itemsInserted(int modelIndex, int count) } } // everything is in order now - emit add() signal - foreach(FxListItem *item, added) - item->attached->emitAdd(); - + for (int j = 0; j < added.count(); ++j) + added.at(j)->attached->emitAdd(); emit countChanged(); } diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp index 65d5ac8..c0d3ab2 100644 --- a/src/declarative/fx/qfxpathview.cpp +++ b/src/declarative/fx/qfxpathview.cpp @@ -616,7 +616,7 @@ void QFxPathViewPrivate::regenerate() void QFxPathViewPrivate::updateItem(QFxItem *item, qreal percent) { if (QObject *obj = QFxPathView::attachedProperties.value(item)) { - foreach(QString attr, path->attributes()) + foreach(const QString &attr, path->attributes()) static_cast<QFxPathViewAttached *>(obj)->setValue(attr.toLatin1(), path->attributeAt(attr, percent)); } diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp index b5826fa..c09b378 100644 --- a/src/declarative/util/qmlanimation.cpp +++ b/src/declarative/util/qmlanimation.cpp @@ -104,7 +104,7 @@ QEasingCurve stringToCurve(const QString &curve) easingCurve.setType((QEasingCurve::Type)value); if (hasParams) { - foreach(QString str, props) { + foreach(const QString &str, props) { int sep = str.indexOf(QLatin1Char(':')); if (sep == -1) { diff --git a/src/declarative/util/qmlconnection.cpp b/src/declarative/util/qmlconnection.cpp index 78f8c23..5cd4371 100644 --- a/src/declarative/util/qmlconnection.cpp +++ b/src/declarative/util/qmlconnection.cpp @@ -165,7 +165,7 @@ void QmlConnection::connectIfValid() QList<QByteArray> sigparams; if (lparen >= 0 && d->signal.length() > lparen+2) { QStringList l = d->signal.mid(lparen+1,d->signal.length()-lparen-2).split(QLatin1Char(',')); - foreach (QString s, l) { + foreach (const QString &s, l) { sigparams.append(s.toLatin1()); } } diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp index 78d0360..54aea2c 100644 --- a/src/declarative/util/qmllistmodel.cpp +++ b/src/declarative/util/qmllistmodel.cpp @@ -388,7 +388,7 @@ void ListModel::checkRoles() const for (int ii = 0; ii < _root->values.count(); ++ii) { ModelNode *node = qvariant_cast<ModelNode *>(_root->values.at(ii)); if (node) { - foreach(QString role, node->properties.keys()) + foreach (const QString &role, node->properties.keys()) addRole(role); } } |