Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
20431e3b
Commit
20431e3b
authored
Jan 28, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: iconView delegate: encode PLModel::IsCurrent(QModelIndex) into cache key
This way item is redrawn when current item changes.
parent
13942d47
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
modules/gui/qt4/components/playlist/icon_view.cpp
modules/gui/qt4/components/playlist/icon_view.cpp
+2
-1
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+1
-0
modules/gui/qt4/components/playlist/playlist_model.hpp
modules/gui/qt4/components/playlist/playlist_model.hpp
+4
-0
No files found.
modules/gui/qt4/components/playlist/icon_view.cpp
View file @
20431e3b
...
...
@@ -82,7 +82,8 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
// picture where all the rendering happens and which will be cached
QPixmap
pix
;
QString
key
=
title
+
artist
+
artUrl
;
QString
key
=
title
+
artist
+
artUrl
+
QString
(
index
.
data
(
PLModel
::
IsCurrentRole
).
toInt
()
);
if
(
QPixmapCache
::
find
(
key
,
pix
))
{
// cool, we found it in the cache
...
...
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
20431e3b
...
...
@@ -346,6 +346,7 @@ QVariant PLModel::data( const QModelIndex &index, int role ) const
QFont
f
;
f
.
setBold
(
true
);
return
QVariant
(
f
);
}
}
else
if
(
role
==
IsCurrentRole
)
return
QVariant
(
isCurrent
(
index
)
);
return
QVariant
();
}
...
...
modules/gui/qt4/components/playlist/playlist_model.hpp
View file @
20431e3b
...
...
@@ -54,6 +54,10 @@ class PLModel : public QAbstractItemModel
friend
class
PLItem
;
public:
enum
{
IsCurrentRole
=
Qt
::
UserRole
};
PLModel
(
playlist_t
*
,
intf_thread_t
*
,
playlist_item_t
*
,
QObject
*
parent
=
0
);
~
PLModel
();
...
...
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