diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-04-26 23:51:01 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-27 05:30:42 (GMT) |
commit | 7224b30171f10ee659014af0c340ad43782fe22b (patch) | |
tree | 088d8d0e609d8e3bf648a21e70bff5cfb1dd501f /src/declarative/graphicsitems | |
parent | 96f0449f6e7b9c3f35fb7c546b6bbdb633d1a7bc (diff) | |
download | Qt-7224b30171f10ee659014af0c340ad43782fe22b.zip Qt-7224b30171f10ee659014af0c340ad43782fe22b.tar.gz Qt-7224b30171f10ee659014af0c340ad43782fe22b.tar.bz2 |
Fix crash in TextEdit when changing text content.
Verify the text cursor is not before attempting to deference the
layout it refers to.
Task-number: QTBUG-25389
Change-Id: I8a75393c5af9f81821ad91cbfdd7bbca0d84b1a2
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextedit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index c23718b..7482669 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -547,7 +547,7 @@ bool QDeclarativeTextEditPrivate::determineHorizontalAlignment() Q_Q(QDeclarativeTextEdit); if (hAlignImplicit && q->isComponentComplete()) { bool alignToRight; - if (text.isEmpty()) { + if (text.isEmpty() && !control->textCursor().isNull()) { const QString preeditText = control->textCursor().block().layout()->preeditAreaText(); alignToRight = preeditText.isEmpty() ? QApplication::keyboardInputDirection() == Qt::RightToLeft |