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
c24f5b99
Commit
c24f5b99
authored
Dec 16, 2009
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: delete QVLCTreeView class and use event filters for the 2 different views.
Some stuff are still broken in the IconView.
parent
69d72d72
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
49 deletions
+46
-49
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+41
-3
modules/gui/qt4/components/playlist/standardpanel.hpp
modules/gui/qt4/components/playlist/standardpanel.hpp
+3
-1
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.cpp
+1
-0
modules/gui/qt4/util/customwidgets.hpp
modules/gui/qt4/util/customwidgets.hpp
+1
-45
No files found.
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
c24f5b99
...
...
@@ -60,7 +60,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
model
=
new
PLModel
(
p_playlist
,
p_intf
,
p_root
,
this
);
/* Create and configure the QTreeView */
view
=
new
Q
VLC
TreeView
;
view
=
new
QTreeView
;
view
->
setModel
(
model
);
view2
=
NULL
;
...
...
@@ -80,6 +80,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
view
->
setAcceptDrops
(
true
);
view
->
setDropIndicatorShown
(
true
);
installEventFilter
(
view
);
/* Saved Settings */
getSettings
()
->
beginGroup
(
"Playlist"
);
if
(
getSettings
()
->
contains
(
"headerStateV2"
)
)
...
...
@@ -101,8 +102,6 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
/* Connections for the TreeView */
CONNECT
(
view
,
activated
(
const
QModelIndex
&
)
,
model
,
activateItem
(
const
QModelIndex
&
)
);
CONNECT
(
view
,
rightClicked
(
QModelIndex
,
QPoint
),
this
,
doPopup
(
QModelIndex
,
QPoint
)
);
CONNECT
(
view
->
header
(),
customContextMenuRequested
(
const
QPoint
&
),
this
,
popupSelectColumn
(
QPoint
)
);
CONNECT
(
model
,
currentChanged
(
const
QModelIndex
&
),
...
...
@@ -304,6 +303,7 @@ void StandardPLPanel::toggleView()
view2
->
setViewMode
(
QListView
::
IconMode
);
view2
->
setMovement
(
QListView
::
Snap
);
layout
->
addWidget
(
view2
,
1
,
0
,
1
,
-
1
);
installEventFilter
(
view2
);
}
view
->
hide
();
view2
->
show
();
...
...
@@ -313,6 +313,44 @@ void StandardPLPanel::toggleView()
view2
->
hide
();
view
->
show
();
}
}
bool
StandardPLPanel
::
eventFilter
(
QObject
*
obj
,
QEvent
*
event
)
{
QAbstractItemView
*
view
=
qobject_cast
<
QAbstractItemView
*>
(
obj
);
if
(
!
view
)
return
false
;
switch
(
event
->
type
()
)
{
case
QEvent
:
:
MouseButtonPress
:
{
QMouseEvent
*
mouseEvent
=
static_cast
<
QMouseEvent
*>
(
event
);
if
(
mouseEvent
->
button
()
&
Qt
::
RightButton
)
{
QModelIndex
index
=
view
->
indexAt
(
QPoint
(
mouseEvent
->
x
(),
mouseEvent
->
y
()
)
);
doPopup
(
index
,
QCursor
::
pos
()
);
return
true
;
}
else
if
(
mouseEvent
->
button
()
&
Qt
::
LeftButton
)
{
if
(
!
view
->
indexAt
(
QPoint
(
mouseEvent
->
x
(),
mouseEvent
->
y
()
)
).
isValid
()
)
view
->
clearSelection
();
}
// view->mousePressEvent( mouseEvent );
}
return
true
;
case
QEvent
:
:
MouseButtonRelease
:
{
QMouseEvent
*
mouseEvent2
=
static_cast
<
QMouseEvent
*>
(
event
);
if
(
mouseEvent2
->
button
()
&
Qt
::
RightButton
)
return
false
;
/* Do NOT forward to QTreeView!! */
// view->mouseReleaseEvent( mouseEvent );
return
true
;
}
default:
return
false
;
}
return
true
;
}
modules/gui/qt4/components/playlist/standardpanel.hpp
View file @
c24f5b99
...
...
@@ -57,6 +57,8 @@ protected:
virtual
void
keyPressEvent
(
QKeyEvent
*
e
);
bool
eventFilter
(
QObject
*
obj
,
QEvent
*
event
);
PLModel
*
model
;
private:
intf_thread_t
*
p_intf
;
...
...
@@ -72,6 +74,7 @@ private:
int
currentRootId
;
QSignalMapper
*
selectColumnsSigMapper
;
void
doPopup
(
QModelIndex
index
,
QPoint
point
);
public
slots
:
void
removeItem
(
int
);
virtual
void
setRoot
(
playlist_item_t
*
);
...
...
@@ -79,7 +82,6 @@ private slots:
void
deleteSelection
();
void
handleExpansion
(
const
QModelIndex
&
);
void
gotoPlayingItem
();
void
doPopup
(
QModelIndex
index
,
QPoint
point
);
void
search
(
const
QString
&
searchText
);
void
popupAdd
();
void
popupSelectColumn
(
QPoint
);
...
...
modules/gui/qt4/components/preferences_widgets.cpp
View file @
c24f5b99
...
...
@@ -48,6 +48,7 @@
#include <QTreeWidgetItem>
#include <QSignalMapper>
#include <QDialogButtonBox>
#include <QKeyEvent>
#define MINWIDTH_BOX 90
#define LAST_COLUMN 10
...
...
modules/gui/qt4/util/customwidgets.hpp
View file @
c24f5b99
...
...
@@ -95,55 +95,11 @@ private:
QIcon
::
Mode
iconMode
;
};
/*****************************************************************
* Custom views
*****************************************************************/
#include <QMouseEvent>
#include <QTreeView>
#include <QCursor>
#include <QPoint>
#include <QModelIndex>
/**
Special QTreeView that can emit rightClicked()
*/
class
QVLCTreeView
:
public
QTreeView
{
Q_OBJECT
;
public:
void
mouseReleaseEvent
(
QMouseEvent
*
e
)
{
if
(
e
->
button
()
&
Qt
::
RightButton
)
return
;
/* Do NOT forward to QTreeView!! */
QTreeView
::
mouseReleaseEvent
(
e
);
}
void
mousePressEvent
(
QMouseEvent
*
e
)
{
if
(
e
->
button
()
&
Qt
::
RightButton
)
{
QModelIndex
index
=
indexAt
(
QPoint
(
e
->
x
(),
e
->
y
()
)
);
if
(
index
.
isValid
()
)
setSelection
(
visualRect
(
index
),
QItemSelectionModel
::
ClearAndSelect
);
emit
rightClicked
(
index
,
QCursor
::
pos
()
);
return
;
}
if
(
e
->
button
()
&
Qt
::
LeftButton
)
{
if
(
!
indexAt
(
QPoint
(
e
->
x
(),
e
->
y
()
)
).
isValid
()
)
clearSelection
();
}
QTreeView
::
mousePressEvent
(
e
);
}
signals:
void
rightClicked
(
QModelIndex
,
QPoint
);
};
/* VLC Key/Wheel hotkeys interactions */
class
QKeyEvent
;
class
QWheelEvent
;
class
QInputEvent
;
int
qtKeyModifiersToVLC
(
QInputEvent
*
e
);
int
qtEventToVLCKey
(
QKeyEvent
*
e
);
...
...
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