diff options
author | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2009-05-06 09:37:12 (GMT) |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2009-05-06 09:49:59 (GMT) |
commit | 4b4c852c2e5c360f19d1656ba4ac077764931ac1 (patch) | |
tree | 88a62f20c17a68c03b9bb91ea5703f60948e4ffe /src/declarative/qml | |
parent | ae87a5853040d0a101cdfd40911e7cfa84542fc9 (diff) | |
download | Qt-4b4c852c2e5c360f19d1656ba4ac077764931ac1.zip Qt-4b4c852c2e5c360f19d1656ba4ac077764931ac1.tar.gz Qt-4b4c852c2e5c360f19d1656ba4ac077764931ac1.tar.bz2 |
Add some support for QWidget (again)
QObject::setParent is not allowed for QWidgets
using QWidget::setParent instead if QObject::isWidgetType()
Reviewed-by: Kai Koehne
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qmlvme.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index 82df3bc..ca4f9c9 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -48,6 +48,7 @@ #include <private/qmlcustomparser_p.h> #include <qperformancelog.h> #include <QStack> +#include <QWidget> #include <private/qmlcompiledcomponent_p.h> #include <QColor> #include <QPointF> @@ -274,7 +275,11 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in } if (!stack.isEmpty()) { QObject *parent = stack.top(); - o->setParent(parent); + if (o->isWidgetType()) { + qobject_cast<QWidget*>(o)->setParent(qobject_cast<QWidget*>(parent)); + } else { + o->setParent(parent); + } } stack.push(o); } |