diff options
author | Eskil Abrahamsen Blomfeldt <eblomfel@trolltech.com> | 2009-08-05 13:33:08 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-01-14 12:49:09 (GMT) |
commit | 135dcf11efe11dacb15f4c384b302d99a0470320 (patch) | |
tree | 71f3f18bd34013313bef94856b314d3fb2e69ffe /src/gui/text/qtextengine.cpp | |
parent | 4cfca7cf456722ee8659b595f231f3cc2033b80d (diff) | |
download | Qt-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/text/qtextengine.cpp')
-rw-r--r-- | src/gui/text/qtextengine.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 5343085..b27b0b7 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2640,6 +2640,46 @@ QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFo init(si, font, format); } +QTextItemInt::QTextItemInt(const QTextItemInt &other) + : descent(other.descent), ascent(other.ascent), width(other.width), + flags(other.flags), justified(other.justified), underlineStyle(other.underlineStyle), + charFormat(other.charFormat), num_chars(other.num_chars), chars(other.chars), + fontEngine(other.fontEngine), f(other.f), glyphs(other.glyphs), + logClusters(other.logClusters) +{ +} + + +QTextItemInt QTextItemInt::clone(char *glyphLayoutMemory, unsigned short *logClusterMemory) const +{ + QTextItemInt ti(*this); + + ti.glyphs = glyphs.clone(glyphLayoutMemory); + ti.logClusters = logClusterMemory; + memmove(logClusterMemory, logClusters, glyphs.numGlyphs * sizeof(unsigned short)); + + return ti; +} + +QTextItemInt &QTextItemInt::operator=(const QTextItemInt &other) +{ + descent = other.descent; + ascent = other.ascent; + width = other.width; + flags = other.flags; + justified = other.justified; + underlineStyle = other.underlineStyle; + const_cast<QTextCharFormat &>(charFormat) = other.charFormat; + num_chars = other.num_chars; + chars = other.chars; + fontEngine = other.fontEngine; + f = other.f; + glyphs = other.glyphs; + logClusters = other.logClusters; + + return *this; +} + void QTextItemInt::init(const QScriptItem &si, QFont *font, const QTextCharFormat &format) { // explicitly initialize flags so that initFontAttributes can be called |