Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
6ad5c698
Commit
6ad5c698
authored
Aug 16, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: forward video key presses to main interface for processing
parent
25bbccd3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
2 deletions
+32
-2
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.cpp
+17
-1
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/components/interface_widgets.hpp
+5
-1
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+7
-0
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+3
-0
No files found.
modules/gui/qt4/components/interface_widgets.cpp
View file @
6ad5c698
...
...
@@ -59,6 +59,22 @@ static void videoSync( void )
#include <math.h>
class
ReparentableWidget
:
public
QWidget
{
private:
VideoWidget
*
owner
;
public:
ReparentableWidget
(
VideoWidget
*
owner
)
:
owner
(
owner
)
{
}
protected:
void
keyPressEvent
(
QKeyEvent
*
e
)
{
emit
owner
->
keyPressed
(
e
);
}
};
/**********************************************************************
* Video Widget. A simple frame on which video is drawn
* This class handles resize issues
...
...
@@ -112,7 +128,7 @@ WId VideoWidget::request( int *pi_x, int *pi_y,
* reparentable widget, that will be within the VideoWidget in windowed
* mode, and within the root window (NULL parent) in full-screen mode.
*/
reparentable
=
new
QWidget
(
);
reparentable
=
new
ReparentableWidget
(
this
);
QLayout
*
innerLayout
=
new
QHBoxLayout
(
reparentable
);
innerLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
...
...
modules/gui/qt4/components/interface_widgets.hpp
View file @
6ad5c698
...
...
@@ -48,12 +48,13 @@ class QPalette;
class
QPixmap
;
class
QHBoxLayout
;
class
QMenu
;
class
ReparentableWidget
;
/******************** Video Widget ****************/
class
VideoWidget
:
public
QFrame
{
Q_OBJECT
friend
class
MainInterface
;
friend
class
ReparentableWidget
;
public:
VideoWidget
(
intf_thread_t
*
);
...
...
@@ -79,6 +80,9 @@ private:
QWidget
*
reparentable
;
QLayout
*
layout
;
signals:
void
keyPressed
(
QKeyEvent
*
);
public
slots
:
void
SetSizing
(
unsigned
int
,
unsigned
int
);
void
SetFullScreen
(
bool
);
...
...
modules/gui/qt4/main_interface.cpp
View file @
6ad5c698
...
...
@@ -230,6 +230,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
videoWidget
,
SetSizing
(
unsigned
int
,
unsigned
int
)
);
CONNECT
(
this
,
askVideoSetFullScreen
(
bool
),
videoWidget
,
SetFullScreen
(
bool
)
);
CONNECT
(
videoWidget
,
keyPressed
(
QKeyEvent
*
),
this
,
handleKeyPress
(
QKeyEvent
*
)
);
}
CONNECT
(
this
,
askUpdate
(),
this
,
doComponentsUpdate
()
);
...
...
@@ -1201,6 +1203,11 @@ void MainInterface::customEvent( QEvent *event )
}
void
MainInterface
::
keyPressEvent
(
QKeyEvent
*
e
)
{
handleKeyPress
(
e
);
}
void
MainInterface
::
handleKeyPress
(
QKeyEvent
*
e
)
{
if
(
(
e
->
modifiers
()
&
Qt
::
ControlModifier
)
&&
(
e
->
key
()
==
Qt
::
Key_H
)
&&
!
menuBar
()
->
isVisible
()
)
...
...
modules/gui/qt4/main_interface.hpp
View file @
6ad5c698
...
...
@@ -178,6 +178,9 @@ private slots:
void
updateSystrayTooltipStatus
(
int
);
void
showCryptedLabel
(
bool
);
void
handleKeyPress
(
QKeyEvent
*
);
signals:
void
askGetVideo
(
WId
*
p_id
,
int
*
pi_x
,
int
*
pi_y
,
unsigned
int
*
pi_width
,
unsigned
int
*
pi_height
);
...
...
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