Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
d9a9c00d
Commit
d9a9c00d
authored
May 27, 2022
by
Jean-Baptiste Mardelle
Browse files
Fix crash on undo center keyframe
parent
ce28f4d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/assets/keyframes/view/keyframeview.cpp
View file @
d9a9c00d
...
...
@@ -53,6 +53,15 @@ KeyframeView::KeyframeView(std::shared_ptr<KeyframeModelList> model, int duratio
setSizePolicy
(
QSizePolicy
(
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
Fixed
));
connect
(
m_model
.
get
(),
&
KeyframeModelList
::
modelChanged
,
this
,
&
KeyframeView
::
slotModelChanged
);
connect
(
m_model
.
get
(),
&
KeyframeModelList
::
modelDisplayChanged
,
this
,
&
KeyframeView
::
slotModelDisplayChanged
);
m_centerConnection
=
connect
(
this
,
&
KeyframeView
::
updateKeyframeOriginal
,
this
,
[
&
](
int
pos
)
{
m_currentKeyframeOriginal
=
pos
;
update
();
});
}
KeyframeView
::~
KeyframeView
()
{
QObject
::
disconnect
(
m_centerConnection
);
}
void
KeyframeView
::
slotModelChanged
()
...
...
@@ -268,13 +277,11 @@ void KeyframeView::slotCenterKeyframe()
break
;
}
Fun
local_redo
=
[
this
,
position
=
m_position
]()
{
m_currentKeyframeOriginal
=
position
;
update
();
emit
updateKeyframeOriginal
(
position
);
return
true
;
};
Fun
local_undo
=
[
this
,
sourcePosition
]()
{
m_currentKeyframeOriginal
=
sourcePosition
;
update
();
emit
updateKeyframeOriginal
(
sourcePosition
);
return
true
;
};
local_redo
();
...
...
src/assets/keyframes/view/keyframeview.hpp
View file @
d9a9c00d
...
...
@@ -20,6 +20,7 @@ class KeyframeView : public QWidget
public:
explicit
KeyframeView
(
std
::
shared_ptr
<
KeyframeModelList
>
model
,
int
duration
,
QWidget
*
parent
=
nullptr
);
~
KeyframeView
()
override
;
void
setDuration
(
int
dur
,
int
inPoint
);
const
QString
getAssetId
();
/** @brief Copy a keyframe parameter to selected keyframes. */
...
...
@@ -94,12 +95,14 @@ private:
QColor
m_colSelected
;
QColor
m_colKeyframe
;
QColor
m_colKeyframeBg
;
QMetaObject
::
Connection
m_centerConnection
;
signals:
void
seekToPos
(
int
pos
);
void
atKeyframe
(
bool
isKeyframe
,
bool
singleKeyframe
);
void
modified
();
void
activateEffect
();
void
updateKeyframeOriginal
(
int
pos
);
};
#endif
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment