aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextedit.cpp
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@digia.com>2014-03-11 11:02:43 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-13 15:26:20 +0100
commit2cd0b96a269efa96f1f2759980ea207b94a995e2 (patch)
treea246ea97d3b59821eff03ecdb713e8783cf693bf /src/quick/items/qquicktextedit.cpp
parent110c38a8a6fa30ad8e114d26df88fc3c23ec42de (diff)
Ensure TextEdit's text is vertically aligned after resizing its height.
The current code only updates the alignment if the width of the TextEdit changed, but we must also check if the height has changed. Task-number: QTBUG-36069 [ChangeLog][QtQuick][TextEdit] Fixed TextEdit not vertically aligning its text after having its height changed. Change-Id: I0b2d6a7384457ca1018fc9899c82699e8ecfcbd4 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/quick/items/qquicktextedit.cpp')
-rw-r--r--src/quick/items/qquicktextedit.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index 665572038a..6fc1a3f4a5 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -1260,7 +1260,8 @@ void QQuickTextEdit::geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry)
{
Q_D(QQuickTextEdit);
- if (newGeometry.width() != oldGeometry.width() && widthValid() && !d->inLayout) {
+ if (!d->inLayout && ((newGeometry.width() != oldGeometry.width() && widthValid())
+ || (newGeometry.height() != oldGeometry.height() && heightValid()))) {
updateSize();
updateWholeDocument();
moveCursorDelegate();