Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
b2e1a820
Commit
b2e1a820
authored
Sep 11, 2010
by
Jean-Baptiste Kempf
Committed by
Jean-Baptiste Kempf
Sep 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt, selector: cleanup
Code cleanup, forward declaration and cosmetics
parent
9eb0513a
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
166 additions
and
167 deletions
+166
-167
modules/gui/qt4/components/playlist/selector.cpp
modules/gui/qt4/components/playlist/selector.cpp
+123
-128
modules/gui/qt4/components/playlist/selector.hpp
modules/gui/qt4/components/playlist/selector.hpp
+43
-39
No files found.
modules/gui/qt4/components/playlist/selector.cpp
View file @
b2e1a820
This diff is collapsed.
Click to expand it.
modules/gui/qt4/components/playlist/selector.hpp
View file @
b2e1a820
...
...
@@ -29,20 +29,16 @@
# include "config.h"
#endif
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QStyledItemDelegate>
#include <QPainter>
#include <QPushButton>
#include <QLabel>
#include <QHBoxLayout>
#include "util/customwidgets.hpp"
#include <vlc_playlist.h>
#include "qt4.hpp"
#include "util/customwidgets.hpp"
/* QVLCFramelessButton */
#include <QTreeWidget>
class
QHBoxLayout
;
class
QPainter
;
class
QTreeWidgetItem
;
class
PlaylistWidget
;
class
QLabel
;
enum
SelectorItemType
{
CATEGORY_TYPE
,
...
...
@@ -57,13 +53,13 @@ enum SpecialData {
};
enum
{
TYPE_ROLE
=
Qt
::
UserRole
,
NAME_ROLE
,
//QString
LONGNAME_ROLE
,
//QString
PL_ITEM_ROLE
,
//playlist_item_t*
PL_ITEM_ID_ROLE
,
//playlist_item_t->i_id
IN_ITEM_ROLE
,
//input_item_t->i_id
SPECIAL_ROLE
//SpecialData
TYPE_ROLE
=
Qt
::
UserRole
+
1
,
NAME_ROLE
,
//QString
LONGNAME_ROLE
,
//QString
PL_ITEM_ROLE
,
//playlist_item_t*
PL_ITEM_ID_ROLE
,
//playlist_item_t->i_id
IN_ITEM_ROLE
,
//input_item_t->i_id
SPECIAL_ROLE
//SpecialData
};
enum
ItemAction
{
...
...
@@ -74,11 +70,8 @@ enum ItemAction {
class
SelectorActionButton
:
public
QVLCFramelessButton
{
public:
SelectorActionButton
(
QWidget
*
parent
=
NULL
)
:
QVLCFramelessButton
(
parent
)
{}
private:
void
paintEvent
(
QPaintEvent
*
);
protected:
virtual
void
paintEvent
(
QPaintEvent
*
);
};
class
PLSelItem
:
public
QWidget
...
...
@@ -86,20 +79,27 @@ class PLSelItem : public QWidget
Q_OBJECT
public:
PLSelItem
(
QTreeWidgetItem
*
,
const
QString
&
);
void
setText
(
const
QString
&
);
void
setText
(
const
QString
&
text
)
{
lbl
->
setText
(
text
);
}
const
QString
text
()
{
return
lbl
->
text
();
}
void
addAction
(
ItemAction
,
const
QString
&
toolTip
=
0
);
QTreeWidgetItem
*
treeItem
()
{
return
qitem
;
}
QString
text
()
{
return
lbl
->
text
();
}
public
slots
:
void
showAction
();
void
hideAction
();
void
showAction
()
{
if
(
lblAction
)
lblAction
->
show
();
}
void
hideAction
()
{
if
(
lblAction
)
lblAction
->
hide
();
}
private
slots
:
void
triggerAction
()
{
emit
action
(
this
);
}
signals:
void
action
(
PLSelItem
*
);
private:
void
enterEvent
(
QEvent
*
);
void
leaveEvent
(
QEvent
*
);
inline
void
enterEvent
(
QEvent
*
){
showAction
();
}
inline
void
leaveEvent
(
QEvent
*
){
hideAction
();
}
QTreeWidgetItem
*
qitem
;
QVLCFramelessButton
*
lblAction
;
QLabel
*
lbl
;
...
...
@@ -116,20 +116,24 @@ public:
virtual
~
PLSelector
();
protected:
friend
class
PlaylistWidget
;
private:
QStringList
mimeTypes
()
const
;
bool
dropMimeData
(
QTreeWidgetItem
*
,
int
,
const
QMimeData
*
,
Qt
::
DropAction
);
void
dragMoveEvent
(
QDragMoveEvent
*
event
);
void
createItems
();
void
drawBranches
(
QPainter
*
,
const
QRect
&
,
const
QModelIndex
&
)
const
;
PLSelItem
*
addItem
(
SelectorItemType
type
,
const
char
*
str
,
bool
drop
,
QTreeWidgetItem
*
parentItem
=
0
);
PLSelItem
*
addItem
(
SelectorItemType
type
,
const
char
*
str
,
bool
drop
=
false
,
QTreeWidgetItem
*
parentItem
=
0
);
PLSelItem
*
addPodcastItem
(
playlist_item_t
*
p_item
);
inline
PLSelItem
*
itemWidget
(
QTreeWidgetItem
*
);
intf_thread_t
*
p_intf
;
QTreeWidgetItem
*
podcastsParent
;
int
podcastsParentId
;
void
drawBranches
(
QPainter
*
,
const
QRect
&
,
const
QModelIndex
&
)
const
;
QStringList
mimeTypes
()
const
;
bool
dropMimeData
(
QTreeWidgetItem
*
,
int
,
const
QMimeData
*
,
Qt
::
DropAction
);
void
dragMoveEvent
(
QDragMoveEvent
*
event
);
intf_thread_t
*
p_intf
;
QTreeWidgetItem
*
podcastsParent
;
int
podcastsParentId
;
private
slots
:
void
setSource
(
QTreeWidgetItem
*
item
);
void
plItemAdded
(
int
,
int
);
...
...
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