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
965c6422
Commit
965c6422
authored
May 04, 2010
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: Correctly close the player when alt+f4 is pressed
even when in fullscreen. Close #3602
parent
03cc7a2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
9 deletions
+32
-9
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.cpp
+31
-8
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/components/interface_widgets.hpp
+1
-1
No files found.
modules/gui/qt4/components/interface_widgets.cpp
View file @
965c6422
...
...
@@ -29,6 +29,8 @@
#endif
#include "components/interface_widgets.hpp"
#include "dialogs_provider.hpp"
#include "util/customwidgets.hpp" // qtEventToVLCKey, QVLCStackedWidget
#include "menus.hpp"
/* Popup menu on bgWidget */
...
...
@@ -37,6 +39,7 @@
#include <QLabel>
#include <QToolButton>
#include <QPalette>
#include <QEvent>
#include <QResizeEvent>
#include <QDate>
#include <QMenu>
...
...
@@ -70,14 +73,7 @@ private:
VideoWidget
*
owner
;
public:
ReparentableWidget
(
VideoWidget
*
owner
)
:
owner
(
owner
)
{
}
protected:
void
keyPressEvent
(
QKeyEvent
*
e
)
{
emit
owner
->
keyPressed
(
e
);
}
{}
};
/**********************************************************************
...
...
@@ -130,6 +126,7 @@ WId VideoWidget::request( int *pi_x, int *pi_y,
* mode, and within the root window (NULL parent) in full-screen mode.
*/
reparentable
=
new
ReparentableWidget
(
this
);
reparentable
->
installEventFilter
(
this
);
QLayout
*
innerLayout
=
new
QHBoxLayout
(
reparentable
);
innerLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
...
...
@@ -245,6 +242,32 @@ void VideoWidget::release( void )
hide
();
}
#undef KeyPress
bool
VideoWidget
::
eventFilter
(
QObject
*
obj
,
QEvent
*
event
)
{
if
(
obj
==
reparentable
)
{
if
(
event
->
type
()
==
QEvent
::
Close
)
{
THEDP
->
quit
();
return
true
;
}
else
if
(
event
->
type
()
==
QEvent
::
KeyPress
)
{
emit
keyPressed
(
static_cast
<
QKeyEvent
*>
(
event
)
);
return
true
;
}
else
if
(
event
->
type
()
==
QEvent
::
Wheel
)
{
int
i_vlckey
=
qtWheelEventToVLCKey
(
static_cast
<
QWheelEvent
*>
(
event
)
);
var_SetInteger
(
p_intf
->
p_libvlc
,
"key-pressed"
,
i_vlckey
);
msg_Dbg
(
p_intf
,
"Here: %i"
,
i_vlckey
);
return
true
;
}
}
return
false
;
}
/**********************************************************************
* Background Widget. Show a simple image background. Currently,
* it's album art if present or cone.
...
...
modules/gui/qt4/components/interface_widgets.hpp
View file @
965c6422
...
...
@@ -73,7 +73,7 @@ private:
QWidget
*
reparentable
;
QLayout
*
layout
;
virtual
bool
eventFilter
(
QObject
*
watched
,
QEvent
*
event
);
signals:
void
keyPressed
(
QKeyEvent
*
);
void
sizeChanged
(
int
,
int
);
...
...
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