summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-07-08 05:30:58 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2010-07-13 04:39:21 (GMT)
commit15855edc421d34773cda52ff510c34b1016f64d7 (patch)
tree6d93d150d90c49d6ef0da8e7092c8d6a115e4f5a
parent7c1ff382b0927d8b003468c16e31333816c3ab6b (diff)
downloadQt-15855edc421d34773cda52ff510c34b1016f64d7.zip
Qt-15855edc421d34773cda52ff510c34b1016f64d7.tar.gz
Qt-15855edc421d34773cda52ff510c34b1016f64d7.tar.bz2
Remove Image::pixmap property. QML applications should use
QDeclarativeImageProvider to provide pixmaps instead. Task-number: QTBUG-11980 (cherry picked from commit 33b664eabe5d9621d71e5bf3bfcc46ea385a399c)
-rw-r--r--src/declarative/QmlChanges.txt7
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage_p.h2
-rw-r--r--tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp31
4 files changed, 5 insertions, 45 deletions
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index 336fbbf..e878ab5 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -16,8 +16,11 @@ Component:
- errorsString() renamed to errorString()
ListView:
- ListView.prevSection property changed to ListView.previousSection
-
-TextInput xToPosition -> positionAt (to match TextEdit.positionAt)
+TextInput:
+ - xToPosition -> positionAt (to match TextEdit.positionAt)
+Image:
+ - pixmap property removed, use QDeclarativeImageProvider to serve pixmaps
+ instead
QList<QObject*> models no longer provide properties in model object. The
properties are now updated when the object changes. An object's property
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index e0db580..3dde6f7 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -114,15 +114,6 @@ QDeclarativeImage::~QDeclarativeImage()
{
}
-/*!
- \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 QDeclarativeImage::pixmap() const
{
Q_D(const QDeclarativeImage);
@@ -522,7 +513,6 @@ void QDeclarativeImage::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWi
void QDeclarativeImage::pixmapChange()
{
updatePaintedGeometry();
- emit pixmapChanged();
}
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeimage_p.h b/src/declarative/graphicsitems/qdeclarativeimage_p.h
index a4f4475..c8bb30b 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeimage_p.h
@@ -57,7 +57,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeImage : public QDeclarativeImageBase
Q_OBJECT
Q_ENUMS(FillMode)
- Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap NOTIFY pixmapChanged DESIGNABLE false)
Q_PROPERTY(FillMode fillMode READ fillMode WRITE setFillMode NOTIFY fillModeChanged)
Q_PROPERTY(qreal paintedWidth READ paintedWidth NOTIFY paintedGeometryChanged)
Q_PROPERTY(qreal paintedHeight READ paintedHeight NOTIFY paintedGeometryChanged)
@@ -79,7 +78,6 @@ public:
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
Q_SIGNALS:
- void pixmapChanged();
void fillModeChanged();
void paintedGeometryChanged();
diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
index c09f7fc..adee312 100644
--- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
+++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
@@ -88,7 +88,6 @@ private slots:
void resized();
void preserveAspectRatio();
void smooth();
- void pixmap();
void svg();
void big();
void tiling_QTBUG_6716();
@@ -261,36 +260,6 @@ void tst_qdeclarativeimage::smooth()
delete obj;
}
-void tst_qdeclarativeimage::pixmap()
-{
- QString componentStr = "import Qt 4.7\nImage { pixmap: testPixmap }";
-
- QPixmap pixmap;
- QDeclarativeContext *ctxt = engine.rootContext();
- ctxt->setContextProperty("testPixmap", pixmap);
-
- QDeclarativeComponent component(&engine);
- component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
-
- QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
- QVERIFY(obj != 0);
- QCOMPARE(obj->source(), QUrl());
- QVERIFY(obj->status() == QDeclarativeImage::Null);
- QCOMPARE(obj->width(), 0.);
- QCOMPARE(obj->height(), 0.);
- QCOMPARE(obj->fillMode(), QDeclarativeImage::Stretch);
- QCOMPARE(obj->progress(), 0.0);
- QVERIFY(obj->pixmap().isNull());
-
- pixmap = QPixmap(SRCDIR "/data/colors.png");
- ctxt->setContextProperty("testPixmap", pixmap);
- QCOMPARE(obj->width(), 120.);
- QCOMPARE(obj->height(), 120.);
- QVERIFY(obj->status() == QDeclarativeImage::Ready);
-
- delete obj;
-}
-
void tst_qdeclarativeimage::svg()
{
QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.svg").toString();