diff options
| author | J-P Nurmi <[email protected]> | 2017-04-12 09:51:25 +0200 |
|---|---|---|
| committer | J-P Nurmi <[email protected]> | 2017-04-25 20:12:49 +0000 |
| commit | 3390cc0274b7f71fec1e627017e24cd82904ab0b (patch) | |
| tree | 2a65cc4b319c70ab8d69e1990c1771643447f692 /src/qml/jsruntime/qv4qobjectwrapper.cpp | |
| parent | 1a3dd2031a8151bf9d50d070840fb664f7fd5d44 (diff) | |
QQuickText: apply updateSize() optimization for item change listeners
QQuickTextPrivate::updateSize() emits implicitWidthChanged() and
implicitHeightChanged() to see if anything is connected to the signals
and therefore calls getImplicitWidth() or getImplicitHeight(), which
again call updateSize() recursively. This way it can detect the
recursion and avoid doing the size calculation multiple times.
The problem with emitting the change notifier signals directly is that
item change listeners (QQuickItemChangeListener) do not get notified.
Item change listeners are commonly used by Qt Quick Layouts and Qt
Quick Controls 2. By calling QQuickItemPrivate::implicitWidthChanged()
and implicitHeightChanged() the item change listeners are also called
in addition to emitting the change notifier signals.
Results from qmlbench delegates_buttoncontrol2.qml run with the very
latest dev-branch of qtquickcontrols2:
Before:
Average: 130.2 frames; using samples; MedianAll=130; StdDev=1.92354, CoV=0.0147737
After:
Average: 139.4 frames; using samples; MedianAll=140; StdDev=0.894427, CoV=0.00641626
Task-number: QTBUG-59746
Change-Id: I4461cdf8ddc25f80a38756a1e2b5e3d7d1e84791
Reviewed-by: Robin Burchell <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper.cpp')
0 files changed, 0 insertions, 0 deletions
