Qt: Substitute for C++17 ism

Replace C++17 ism from !9822 with code with the same effect
that is valid earlier

(cherry picked from commit 50f71efbe0955b32dfb99bb4933f6ff310b39283)
This commit is contained in:
John Thacker 2023-02-19 13:13:06 -05:00
parent 2d4e637fef
commit 189d93b4b8
1 changed files with 4 additions and 2 deletions

View File

@ -340,7 +340,8 @@ void PacketListModel::addFrameComment(const QModelIndexList &indices, const QByt
frame_data *fdata;
if (!cap_file_) return;
foreach (const auto &index, std::as_const(indices)) {
for (qsizetype i = 0; i < indices.size(); ++i) {
const auto &index = indices.at(i);
if (!index.isValid()) continue;
PacketListRecord *record = static_cast<PacketListRecord*>(index.internalPointer());
@ -414,7 +415,8 @@ void PacketListModel::deleteFrameComments(const QModelIndexList &indices)
frame_data *fdata;
if (!cap_file_) return;
foreach (const auto &index, std::as_const(indices)) {
for (qsizetype i = 0; i < indices.size(); ++i) {
const auto &index = indices.at(i);
if (!index.isValid()) continue;
PacketListRecord *record = static_cast<PacketListRecord*>(index.internalPointer());