aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextedit_p_p.h
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-07-10 11:30:53 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-16 02:30:52 +0200
commit6e5944df6349c080b4e4550e2fd085cfc34cf207 (patch)
treee24a33d2554bf485ebfac34ce83aa83cca455598 /src/quick/items/qquicktextedit_p_p.h
parent80dd824864df17bb1293a4438325f2b20306861b (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.h3
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;