Skip to content
GitLab
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
4db4d42f
Commit
4db4d42f
authored
Oct 31, 2022
by
Jean-Baptiste Mardelle
Browse files
Fix incorrect model used for retrieving data
parent
8f581ac1
Pipeline
#258902
failed with stage
in 4 minutes and 38 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/project/dialogs/guideslist.cpp
View file @
4db4d42f
...
...
@@ -34,7 +34,7 @@ public:
return
QString
(
"%1 %2"
).
arg
(
QIdentityProxyModel
::
data
(
index
,
MarkerListModel
::
TCRole
).
toString
(),
QIdentityProxyModel
::
data
(
index
,
role
).
toString
());
}
return
sourceModel
()
->
data
(
index
,
role
);
return
sourceModel
()
->
data
(
mapToSource
(
index
)
,
role
);
}
};
...
...
@@ -74,7 +74,7 @@ void GuidesList::saveGuides()
void
GuidesList
::
editGuide
(
const
QModelIndex
&
ix
)
{
if
(
!
ix
.
isValid
())
return
;
int
frame
=
m_
sortModel
->
data
(
ix
,
MarkerListModel
::
FrameRole
).
toInt
();
int
frame
=
m_
proxy
->
data
(
ix
,
MarkerListModel
::
FrameRole
).
toInt
();
GenTime
pos
(
frame
,
pCore
->
getCurrentFps
());
if
(
auto
markerModel
=
m_model
.
lock
())
{
markerModel
->
editMarkerGui
(
pos
,
qApp
->
activeWindow
(),
false
);
...
...
@@ -88,7 +88,7 @@ void GuidesList::removeGuide()
Fun
undo
=
[]()
{
return
true
;
};
Fun
redo
=
[]()
{
return
true
;
};
for
(
auto
&
ix
:
selection
)
{
int
frame
=
m_
sortModel
->
data
(
ix
,
MarkerListModel
::
FrameRole
).
toInt
();
int
frame
=
m_
proxy
->
data
(
ix
,
MarkerListModel
::
FrameRole
).
toInt
();
GenTime
pos
(
frame
,
pCore
->
getCurrentFps
());
markerModel
->
removeMarker
(
pos
,
undo
,
redo
);
}
...
...
@@ -126,8 +126,10 @@ void GuidesList::selectionChanged(const QItemSelection &selected, const QItemSel
return
;
}
const
QModelIndex
ix
=
selected
.
indexes
().
first
();
if
(
!
ix
.
isValid
())
return
;
int
pos
=
m_sortModel
->
data
(
ix
,
MarkerListModel
::
FrameRole
).
toInt
();
if
(
!
ix
.
isValid
())
{
return
;
}
int
pos
=
m_proxy
->
data
(
ix
,
MarkerListModel
::
FrameRole
).
toInt
();
pCore
->
seekMonitor
(
Kdenlive
::
ProjectMonitor
,
pos
);
}
...
...
@@ -137,8 +139,8 @@ void GuidesList::setModel(std::weak_ptr<MarkerListModel> model, MarkerSortModel
{
m_model
=
std
::
move
(
model
);
if
(
auto
markerModel
=
m_model
.
lock
())
{
m_
sort
Model
=
viewModel
;
guides_list
->
setModel
(
viewModel
);
m_
proxy
->
setSource
Model
(
viewModel
)
;
guides_list
->
setModel
(
m_proxy
);
guides_list
->
setSelectionMode
(
QAbstractItemView
::
ExtendedSelection
);
connect
(
guides_list
->
selectionModel
(),
&
QItemSelectionModel
::
selectionChanged
,
this
,
&
GuidesList
::
selectionChanged
);
connect
(
markerModel
.
get
(),
&
MarkerListModel
::
categoriesChanged
,
this
,
&
GuidesList
::
rebuildCategories
);
...
...
src/project/dialogs/guideslist.h
View file @
4db4d42f
...
...
@@ -42,7 +42,6 @@ private:
/** @brief Set the marker model that will be displayed. */
std
::
weak_ptr
<
MarkerListModel
>
m_model
;
QIdentityProxyModel
*
m_proxy
;
MarkerSortModel
*
m_sortModel
;
QVBoxLayout
m_categoriesLayout
;
QButtonGroup
*
catGroup
{
nullptr
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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