summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxtextedit.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-09-16 06:26:46 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-09-16 06:26:46 (GMT)
commit633b4b0655bf47b6f5100ee9a6c2f692b0aeb081 (patch)
treed5deeb37b770f2fdff140c2f75a1f38a992da2be /src/declarative/fx/qfxtextedit.cpp
parentd3b03a7d6c4ad023572d7099ee9f9ec3f0711d04 (diff)
downloadQt-633b4b0655bf47b6f5100ee9a6c2f692b0aeb081.zip
Qt-633b4b0655bf47b6f5100ee9a6c2f692b0aeb081.tar.gz
Qt-633b4b0655bf47b6f5100ee9a6c2f692b0aeb081.tar.bz2
Experiment with implicitWidth and implicitHeight functions.
Diffstat (limited to 'src/declarative/fx/qfxtextedit.cpp')
-rw-r--r--src/declarative/fx/qfxtextedit.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp
index 72f12cc..0185ce0 100644
--- a/src/declarative/fx/qfxtextedit.cpp
+++ b/src/declarative/fx/qfxtextedit.cpp
@@ -1044,18 +1044,13 @@ void QFxTextEdit::updateSize()
yoff = dy/2;
}
setBaselineOffset(fm.ascent() + yoff + d->textMargin);
- if (!widthValid()) {
- int newWidth = (int)d->document->idealWidth();
- d->document->setTextWidth(newWidth); // ### QTextDoc> Alignment will not work unless textWidth is set
- setImplicitWidth(newWidth);
- }
- if (!heightValid()) {
- if (d->text.isEmpty()) {
- setImplicitHeight(fm.height());
- } else {
- setImplicitHeight((int)d->document->size().height());
- }
- }
+
+ //### need to comfirm cost of always setting these
+ int newWidth = (int)d->document->idealWidth();
+ d->document->setTextWidth(newWidth); // ### QTextDoc> Alignment will not work unless textWidth is set. Does Text need this line as well?
+ setImplicitWidth(newWidth);
+ setImplicitHeight(d->text.isEmpty() ? fm.height() : (int)d->document->size().height());
+
setContentsSize(QSize(width(), height()));
} else {
d->dirty = true;