summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Studio/Palettes/Timeline
diff options
context:
space:
mode:
authorAndras Mantia <andras@kdab.com>2017-12-20 16:12:30 +0200
committerAndras Mantia <andras@kdab.com>2018-01-03 09:51:47 +0000
commite7f657ce720b1aa3a816bc295311cfdcd0129878 (patch)
tree6399a20adeeb606f574cbdbf154d5c8e59b70fe3 /src/Authoring/Studio/Palettes/Timeline
parent709fe5eb1685acc6f99a1ec6ab88318fcd171505 (diff)
Switch back to normal pointers
Fixes crashes on exit due to double deletion, as they are qobject pointers and had a parent specified. Change-Id: I1dbda749c7ad008330c341aac42b739efaedf4f9 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Palettes/Timeline')
-rw-r--r--src/Authoring/Studio/Palettes/Timeline/TimelineView.cpp12
-rw-r--r--src/Authoring/Studio/Palettes/Timeline/TimelineView.h5
2 files changed, 8 insertions, 9 deletions
diff --git a/src/Authoring/Studio/Palettes/Timeline/TimelineView.cpp b/src/Authoring/Studio/Palettes/Timeline/TimelineView.cpp
index 93d1a25b..b764e31c 100644
--- a/src/Authoring/Studio/Palettes/Timeline/TimelineView.cpp
+++ b/src/Authoring/Studio/Palettes/Timeline/TimelineView.cpp
@@ -59,7 +59,7 @@ TimelineView::TimelineView(QWidget *parent) : QQuickWidget(parent)
QAbstractItemModel *TimelineView::objectModel() const
{
- return m_model.data(); // should be safe as it is passed only to QML
+ return m_model; // should be safe as it is passed only to QML
}
void TimelineView::setSelection(int index)
@@ -146,13 +146,13 @@ void TimelineView::OnActiveSlide(const qt3dsdm::Qt3DSDMSlideHandle &inMaster, in
auto *theSlideSystem = GetDoc()->GetStudioSystem()->GetSlideSystem();
auto theSlideInstance = theSlideSystem->GetSlideInstance(inSlide);
- m_objectListModel.reset(new TimelineObjectModel(g_StudioApp.GetCore(),
- GetDoc()->GetActiveRootInstance(), this));
+ m_objectListModel = new TimelineObjectModel(g_StudioApp.GetCore(),
+ GetDoc()->GetActiveRootInstance(), this);
m_objectListModel->setTimelineItemBinding(m_translationManager->GetOrCreate(theSlideInstance));
- if (m_model.isNull())
- m_model.reset(new FlatObjectListModel(m_objectListModel.data(), this));
+ if (!m_model)
+ m_model = new FlatObjectListModel(m_objectListModel, this);
else
- m_model->setSourceModel(m_objectListModel.data());
+ m_model->setSourceModel(m_objectListModel);
// expand by default the first level
m_model->expandTo(QModelIndex(), m_objectListModel->index(0, 0, m_objectListModel->index(0,0)));
diff --git a/src/Authoring/Studio/Palettes/Timeline/TimelineView.h b/src/Authoring/Studio/Palettes/Timeline/TimelineView.h
index 1981f649..a09f9307 100644
--- a/src/Authoring/Studio/Palettes/Timeline/TimelineView.h
+++ b/src/Authoring/Studio/Palettes/Timeline/TimelineView.h
@@ -30,7 +30,6 @@
#define TIMELINEVIEW_H
#include <QQuickWidget>
-#include <QScopedPointer>
#include "DispatchListeners.h"
#include "ObjectListModel.h"
@@ -84,8 +83,8 @@ private:
std::vector<std::shared_ptr<qt3dsdm::ISignalConnection>>
m_Connections; /// connections to the DataModel
- QScopedPointer<FlatObjectListModel> m_model;
- QScopedPointer<TimelineObjectModel> m_objectListModel;
+ FlatObjectListModel *m_model = nullptr;
+ TimelineObjectModel *m_objectListModel = nullptr;
qt3dsdm::Qt3DSDMSlideHandle m_activeSlide;
CTimelineTranslationManager *m_translationManager = nullptr;