diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-07-31 05:36:20 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-07-31 05:36:20 (GMT) |
commit | 2776e24964a49c98bd807351ccdffebaed5e2eea (patch) | |
tree | 0c3504c36267cbbe00a1de34a0519d6a99509bec | |
parent | fcabdbdf2867721a0925ade8c1dca6425b6aa632 (diff) | |
download | Qt-2776e24964a49c98bd807351ccdffebaed5e2eea.zip Qt-2776e24964a49c98bd807351ccdffebaed5e2eea.tar.gz Qt-2776e24964a49c98bd807351ccdffebaed5e2eea.tar.bz2 |
Other minor API review changes.
-rw-r--r-- | src/declarative/extra/qfxanimatedimageitem.cpp | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfximage.cpp | 20 | ||||
-rw-r--r-- | src/declarative/fx/qfximage.h | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfximage_p.h | 5 |
4 files changed, 14 insertions, 15 deletions
diff --git a/src/declarative/extra/qfxanimatedimageitem.cpp b/src/declarative/extra/qfxanimatedimageitem.cpp index 44a1d67..daacdac 100644 --- a/src/declarative/extra/qfxanimatedimageitem.cpp +++ b/src/declarative/extra/qfxanimatedimageitem.cpp @@ -197,7 +197,7 @@ void QFxAnimatedImageItem::setSource(const QUrl &url) if (url.isEmpty()) { delete d->_movie; - d->status = Idle; + d->status = Null; } else { d->status = Loading; QNetworkRequest req(d->url); diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp index 98e8985..605e1ea 100644 --- a/src/declarative/fx/qfximage.cpp +++ b/src/declarative/fx/qfximage.cpp @@ -167,13 +167,12 @@ QFxImage::~QFxImage() } /*! - \property QFxImage::pixmap + \property QFxImage::image \brief the image displayed in this item. This property contains the image currently being displayed by this item, - which may be an empty pixmap if nothing is currently displayed. If this - property is set, the source property will be unset. This property is intended - to be used only in C++, not in QML. + which may be empty if nothing is currently displayed. Setting the source + property overrides any setting of this property. */ QPixmap QFxImage::pixmap() const { @@ -184,9 +183,9 @@ QPixmap QFxImage::pixmap() const void QFxImage::setPixmap(const QPixmap &pix) { Q_D(QFxImage); - d->url = QUrl(); + if (!d->url.isEmpty()) + return; d->pix = pix; - d->opaque=false; setImplicitWidth(d->pix.width()); setImplicitHeight(d->pix.height()); @@ -454,7 +453,8 @@ void QFxImage::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) This property holds the status of image loading. It can be one of: \list - \o Idle - no image has been set, or the image has been loaded + \o Null - no image has been set + \o Ready - the image has been loaded \o Loading - the images is currently being loaded \o Error - an error occurred while loading the image \endlist @@ -546,8 +546,8 @@ void QFxImage::setSource(const QUrl &url) } if (url.isEmpty()) { - setPixmap(QPixmap()); - d->status = Idle; + d->pix = QPixmap(); + d->status = Null; d->progress = 1.0; setImplicitWidth(0); setImplicitHeight(0); @@ -605,7 +605,7 @@ void QFxImage::requestFinished() setImplicitHeight(d->pix.height()); if (d->status == Loading) - d->status = Idle; + d->status = Ready; d->progress = 1.0; emit statusChanged(d->status); emit sourceChanged(d->url); diff --git a/src/declarative/fx/qfximage.h b/src/declarative/fx/qfximage.h index 9573ce5..9ab4456 100644 --- a/src/declarative/fx/qfximage.h +++ b/src/declarative/fx/qfximage.h @@ -84,7 +84,7 @@ public: bool smoothTransform() const; void setSmoothTransform(bool); - enum Status { Idle, Loading, Error }; + enum Status { Null, Ready, Loading, Error }; Status status() const; qreal progress() const; diff --git a/src/declarative/fx/qfximage_p.h b/src/declarative/fx/qfximage_p.h index a9ad054..32529c4 100644 --- a/src/declarative/fx/qfximage_p.h +++ b/src/declarative/fx/qfximage_p.h @@ -70,9 +70,9 @@ class QFxImagePrivate : public QFxItemPrivate public: QFxImagePrivate() - : scaleGrid(0), smooth(false), opaque(false), + : scaleGrid(0), smooth(false), fillMode(QFxImage::Stretch), - status(QFxImage::Idle), sciReply(0), + status(QFxImage::Null), sciReply(0), progress(0.0) { } @@ -94,7 +94,6 @@ public: QFxScaleGrid *scaleGrid; QPixmap pix; bool smooth : 1; - bool opaque : 1; QFxImage::FillMode fillMode; QFxImage::Status status; |