Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
14556820
Commit
14556820
authored
Jan 09, 2013
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QtPlayer example: small way to fullscreen
parent
a8ff5278
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
doc/libvlc/QtPlayer/player.cpp
doc/libvlc/QtPlayer/player.cpp
+21
-0
doc/libvlc/QtPlayer/player.h
doc/libvlc/QtPlayer/player.h
+1
-0
No files found.
doc/libvlc/QtPlayer/player.cpp
View file @
14556820
...
...
@@ -43,6 +43,7 @@ void Mwindow::initUI() {
QAction
*
Open
=
new
QAction
(
"&Open"
,
this
);
QAction
*
Quit
=
new
QAction
(
"&Quit"
,
this
);
QAction
*
playAc
=
new
QAction
(
"&Play/Pause"
,
this
);
QAction
*
fsAc
=
new
QAction
(
"&Fullscreen"
,
this
);
QAction
*
aboutAc
=
new
QAction
(
"&About"
,
this
);
Open
->
setShortcut
(
QKeySequence
(
"Ctrl+O"
));
...
...
@@ -52,10 +53,12 @@ void Mwindow::initUI() {
fileMenu
->
addAction
(
aboutAc
);
fileMenu
->
addAction
(
Quit
);
editMenu
->
addAction
(
playAc
);
editMenu
->
addAction
(
fsAc
);
connect
(
Open
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
openFile
()));
connect
(
playAc
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
play
()));
connect
(
aboutAc
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
about
()));
connect
(
fsAc
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
fullscreen
()));
connect
(
Quit
,
SIGNAL
(
triggered
()),
qApp
,
SLOT
(
quit
()));
/* Buttons for the UI */
...
...
@@ -68,6 +71,9 @@ void Mwindow::initUI() {
QPushButton
*
muteBut
=
new
QPushButton
(
"Mute"
);
QObject
::
connect
(
muteBut
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
mute
()));
QPushButton
*
fsBut
=
new
QPushButton
(
"Fullscreen"
);
QObject
::
connect
(
fsBut
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
fullscreen
()));
volumeSlider
=
new
QSlider
(
Qt
::
Horizontal
);
QObject
::
connect
(
volumeSlider
,
SIGNAL
(
sliderMoved
(
int
)),
this
,
SLOT
(
changeVolume
(
int
)));
volumeSlider
->
setValue
(
80
);
...
...
@@ -92,12 +98,15 @@ void Mwindow::initUI() {
/* Put all in layouts */
QHBoxLayout
*
layout
=
new
QHBoxLayout
;
layout
->
setMargin
(
0
);
layout
->
addWidget
(
playBut
);
layout
->
addWidget
(
stopBut
);
layout
->
addWidget
(
muteBut
);
layout
->
addWidget
(
fsBut
);
layout
->
addWidget
(
volumeSlider
);
QVBoxLayout
*
layout2
=
new
QVBoxLayout
;
layout2
->
setMargin
(
0
);
layout2
->
addWidget
(
videoWidget
);
layout2
->
addWidget
(
slider
);
layout2
->
addLayout
(
layout
);
...
...
@@ -225,6 +234,18 @@ void Mwindow::about()
QMessageBox
::
about
(
this
,
"Qt libVLC player demo"
,
QString
::
fromUtf8
(
libvlc_get_version
())
);
}
void
Mwindow
::
fullscreen
()
{
if
(
isFullScreen
())
{
showNormal
();
menuWidget
()
->
show
();
}
else
{
showFullScreen
();
menuWidget
()
->
hide
();
}
}
void
Mwindow
::
closeEvent
(
QCloseEvent
*
event
)
{
stop
();
event
->
accept
();
...
...
doc/libvlc/QtPlayer/player.h
View file @
14556820
...
...
@@ -25,6 +25,7 @@ class Mwindow : public QMainWindow {
void
stop
();
void
mute
();
void
about
();
void
fullscreen
();
int
changeVolume
(
int
);
void
changePosition
(
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