summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/audio/audiooutput/audiooutput.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/multimedia/audio/audiooutput/audiooutput.cpp')
-rw-r--r--examples/multimedia/audio/audiooutput/audiooutput.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/examples/multimedia/audio/audiooutput/audiooutput.cpp b/examples/multimedia/audio/audiooutput/audiooutput.cpp
index d239eb0..19f7a3f 100644
--- a/examples/multimedia/audio/audiooutput/audiooutput.cpp
+++ b/examples/multimedia/audio/audiooutput/audiooutput.cpp
@@ -142,10 +142,8 @@ AudioTest::AudioTest()
QVBoxLayout* layout = new QVBoxLayout;
deviceBox = new QComboBox(this);
- QList<QAudioDeviceId> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput);
- for(int i = 0; i < devices.size(); ++i) {
- deviceBox->addItem(QAudioDeviceInfo(devices.at(i)).deviceName(), qVariantFromValue(devices.at(i)));
- }
+ foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::deviceList(QAudio::AudioOutput))
+ deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo));
connect(deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int)));
layout->addWidget(deviceBox);
@@ -200,7 +198,7 @@ void AudioTest::deviceChanged(int idx)
audioOutput->disconnect(this);
delete audioOutput;
- device = deviceBox->itemData(idx).value<QAudioDeviceId>();
+ device = deviceBox->itemData(idx).value<QAudioDeviceInfo>();
audioOutput = new QAudioOutput(device,settings,this);
connect(audioOutput,SIGNAL(notify()),SLOT(status()));
connect(audioOutput,SIGNAL(stateChanged(QAudio::State)),SLOT(state(QAudio::State)));