aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2021-08-04 13:38:04 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2021-08-10 16:29:47 +0200
commit500bd9640ff847d52dde82f863142915be0db1fa (patch)
tree9e1bad1e7f37dcd104286ffb65b1ae9496ecba8b /src/quicktemplates2
parent4a21cf3dd292ccf2a7a9b29d4d0d95b147d6d563 (diff)
SelectionRectangle: set handle parent before incubating
We need to set parentItem before we incubate the handle, otherwise we'll get a lot of errors if the handle has bindings to the parent. Change-Id: If26b34cfc174ff98472ca5c3e680387469fc0027 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 39f86e73654182df54295d76baf033d307425ef2)
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r--src/quicktemplates2/qquickselectionrectangle.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickselectionrectangle.cpp b/src/quicktemplates2/qquickselectionrectangle.cpp
index 1f66184461..60c886cd99 100644
--- a/src/quicktemplates2/qquickselectionrectangle.cpp
+++ b/src/quicktemplates2/qquickselectionrectangle.cpp
@@ -262,13 +262,13 @@ QQuickItem *QQuickSelectionRectanglePrivate::createHandle(QQmlComponent *delegat
Q_Q(QQuickSelectionRectangle);
// Incubate the handle
- const auto handlerTarget = m_selectable->selectionPointerHandlerTarget();
QObject *obj = delegate->beginCreate(QQmlEngine::contextForObject(q));
QQuickItem *handleItem = qobject_cast<QQuickItem*>(obj);
+ const auto handlerTarget = m_selectable->selectionPointerHandlerTarget();
+ handleItem->setParentItem(handlerTarget);
if (auto attached = getAttachedObject(handleItem))
attached->setControl(q);
delegate->completeCreate();
- handleItem->setParentItem(handlerTarget);
if (handleItem->z() == 0)
handleItem->setZ(100);