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

@@ -309,7 +309,7 @@ void ProjectPrintWindow::printDiagram(Diagram *diagram, bool fit_page, QPainter
//Scrolls through the page for print
bool first_ = true;
for (auto page : page_to_print)
for (auto page : std::as_const(page_to_print))
{
first_ ? first_ = false : m_printer->newPage();
diagram->render(painter, QRect(QPoint(0,0), page.size()), page.translated(diagram_rect.topLeft()), Qt::KeepAspectRatio);
@@ -320,7 +320,8 @@ void ProjectPrintWindow::printDiagram(Diagram *diagram, bool fit_page, QPainter
for (auto view : diagram->views()) {
view->setInteractive(true);
}
for (auto qgi : focusable_items) {
for (auto qgi : std::as_const(focusable_items))
{
qgi->setFlag(QGraphicsItem::ItemIsFocusable, true);
}
saveReloadDiagramParameters(diagram, option, false);