summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@nokia.com>2009-06-16 13:45:33 (GMT)
committerThomas Hartmann <Thomas.Hartmann@nokia.com>2009-06-16 13:54:11 (GMT)
commit6f4779a7ac3dcfca23124f20bba6ab650e4a8a04 (patch)
tree41b4a76685d310ebfe4a9be8925a223acda35aa9 /src/declarative/qml
parent59629ac728f2fdbc3047554d715e2f908b1844c4 (diff)
downloadQt-6f4779a7ac3dcfca23124f20bba6ab650e4a8a04.zip
Qt-6f4779a7ac3dcfca23124f20bba6ab650e4a8a04.tar.gz
Qt-6f4779a7ac3dcfca23124f20bba6ab650e4a8a04.tar.bz2
Fixing QWidget support
Reviewed-by: Kai Koehne
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qmlvme.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp
index ccf12b0..be09190 100644
--- a/src/declarative/qml/qmlvme.cpp
+++ b/src/declarative/qml/qmlvme.cpp
@@ -193,7 +193,17 @@ QObject *QmlVME::run(QStack<QObject *> &stack, QmlContext *ctxt, QmlCompiledComp
}
if (!stack.isEmpty()) {
QObject *parent = stack.top();
- o->setParent(parent);
+ if (o->isWidgetType()) {
+ QWidget *widget = static_cast<QWidget*>(o);
+ if (parent->isWidgetType()) {
+ QWidget *parentWidget = static_cast<QWidget*>(parent);
+ widget->setParent(parentWidget);
+ } else {
+ // TODO: parent might be a layout
+ }
+ } else {
+ o->setParent(parent);
+ }
}
stack.push(o);
}