aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/stateseditor
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2018-01-13 18:49:39 +0100
committerThomas Hartmann <thomas.hartmann@qt.io>2018-01-23 10:14:12 +0000
commita7515d25a971aeaf5c54cc9a52a325e05a7c6e98 (patch)
tree02dfeac35705e4b0c727a7fe05830de1fcdf0178 /src/plugins/qmldesigner/components/stateseditor
parent92d32c3a2618719383d4f8678bfd4f5ee041a198 (diff)
QmlDesigner: Avoid detachs
The non const overloads of first() and last() do detach if the reference count is higher than 1. Therefore we use constFirst() and constLast() instead. Change-Id: I737cfc428f1c21f16185b9b51175e181c0ec7068 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/components/stateseditor')
-rw-r--r--src/plugins/qmldesigner/components/stateseditor/stateseditorimageprovider.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorimageprovider.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorimageprovider.cpp
index 36b3794fd21..ec434abb59f 100644
--- a/src/plugins/qmldesigner/components/stateseditor/stateseditorimageprovider.cpp
+++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorimageprovider.cpp
@@ -43,7 +43,7 @@ QImage StatesEditorImageProvider::requestImage(const QString &id, QSize *size, c
bool nodeInstanceViewIsDetached = m_nodeInstanceView.isNull() || !m_nodeInstanceView->model();
if (!nodeInstanceViewIsDetached) {
- QString imageId = id.split(QLatin1Char('-')).first();
+ QString imageId = id.split(QLatin1Char('-')).constFirst();
if (imageId == QLatin1String("baseState")) {
image = m_nodeInstanceView->statePreviewImage(m_nodeInstanceView->rootModelNode());
} else {