diff options
author | Jiri Novak <j.novak@netsystem.cz> | 2016-12-12 13:26:53 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2016-12-12 23:10:13 +0000 |
commit | 7ad655c9b69f017f880dfd1cd1d0ec4a04479e2b (patch) | |
tree | 6ae433de0f388e19d9c966417aa4e1b8fdc70a63 /ui/qt/rtp_player_dialog.cpp | |
parent | 9e9b5ecc0c001b8f742746b2b9f0104bab9a9d9a (diff) | |
download | wireshark-7ad655c9b69f017f880dfd1cd1d0ec4a04479e2b.tar.gz |
rtp_player_dialog.cpp: fix usage of unsupported method QComboBox::setCurrentText with Qt4.x
QComboBox::setCurrentText() method is available in Qt5.x.
Older versions code won't compile with it.
Bug: 13235
Change-Id: Ia2e2713fefe0f2be01a0b77ff1ac39c9162fd0d1
Reviewed-on: https://code.wireshark.org/review/19219
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'ui/qt/rtp_player_dialog.cpp')
-rw-r--r-- | ui/qt/rtp_player_dialog.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/qt/rtp_player_dialog.cpp b/ui/qt/rtp_player_dialog.cpp index 22ab5d0897..562629e399 100644 --- a/ui/qt/rtp_player_dialog.cpp +++ b/ui/qt/rtp_player_dialog.cpp @@ -156,7 +156,14 @@ RtpPlayerDialog::RtpPlayerDialog(QWidget &parent, CaptureFile &cf) : QString out_name = out_device.deviceName(); ui->outputDeviceComboBox->addItem(out_name); if (out_name == default_out_name) { +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) ui->outputDeviceComboBox->setCurrentText(out_name); +#else + int new_index = ui->outputDeviceComboBox->findText(default_out_name); + if (new_index >= 0) { + ui->outputDeviceComboBox->setCurrentIndex(new_index); + } +#endif } } if (ui->outputDeviceComboBox->count() < 1) { |