summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index 167db77..f02b7d1 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -1066,9 +1066,14 @@ void QDeclarativeTextEdit::drawContents(QPainter *painter, const QRect &bounds)
void QDeclarativeTextEdit::updateImgCache(const QRectF &rf)
{
Q_D(const QDeclarativeTextEdit);
- QRect r = rf.toRect();
- if (r != QRect(0,0,INT_MAX,INT_MAX)) // Don't translate "everything"
- r = r.translated(0,d->yoff);
+ QRect r;
+ if (!rf.isValid()) {
+ r = QRect(0,0,INT_MAX,INT_MAX);
+ } else {
+ r = rf.toRect();
+ if (r != QRect(0,0,INT_MAX,INT_MAX)) // Don't translate "everything"
+ r = r.translated(0,d->yoff);
+ }
dirtyCache(r);
emit update();
}