diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-07-10 11:30:53 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-16 02:30:52 +0200 |
commit | 6e5944df6349c080b4e4550e2fd085cfc34cf207 (patch) | |
tree | e24a33d2554bf485ebfac34ce83aa83cca455598 /src/quick/items/qquicktextedit_p_p.h | |
parent | 80dd824864df17bb1293a4438325f2b20306861b (diff) |
Fix horizontal alignment of unwrapped text in TextEdit.
When the actual width of the text in a QTextDocument exceeds the
specificed textWidth it is aligned left irregardless of the text
alignment. Compensate by doing our own alignment of the laid out
document.
Change-Id: I7df900316ffb3ecdf01ddb053480a60a8258182d
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/quick/items/qquicktextedit_p_p.h')
-rw-r--r-- | src/quick/items/qquicktextedit_p_p.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/items/qquicktextedit_p_p.h b/src/quick/items/qquicktextedit_p_p.h index f412aac7ec..c02e34c166 100644 --- a/src/quick/items/qquicktextedit_p_p.h +++ b/src/quick/items/qquicktextedit_p_p.h @@ -72,7 +72,7 @@ public: QQuickTextEditPrivate() : color(QRgb(0xFF000000)), selectionColor(QRgb(0xFF000080)), selectedTextColor(QRgb(0xFFFFFFFF)) - , textMargin(0.0), yoff(0), font(sourceFont), cursorComponent(0), cursorItem(0), document(0), control(0) + , textMargin(0.0), xoff(0), yoff(0), font(sourceFont), cursorComponent(0), cursorItem(0), document(0), control(0) , lastSelectionStart(0), lastSelectionEnd(0), lineCount(0) , hAlign(QQuickTextEdit::AlignLeft), vAlign(QQuickTextEdit::AlignTop) , format(QQuickTextEdit::PlainText), wrapMode(QQuickTextEdit::NoWrap) @@ -109,6 +109,7 @@ public: QSizeF contentSize; qreal textMargin; + qreal xoff; qreal yoff; QString text; |