summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainter.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-08-05 13:33:08 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-01-14 12:49:09 (GMT)
commit135dcf11efe11dacb15f4c384b302d99a0470320 (patch)
tree71f3f18bd34013313bef94856b314d3fb2e69ffe /src/gui/painting/qpainter.cpp
parent4cfca7cf456722ee8659b595f231f3cc2033b80d (diff)
downloadQt-135dcf11efe11dacb15f4c384b302d99a0470320.zip
Qt-135dcf11efe11dacb15f4c384b302d99a0470320.tar.gz
Qt-135dcf11efe11dacb15f4c384b302d99a0470320.tar.bz2
Support maximumSize for the layout of the text in a QStaticText
Put back maximumSize property in QStaticText to allow matching calls to drawText with a target rectangle. Implementation is done by having a dummy paint engine which records the calls to drawTextItem() and storing these, then replaying them later.
Diffstat (limited to 'src/gui/painting/qpainter.cpp')
-rw-r--r--src/gui/painting/qpainter.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 50d27ac..1057893 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5729,13 +5729,9 @@ void QPainter::drawStaticText(const QPointF &position, const QStaticText &static
return;
const QStaticTextPrivate *staticText_d = QStaticTextPrivate::get(&staticText);
-
- QFixed x = QFixed::fromReal(position.x());
for (int i=0; i<staticText_d->itemCount; ++i) {
const QTextItemInt &gf = staticText_d->items[i];
- if (gf.num_chars != 0)
- drawTextItem(QPointF(x.toReal(), position.y()), gf);
- x += gf.width;
+ d->engine->drawTextItem(staticText_d->itemPositions[i] + position, gf);
}
}