summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qstatictext.h
Commit message (Collapse)AuthorAgeFilesLines
* Add prepare() function to QStaticTextEskil Abrahamsen Blomfeldt2010-01-141-1/+6
| | | | | | Allow the QStaticText layout to be completely defined prior to painting by introducing a function for setting the font and transform on the object ahead of using it with a QPainter.
* Remove font property in QStaticText and fix handling translation onEskil Abrahamsen Blomfeldt2010-01-141-6/+1
| | | | | | | | | | | | | painter 1. The font property in QStaticText has been removed. Rather than set a font on the text explicitly, it picks up the font from the painter. If you change the font on the painter, the text layout will have to be updated, like with a matrix. 2. The translation might not be the only transformation on the painter, so rather than translate back to origo, we explicitly set dx and dy on the transform to 0.0 for the duration of the function. 3. Update test to reflect changes
* Support maximumSize for the layout of the text in a QStaticTextEskil Abrahamsen Blomfeldt2010-01-141-1/+4
| | | | | | | 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.
* Speed optimization for QStaticTextEskil Abrahamsen Blomfeldt2010-01-141-0/+2
| | | | | | | Don't use QVector to store the text items, but put them in a regular array for quick access. drawStaticText() is now about 2.7 times the speed of drawText().
* Optimize QStaticText for one line stringsEskil Abrahamsen Blomfeldt2010-01-141-4/+1
| | | | | | | QTextLayout takes a lot of memory. We can get a bigger speed-up and a more reasonable memory consumption by only supporting the single line static texts and caching the text items. We need to copy some structs from the text engine, since this is on the stack.
* Compile on S60Eskil Abrahamsen Blomfeldt2010-01-141-0/+1
|
* CompileEskil Abrahamsen Blomfeldt2010-01-141-2/+2
| | | | Q_DECLARE_PRIVATE requires d_ptr to be a QFooPointer<>-object.
* Add operators and implicit sharing to QStaticTextEskil Abrahamsen Blomfeldt2010-01-141-2/+8
| | | | | Adds copy constructor, operator==, operator= and operator!= to QStaticText. Implemented using an implicitly shared private object.
* Remove ambiguous overload for QStaticText() constructorEskil Abrahamsen Blomfeldt2010-01-141-1/+0
| | | | | The QStaticText(QString) constructor has been replaced by a constructor with defaults for the additional arguments
* Add lazy initialization to QStaticTextEskil Abrahamsen Blomfeldt2010-01-141-1/+15
| | | | | | People should be able to initialize the QStaticText lazily, or change its data after instantiation. Each of the setters will recalculate the layout to make sure it's always in sync.
* Fix formatting/clipping rectangle in QPainter::drawStaticText()Eskil Abrahamsen Blomfeldt2010-01-141-0/+1
| | | | | The rectangle should clip the text vertically and break lines horizontally, to mirror behavior of QPainter::drawText().
* Start support for formatting text within a bounding rectEskil Abrahamsen Blomfeldt2010-01-141-1/+1
| | | | | Support to mirror drawText(QRectF, QString). Instead of a rect you give the text a static size and then paint it to an arbitrary point later on.
* Introduce QStaticText APIEskil Abrahamsen Blomfeldt2010-01-141-0/+69
Much of the time in drawText() is used on text layouting, which is wasted time when the text is not updated every frame. QStaticText is meant to cache the relevant parts of this work. It currently uses a copy-paste of the layout code in QPainter::drawText() and 99% of the time in QPainter::drawStaticText() is spent in drawTextItem(). We can use QTextLayout here instead without losing much.