Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
16219780
Commit
16219780
authored
Jun 14, 2012
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: PLTreeView: Show details as tooltip
parent
bd733d23
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
0 deletions
+68
-0
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+27
-0
modules/gui/qt4/components/playlist/views.cpp
modules/gui/qt4/components/playlist/views.cpp
+38
-0
modules/gui/qt4/components/playlist/views.hpp
modules/gui/qt4/components/playlist/views.hpp
+3
-0
No files found.
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
16219780
...
...
@@ -389,6 +389,33 @@ QVariant PLModel::data( const QModelIndex &index, const int role ) const
f
.
setBold
(
true
);
return
QVariant
(
f
);
}
else
if
(
role
==
Qt
::
ToolTipRole
)
{
QString
artUrl
=
getArtUrl
(
index
);
if
(
artUrl
.
isEmpty
()
)
artUrl
=
":/noart"
;
QString
duration
=
qtr
(
"unknown"
);
QString
name
;
PL_LOCK
;
input_item_t
*
p_item
=
item
->
inputItem
();
if
(
!
p_item
)
{
PL_UNLOCK
;
return
QVariant
();
}
if
(
p_item
->
i_duration
>
0
)
{
char
*
psz
=
psz_column_meta
(
item
->
inputItem
(),
COLUMN_DURATION
);
duration
=
qfu
(
psz
);
free
(
psz
);
}
name
=
QString
(
p_item
->
psz_name
);
PL_UNLOCK
;
return
QVariant
(
QString
(
"<img width=
\"
128
\"
height=
\"
128
\"
align=
\"
left
\"
src=
\"
%1
\"
/><div><b>%2</b><br/>%3</div>"
)
.
arg
(
artUrl
)
.
arg
(
name
)
.
arg
(
qtr
(
"Duration"
)
+
": "
+
duration
)
);
}
else
if
(
role
==
Qt
::
BackgroundRole
&&
isCurrent
(
index
)
)
{
return
QVariant
(
QBrush
(
Qt
::
gray
)
);
...
...
modules/gui/qt4/components/playlist/views.cpp
View file @
16219780
...
...
@@ -313,6 +313,19 @@ void PlIconView::dragMoveEvent ( QDragMoveEvent * event )
QAbstractItemView
::
dragMoveEvent
(
event
);
}
bool
PlIconView
::
viewportEvent
(
QEvent
*
event
)
{
if
(
event
->
type
()
==
QEvent
::
ToolTip
)
{
event
->
ignore
();
return
true
;
}
else
{
return
QAbstractItemView
::
viewportEvent
(
event
);
}
}
PlListView
::
PlListView
(
PLModel
*
,
QWidget
*
parent
)
:
QListView
(
parent
)
{
setViewMode
(
QListView
::
ListMode
);
...
...
@@ -350,6 +363,19 @@ void PlListView::keyPressEvent( QKeyEvent *event )
QListView
::
keyPressEvent
(
event
);
}
bool
PlListView
::
viewportEvent
(
QEvent
*
event
)
{
if
(
event
->
type
()
==
QEvent
::
ToolTip
)
{
event
->
ignore
();
return
true
;
}
else
{
return
QAbstractItemView
::
viewportEvent
(
event
);
}
}
void
PlTreeView
::
setModel
(
QAbstractItemModel
*
model
)
{
QTreeView
::
setModel
(
model
);
...
...
@@ -477,3 +503,15 @@ void PicFlowView::playItem( int i_item )
emit
activated
(
model
()
->
index
(
i_item
,
0
)
);
}
bool
PicFlowView
::
viewportEvent
(
QEvent
*
event
)
{
if
(
event
->
type
()
==
QEvent
::
ToolTip
)
{
event
->
ignore
();
return
true
;
}
else
{
return
QAbstractItemView
::
viewportEvent
(
event
);
}
}
modules/gui/qt4/components/playlist/views.hpp
View file @
16219780
...
...
@@ -71,6 +71,7 @@ public:
protected:
virtual
void
startDrag
(
Qt
::
DropActions
supportedActions
);
virtual
void
dragMoveEvent
(
QDragMoveEvent
*
event
);
virtual
bool
viewportEvent
(
QEvent
*
);
};
class
PlListView
:
public
QListView
...
...
@@ -83,6 +84,7 @@ protected:
virtual
void
startDrag
(
Qt
::
DropActions
supportedActions
);
virtual
void
dragMoveEvent
(
QDragMoveEvent
*
event
);
virtual
void
keyPressEvent
(
QKeyEvent
*
event
);
virtual
bool
viewportEvent
(
QEvent
*
);
};
class
PlTreeView
:
public
QTreeView
...
...
@@ -114,6 +116,7 @@ protected:
virtual
bool
isIndexHidden
(
const
QModelIndex
&
)
const
;
virtual
QRegion
visualRegionForSelection
(
const
QItemSelection
&
)
const
;
virtual
void
setSelection
(
const
QRect
&
,
QFlags
<
QItemSelectionModel
::
SelectionFlag
>
);
virtual
bool
viewportEvent
(
QEvent
*
);
private:
PictureFlow
*
picFlow
;
...
...
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