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
e1617c8d
Commit
e1617c8d
authored
Aug 14, 2022
by
Julius Künzel
💬
Browse files
[Qt6] Port QAbstractItemView::itemDelegate to itemDelegateForIndex
parent
37d7fe25
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/bin.cpp
View file @
e1617c8d
...
...
@@ -698,7 +698,11 @@ void MyListView::mousePressEvent(QMouseEvent *event)
if
(
event
->
button
()
==
Qt
::
LeftButton
)
{
QModelIndex
ix
=
indexAt
(
event
->
pos
());
if
(
ix
.
isValid
())
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QAbstractItemDelegate
*
del
=
itemDelegate
(
ix
);
#else
QAbstractItemDelegate
*
del
=
itemDelegateForIndex
(
ix
);
#endif
m_dragType
=
static_cast
<
BinListItemDelegate
*>
(
del
)
->
dragType
;
m_startPos
=
event
->
pos
();
}
else
{
...
...
@@ -755,7 +759,11 @@ void MyListView::mouseMoveEvent(QMouseEvent *event)
QModelIndex
index
=
indexAt
(
event
->
pos
());
if
(
index
.
isValid
())
{
if
(
KdenliveSettings
::
hoverPreview
())
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QAbstractItemDelegate
*
del
=
itemDelegate
(
index
);
#else
QAbstractItemDelegate
*
del
=
itemDelegateForIndex
(
index
);
#endif
if
(
del
)
{
auto
delegate
=
static_cast
<
BinListItemDelegate
*>
(
del
);
QRect
vRect
=
visualRect
(
index
);
...
...
@@ -805,7 +813,11 @@ void MyTreeView::mousePressEvent(QMouseEvent *event)
if
(
event
->
button
()
==
Qt
::
LeftButton
)
{
QModelIndex
ix
=
indexAt
(
event
->
pos
());
if
(
ix
.
isValid
())
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QAbstractItemDelegate
*
del
=
itemDelegate
(
ix
);
#else
QAbstractItemDelegate
*
del
=
itemDelegateForIndex
(
ix
);
#endif
m_dragType
=
static_cast
<
BinItemDelegate
*>
(
del
)
->
dragType
;
m_startPos
=
event
->
pos
();
}
else
{
...
...
@@ -857,7 +869,11 @@ void MyTreeView::mouseMoveEvent(QMouseEvent *event)
QModelIndex
index
=
indexAt
(
event
->
pos
());
if
(
index
.
isValid
())
{
if
(
KdenliveSettings
::
hoverPreview
())
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QAbstractItemDelegate
*
del
=
itemDelegate
(
index
);
#else
QAbstractItemDelegate
*
del
=
itemDelegateForIndex
(
index
);
#endif
int
frame
=
static_cast
<
BinItemDelegate
*>
(
del
)
->
getFrame
(
index
,
event
->
pos
().
x
());
if
(
frame
>=
0
)
{
emit
displayBinFrame
(
index
,
frame
,
event
->
modifiers
()
&
Qt
::
ShiftModifier
);
...
...
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