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
1cdeaa80
Commit
1cdeaa80
authored
Jan 25, 2010
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: variable renaming so they are more explicit
parent
27f5e6a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
53 deletions
+53
-53
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+51
-51
modules/gui/qt4/components/playlist/standardpanel.hpp
modules/gui/qt4/components/playlist/standardpanel.hpp
+2
-2
No files found.
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
1cdeaa80
...
@@ -62,49 +62,49 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
...
@@ -62,49 +62,49 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
model
=
new
PLModel
(
p_playlist
,
p_intf
,
p_root
,
this
);
model
=
new
PLModel
(
p_playlist
,
p_intf
,
p_root
,
this
);
/* Create and configure the QTreeView */
/* Create and configure the QTreeView */
v
iew
=
new
QTreeView
;
treeV
iew
=
new
QTreeView
;
v
iew
->
setModel
(
model
);
treeV
iew
->
setModel
(
model
);
view2
=
NULL
;
iconView
=
NULL
;
v
iew
->
setIconSize
(
QSize
(
20
,
20
)
);
treeV
iew
->
setIconSize
(
QSize
(
20
,
20
)
);
v
iew
->
setAlternatingRowColors
(
true
);
treeV
iew
->
setAlternatingRowColors
(
true
);
v
iew
->
setAnimated
(
true
);
treeV
iew
->
setAnimated
(
true
);
v
iew
->
setUniformRowHeights
(
true
);
treeV
iew
->
setUniformRowHeights
(
true
);
v
iew
->
setSortingEnabled
(
true
);
treeV
iew
->
setSortingEnabled
(
true
);
v
iew
->
header
()
->
setSortIndicator
(
-
1
,
Qt
::
AscendingOrder
);
treeV
iew
->
header
()
->
setSortIndicator
(
-
1
,
Qt
::
AscendingOrder
);
v
iew
->
header
()
->
setSortIndicatorShown
(
true
);
treeV
iew
->
header
()
->
setSortIndicatorShown
(
true
);
v
iew
->
header
()
->
setClickable
(
true
);
treeV
iew
->
header
()
->
setClickable
(
true
);
v
iew
->
header
()
->
setContextMenuPolicy
(
Qt
::
CustomContextMenu
);
treeV
iew
->
header
()
->
setContextMenuPolicy
(
Qt
::
CustomContextMenu
);
v
iew
->
setSelectionBehavior
(
QAbstractItemView
::
SelectRows
);
treeV
iew
->
setSelectionBehavior
(
QAbstractItemView
::
SelectRows
);
v
iew
->
setSelectionMode
(
QAbstractItemView
::
ExtendedSelection
);
treeV
iew
->
setSelectionMode
(
QAbstractItemView
::
ExtendedSelection
);
v
iew
->
setDragEnabled
(
true
);
treeV
iew
->
setDragEnabled
(
true
);
v
iew
->
setAcceptDrops
(
true
);
treeV
iew
->
setAcceptDrops
(
true
);
v
iew
->
setDropIndicatorShown
(
true
);
treeV
iew
->
setDropIndicatorShown
(
true
);
installEventFilter
(
v
iew
);
installEventFilter
(
treeV
iew
);
/* Saved Settings */
/* Saved Settings */
getSettings
()
->
beginGroup
(
"Playlist"
);
getSettings
()
->
beginGroup
(
"Playlist"
);
if
(
getSettings
()
->
contains
(
"headerStateV2"
)
)
if
(
getSettings
()
->
contains
(
"headerStateV2"
)
)
{
{
v
iew
->
header
()
->
restoreState
(
treeV
iew
->
header
()
->
restoreState
(
getSettings
()
->
value
(
"headerStateV2"
).
toByteArray
()
);
getSettings
()
->
value
(
"headerStateV2"
).
toByteArray
()
);
}
}
else
else
{
{
for
(
int
m
=
1
,
c
=
0
;
m
!=
COLUMN_END
;
m
<<=
1
,
c
++
)
for
(
int
m
=
1
,
c
=
0
;
m
!=
COLUMN_END
;
m
<<=
1
,
c
++
)
{
{
v
iew
->
setColumnHidden
(
c
,
!
(
m
&
COLUMN_DEFAULT
)
);
treeV
iew
->
setColumnHidden
(
c
,
!
(
m
&
COLUMN_DEFAULT
)
);
if
(
m
==
COLUMN_TITLE
)
v
iew
->
header
()
->
resizeSection
(
c
,
200
);
if
(
m
==
COLUMN_TITLE
)
treeV
iew
->
header
()
->
resizeSection
(
c
,
200
);
else
if
(
m
==
COLUMN_DURATION
)
v
iew
->
header
()
->
resizeSection
(
c
,
80
);
else
if
(
m
==
COLUMN_DURATION
)
treeV
iew
->
header
()
->
resizeSection
(
c
,
80
);
}
}
}
}
getSettings
()
->
endGroup
();
getSettings
()
->
endGroup
();
/* Connections for the TreeView */
/* Connections for the TreeView */
CONNECT
(
v
iew
,
activated
(
const
QModelIndex
&
),
CONNECT
(
treeV
iew
,
activated
(
const
QModelIndex
&
),
model
,
activateItem
(
const
QModelIndex
&
)
);
model
,
activateItem
(
const
QModelIndex
&
)
);
CONNECT
(
v
iew
->
header
(),
customContextMenuRequested
(
const
QPoint
&
),
CONNECT
(
treeV
iew
->
header
(),
customContextMenuRequested
(
const
QPoint
&
),
this
,
popupSelectColumn
(
QPoint
)
);
this
,
popupSelectColumn
(
QPoint
)
);
CONNECT
(
model
,
currentChanged
(
const
QModelIndex
&
),
CONNECT
(
model
,
currentChanged
(
const
QModelIndex
&
),
this
,
handleExpansion
(
const
QModelIndex
&
)
);
this
,
handleExpansion
(
const
QModelIndex
&
)
);
...
@@ -142,7 +142,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
...
@@ -142,7 +142,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
BUTTONACT
(
viewButton
,
toggleView
()
);
BUTTONACT
(
viewButton
,
toggleView
()
);
/* Finish the layout */
/* Finish the layout */
layout
->
addWidget
(
v
iew
,
1
,
0
,
1
,
-
1
);
layout
->
addWidget
(
treeV
iew
,
1
,
0
,
1
,
-
1
);
selectColumnsSigMapper
=
new
QSignalMapper
(
this
);
selectColumnsSigMapper
=
new
QSignalMapper
(
this
);
CONNECT
(
selectColumnsSigMapper
,
mapped
(
int
),
CONNECT
(
selectColumnsSigMapper
,
mapped
(
int
),
...
@@ -152,19 +152,19 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
...
@@ -152,19 +152,19 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
StandardPLPanel
::~
StandardPLPanel
()
StandardPLPanel
::~
StandardPLPanel
()
{
{
getSettings
()
->
beginGroup
(
"Playlist"
);
getSettings
()
->
beginGroup
(
"Playlist"
);
getSettings
()
->
setValue
(
"headerStateV2"
,
v
iew
->
header
()
->
saveState
()
);
getSettings
()
->
setValue
(
"headerStateV2"
,
treeV
iew
->
header
()
->
saveState
()
);
getSettings
()
->
endGroup
();
getSettings
()
->
endGroup
();
}
}
/* Unused anymore, but might be useful, like in right-click menu */
/* Unused anymore, but might be useful, like in right-click menu */
void
StandardPLPanel
::
gotoPlayingItem
()
void
StandardPLPanel
::
gotoPlayingItem
()
{
{
v
iew
->
scrollTo
(
model
->
currentIndex
()
);
treeV
iew
->
scrollTo
(
model
->
currentIndex
()
);
}
}
void
StandardPLPanel
::
handleExpansion
(
const
QModelIndex
&
index
)
void
StandardPLPanel
::
handleExpansion
(
const
QModelIndex
&
index
)
{
{
v
iew
->
scrollTo
(
index
);
treeV
iew
->
scrollTo
(
index
);
}
}
/* PopupAdd Menu for the Add Menu */
/* PopupAdd Menu for the Add Menu */
...
@@ -204,7 +204,7 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
...
@@ -204,7 +204,7 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
QAction
*
option
=
menu
.
addAction
(
QAction
*
option
=
menu
.
addAction
(
qfu
(
psz_column_title
(
i
)
)
);
qfu
(
psz_column_title
(
i
)
)
);
option
->
setCheckable
(
true
);
option
->
setCheckable
(
true
);
option
->
setChecked
(
!
v
iew
->
isColumnHidden
(
j
)
);
option
->
setChecked
(
!
treeV
iew
->
isColumnHidden
(
j
)
);
selectColumnsSigMapper
->
setMapping
(
option
,
j
);
selectColumnsSigMapper
->
setMapping
(
option
,
j
);
CONNECT
(
option
,
triggered
(),
selectColumnsSigMapper
,
map
()
);
CONNECT
(
option
,
triggered
(),
selectColumnsSigMapper
,
map
()
);
}
}
...
@@ -213,7 +213,7 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
...
@@ -213,7 +213,7 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
void
StandardPLPanel
::
toggleColumnShown
(
int
i
)
void
StandardPLPanel
::
toggleColumnShown
(
int
i
)
{
{
view
->
setColumnHidden
(
i
,
!
v
iew
->
isColumnHidden
(
i
)
);
treeView
->
setColumnHidden
(
i
,
!
treeV
iew
->
isColumnHidden
(
i
)
);
}
}
/* Search in the playlist */
/* Search in the playlist */
...
@@ -224,7 +224,7 @@ void StandardPLPanel::search( const QString& searchText )
...
@@ -224,7 +224,7 @@ void StandardPLPanel::search( const QString& searchText )
void
StandardPLPanel
::
doPopup
(
QModelIndex
index
,
QPoint
point
)
void
StandardPLPanel
::
doPopup
(
QModelIndex
index
,
QPoint
point
)
{
{
QItemSelectionModel
*
selection
=
v
iew
->
selectionModel
();
QItemSelectionModel
*
selection
=
treeV
iew
->
selectionModel
();
QModelIndexList
list
=
selection
->
selectedIndexes
();
QModelIndexList
list
=
selection
->
selectedIndexes
();
model
->
popup
(
index
,
point
,
list
);
model
->
popup
(
index
,
point
,
list
);
}
}
...
@@ -289,35 +289,35 @@ void StandardPLPanel::keyPressEvent( QKeyEvent *e )
...
@@ -289,35 +289,35 @@ void StandardPLPanel::keyPressEvent( QKeyEvent *e )
void
StandardPLPanel
::
deleteSelection
()
void
StandardPLPanel
::
deleteSelection
()
{
{
QItemSelectionModel
*
selection
=
v
iew
->
selectionModel
();
QItemSelectionModel
*
selection
=
treeV
iew
->
selectionModel
();
QModelIndexList
list
=
selection
->
selectedIndexes
();
QModelIndexList
list
=
selection
->
selectedIndexes
();
model
->
doDelete
(
list
);
model
->
doDelete
(
list
);
}
}
void
StandardPLPanel
::
toggleView
()
void
StandardPLPanel
::
toggleView
()
{
{
if
(
view
&&
v
iew
->
isVisible
()
)
if
(
treeView
&&
treeV
iew
->
isVisible
()
)
{
{
if
(
view2
==
NULL
)
if
(
iconView
==
NULL
)
{
{
view2
=
new
PlIconView
(
model
,
this
);
iconView
=
new
PlIconView
(
model
,
this
);
layout
->
addWidget
(
view2
,
1
,
0
,
1
,
-
1
);
layout
->
addWidget
(
iconView
,
1
,
0
,
1
,
-
1
);
installEventFilter
(
view2
);
installEventFilter
(
iconView
);
}
}
v
iew
->
hide
();
treeV
iew
->
hide
();
view2
->
show
();
iconView
->
show
();
}
}
else
else
{
{
view2
->
hide
();
iconView
->
hide
();
v
iew
->
show
();
treeV
iew
->
show
();
}
}
}
}
bool
StandardPLPanel
::
eventFilter
(
QObject
*
obj
,
QEvent
*
event
)
bool
StandardPLPanel
::
eventFilter
(
QObject
*
obj
,
QEvent
*
event
)
{
{
QAbstractItemView
*
v
iew
=
qobject_cast
<
QAbstractItemView
*>
(
obj
);
QAbstractItemView
*
aV
iew
=
qobject_cast
<
QAbstractItemView
*>
(
obj
);
if
(
!
v
iew
)
return
false
;
if
(
!
aV
iew
)
return
false
;
switch
(
event
->
type
()
)
switch
(
event
->
type
()
)
{
{
...
@@ -326,18 +326,18 @@ bool StandardPLPanel::eventFilter( QObject *obj, QEvent *event )
...
@@ -326,18 +326,18 @@ bool StandardPLPanel::eventFilter( QObject *obj, QEvent *event )
QMouseEvent
*
mouseEvent
=
static_cast
<
QMouseEvent
*>
(
event
);
QMouseEvent
*
mouseEvent
=
static_cast
<
QMouseEvent
*>
(
event
);
if
(
mouseEvent
->
button
()
&
Qt
::
RightButton
)
if
(
mouseEvent
->
button
()
&
Qt
::
RightButton
)
{
{
QModelIndex
index
=
v
iew
->
indexAt
(
QModelIndex
index
=
aV
iew
->
indexAt
(
QPoint
(
mouseEvent
->
x
(),
mouseEvent
->
y
()
)
);
QPoint
(
mouseEvent
->
x
(),
mouseEvent
->
y
()
)
);
doPopup
(
index
,
QCursor
::
pos
()
);
doPopup
(
index
,
QCursor
::
pos
()
);
return
true
;
return
true
;
}
}
else
if
(
mouseEvent
->
button
()
&
Qt
::
LeftButton
)
else
if
(
mouseEvent
->
button
()
&
Qt
::
LeftButton
)
{
{
if
(
!
v
iew
->
indexAt
(
QPoint
(
mouseEvent
->
x
(),
if
(
!
aV
iew
->
indexAt
(
QPoint
(
mouseEvent
->
x
(),
mouseEvent
->
y
()
)
).
isValid
()
)
mouseEvent
->
y
()
)
).
isValid
()
)
v
iew
->
clearSelection
();
aV
iew
->
clearSelection
();
}
}
//
v
iew->mousePressEvent( mouseEvent );
//
aV
iew->mousePressEvent( mouseEvent );
}
}
return
true
;
return
true
;
case
QEvent
:
:
MouseButtonRelease
:
case
QEvent
:
:
MouseButtonRelease
:
...
@@ -345,7 +345,7 @@ bool StandardPLPanel::eventFilter( QObject *obj, QEvent *event )
...
@@ -345,7 +345,7 @@ bool StandardPLPanel::eventFilter( QObject *obj, QEvent *event )
QMouseEvent
*
mouseEvent2
=
static_cast
<
QMouseEvent
*>
(
event
);
QMouseEvent
*
mouseEvent2
=
static_cast
<
QMouseEvent
*>
(
event
);
if
(
mouseEvent2
->
button
()
&
Qt
::
RightButton
)
if
(
mouseEvent2
->
button
()
&
Qt
::
RightButton
)
return
false
;
/* Do NOT forward to QTreeView!! */
return
false
;
/* Do NOT forward to QTreeView!! */
//
v
iew->mouseReleaseEvent( mouseEvent );
//
aV
iew->mouseReleaseEvent( mouseEvent );
return
true
;
return
true
;
}
}
default:
default:
...
...
modules/gui/qt4/components/playlist/standardpanel.hpp
View file @
1cdeaa80
...
@@ -71,8 +71,8 @@ private:
...
@@ -71,8 +71,8 @@ private:
QPushButton
*
addButton
;
QPushButton
*
addButton
;
QGridLayout
*
layout
;
QGridLayout
*
layout
;
QTreeView
*
v
iew
;
QTreeView
*
treeV
iew
;
PlIconView
*
view2
;
PlIconView
*
iconView
;
int
currentRootId
;
int
currentRootId
;
QSignalMapper
*
selectColumnsSigMapper
;
QSignalMapper
*
selectColumnsSigMapper
;
...
...
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