mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-05-21 04:29:58 +02:00
Fixed deprecated qAsConst() to std::as_const()
This commit is contained in:
@@ -203,7 +203,7 @@ void TerminalStripDrawer::paint(QPainter *painter)
|
||||
painter->restore();
|
||||
|
||||
//Draw the bridges
|
||||
for (const auto &points_ : qAsConst(bridges_anchor_points))
|
||||
for (const auto &points_ : std::as_const(bridges_anchor_points))
|
||||
{
|
||||
painter->save();
|
||||
auto pen_{painter->pen()};
|
||||
|
||||
@@ -126,7 +126,7 @@ void RemoveTerminalFromStripCommand::redo()
|
||||
if (m_strip)
|
||||
{
|
||||
QVector<QSharedPointer<RealTerminal>> real_t;
|
||||
for (const auto &real_t_vector : qAsConst(m_terminals)) {
|
||||
for (const auto &real_t_vector : std::as_const(m_terminals)) {
|
||||
real_t.append(real_t_vector);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ void UnGroupTerminalsCommand::undo()
|
||||
m_terminal_strip->groupTerminals(key, m_physical_real_H.value(key));
|
||||
}
|
||||
//Second, set level.
|
||||
for (const auto &pair : qAsConst(m_real_t_level)) {
|
||||
for (const auto &pair : std::as_const(m_real_t_level)) {
|
||||
m_terminal_strip->setLevel(pair.first, pair.second);
|
||||
}
|
||||
}
|
||||
@@ -78,7 +78,7 @@ void UnGroupTerminalsCommand::redo()
|
||||
{
|
||||
if (m_terminal_strip)
|
||||
{
|
||||
for (const auto &value : qAsConst(m_physical_real_H)) {
|
||||
for (const auto &value : std::as_const(m_physical_real_H)) {
|
||||
m_terminal_strip->unGroupTerminals(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,7 +466,7 @@ QSharedPointer<RealTerminal> TerminalStrip::realTerminalForUuid(const QUuid &uui
|
||||
QVector<QSharedPointer<RealTerminal>> TerminalStrip::realTerminals() const
|
||||
{
|
||||
QVector<QSharedPointer<RealTerminal>> vector_;
|
||||
for (const auto &phy : qAsConst(m_physical_terminals)) {
|
||||
for (const auto &phy : std::as_const(m_physical_terminals)) {
|
||||
vector_.append(phy->realTerminals());
|
||||
}
|
||||
return vector_;
|
||||
@@ -856,7 +856,7 @@ QSharedPointer<TerminalStripBridge> TerminalStrip::isBridged(const QSharedPointe
|
||||
{
|
||||
if (real_terminal)
|
||||
{
|
||||
for (const auto &bridge_ : qAsConst(m_bridge)) {
|
||||
for (const auto &bridge_ : std::as_const(m_bridge)) {
|
||||
if (bridge_->realTerminals().contains(real_terminal))
|
||||
return bridge_;
|
||||
}
|
||||
@@ -983,7 +983,7 @@ QDomElement TerminalStrip::toXml(QDomDocument &parent_document)
|
||||
}
|
||||
root_elmt.appendChild(xml_layout);
|
||||
|
||||
for (const auto &bridge_ : qAsConst(m_bridge)) {
|
||||
for (const auto &bridge_ : std::as_const(m_bridge)) {
|
||||
root_elmt.appendChild(bridge_->toXml(parent_document));
|
||||
}
|
||||
|
||||
@@ -1024,7 +1024,7 @@ bool TerminalStrip::fromXml(QDomElement &xml_element)
|
||||
for (auto &xml_real : QETXML::findInDomElement(xml_physical, RealTerminal::xmlTagName()))
|
||||
{
|
||||
const auto uuid_ = QUuid(xml_real.attribute(QStringLiteral("element_uuid")));
|
||||
for (auto terminal_elmt : qAsConst(free_terminals))
|
||||
for (auto terminal_elmt : std::as_const(free_terminals))
|
||||
{
|
||||
if (terminal_elmt->uuid() == uuid_)
|
||||
{
|
||||
|
||||
@@ -85,7 +85,7 @@ QDomElement TerminalStripBridge::toXml(QDomDocument &parent_document) const
|
||||
root_elmt.setAttribute(QStringLiteral("color"), m_color.name());
|
||||
|
||||
auto terminals_elmt = parent_document.createElement(QStringLiteral("real_terminals"));
|
||||
for (const auto &real_t : qAsConst(m_real_terminals))
|
||||
for (const auto &real_t : std::as_const(m_real_terminals))
|
||||
{
|
||||
if (real_t)
|
||||
{
|
||||
|
||||
@@ -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_;
|
||||
|
||||
@@ -60,7 +60,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();
|
||||
@@ -222,7 +222,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();
|
||||
@@ -324,7 +324,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()};
|
||||
|
||||
Reference in New Issue
Block a user