summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativetext.cpp
diff options
context:
space:
mode:
authorA-Team <ateam@pad.test.qt.nokia.com>2010-09-09 22:00:10 (GMT)
committerA-Team <ateam@pad.test.qt.nokia.com>2010-09-09 22:00:10 (GMT)
commit03c56248554b731356d283e467e1d31c54e78653 (patch)
tree5cfc5f5009f6534951f85257dddf1be1260b516f /src/declarative/graphicsitems/qdeclarativetext.cpp
parentdd387a0125b577fafc1a3363a4b8cd995053b7db (diff)
parent524379030503600bbca1a8e2b5889b91b0798203 (diff)
downloadQt-03c56248554b731356d283e467e1d31c54e78653.zip
Qt-03c56248554b731356d283e467e1d31c54e78653.tar.gz
Qt-03c56248554b731356d283e467e1d31c54e78653.tar.bz2
Merge branch '4.7-upstream' into 4.7-doc
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetext.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 83098ae..1f4c1c7 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -429,6 +429,9 @@ void QDeclarativeText::setStyle(QDeclarativeText::TextStyle style)
if (d->style == style)
return;
+ // changing to/from Normal requires the boundingRect() to change
+ if (isComponentComplete() && (d->style == Normal || style == Normal))
+ prepareGeometryChange();
d->style = style;
d->markImgDirty();
emit styleChanged(d->style);
@@ -494,8 +497,9 @@ void QDeclarativeText::setHAlign(HAlignment align)
if (d->hAlign == align)
return;
+ if (isComponentComplete())
+ prepareGeometryChange();
d->hAlign = align;
- update();
emit horizontalAlignmentChanged(align);
}
@@ -511,8 +515,9 @@ void QDeclarativeText::setVAlign(VAlignment align)
if (d->vAlign == align)
return;
+ if (isComponentComplete())
+ prepareGeometryChange();
d->vAlign = align;
- update();
emit verticalAlignmentChanged(align);
}
@@ -805,7 +810,6 @@ void QDeclarativeTextPrivate::updateSize()
else
doc->setTextWidth(doc->idealWidth()); // ### Text does not align if width is not set (QTextDoc bug)
dy -= (int)doc->size().height();
- q->prepareGeometryChange();
QSize dsize = doc->size().toSize();
if (dsize != cachedLayoutSize) {
q->prepareGeometryChange();
@@ -882,8 +886,6 @@ void QDeclarativeTextPrivate::drawOutline()
ppm.drawPixmap(pos, imgCache);
ppm.end();
- if (imgCache.size() != img.size())
- q_func()->prepareGeometryChange();
imgCache = img;
}
@@ -902,8 +904,6 @@ void QDeclarativeTextPrivate::drawOutline(int yOffset)
ppm.drawPixmap(pos, imgCache);
ppm.end();
- if (imgCache.size() != img.size())
- q_func()->prepareGeometryChange();
imgCache = img;
}
@@ -1054,8 +1054,6 @@ void QDeclarativeTextPrivate::checkImgCache()
if (style != QDeclarativeText::Normal)
imgStyleCache = wrappedTextImage(true); //### should use styleColor
}
- if (imgCache.size() != newImgCache.size())
- q_func()->prepareGeometryChange();
imgCache = newImgCache;
if (!empty)
switch (style) {
@@ -1205,7 +1203,7 @@ void QDeclarativeText::mousePressEvent(QGraphicsSceneMouseEvent *event)
}
/*!
- \qmlsignal Text::onLinkActivated(link)
+ \qmlsignal Text::onLinkActivated(string link)
This handler is called when the user clicks on a link embedded in the text.
The link must be in rich text or HTML format and the