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 /src/declarative/fx/qfximage.cpp | |
parent | fcabdbdf2867721a0925ade8c1dca6425b6aa632 (diff) | |
download | Qt-2776e24964a49c98bd807351ccdffebaed5e2eea.zip Qt-2776e24964a49c98bd807351ccdffebaed5e2eea.tar.gz Qt-2776e24964a49c98bd807351ccdffebaed5e2eea.tar.bz2 |
Other minor API review changes.
Diffstat (limited to 'src/declarative/fx/qfximage.cpp')
-rw-r--r-- | src/declarative/fx/qfximage.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
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); |