Apply clang-tidy's performance-unnecessary-value-param, performance-for-

range-copy


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5448 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
scorpio810
2018-07-19 14:14:31 +00:00
parent 05fea9b94a
commit e4b1ba9797
97 changed files with 263 additions and 238 deletions

View File

@@ -1226,7 +1226,7 @@ void DynamicElementTextModel::setConnection(DynamicElementTextItem *deti, bool s
if(!m_hash_text_connect.keys().contains(deti))
return;
for (QMetaObject::Connection con : m_hash_text_connect.value(deti))
for (const QMetaObject::Connection& con : m_hash_text_connect.value(deti))
disconnect(con);
m_hash_text_connect.remove(deti);
@@ -1264,7 +1264,7 @@ void DynamicElementTextModel::setConnection(ElementTextItemGroup *group, bool se
if(!m_hash_group_connect.keys().contains(group))
return;
for (QMetaObject::Connection con : m_hash_group_connect.value(group))
for (const QMetaObject::Connection& con : m_hash_group_connect.value(group))
disconnect(con);
m_hash_group_connect.remove(group);
@@ -1443,13 +1443,13 @@ QWidget *DynamicTextItemDelegate::createEditor(QWidget *parent, const QStyleOpti
//We use a QMap because the keys of the map are sorted, then no matter the curent local,
//the value of the combo box are always alphabetically sorted
QMap <QString, QString> info_map;
for(QString str : availableInfo(deti)) {
for(const QString& str : availableInfo(deti)) {
info_map.insert(QETApp::elementTranslatedInfoKey(str), str);
}
QComboBox *qcb = new QComboBox(parent);
qcb->setObjectName("info_text");
for (QString key : info_map.keys()) {
for (const QString& key : info_map.keys()) {
qcb->addItem(key, info_map.value(key));
}
return qcb;
@@ -1733,7 +1733,7 @@ QStringList DynamicTextItemDelegate::availableInfo(DynamicElementTextItem *deti)
info_list.removeAll("formula"); //No need to have formula
DiagramContext dc = elmt->elementInformations();
for(QString info : info_list)
for(const QString& info : info_list)
{
if(dc.contains(info))
qstrl << info;