aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@digia.com>2012-10-08 10:34:09 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-09 11:23:09 +0200
commit5ed77ed046873f9df293753b05a4c5eee0b1f61d (patch)
tree16195d0577752245421a48ba31f0fbeb2628d23d
parent67eb7a3763b4003768dd10c65f8043fef39fbf8d (diff)
crash fix in designersupport
Unless result is an insert iterator, qCopy() assumes that all iterators in the range [result + (finish - start)] are dereferenceable. This is not the case for an empty list. Using foreach instead. Change-Id: I2212a88e9b462ae2220ba5aeb43c662592cec57f Reviewed-by: Marco Bubke <marco.bubke@digia.com>
-rw-r--r--src/quick/designer/designersupport.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/quick/designer/designersupport.cpp b/src/quick/designer/designersupport.cpp
index 5584a242a7..c06e8f0579 100644
--- a/src/quick/designer/designersupport.cpp
+++ b/src/quick/designer/designersupport.cpp
@@ -363,7 +363,10 @@ QList<QObject*> DesignerSupport::statesForItem(QQuickItem *item)
{
QList<QObject*> objectList;
QList<QQuickState *> stateList = QQuickItemPrivate::get(item)->_states()->states();
- qCopy(stateList.begin(), stateList.end(), objectList.begin());
+
+ objectList.reserve(stateList.size());
+ foreach (QQuickState* state, stateList)
+ objectList.append(state);
return objectList;
}