diff options
author | Liang Qi <liang.qi@qt.io> | 2017-10-24 12:32:39 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2017-10-24 12:32:39 +0000 |
commit | 1aa91f8b0b140c417c6e97dfd22fa498d31bceb6 (patch) | |
tree | 714b9c79ca84cf9bda9912ea723cd925f0e8f4c9 /src/quick/items | |
parent | 83c8f8d90a960965c1f166c4421f514f4236212a (diff) | |
parent | 15dd1b7883f5dbe66266aeb588381f85f3532ab9 (diff) |
Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/qquickloader.cpp | 9 | ||||
-rw-r--r-- | src/quick/items/qquicktextcontrol.cpp | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp index cd356a9eeb..27afe5a5db 100644 --- a/src/quick/items/qquickloader.cpp +++ b/src/quick/items/qquickloader.cpp @@ -916,9 +916,14 @@ void QQuickLoaderPrivate::_q_updateSize(bool loaderGeometryChanged) if (!item) return; - if (loaderGeometryChanged && q->widthValid()) + const bool needToUpdateWidth = loaderGeometryChanged && q->widthValid(); + const bool needToUpdateHeight = loaderGeometryChanged && q->heightValid(); + + if (needToUpdateWidth && needToUpdateHeight) + item->setSize(QSizeF(q->width(), q->height())); + else if (needToUpdateWidth) item->setWidth(q->width()); - if (loaderGeometryChanged && q->heightValid()) + else if (needToUpdateHeight) item->setHeight(q->height()); if (updatingSize) diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp index 2e23d69e5b..874c02fc99 100644 --- a/src/quick/items/qquicktextcontrol.cpp +++ b/src/quick/items/qquicktextcontrol.cpp @@ -432,6 +432,7 @@ void QQuickTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged / #endif emit q->selectionChanged(); } + q->updateCursorRectangle(true); } void QQuickTextControlPrivate::_q_updateCurrentCharFormatAndSelection() @@ -1150,7 +1151,6 @@ void QQuickTextControlPrivate::mouseMoveEvent(QMouseEvent *e, const QPointF &mou if (interactionFlags & Qt::TextEditable) { if (cursor.position() != oldCursorPos) { emit q->cursorPositionChanged(); - q->updateCursorRectangle(true); } _q_updateCurrentCharFormatAndSelection(); #if QT_CONFIG(im) @@ -1159,7 +1159,6 @@ void QQuickTextControlPrivate::mouseMoveEvent(QMouseEvent *e, const QPointF &mou #endif } else if (cursor.position() != oldCursorPos) { emit q->cursorPositionChanged(); - q->updateCursorRectangle(true); } selectionChanged(true); repaintOldAndNewSelection(oldSelection); |