aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktext.cpp
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2017-11-29 16:40:07 +0100
committerAleix Pol Gonzalez <aleixpol@kde.org>2018-07-31 16:38:01 +0000
commite92f76cf9ea91e87ec2e3e68234899fd9c12142f (patch)
treef90d2d8a3d7a787368a25b8e868835cbf7d3fe9c /src/quick/items/qquicktext.cpp
parent6952f40a3ef47e5bc62286f75b26b2d79eaa9d74 (diff)
Increase fine-grained signals for some properties in Text
Text.[content/painted][Width/Height] were being always notified of changes at bulk. This is can be harmful in performance of QML applications that will trigger change requests on the program whenever a property is modified. This introduces separate signals so it's not a problem anymore. Change-Id: I5b82cf13158298dbc91157b837d0ed4aadeb86cf Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/quick/items/qquicktext.cpp')
-rw-r--r--src/quick/items/qquicktext.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 3c260165f7..3cce30aaf6 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -486,6 +486,10 @@ void QQuickTextPrivate::updateSize()
if (layedOutTextRect.size() != previousSize)
emit q->contentSizeChanged();
+ if (layedOutTextRect.width() != previousSize.width())
+ emit q->contentWidthChanged(layedOutTextRect.width());
+ if (layedOutTextRect.height() != previousSize.height())
+ emit q->contentHeightChanged(layedOutTextRect.height());
updateType = UpdatePaintNode;
q->update();
}