diff options
author | Joona Petrell <joona.t.petrell@nokia.com> | 2011-03-04 03:26:12 (GMT) |
---|---|---|
committer | Joona Petrell <joona.t.petrell@nokia.com> | 2011-03-04 03:36:56 (GMT) |
commit | 9f674617daf03026d78f8ce18328cbe6c31b689d (patch) | |
tree | ec41ebf4edba3bbedc6ae8e53ef8a24b7b8cc98a /src/declarative/graphicsitems | |
parent | 94bf3f5acd1342687c55fc5d82077ca89d59b633 (diff) | |
download | Qt-9f674617daf03026d78f8ce18328cbe6c31b689d.zip Qt-9f674617daf03026d78f8ce18328cbe6c31b689d.tar.gz Qt-9f674617daf03026d78f8ce18328cbe6c31b689d.tar.bz2 |
Remove text alignment of empty QML editors following the layout direction
Task-number: QTBUG-15880
Reviewed-by: Martin Jones
Removed implicit text alignment of empty text in QML editor
following the application's default layout direction.
Change was originally made few days ago in the commit
88253db8a7d7910e1393b1948fb3747117538c92. Aligning empty and
neutral text to the right for RTL locales requires much more
comprehensive changes to the Qt's internal text classes than
initially thought.
Change-Id: I93a26df259b87dff47d57423949270656746c9a7
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetext.cpp | 5 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextedit.cpp | 5 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextinput.cpp | 5 |
3 files changed, 3 insertions, 12 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 66a2355..3988f7f 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -218,10 +218,7 @@ void QDeclarativeTextPrivate::determineHorizontalAlignment() if (hAlignImplicit && q->isComponentComplete()) { // if no explicit alignment has been set, follow the natural layout direction of the text QDeclarativeText::HAlignment previousAlign = hAlign; - if (text.isEmpty() && QApplication::layoutDirection() == Qt::RightToLeft) - hAlign = QDeclarativeText::AlignRight; - else - hAlign = text.isRightToLeft() ? QDeclarativeText::AlignRight : QDeclarativeText::AlignLeft; + hAlign = text.isRightToLeft() ? QDeclarativeText::AlignRight : QDeclarativeText::AlignLeft; if (previousAlign != hAlign) emit q->horizontalAlignmentChanged(hAlign); } diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 5e1459c..78729aa 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -1547,10 +1547,7 @@ void QDeclarativeTextEditPrivate::determineHorizontalAlignment() if (hAlignImplicit && q->isComponentComplete()) { // if no explicit alignment has been set, follow the natural layout direction of the text QDeclarativeTextEdit::HAlignment previousAlign = hAlign; - if (text.isEmpty() && QApplication::layoutDirection() == Qt::RightToLeft) - hAlign = QDeclarativeTextEdit::AlignRight; - else - hAlign = rightToLeftText ? QDeclarativeTextEdit::AlignRight : QDeclarativeTextEdit::AlignLeft; + hAlign = rightToLeftText ? QDeclarativeTextEdit::AlignRight : QDeclarativeTextEdit::AlignLeft; if (previousAlign != hAlign) emit q->horizontalAlignmentChanged(hAlign); } diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index d9d9335..670a6ea 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -1283,10 +1283,7 @@ void QDeclarativeTextInputPrivate::determineHorizontalAlignment() QString text = control->text(); // if no explicit alignment has been set, follow the natural layout direction of the text QDeclarativeTextInput::HAlignment previousAlign = hAlign; - if (text.isEmpty() && QApplication::layoutDirection() == Qt::RightToLeft) - hAlign = QDeclarativeTextInput::AlignRight; - else - hAlign = text.isRightToLeft() ? QDeclarativeTextInput::AlignRight : QDeclarativeTextInput::AlignLeft; + hAlign = text.isRightToLeft() ? QDeclarativeTextInput::AlignRight : QDeclarativeTextInput::AlignLeft; if (previousAlign != hAlign) emit q->horizontalAlignmentChanged(hAlign); } |