diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-19 04:09:24 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-19 04:09:24 (GMT) |
commit | 3344836a008fe1c4620217919a52d9a571a86503 (patch) | |
tree | 70a8c1363b4cacf5f629ae09e733c1b8f284c655 /src/declarative | |
parent | 7aedb72dea904981969c0a4a9e5a6b721381c5a9 (diff) | |
parent | 2075925adaa1a1c78b6da9dc10d2b1a165178363 (diff) | |
download | Qt-3344836a008fe1c4620217919a52d9a571a86503.zip Qt-3344836a008fe1c4620217919a52d9a571a86503.tar.gz Qt-3344836a008fe1c4620217919a52d9a571a86503.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src/declarative')
5 files changed, 29 insertions, 23 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 951b171..018d48f 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -248,18 +248,12 @@ void QDeclarativeFlickablePrivate::fixupX_callback(void *data) void QDeclarativeFlickablePrivate::fixupX() { Q_Q(QDeclarativeFlickable); - if (!q->xflick() || hData.move.timeLine()) - return; - fixup(hData, q->minXExtent(), q->maxXExtent()); } void QDeclarativeFlickablePrivate::fixupY() { Q_Q(QDeclarativeFlickable); - if (!q->yflick() || vData.move.timeLine()) - return; - fixup(vData, q->minYExtent(), q->maxYExtent()); } @@ -1059,8 +1053,12 @@ void QDeclarativeFlickable::setContentWidth(qreal w) else d->viewport->setWidth(w); // Make sure that we're entirely in view. - if (!d->pressed) + if (!d->pressed) { + int oldDuration = d->fixupDuration; + d->fixupDuration = 0; d->fixupX(); + d->fixupDuration = oldDuration; + } emit contentWidthChanged(); d->updateBeginningEnd(); } @@ -1082,8 +1080,12 @@ void QDeclarativeFlickable::setContentHeight(qreal h) else d->viewport->setHeight(h); // Make sure that we're entirely in view. - if (!d->pressed) + if (!d->pressed) { + int oldDuration = d->fixupDuration; + d->fixupDuration = 0; d->fixupY(); + d->fixupDuration = oldDuration; + } emit contentHeightChanged(); d->updateBeginningEnd(); } diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index a3d585a..727dba3 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -746,12 +746,6 @@ void QDeclarativeGridViewPrivate::fixupPosition() void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExtent) { Q_Q(QDeclarativeGridView); - - if ((&data == &vData && !q->yflick()) - || (&data == &hData && !q->xflick()) - || data.move.timeLine()) - return; - int oldDuration = fixupDuration; fixupDuration = moveReason == Mouse ? fixupDuration : 0; diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 80db730..5a0292f 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1101,11 +1101,6 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m || (orient == QDeclarativeListView::Vertical && &data == &hData)) return; - if ((&data == &vData && !q->yflick()) - || (&data == &hData && !q->xflick()) - || data.move.timeLine()) - return; - int oldDuration = fixupDuration; fixupDuration = moveReason == Mouse ? fixupDuration : 0; diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp index 54c8ab2..3daa83f 100644 --- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp +++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp @@ -172,6 +172,8 @@ void QDeclarativeGradient::doUpdate() \image declarative-rect.png */ +int QDeclarativeRectanglePrivate::doUpdateSlotIdx = -1; + /*! \internal \class QDeclarativeRectangle @@ -252,11 +254,16 @@ void QDeclarativeRectangle::setGradient(QDeclarativeGradient *gradient) Q_D(QDeclarativeRectangle); if (d->gradient == gradient) return; + static int updatedSignalIdx = -1; + if (updatedSignalIdx < 0) + updatedSignalIdx = QDeclarativeGradient::staticMetaObject.indexOfSignal("updated()"); + if (d->doUpdateSlotIdx < 0) + d->doUpdateSlotIdx = QDeclarativeRectangle::staticMetaObject.indexOfSlot("doUpdate()"); if (d->gradient) - disconnect(d->gradient, SIGNAL(updated()), this, SLOT(doUpdate())); + QMetaObject::disconnect(d->gradient, updatedSignalIdx, this, d->doUpdateSlotIdx); d->gradient = gradient; if (d->gradient) - connect(d->gradient, SIGNAL(updated()), this, SLOT(doUpdate())); + QMetaObject::connect(d->gradient, updatedSignalIdx, this, d->doUpdateSlotIdx); update(); } @@ -350,7 +357,9 @@ void QDeclarativeRectangle::generateBorderedRect() Q_D(QDeclarativeRectangle); if (d->rectImage.isNull()) { const int pw = d->pen && d->pen->isValid() ? d->pen->width() : 0; - d->rectImage = QPixmap(pw*2 + 3, pw*2 + 3); + // Adding 5 here makes qDrawBorderPixmap() paint correctly with smooth: true + // Ideally qDrawBorderPixmap() would be fixed - QTBUG-7999 + d->rectImage = QPixmap(pw*2 + 5, pw*2 + 5); d->rectImage.fill(Qt::transparent); QPainter p(&(d->rectImage)); p.setRenderHint(QPainter::Antialiasing); diff --git a/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h b/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h index 84418bc..001b018 100644 --- a/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h @@ -81,12 +81,18 @@ public: qreal radius; qreal paintmargin; QPixmap rectImage; + static int doUpdateSlotIdx; QDeclarativePen *getPen() { if (!pen) { Q_Q(QDeclarativeRectangle); pen = new QDeclarativePen; - QObject::connect(pen, SIGNAL(penChanged()), q, SLOT(doUpdate())); + static int penChangedSignalIdx = -1; + if (penChangedSignalIdx < 0) + penChangedSignalIdx = QDeclarativePen::staticMetaObject.indexOfSignal("penChanged()"); + if (doUpdateSlotIdx < 0) + doUpdateSlotIdx = QDeclarativeRectangle::staticMetaObject.indexOfSlot("doUpdate()"); + QMetaObject::connect(pen, penChangedSignalIdx, q, doUpdateSlotIdx); } return pen; } |