summaryrefslogtreecommitdiff
path: root/ui/qt/uat_model.cpp
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2016-10-21 10:41:52 +0200
committerPeter Wu <peter@lekensteyn.nl>2016-10-21 15:07:57 +0000
commitd142e7f4038f840ec2d7d89a1de4d486e1f54222 (patch)
tree5539240ec18efaca92794fe1f0c8678da3a15175 /ui/qt/uat_model.cpp
parent991e0747a3b0bbeddb27dc29e53fa6dbb5c68e4b (diff)
downloadwireshark-d142e7f4038f840ec2d7d89a1de4d486e1f54222.tar.gz
Fix build for Qt 4.8
setCurrentText is only available in Qt5, so select the item manually. https://doc.qt.io/qt-5/qcombobox.html#currentText-prop Fixes: v2.3.0rc0-1002-g1cd2255 ("Qt: convert UatDialog to model/view pattern, improve UX") Change-Id: I402e7d159d512e870849ee54d851276c4cc7cf34 Reviewed-on: https://code.wireshark.org/review/18351 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'ui/qt/uat_model.cpp')
-rw-r--r--ui/qt/uat_model.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/ui/qt/uat_model.cpp b/ui/qt/uat_model.cpp
index 6927674190..03337e2c51 100644
--- a/ui/qt/uat_model.cpp
+++ b/ui/qt/uat_model.cpp
@@ -179,9 +179,18 @@ bool UatModel::setData(const QModelIndex &index, const QVariant &value, int role
// The validation status for other columns were also affected by
// changing this field, mark those as dirty!
emit dataChanged(this->index(row, updated_cols.first()),
- this->index(row, updated_cols.last()), roles);
+ this->index(row, updated_cols.last())
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+ , roles
+#endif
+ );
} else {
- emit dataChanged(index, index, roles);
+
+ emit dataChanged(index, index
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+ , roles
+#endif
+ );
}
return true;
}
@@ -252,7 +261,12 @@ bool UatModel::copyRow(int dst_row, int src_row)
QVector<int> roles;
roles << Qt::EditRole << Qt::BackgroundRole;
- emit dataChanged(index(dst_row, 0), index(dst_row, columnCount()), roles);
+ emit dataChanged(index(dst_row, 0), index(dst_row, columnCount())
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+ , roles
+#endif
+ );
+
return true;
}