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:
Laurent Trinques
2025-02-14 15:52:23 +01:00
parent adcf77e34a
commit dba7caed30
88 changed files with 512 additions and 409 deletions

View File

@@ -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>";