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
a0827f2d
Commit
a0827f2d
authored
Mar 20, 2022
by
Jean-Baptiste Mardelle
Browse files
Fix selection in bin icon view
parent
ae8f2a06
Pipeline
#152751
passed with stage
in 6 minutes and 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/bin/bin.cpp
View file @
a0827f2d
...
...
@@ -2981,19 +2981,22 @@ void Bin::selectClip(const std::shared_ptr<ProjectClip> &clip)
QModelIndex
ix
=
m_itemModel
->
getIndexFromItem
(
clip
);
int
row
=
ix
.
row
();
const
QModelIndex
id
=
m_itemModel
->
index
(
row
,
0
,
ix
.
parent
());
const
QModelIndex
id2
=
m_itemModel
->
index
(
row
,
m_itemModel
->
columnCount
()
-
1
,
ix
.
parent
());
if
(
id
.
isValid
()
&&
id2
.
isValid
())
{
m_proxyModel
->
selectionModel
()
->
select
(
QItemSelection
(
m_proxyModel
->
mapFromSource
(
id
),
m_proxyModel
->
mapFromSource
(
id2
)),
QItemSelectionModel
::
SelectCurrent
);
}
// Ensure parent folder is expanded
if
(
m_listType
==
BinTreeView
)
{
// Make sure parent folder is expanded
auto
*
view
=
static_cast
<
QTreeView
*>
(
m_itemView
);
view
->
expand
(
m_proxyModel
->
mapFromSource
(
ix
.
parent
()));
const
QModelIndex
id2
=
m_itemModel
->
index
(
row
,
m_itemModel
->
columnCount
()
-
1
,
ix
.
parent
());
if
(
id
.
isValid
()
&&
id2
.
isValid
())
{
m_proxyModel
->
selectionModel
()
->
select
(
QItemSelection
(
m_proxyModel
->
mapFromSource
(
id
),
m_proxyModel
->
mapFromSource
(
id2
)),
QItemSelectionModel
::
SelectCurrent
);
}
}
else
{
// Ensure parent folder is currently opened
m_itemView
->
setRootIndex
(
m_proxyModel
->
mapFromSource
(
ix
.
parent
()));
m_upAction
->
setEnabled
(
!
ix
.
parent
().
data
(
AbstractProjectItem
::
DataId
).
toString
().
isEmpty
());
if
(
id
.
isValid
())
{
m_proxyModel
->
selectionModel
()
->
setCurrentIndex
(
m_proxyModel
->
mapFromSource
(
id
),
QItemSelectionModel
::
ClearAndSelect
);
}
}
m_itemView
->
scrollTo
(
m_proxyModel
->
mapFromSource
(
ix
),
QAbstractItemView
::
EnsureVisible
);
}
...
...
Write
Preview
Markdown
is supported
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