Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Fix crash on composition selection

parent 92425f81
......@@ -28,10 +28,10 @@
#include <KColorScheme>
#include <QFontDatabase>
KeyframeView::KeyframeView(std::shared_ptr<KeyframeModelList> model, QWidget *parent)
KeyframeView::KeyframeView(std::shared_ptr<KeyframeModelList> model, int duration, QWidget *parent)
: QWidget(parent)
, m_model(model)
, m_duration(1)
, m_duration(duration)
, m_position(0)
, m_currentKeyframe(-1)
, m_currentKeyframeOriginal(-1)
......
......@@ -32,7 +32,7 @@ class KeyframeView : public QWidget
Q_OBJECT
public:
explicit KeyframeView(std::shared_ptr<KeyframeModelList> model, QWidget *parent = nullptr);
explicit KeyframeView(std::shared_ptr<KeyframeModelList> model, int duration, QWidget *parent = nullptr);
void setDuration(int dur);
public slots:
......
......@@ -47,7 +47,6 @@
KeyframeWidget::KeyframeWidget(std::shared_ptr<AssetParameterModel> model, QModelIndex index, QWidget *parent)
: AbstractParamWidget(model, index, parent)
, m_keyframes(model->getKeyframeModel())
, m_monitorHelper(nullptr)
, m_neededScene(MonitorSceneType::MonitorSceneDefault)
{
......@@ -60,8 +59,9 @@ KeyframeWidget::KeyframeWidget(std::shared_ptr<AssetParameterModel> model, QMode
bool ok = false;
int duration = m_model->data(m_index, AssetParameterModel::ParentDurationRole).toInt(&ok);
Q_ASSERT(ok);
m_keyframeview = new KeyframeView(m_keyframes, this);
m_keyframeview->setDuration(duration);
m_model->prepareKeyframes();
m_keyframes = m_model->getKeyframeModel();
m_keyframeview = new KeyframeView(m_keyframes, duration, this);
m_buttonAddDelete = new QToolButton(this);
m_buttonAddDelete->setAutoRaise(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment