summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-05-26 05:15:45 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-05-26 05:15:45 (GMT)
commite9a25332df933227c6b71a1654260d8421f56415 (patch)
treed0537f2e39fed1261bba0a14a43755cf2e5dbf1a /src/declarative/graphicsitems/qdeclarativepainteditem.cpp
parent291dce4ceba88a6cada0415524e3466621ac1612 (diff)
downloadQt-e9a25332df933227c6b71a1654260d8421f56415.zip
Qt-e9a25332df933227c6b71a1654260d8421f56415.tar.gz
Qt-e9a25332df933227c6b71a1654260d8421f56415.tar.bz2
Fix TextEdit clipping when not wrapped. Rename most-useful-wrap-mode to "Wrap".
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativepainteditem.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativepainteditem.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
index c4f0b86..13d1b61 100644
--- a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
@@ -152,8 +152,6 @@ void QDeclarativePaintedItem::setContentsSize(const QSize &size)
Q_D(QDeclarativePaintedItem);
if (d->contentsSize == size) return;
d->contentsSize = size;
- setImplicitWidth(size.width()*d->contentsScale);
- setImplicitHeight(size.height()*d->contentsScale);
clearCache();
update();
emit contentsSizeChanged();
@@ -170,8 +168,6 @@ void QDeclarativePaintedItem::setContentsScale(qreal scale)
Q_D(QDeclarativePaintedItem);
if (d->contentsScale == scale) return;
d->contentsScale = scale;
- setImplicitWidth(d->contentsSize.width()*scale);
- setImplicitHeight(d->contentsSize.height()*scale);
clearCache();
update();
emit contentsScaleChanged();
@@ -232,6 +228,19 @@ void QDeclarativePaintedItem::setCacheFrozen(bool frozen)
// XXX clear cache?
}
+QRectF QDeclarativePaintedItem::boundingRect() const
+{
+ Q_D(const QDeclarativePaintedItem);
+ qreal w = d->mWidth;
+ QSizeF sz = d->contentsSize * d->contentsScale;
+ if (w < sz.width())
+ w = sz.width();
+ qreal h = d->mHeight;
+ if (h < sz.height())
+ h = sz.height();
+ return QRectF(0.0,0.0,w,h);
+}
+
/*!
\internal
*/