Skip to content

Commit 196fdb5

Browse files
committed
fix qAsConst warnings
1 parent 037e5a4 commit 196fdb5

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

QtSLiM/QtSLiMExtras.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ QStringList QtSLiMRunLineEditArrayDialog(QWidget *p_parent, QString title, QStri
957957
{
958958
QStringList returnList;
959959

960-
for (QLineEdit *lineEdit : qAsConst(lineEdits))
960+
for (QLineEdit *lineEdit : static_cast<const QVector<QLineEdit *> &>(lineEdits))
961961
returnList.append(lineEdit->text());
962962

963963
delete dialog;

QtSLiM/QtSLiMFindRecipe.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void QtSLiMFindRecipe::updateMatchListWidget(void)
180180

181181
matchList->clear();
182182

183-
for (const QString &match : qAsConst(matchRecipeFilenames))
183+
for (const QString &match : static_cast<const QStringList &>(matchRecipeFilenames))
184184
matchList->addItem(displayStringForRecipeFilename(match));
185185
}
186186

QtSLiM/QtSLiMVariableBrowser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ void QtSLiMVariableBrowser::reloadBrowser(bool nowValidState)
337337

338338
// We don't use the EidosValues in the saved tree at all, since they will potentially be stale;
339339
// to free up the memory involved, we go through the saved tree and wipe the values to nullptr
340-
for (QTreeWidgetItem *old_root_child : qAsConst(old_children))
340+
for (QTreeWidgetItem *old_root_child : static_cast<const QList<QTreeWidgetItem *> &>(old_children))
341341
wipeEidosValuesFromSubtree(old_root_child);
342342
}
343343
else
@@ -387,7 +387,7 @@ void QtSLiMVariableBrowser::reloadBrowser(bool nowValidState)
387387
// Analyze the old children and try to expand items to match the previous state
388388
doingMatching = true;
389389

390-
for (QTreeWidgetItem *old_root_child : qAsConst(old_children))
390+
for (QTreeWidgetItem *old_root_child : static_cast<const QList<QTreeWidgetItem *> &>(old_children))
391391
matchExpansionOfOldItem(old_root_child, root);
392392

393393
// Try to restore the scroll position to where it was when we saved the tree

0 commit comments

Comments
 (0)