mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 16:20:52 +01:00
Fixed deprecated qAsConst() to std::as_const()
This commit is contained in:
@@ -151,7 +151,7 @@ Diagram::~Diagram()
|
||||
continue;
|
||||
deletable_items.append(qgi);
|
||||
}
|
||||
for (const auto &item : qAsConst(deletable_items))
|
||||
for (const auto &item : std::as_const(deletable_items))
|
||||
{
|
||||
removeItem(item);
|
||||
delete item;
|
||||
@@ -1453,13 +1453,13 @@ bool Diagram::fromXml(QDomElement &document,
|
||||
if (position != QPointF())
|
||||
{
|
||||
QVector <QGraphicsItem *> added_items;
|
||||
for (auto element : qAsConst(added_elements )) added_items << element;
|
||||
for (auto cond : qAsConst(added_conductors )) added_items << cond;
|
||||
for (auto shape : qAsConst(added_shapes )) added_items << shape;
|
||||
for (auto text : qAsConst(added_texts )) added_items << text;
|
||||
for (auto image : qAsConst(added_images )) added_items << image;
|
||||
for (auto table : qAsConst(added_tables )) added_items << table;
|
||||
for (const auto &strip : qAsConst(added_strips)) added_items << strip;
|
||||
for (auto element : std::as_const(added_elements )) added_items << element;
|
||||
for (auto cond : std::as_const(added_conductors )) added_items << cond;
|
||||
for (auto shape : std::as_const(added_shapes )) added_items << shape;
|
||||
for (auto text : std::as_const(added_texts )) added_items << text;
|
||||
for (auto image : std::as_const(added_images )) added_items << image;
|
||||
for (auto table : std::as_const(added_tables )) added_items << table;
|
||||
for (const auto &strip : std::as_const(added_strips)) added_items << strip;
|
||||
|
||||
//Get the top left corner of the rectangle that contain all added items
|
||||
QRectF items_rect;
|
||||
@@ -1568,11 +1568,11 @@ void Diagram::refreshContents()
|
||||
conductor->refreshText();
|
||||
}
|
||||
|
||||
for (auto &table : qAsConst(dc_.m_tables)) {
|
||||
for (auto &table : std::as_const(dc_.m_tables)) {
|
||||
table->initLink();
|
||||
}
|
||||
|
||||
for (auto &strip :qAsConst(dc_.m_terminal_strip)) {
|
||||
for (auto &strip :std::as_const(dc_.m_terminal_strip)) {
|
||||
strip->refreshPending();
|
||||
}
|
||||
}
|
||||
@@ -1757,7 +1757,7 @@ void Diagram::invertSelection()
|
||||
item_list << item;
|
||||
}
|
||||
}
|
||||
for (auto item : qAsConst(item_list)) {
|
||||
for (auto item : std::as_const(item_list)) {
|
||||
item -> setSelected(!item -> isSelected());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user