diff options
author | Christian Strømme <christian.stromme@qt.io> | 2018-08-20 15:29:41 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-08-28 13:01:30 +0000 |
commit | 29f22c2e0444f00c62667437c64ccceb85d2951a (patch) | |
tree | dca463f124f68369dddc8c31338ae9e531bb9319 /src/runtime/q3dsuippresentation.cpp | |
parent | 7aed790d66a468dbd5c58813fafe1cef2630333b (diff) |
Add infrastructure to connect properties from Quick API to the Q3DS API
Removes the syncProperties() function, as it's strictly not needed
anymore. If there's a need to intercept one or more property change,
two different options are provided:
1. Add a property on the target object that is prefixed with "qq_" or
2. Re-implement the propertChanged() function.
Change-Id: If2ef181f09f17916b0d2d9606663175958e46e77
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/runtime/q3dsuippresentation.cpp')
-rw-r--r-- | src/runtime/q3dsuippresentation.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/q3dsuippresentation.cpp b/src/runtime/q3dsuippresentation.cpp index 23836f0..11c2aa6 100644 --- a/src/runtime/q3dsuippresentation.cpp +++ b/src/runtime/q3dsuippresentation.cpp @@ -40,6 +40,7 @@ #include <QtMath> #include <QImage> +#include <QtCore/qobject.h> #include <QtCore/qmetaobject.h> QT_BEGIN_NAMESPACE @@ -411,6 +412,12 @@ Q3DSGraphObject::Q3DSGraphObject(Q3DSGraphObject::Type type) Q3DSGraphObject::~Q3DSGraphObject() { + const QVariant v = property(QByteArrayLiteral("_q3dsbinding")); + if (v.isValid()) { + QObject *src = v.value<QObject *>(); + QMetaObject::invokeMethod(src, "unbind", Qt::DirectConnection); + } + destroyGraph(); delete m_attached; } |