summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qstatictext.h
Commit message (Collapse)AuthorAgeFilesLines
* Update contact information in license headers.Sergio Ahumada2012-08-011-2/+2
| | | | | | | | | | | | | - Replace Nokia contact email address with Qt Project website. - Remove "All rights reserved" line from license headers. As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: Ie7ba62011752fcb149b99b26317c54f2a0cfa931 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Update year in Nokia copyright messages.Jason McDonald2012-01-111-1/+1
| | | | | | | | | Simple search and replace. This commit doesn't touch 3rd-party files, nor translations (where the change is not so simple and will be handled in a separate commit). Change-Id: I4e48513b8078a44a8cd272326685b25338890148 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update licenseheader text in source files for qt4.8Jyri Tahtela2011-05-131-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Update copyright year to 2011.Jason McDonald2011-01-111-1/+1
| | | | Reviewed-by: Trust Me
* Add QTextOption API to QStaticTextEskil Abrahamsen Blomfeldt2010-06-141-1/+4
| | | | | | | | | | | To allow more control over the layout process for a QStaticText, introduce a QTextOption API. This will allow you to, e.g., set an alignment for the text layout. Patch also contains a couple of bug fixes to make right alignment work correctly when you set a text width on the QStaticText. Task-number: QTBUG-9031 Reviewed-by: Samuel
* Make QStaticText layout lazyEskil Abrahamsen Blomfeldt2010-03-291-1/+1
| | | | | | | | | | | | To avoid the unnecessary overhead of doing the text layout every time a part of the QStaticText object is changed, we mark it as invalid instead and do the layout when we have to. This means an overhead on the first paint event for most users. The overhead can be avoided by using the QStaticText::prepare() function and will probably not be noticable anyway, since it's a one-time thing. Task-number: QTBUG-9030 Reviewed-by: Gunnar
* Change QStaticText::setMaximumSize() to setTextWidth()Eskil Abrahamsen Blomfeldt2010-03-291-3/+3
| | | | | | | | | | | | | | | | | | To avoid having to precalculate the height of the laid out text, we now only supply a maximum text width to QStaticText. The only usage of the maximum height would be to clip the results, and clipping should be set separately from the QStaticText call, since this has no impact on the layout of the glyphs. The tests have been updated to reflect the change in logic. We also need a consistent way of specifying the position of the text. Before, the position meant "baseline position" for unbroken text and "top left position" for text with a specified layout width. We want to be consistent, and since baseline position makes no sense for multiline text, we standardize on top left position. Task-number: QTBUG-9029 Reviewed-by: Gunnar
* Fix compilation with namespace.ck2010-02-221-2/+2
|
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2Jason McDonald2010-02-161-2/+7
|\
| * Rename QStaticText::setUseBackendOptimizations to setPerformanceHint()Eskil Abrahamsen Blomfeldt2010-02-161-2/+7
| | | | | | | | | | | | | | Make the API more general and more readable by using a PerformanceHint enum instead of an on/off-trigger for the OpenGL-specific caching. Reviewed-by: Samuel
* | Fix license headers.Jason McDonald2010-02-161-18/+18
|/ | | | Reviewed-by: Trust Me
* Separate out textFormat property from setText() function and removeEskil Abrahamsen Blomfeldt2010-02-151-3/+4
| | | | | | | | | isEmpty() function in QStaticText To make the return value of text() more intuitively clearer, and to make the API more readable, I've separated out the text format into a separate property. The isEmpty() function seemed out-of-place in the API, as suggested by reviews, so it has been removed.
* Add API for rich text and getting actual size of QStaticTextEskil Abrahamsen Blomfeldt2010-02-141-1/+3
| | | | | | Required for several use cases, support for some html tags to change font, color and do advanced text layouts, as well as getting the bounds of the text when drawn.
* Make QStaticText public API againEskil Abrahamsen Blomfeldt2010-02-101-0/+98
| | | | | QStaticText was previously made private API to support inclusion in Qt 4.6.x. This change turns it back into public API for Qt 4.7.0.
* Make QStaticText private APIEskil Abrahamsen Blomfeldt2010-02-011-98/+0
| | | | | | | | Turns QStaticText into private API in preparation for Qt 4.6.x. The related functions in QPainter are marked as internal in the docs. There are already internal functions in QPainter, so this seemed like a reasonable solution. Since the functions require QStaticText they will not be accessible to anyone who does not include private API.
* Improve performance of QStaticText on OpenGL by caching data on GPUEskil Abrahamsen Blomfeldt2010-01-291-0/+3
| | | | | | | | There's a big improvement to be seen in the OpenGL engine by caching the vertex data for the QStaticText in VBOs. In order to have the buffers properly disposed, I've implemented a userdata concept for QStaticTextItem. By default, the optimizations will be turned off, and can be turned on by using the useBackendOptimizations flag.
* Compile for SymbianEskil Abrahamsen Blomfeldt2010-01-261-0/+1
| | | | Missing include
* Implement QPaintBufferEngine::drawStaticTextItem()Eskil Abrahamsen Blomfeldt2010-01-181-0/+2
| | | | | | Make QPaintEngineEx::drawStaticTextItem() pure virtual to make sure it's implemented in all engines, and implement the paint buffer version to make gui compile.
* 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.