summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-11-29 13:21:38 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2015-01-20 16:15:45 +0100
commitfc8adfea9f5e09e5f47ac4e592e5d9db471caede (patch)
tree0a4a83bd384498fefa688f166b655fe95996bf7b /src/corelib/kernel
parent463c559962ad480c69fdbe6ebcf741a4b2bd6eee (diff)
Introduce helper for QML to allow creating QWidget hierarchies
Commit 1259c5768e410361bcd8b5cf0c2057a2ebabda83 in qtdeclarative removed the ability to create QWidgets in QML by giving them the correct parent, which requires calling QWidget::setParent instead of QObject::setParent. This patch introduces a hook that will allow QtQml to give widgets a proper parent. Change-Id: I84c57ca5032582c43e405219343d55ac9cf2ffa0 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qobject.cpp1
-rw-r--r--src/corelib/kernel/qobject_p.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 223de0c8e0..2f9ef9ca4a 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -177,6 +177,7 @@ void (*QAbstractDeclarativeData::parentChanged)(QAbstractDeclarativeData *, QObj
void (*QAbstractDeclarativeData::signalEmitted)(QAbstractDeclarativeData *, QObject *, int, void **) = 0;
int (*QAbstractDeclarativeData::receivers)(QAbstractDeclarativeData *, const QObject *, int) = 0;
bool (*QAbstractDeclarativeData::isSignalConnected)(QAbstractDeclarativeData *, const QObject *, int) = 0;
+void (*QAbstractDeclarativeData::setWidgetParent)(QObject *, QObject *) = 0;
QObjectData::~QObjectData() {}
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index b663bc8d8c..dba5f0265f 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -87,6 +87,7 @@ public:
static void (*signalEmitted)(QAbstractDeclarativeData *, QObject *, int, void **);
static int (*receivers)(QAbstractDeclarativeData *, const QObject *, int);
static bool (*isSignalConnected)(QAbstractDeclarativeData *, const QObject *, int);
+ static void (*setWidgetParent)(QObject *, QObject *); // Used by the QML engine to specify parents for widgets. Set by QtWidgets.
};
// This is an implementation of QAbstractDeclarativeData that is identical with