diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-08-24 14:54:53 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-08-27 15:06:01 +0000 |
commit | 9ebd96f2cb81edd47b45beac8498aa0d0f2e8a0d (patch) | |
tree | b3a8fea3ac5caa15390b1054f24d9c8fa908e704 /src/Authoring/Studio/Palettes | |
parent | d83edd789188020bb028e314a27fae0bc8a1c1e7 (diff) |
Retain ownership of DataInputSelectView in the cpp side
InspectorControlView::showDataInputChooser() returned a pointer to
DataInputSelectView instance, which caused the ownership of it to
transfer to QML engine. In general, when a plain QObject pointer is
returned from C++ side to QML, the QML engine assumes ownership of said
object unless ownership is explicitly retained on C++ side using
QQmlEngine::setObjectOwnership(). Since we did't use the returned
pointer from InspectorControlView::showDataInputChooser, I simply
removed the return value to retain the ownership on C++ side.
Task-number: QT3DS-2127
Change-Id: I5c10b5e4dbd3468015f96a87aa14365672bc93c2
Reviewed-by: Janne Kangas <janne.kangas@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Palettes')
-rw-r--r-- | src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp | 4 | ||||
-rw-r--r-- | src/Authoring/Studio/Palettes/Inspector/InspectorControlView.h | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp index e6333315..820e2987 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp @@ -510,7 +510,7 @@ QObject *InspectorControlView::showObjectReference(int handle, int instance, con return m_objectReferenceView; } -QObject *InspectorControlView::showDataInputChooser(int handle, int instance, const QPoint &point) +void InspectorControlView::showDataInputChooser(int handle, int instance, const QPoint &point) { if (!m_dataInputChooserView) { const QVector<EDataType> acceptedTypes; @@ -543,8 +543,6 @@ QObject *InspectorControlView::showDataInputChooser(int handle, int instance, co m_inspectorControlModel->currentControllerValue(instance, handle), handle, instance); CDialogs::showWidgetBrowser(this, m_dataInputChooserView, point); - - return m_dataInputChooserView; } QColor InspectorControlView::showColorDialog(const QColor &color) diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.h b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.h index 2d812c2a..9ac1a714 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.h +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.h @@ -75,7 +75,7 @@ public: Q_INVOKABLE QObject *showMeshChooser(int handle, int instance, const QPoint &point); Q_INVOKABLE QObject *showObjectReference(int handle, int instance, const QPoint &point); Q_INVOKABLE QObject *showTextureChooser(int handle, int instance, const QPoint &point); - Q_INVOKABLE QObject *showDataInputChooser(int handle, int instance, const QPoint &point); + Q_INVOKABLE void showDataInputChooser(int handle, int instance, const QPoint &point); Q_INVOKABLE QColor showColorDialog(const QColor &color); Q_INVOKABLE bool toolTipsEnabled(); Q_INVOKABLE QString convertPathToProjectRoot(const QString &presentationPath); |