From d46e0bacc625dd7e143dc226e7009b48e928cf1d Mon Sep 17 00:00:00 2001 From: Andrew Udvare Date: Sat, 11 Jan 2014 03:45:45 -0800 Subject: [PATCH] Test for string length --- src/widgets/lineedit.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/widgets/lineedit.cpp b/src/widgets/lineedit.cpp index 4d8f9ef5e..7a21b40dc 100644 --- a/src/widgets/lineedit.cpp +++ b/src/widgets/lineedit.cpp @@ -151,7 +151,9 @@ void LineEdit::set_text(const QString& text) { // For some reason Qt will detect any text with LTR at the end as LTR, so instead // compare only the first character - set_rtl(QString(1, text.at(0)).isRightToLeft()); + if (text.length()) { + set_rtl(QString(text.at(0)).isRightToLeft()); + } } void LineEdit::paintEvent(QPaintEvent* e) {