aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2023-10-27 12:31:07 +0200
committerPeter Wu <peter@lekensteyn.nl>2023-10-27 14:33:18 +0000
commite9c37474885df64575064aa59be93667c1112f6c (patch)
tree93ddea82acfcb4a9d8da66f78e0326e9adc60161
parent33b66952ac3fa55d63aa5174e8c83c1367f53383 (diff)
Qt: remove use of qAsConst which is deprecated in Qt 6.6
The parameters passed to qAsConst are already of type `const T&`, so we do not need `qAsConst`. Remove it to address deprecation warnings. See also https://www.kdab.com/blog-qasconst-and-stdas_const/
-rw-r--r--ui/qt/follow_stream_dialog.cpp2
-rw-r--r--ui/qt/models/packet_list_model.cpp4
-rw-r--r--ui/qt/show_packet_bytes_dialog.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp
index 54f4e61484..aa73331faf 100644
--- a/ui/qt/follow_stream_dialog.cpp
+++ b/ui/qt/follow_stream_dialog.cpp
@@ -148,7 +148,7 @@ void FollowStreamDialog::addCodecs(const QMap<QString, QTextCodec *> &codecMap)
// Make the combobox respect max visible items?
//ui->cbCharset->setStyleSheet("QComboBox { combobox-popup: 0;}");
ui->cbCharset->insertSeparator(ui->cbCharset->count());
- for (const auto &codec : qAsConst(codecMap)) {
+ for (const auto &codec : codecMap) {
// This is already in the menu and handled separately
if (codec->name() != "US-ASCII" && codec->name() != "UTF-8")
ui->cbCharset->addItem(tr(codec->name()), SHOW_CODEC);
diff --git a/ui/qt/models/packet_list_model.cpp b/ui/qt/models/packet_list_model.cpp
index c050fcaef1..876ae34b8b 100644
--- a/ui/qt/models/packet_list_model.cpp
+++ b/ui/qt/models/packet_list_model.cpp
@@ -340,7 +340,7 @@ void PacketListModel::addFrameComment(const QModelIndexList &indices, const QByt
frame_data *fdata;
if (!cap_file_) return;
- for (const auto &index : qAsConst(indices)) {
+ for (const auto &index : indices) {
if (!index.isValid()) continue;
PacketListRecord *record = static_cast<PacketListRecord*>(index.internalPointer());
@@ -414,7 +414,7 @@ void PacketListModel::deleteFrameComments(const QModelIndexList &indices)
frame_data *fdata;
if (!cap_file_) return;
- for (const auto &index : qAsConst(indices)) {
+ for (const auto &index : indices) {
if (!index.isValid()) continue;
PacketListRecord *record = static_cast<PacketListRecord*>(index.internalPointer());
diff --git a/ui/qt/show_packet_bytes_dialog.cpp b/ui/qt/show_packet_bytes_dialog.cpp
index 7e2901fbdf..161636c902 100644
--- a/ui/qt/show_packet_bytes_dialog.cpp
+++ b/ui/qt/show_packet_bytes_dialog.cpp
@@ -116,7 +116,7 @@ void ShowPacketBytesDialog::addCodecs(const QMap<QString, QTextCodec *> &codecMa
// Make the combobox respect max visible items?
//ui->cbShowAs->setStyleSheet("QComboBox { combobox-popup: 0;}");
ui->cbShowAs->insertSeparator(ui->cbShowAs->count());
- for (const auto &codec : qAsConst(codecMap)) {
+ for (const auto &codec : codecMap) {
// This is already placed in the menu and handled separately
if (codec->name() != "US-ASCII" && codec->name() != "UTF-8")
ui->cbShowAs->addItem(tr(codec->name()), SHOW_CODEC);