From 790268130926f318c007b41439c9d60463666e34 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 31 Mar 2014 09:58:13 +0200 Subject: Fix performance regression of parent setting during QML object creation This showed up in the profiles again: In QML we create a lot of objects with many children and sending a child event each time is expensive. That's why the VME didn't do that and hadn't done so in ages. This patch restores that behavior and aspect of loading performance. Change-Id: I5078fe330d913dc832b284aaecf031152dc80802 Reviewed-by: Lars Knoll --- src/qml/qml/qqmlobjectcreator.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/qml/qml/qqmlobjectcreator.cpp') diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index e4e0d63b37..9d1f5758a8 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -1073,9 +1073,8 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isCo return 0; } } - // ### use no-event variant if (parent) - instance->setParent(parent); + QQml_setParent_noEvent(instance, parent); ddata = QQmlData::get(instance, /*create*/true); ddata->lineNumber = obj->location.line; -- cgit v1.2.3