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
ede2bb15
Commit
ede2bb15
authored
Jan 26, 2010
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: track the currentView and simplify the code
parent
7c1fe483
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+10
-12
modules/gui/qt4/components/playlist/standardpanel.hpp
modules/gui/qt4/components/playlist/standardpanel.hpp
+1
-0
No files found.
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
ede2bb15
...
@@ -175,14 +175,9 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
...
@@ -175,14 +175,9 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
void
StandardPLPanel
::
popupPlView
(
const
QPoint
&
point
)
void
StandardPLPanel
::
popupPlView
(
const
QPoint
&
point
)
{
{
QAbstractItemView
*
aView
;
QModelIndex
index
=
currentView
->
indexAt
(
point
);
if
(
treeView
&&
treeView
->
isVisible
()
)
aView
=
treeView
;
QPoint
globalPoint
=
currentView
->
viewport
()
->
mapToGlobal
(
point
);
else
if
(
iconView
&&
iconView
->
isVisible
()
)
aView
=
iconView
;
QItemSelectionModel
*
selection
=
currentView
->
selectionModel
();
else
return
;
QModelIndex
index
=
aView
->
indexAt
(
point
);
QPoint
globalPoint
=
aView
->
viewport
()
->
mapToGlobal
(
point
);
QItemSelectionModel
*
selection
=
aView
->
selectionModel
();
QModelIndexList
list
=
selection
->
selectedIndexes
();
QModelIndexList
list
=
selection
->
selectedIndexes
();
model
->
popup
(
index
,
globalPoint
,
list
);
model
->
popup
(
index
,
globalPoint
,
list
);
}
}
...
@@ -258,9 +253,7 @@ void StandardPLPanel::keyPressEvent( QKeyEvent *e )
...
@@ -258,9 +253,7 @@ void StandardPLPanel::keyPressEvent( QKeyEvent *e )
void
StandardPLPanel
::
deleteSelection
()
void
StandardPLPanel
::
deleteSelection
()
{
{
//FIXME
QItemSelectionModel
*
selection
=
currentView
->
selectionModel
();
if
(
!
treeView
)
return
;
QItemSelectionModel
*
selection
=
treeView
->
selectionModel
();
QModelIndexList
list
=
selection
->
selectedIndexes
();
QModelIndexList
list
=
selection
->
selectedIndexes
();
model
->
doDelete
(
list
);
model
->
doDelete
(
list
);
}
}
...
@@ -307,7 +300,7 @@ void StandardPLPanel::createTreeView()
...
@@ -307,7 +300,7 @@ void StandardPLPanel::createTreeView()
{
{
for
(
int
m
=
1
,
c
=
0
;
m
!=
COLUMN_END
;
m
<<=
1
,
c
++
)
for
(
int
m
=
1
,
c
=
0
;
m
!=
COLUMN_END
;
m
<<=
1
,
c
++
)
{
{
treeView
->
setClumnHidden
(
c
,
!
(
m
&
COLUMN_DEFAULT
)
);
treeView
->
setC
o
lumnHidden
(
c
,
!
(
m
&
COLUMN_DEFAULT
)
);
if
(
m
==
COLUMN_TITLE
)
treeView
->
header
()
->
resizeSection
(
c
,
200
);
if
(
m
==
COLUMN_TITLE
)
treeView
->
header
()
->
resizeSection
(
c
,
200
);
else
if
(
m
==
COLUMN_DURATION
)
treeView
->
header
()
->
resizeSection
(
c
,
80
);
else
if
(
m
==
COLUMN_DURATION
)
treeView
->
header
()
->
resizeSection
(
c
,
80
);
}
}
...
@@ -341,11 +334,16 @@ void StandardPLPanel::toggleView()
...
@@ -341,11 +334,16 @@ void StandardPLPanel::toggleView()
treeView
->
hide
();
treeView
->
hide
();
iconView
->
show
();
iconView
->
show
();
currentView
=
iconView
;
}
}
else
else
{
{
if
(
treeView
==
NULL
)
createTreeView
();
iconView
->
hide
();
iconView
->
hide
();
treeView
->
show
();
treeView
->
show
();
currentView
=
treeView
;
}
}
}
}
...
...
modules/gui/qt4/components/playlist/standardpanel.hpp
View file @
ede2bb15
...
@@ -71,6 +71,7 @@ private:
...
@@ -71,6 +71,7 @@ private:
QTreeView
*
treeView
;
QTreeView
*
treeView
;
PlIconView
*
iconView
;
PlIconView
*
iconView
;
QAbstractItemView
*
currentView
;
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