From 93630cd621b472d73fc8456ca396cda012a1aee0 Mon Sep 17 00:00:00 2001 From: Jochen Seemann Date: Thu, 23 Nov 2017 21:12:24 +0100 Subject: examples: use Qt5-style connects where possible Additionally, remove obsolete CHECKED_CONNECT macro from the spectrum example. Change-Id: Id6fe01718679463c2b025d688c970583d64d60e9 Reviewed-by: VaL Doroshchuk Reviewed-by: Christian Stromme --- examples/multimedia/audiodecoder/audiodecoder.cpp | 26 +++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'examples/multimedia/audiodecoder/audiodecoder.cpp') diff --git a/examples/multimedia/audiodecoder/audiodecoder.cpp b/examples/multimedia/audiodecoder/audiodecoder.cpp index 5145d529e..86904f7c9 100644 --- a/examples/multimedia/audiodecoder/audiodecoder.cpp +++ b/examples/multimedia/audiodecoder/audiodecoder.cpp @@ -67,15 +67,23 @@ AudioDecoder::AudioDecoder(bool isPlayback, bool isDelete) format.setSampleType(QAudioFormat::SignedInt); m_decoder.setAudioFormat(format); - connect(&m_decoder, SIGNAL(bufferReady()), this, SLOT(bufferReady())); - connect(&m_decoder, SIGNAL(error(QAudioDecoder::Error)), this, SLOT(error(QAudioDecoder::Error))); - connect(&m_decoder, SIGNAL(stateChanged(QAudioDecoder::State)), this, SLOT(stateChanged(QAudioDecoder::State))); - connect(&m_decoder, SIGNAL(finished()), this, SLOT(finished())); - connect(&m_decoder, SIGNAL(positionChanged(qint64)), this, SLOT(updateProgress())); - connect(&m_decoder, SIGNAL(durationChanged(qint64)), this, SLOT(updateProgress())); - - connect(&m_soundEffect, SIGNAL(statusChanged()), this, SLOT(playbackStatusChanged())); - connect(&m_soundEffect, SIGNAL(playingChanged()), this, SLOT(playingChanged())); + connect(&m_decoder, &QAudioDecoder::bufferReady, + this, &AudioDecoder::bufferReady); + connect(&m_decoder, QOverload::of(&QAudioDecoder::error), + this, QOverload::of(&AudioDecoder::error)); + connect(&m_decoder, &QAudioDecoder::stateChanged, + this, &AudioDecoder::stateChanged); + connect(&m_decoder, &QAudioDecoder::finished, + this, &AudioDecoder::finished); + connect(&m_decoder, &QAudioDecoder::positionChanged, + this, &AudioDecoder::updateProgress); + connect(&m_decoder, &QAudioDecoder::durationChanged, + this, &AudioDecoder::updateProgress); + + connect(&m_soundEffect, &QSoundEffect::statusChanged, + this, &AudioDecoder::playbackStatusChanged); + connect(&m_soundEffect, &QSoundEffect::playingChanged, + this, &AudioDecoder::playingChanged); m_progress = -1.0; } -- cgit v1.2.3