diff options
author | Bea Lam <bea.lam@nokia.com> | 2009-11-25 01:33:59 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2009-11-25 01:33:59 (GMT) |
commit | 553cf812d36437542005fcf758fe707b7e1c63a5 (patch) | |
tree | d8f66a8c2718215c4e2297bc2490c0cc82bd38b2 /src/declarative/graphicsitems | |
parent | 5271a2f1a1bbc7eae45824d3aa860d53e3879b79 (diff) | |
parent | 368aa557ab3cf8a5c241890ff2f21e2b890df114 (diff) | |
download | Qt-553cf812d36437542005fcf758fe707b7e1c63a5.zip Qt-553cf812d36437542005fcf758fe707b7e1c63a5.tar.gz Qt-553cf812d36437542005fcf758fe707b7e1c63a5.tar.bz2 |
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/graphicsitems')
5 files changed, 25 insertions, 6 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp index b3a34ed..cc0f905 100644 --- a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp @@ -613,7 +613,7 @@ void QmlGraphicsFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent const qreal maxY = q->maxYExtent(); if (newY > minY) newY = minY + (newY - minY) / 2; - if (newY < maxY && maxY - minY < 0) + if (newY < maxY && maxY - minY <= 0) newY = maxY + (newY - maxY) / 2; if (!q->overShoot() && (newY > minY || newY < maxY)) { if (newY > minY) @@ -640,7 +640,7 @@ void QmlGraphicsFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent const qreal maxX = q->maxXExtent(); if (newX > minX) newX = minX + (newX - minX) / 2; - if (newX < maxX && maxX - minX < 0) + if (newX < maxX && maxX - minX <= 0) newX = maxX + (newX - maxX) / 2; if (!q->overShoot() && (newX > minX || newX < maxX)) { if (newX > minX) diff --git a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp index 7e2d983..e36ea50 100644 --- a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp @@ -1138,7 +1138,11 @@ qreal QmlGraphicsGridView::maxYExtent() const Q_D(const QmlGraphicsGridView); if (d->flow == QmlGraphicsGridView::TopToBottom) return QmlGraphicsFlickable::maxYExtent(); - return -(d->endPosition() - height()); + qreal extent = -(d->endPosition() - height()); + const qreal minY = minYExtent(); + if (extent > minY) + extent = minY; + return extent; } qreal QmlGraphicsGridView::minXExtent() const @@ -1154,7 +1158,11 @@ qreal QmlGraphicsGridView::maxXExtent() const Q_D(const QmlGraphicsGridView); if (d->flow == QmlGraphicsGridView::LeftToRight) return QmlGraphicsFlickable::maxXExtent(); - return -(d->endPosition() - width()); + qreal extent = -(d->endPosition() - width()); + const qreal minX = minXExtent(); + if (extent > minX) + extent = minX; + return extent; } void QmlGraphicsGridView::keyPressEvent(QKeyEvent *event) diff --git a/src/declarative/graphicsitems/qmlgraphicsimage.cpp b/src/declarative/graphicsitems/qmlgraphicsimage.cpp index 42fd910..9d59796 100644 --- a/src/declarative/graphicsitems/qmlgraphicsimage.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsimage.cpp @@ -141,6 +141,15 @@ QmlGraphicsImage::~QmlGraphicsImage() { } +/*! + \qmlproperty QPixmap Image::pixmap + + This property holds the QPixmap image to display. + + This is useful for displaying images provided by a C++ implementation, + for example, a model may provide a data role of type QPixmap. +*/ + QPixmap QmlGraphicsImage::pixmap() const { Q_D(const QmlGraphicsImage); @@ -164,6 +173,7 @@ void QmlGraphicsImagePrivate::setPixmap(const QPixmap &pixmap) q->setImplicitHeight(pix.height()); q->update(); + emit q->pixmapChanged(); } /*! diff --git a/src/declarative/graphicsitems/qmlgraphicsimage_p.h b/src/declarative/graphicsitems/qmlgraphicsimage_p.h index 76b8da5..81e10ab 100644 --- a/src/declarative/graphicsitems/qmlgraphicsimage_p.h +++ b/src/declarative/graphicsitems/qmlgraphicsimage_p.h @@ -56,7 +56,7 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsImage : public QmlGraphicsImageBase Q_OBJECT Q_ENUMS(FillMode) - Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap DESIGNABLE false) + Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap NOTIFY pixmapChanged DESIGNABLE false) Q_PROPERTY(FillMode fillMode READ fillMode WRITE setFillMode NOTIFY fillModeChanged) public: @@ -74,6 +74,7 @@ public: Q_SIGNALS: void fillModeChanged(); + void pixmapChanged(); protected: QmlGraphicsImage(QmlGraphicsImagePrivate &dd, QmlGraphicsItem *parent); diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index c6291f2..e05ae66 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -1318,7 +1318,7 @@ void QmlGraphicsListView::setHighlightFollowsCurrentItem(bool autoHighlight) /*! \qmlproperty real ListView::preferredHighlightBegin \qmlproperty real ListView::preferredHighlightEnd - \qmlproperty bool ListView::highlightRangeMode + \qmlproperty enumeration ListView::highlightRangeMode These properties set the preferred range of the highlight (current item) within the view. |