mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 22:00:35 +01:00
Try Clazy fix-its
clazy is a compiler plugin which allows clang to understand Qt semantics. You get more than 50 Qt related compiler warnings, ranging from unneeded memory allocations to misusage of API, including fix-its for automatic refactoring. https://invent.kde.org/sdk/clazy
This commit is contained in:
@@ -545,7 +545,7 @@ void QETElementEditor::updateInformations()
|
||||
QString selection_xml_name = part -> xmlName();
|
||||
bool same_xml_name = true;
|
||||
bool style_editable = true;
|
||||
for (QGraphicsItem *qgi: selected_qgis)
|
||||
for (QGraphicsItem* qgi : std::as_const(selected_qgis))
|
||||
{
|
||||
if (CustomElementPart *cep = dynamic_cast<CustomElementPart *>(qgi)) {
|
||||
cep_list << cep;
|
||||
@@ -582,9 +582,11 @@ void QETElementEditor::updateInformations()
|
||||
bool equal = true;
|
||||
QList<CustomElementPart*> parts = editor -> currentParts();
|
||||
if (parts.length() == cep_list.length()) {
|
||||
for (auto cep: cep_list) {
|
||||
for (auto cep : std::as_const(cep_list))
|
||||
{
|
||||
bool part_found = false;
|
||||
for (auto part: parts) {
|
||||
for (auto part : std::as_const(parts))
|
||||
{
|
||||
if (part == cep) {
|
||||
part_found = true;
|
||||
break;
|
||||
@@ -789,12 +791,12 @@ bool QETElementEditor::checkElement()
|
||||
|
||||
dialog_message += "<ol>";
|
||||
QList<QETWarning> total = warnings << errors;
|
||||
for(QETWarning warning : total)
|
||||
for (const QETWarning& warning : total)
|
||||
{
|
||||
dialog_message += "<li>";
|
||||
dialog_message += QString(
|
||||
tr("<b>%1</b> : %2", "warning title: warning description")
|
||||
).arg(warning.first).arg(warning.second);
|
||||
dialog_message +=
|
||||
QString(tr("<b>%1</b> : %2", "warning title: warning description"))
|
||||
.arg(warning.first, warning.second);
|
||||
dialog_message += "</li>";
|
||||
}
|
||||
dialog_message += "</ol>";
|
||||
|
||||
Reference in New Issue
Block a user