Replace deprecated qAsConst with std::as_const

qAsConst was deprecated in Qt 6.6; std::as_const (C++17, already the
project standard) is the drop-in replacement. Clears 46 -Wdeprecated-
declarations warnings across 18 files. No behavioural change.
This commit is contained in:
Dieter Mayer
2026-07-12 21:44:47 +02:00
parent 5c65bf6486
commit 1265e51ebe
18 changed files with 46 additions and 46 deletions
+2 -2
View File
@@ -1093,7 +1093,7 @@ void QETElementEditor::updateAction()
<< ui->m_revert_selection_action
<< ui->m_paste_from_file_action
<< ui->m_paste_from_element_action;
for (auto action : qAsConst(ro_list)) {
for (auto action : std::as_const(ro_list)) {
action->setDisabled(m_read_only);
}
@@ -1108,7 +1108,7 @@ void QETElementEditor::updateAction()
<< ui->m_flip_action
<< ui->m_mirror_action;
auto items_selected = !m_read_only && m_elmt_scene->selectedItems().count();
for (auto action : qAsConst(select_list)) {
for (auto action : std::as_const(select_list)) {
action->setEnabled(items_selected);
}
+1 -1
View File
@@ -428,7 +428,7 @@ void TerminalEditor::activeConnections(bool active)
m_editor_connections << connect(ui->m_label_frame_cb, &QCheckBox::toggled,
this, &TerminalEditor::labelFrameEdited);
} else {
for (auto const & con : qAsConst(m_editor_connections)) {
for (auto const & con : std::as_const(m_editor_connections)) {
QObject::disconnect(con);
}
m_editor_connections.clear();
+1 -1
View File
@@ -84,7 +84,7 @@ void TextEditor::setUpChangeConnection(QPointer<PartText> part)
void TextEditor::disconnectChangeConnection()
{
for (const auto &connection : qAsConst(m_change_connection)) {
for (const auto &connection : std::as_const(m_change_connection)) {
disconnect(connection);
}
m_change_connection.clear();