Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
d4e7c32a
Commit
d4e7c32a
authored
Feb 12, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: ooops, fix deleting playlist items by key press
parent
b5c4baa4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
19 deletions
+21
-19
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+19
-16
modules/gui/qt4/components/playlist/standardpanel.hpp
modules/gui/qt4/components/playlist/standardpanel.hpp
+2
-3
No files found.
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
d4e7c32a
...
...
@@ -288,17 +288,25 @@ void StandardPLPanel::browseInto( )
QModelIndex
()
);
}
/* Delete and Suppr key remove the selection
FilterKey function and code function */
void
StandardPLPanel
::
keyPressEvent
(
QKeyEvent
*
e
)
void
StandardPLPanel
::
wheelEvent
(
QWheelEvent
*
e
)
{
switch
(
e
->
key
()
)
// Accept this event in order to prevent unwanted volume up/down changes
e
->
accept
();
}
bool
StandardPLPanel
::
eventFilter
(
QObject
*
watched
,
QEvent
*
event
)
{
if
(
event
->
type
()
==
QEvent
::
KeyPress
)
{
QKeyEvent
*
keyEvent
=
static_cast
<
QKeyEvent
*>
(
event
);
if
(
keyEvent
->
key
()
==
Qt
::
Key_Delete
||
keyEvent
->
key
()
==
Qt
::
Key_Back
)
{
case
Qt
:
:
Key_Back
:
case
Qt
:
:
Key_Delete
:
deleteSelection
();
break
;
return
true
;
}
}
return
false
;
}
void
StandardPLPanel
::
deleteSelection
()
...
...
@@ -316,7 +324,7 @@ void StandardPLPanel::createIconView()
this
,
popupPlView
(
const
QPoint
&
)
);
CONNECT
(
iconView
,
activated
(
const
QModelIndex
&
),
this
,
activate
(
const
QModelIndex
&
)
);
iconView
->
installEventFilter
(
this
);
layout
->
addWidget
(
iconView
,
1
,
0
,
1
,
-
1
);
}
...
...
@@ -328,7 +336,7 @@ void StandardPLPanel::createListView()
this
,
popupPlView
(
const
QPoint
&
)
);
CONNECT
(
listView
,
activated
(
const
QModelIndex
&
),
this
,
activate
(
const
QModelIndex
&
)
);
listView
->
installEventFilter
(
this
);
layout
->
addWidget
(
listView
,
1
,
0
,
1
,
-
1
);
}
...
...
@@ -380,6 +388,7 @@ void StandardPLPanel::createTreeView()
this
,
popupSelectColumn
(
QPoint
)
);
CONNECT
(
treeView
,
customContextMenuRequested
(
const
QPoint
&
),
this
,
popupPlView
(
const
QPoint
&
)
);
treeView
->
installEventFilter
(
this
);
/* SignalMapper for columns */
selectColumnsSigMapper
=
new
QSignalMapper
(
this
);
...
...
@@ -447,12 +456,6 @@ void StandardPLPanel::cycleViews()
assert
(
0
);
}
void
StandardPLPanel
::
wheelEvent
(
QWheelEvent
*
e
)
{
// Accept this event in order to prevent unwanted volume up/down changes
e
->
accept
();
}
void
StandardPLPanel
::
activate
(
const
QModelIndex
&
index
)
{
if
(
model
->
hasChildren
(
index
)
)
...
...
modules/gui/qt4/components/playlist/standardpanel.hpp
View file @
d4e7c32a
...
...
@@ -60,9 +60,6 @@ public:
protected:
friend
class
PlaylistWidget
;
virtual
void
keyPressEvent
(
QKeyEvent
*
e
);
virtual
void
wheelEvent
(
QWheelEvent
*
e
);
PLModel
*
model
;
private:
enum
{
...
...
@@ -99,6 +96,8 @@ private:
void
createTreeView
();
void
createIconView
();
void
createListView
();
void
wheelEvent
(
QWheelEvent
*
e
);
bool
eventFilter
(
QObject
*
watched
,
QEvent
*
event
);
public
slots
:
void
setRoot
(
playlist_item_t
*
);
...
...
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