| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Updated version of LGPL and FDL licenseheaders.
Apply release phase licenseheaders for all source files.
Reviewed-by: Trust Me
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Missing include
|
|
|
|
|
|
| |
Make QPaintEngineEx::drawStaticTextItem() pure virtual to make sure
it's implemented in all engines, and implement the paint buffer version
to make gui compile.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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().
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Q_DECLARE_PRIVATE requires d_ptr to be a QFooPointer<>-object.
|
|
|
|
|
| |
Adds copy constructor, operator==, operator= and operator!= to
QStaticText. Implemented using an implicitly shared private object.
|
|
|
|
|
| |
The QStaticText(QString) constructor has been replaced by a constructor
with defaults for the additional arguments
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The rectangle should clip the text vertically and break lines
horizontally, to mirror behavior of QPainter::drawText().
|
|
|
|
|
| |
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.
|
|
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.
|