From cee97322cab0c14e1e3cce7773ba82c6aca86bb3 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 30 Mar 2010 09:32:48 +1000 Subject: Make sure cursor delegate is parented. setParentItem no longer sets QObject parent. --- src/declarative/graphicsitems/qdeclarativetextedit.cpp | 2 ++ src/declarative/graphicsitems/qdeclarativetextinput.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 7dacfbb..03b2425 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -43,6 +43,7 @@ #include "qdeclarativetextedit_p_p.h" #include "qdeclarativeevents_p_p.h" +#include #include #include @@ -485,6 +486,7 @@ void QDeclarativeTextEdit::loadCursorDelegate() this, SLOT(moveCursorDelegate())); d->control->setCursorWidth(0); dirtyCache(cursorRect()); + QDeclarative_setParent_noEvent(d->cursor, this); d->cursor->setParentItem(this); d->cursor->setHeight(QFontMetrics(d->font).height()); moveCursorDelegate(); diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index f57ffc1..88801a4 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -42,6 +42,7 @@ #include "qdeclarativetextinput_p.h" #include "qdeclarativetextinput_p_p.h" +#include #include #include @@ -619,6 +620,7 @@ void QDeclarativeTextInput::createCursor() return; } + QDeclarative_setParent_noEvent(d->cursorItem, this); d->cursorItem->setParentItem(this); d->cursorItem->setX(d->control->cursorToX()); d->cursorItem->setHeight(d->control->height()); -- cgit v0.12