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
@@ -535,7 +535,7 @@ modelRealTerminalData TerminalStripModel::dataAtRow(int row) const
else
{
auto current_row = 0;
for (const auto &physical_data : qAsConst(m_physical_data))
for (const auto &physical_data : std::as_const(m_physical_data))
{
for (const auto &real_data : physical_data.real_data)
{
@@ -567,7 +567,7 @@ void TerminalStripModel::replaceDataAtRow(modelRealTerminalData data, int row)
auto current_row = 0;
auto current_physical = 0;
for (const auto &physical_data : qAsConst(m_physical_data))
for (const auto &physical_data : std::as_const(m_physical_data))
{
auto current_real = 0;
for (int i=0 ; i<physical_data.real_data.count() ; ++i)
@@ -606,7 +606,7 @@ modelPhysicalTerminalData TerminalStripModel::physicalDataAtIndex(int index) con
int current_phy = -1;
bool match_ = false;
for (const auto &ptd_ : qAsConst(m_physical_data))
for (const auto &ptd_ : std::as_const(m_physical_data))
{
current_checked_index += ptd_.real_data.size();
++current_phy;
@@ -637,9 +637,9 @@ modelRealTerminalData TerminalStripModel::realDataAtIndex(int index) const
int current_checked_index = -1;
for (const auto & ptd_ : qAsConst(m_physical_data))
for (const auto & ptd_ : std::as_const(m_physical_data))
{
for (const auto & rtd_ : qAsConst(ptd_.real_data)) {
for (const auto & rtd_ : std::as_const(ptd_.real_data)) {
++current_checked_index;
if (current_checked_index == index) {
return rtd_;
@@ -85,7 +85,7 @@ void TerminalStripTreeDockWidget::reload()
m_uuid_terminal_H.clear();
m_uuid_strip_H.clear();
for (const auto &connection_ : qAsConst(m_strip_changed_connection)) {
for (const auto &connection_ : std::as_const(m_strip_changed_connection)) {
disconnect(connection_);
}
m_strip_changed_connection.clear();
@@ -250,7 +250,7 @@ void TerminalStripTreeDockWidget::buildTree()
return a->name() < b->name();
});
for (const auto &ts : qAsConst(ts_vector)) {
for (const auto &ts : std::as_const(ts_vector)) {
addTerminalStrip(ts);
}
addFreeTerminal();
@@ -352,7 +352,7 @@ void TerminalStripTreeDockWidget::addFreeTerminal()
auto free_terminal_item = ui->m_tree_view->topLevelItem(1);
for (const auto terminal : qAsConst(vector_))
for (const auto terminal : std::as_const(vector_))
{
QUuid uuid_ = terminal->uuid();
QStringList strl{terminal->actualLabel()};