From 6e5944df6349c080b4e4550e2fd085cfc34cf207 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Tue, 10 Jul 2012 11:30:53 +1000 Subject: 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 --- src/quick/items/qquicktextedit_p_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/quick/items/qquicktextedit_p_p.h') 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; -- cgit v1.2.3