summaryrefslogtreecommitdiffstats
path: root/examples/multimediawidgets/customvideosurface/customvideowidget
diff options
context:
space:
mode:
authorJochen Seemann <seemann.jochen@gmail.com>2017-11-23 21:12:24 +0100
committerJochen Seemann <seemann.jochen@gmail.com>2017-12-19 12:04:34 +0000
commit93630cd621b472d73fc8456ca396cda012a1aee0 (patch)
treebb42ea8fc88d5961493caccbd116c5b1748a089f /examples/multimediawidgets/customvideosurface/customvideowidget
parent5629823b05ca7d24924ac879b5a0469a3cb03e78 (diff)
examples: use Qt5-style connects where possible
Additionally, remove obsolete CHECKED_CONNECT macro from the spectrum example. Change-Id: Id6fe01718679463c2b025d688c970583d64d60e9 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io> Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'examples/multimediawidgets/customvideosurface/customvideowidget')
-rw-r--r--examples/multimediawidgets/customvideosurface/customvideowidget/videoplayer.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/examples/multimediawidgets/customvideosurface/customvideowidget/videoplayer.cpp b/examples/multimediawidgets/customvideosurface/customvideowidget/videoplayer.cpp
index 7d0759c35..7730f8140 100644
--- a/examples/multimediawidgets/customvideosurface/customvideowidget/videoplayer.cpp
+++ b/examples/multimediawidgets/customvideosurface/customvideowidget/videoplayer.cpp
@@ -64,20 +64,21 @@ VideoPlayer::VideoPlayer(QWidget *parent)
VideoWidget *videoWidget = new VideoWidget;
QAbstractButton *openButton = new QPushButton(tr("Open..."));
- connect(openButton, SIGNAL(clicked()), this, SLOT(openFile()));
+ connect(openButton, &QAbstractButton::clicked,
+ this, &VideoPlayer::openFile);
playButton = new QPushButton;
playButton->setEnabled(false);
playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay));
- connect(playButton, SIGNAL(clicked()),
- this, SLOT(play()));
+ connect(playButton, &QAbstractButton::clicked,
+ this, &VideoPlayer::play);
positionSlider = new QSlider(Qt::Horizontal);
positionSlider->setRange(0, 0);
- connect(positionSlider, SIGNAL(sliderMoved(int)),
- this, SLOT(setPosition(int)));
+ connect(positionSlider, &QSlider::sliderMoved,
+ this, &VideoPlayer::setPosition);
QBoxLayout *controlLayout = new QHBoxLayout;
controlLayout->setMargin(0);
@@ -92,10 +93,10 @@ VideoPlayer::VideoPlayer(QWidget *parent)
setLayout(layout);
mediaPlayer.setVideoOutput(videoWidget->videoSurface());
- connect(&mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)),
- this, SLOT(mediaStateChanged(QMediaPlayer::State)));
- connect(&mediaPlayer, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64)));
- connect(&mediaPlayer, SIGNAL(durationChanged(qint64)), this, SLOT(durationChanged(qint64)));
+ connect(&mediaPlayer, &QMediaPlayer::stateChanged,
+ this, &VideoPlayer::mediaStateChanged);
+ connect(&mediaPlayer, &QMediaPlayer::positionChanged, this, &VideoPlayer::positionChanged);
+ connect(&mediaPlayer, &QMediaPlayer::durationChanged, this, &VideoPlayer::durationChanged);
}
VideoPlayer::~VideoPlayer()