diff options
author | Jochen Seemann <seemann.jochen@gmail.com> | 2017-11-23 21:12:24 +0100 |
---|---|---|
committer | Jochen Seemann <seemann.jochen@gmail.com> | 2017-12-19 12:04:34 +0000 |
commit | 93630cd621b472d73fc8456ca396cda012a1aee0 (patch) | |
tree | bb42ea8fc88d5961493caccbd116c5b1748a089f /examples/multimediawidgets/customvideosurface/customvideoitem | |
parent | 5629823b05ca7d24924ac879b5a0469a3cb03e78 (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/customvideoitem')
-rw-r--r-- | examples/multimediawidgets/customvideosurface/customvideoitem/videoplayer.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/examples/multimediawidgets/customvideosurface/customvideoitem/videoplayer.cpp b/examples/multimediawidgets/customvideosurface/customvideoitem/videoplayer.cpp index 7da566a20..60b93a116 100644 --- a/examples/multimediawidgets/customvideosurface/customvideoitem/videoplayer.cpp +++ b/examples/multimediawidgets/customvideosurface/customvideoitem/videoplayer.cpp @@ -80,24 +80,25 @@ VideoPlayer::VideoPlayer(QWidget *parent) rotateSlider->setRange(-180, 180); rotateSlider->setValue(0); - connect(rotateSlider, SIGNAL(valueChanged(int)), - this, SLOT(rotateVideo(int))); + connect(rotateSlider, &QSlider::valueChanged, + this, &VideoPlayer::rotateVideo); 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); @@ -113,10 +114,10 @@ VideoPlayer::VideoPlayer(QWidget *parent) setLayout(layout); mediaPlayer.setVideoOutput(videoItem); - 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() |