diff options
author | Roland Knall <rknall@gmail.com> | 2017-02-26 10:41:50 +0100 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2017-02-26 13:12:15 +0000 |
commit | 2cfac2c681607a0c4e3cd3457cffd415c84a4959 (patch) | |
tree | 696f4eceba5c1552c4775e9101afac8427994385 | |
parent | f3d52cb534c67df8a811578d9387c41c05b714dd (diff) | |
download | wireshark-2cfac2c681607a0c4e3cd3457cffd415c84a4959.tar.gz |
pluginif: Adapt code for Qt4.8
Change-Id: I663bb39cc6b186228bee01946c705eb6e12a8a0a
Reviewed-on: https://code.wireshark.org/review/20280
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
-rw-r--r-- | ui/qt/additional_toolbar.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/qt/additional_toolbar.cpp b/ui/qt/additional_toolbar.cpp index 5192fb5312..aff096a3ec 100644 --- a/ui/qt/additional_toolbar.cpp +++ b/ui/qt/additional_toolbar.cpp @@ -336,7 +336,22 @@ toolbar_selector_cb(gpointer item, gpointer item_data, gpointer user_data) if ( conv_ok && dataValue >= 0 && comboBox->model()->rowCount() < dataValue ) comboBox->setCurrentIndex(dataValue); else + { +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) comboBox->setCurrentText(data); +#else + for(int i = 0; i < comboBox->model()->rowCount(); i++) + { + QStandardItem * dataValue = ((QStandardItemModel *)comboBox->model())->item(i, 0); + ext_toolbar_value_t * tbValue = VariantPointer<ext_toolbar_value_t>::asPtr(dataValue->data()); + if ( data.compare(QString(tbValue->display)) ) + { + comboBox->setCurrentIndex(i); + break; + } + } +#endif + } } else if ( update_entry->type == EXT_TOOLBAR_UPDATE_DATA ) { |