From 78735cd31aace383cf87e276c26f2c7d8367293e Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 27 Apr 2024 12:54:59 +0300 Subject: [PATCH] Refactoring. Replace the redundant type with "auto". --- src/app/puzzle/carousel/vpcarrouselpiece.cpp | 2 +- .../puzzlepreferenceslayoutpage.cpp | 2 +- src/app/puzzle/layout/vppiece.cpp | 4 +- src/app/puzzle/layout/vpsheet.cpp | 6 +- src/app/puzzle/scene/vpgraphicspiece.cpp | 2 +- .../puzzle/scene/vpgraphicspiececontrols.cpp | 14 ++-- src/app/puzzle/scene/vpgraphicssheet.cpp | 4 +- src/app/puzzle/vpmainwindow.cpp | 10 +-- src/app/puzzle/vptilefactory.cpp | 28 +++---- src/app/puzzle/xml/vplayoutfilereader.cpp | 4 +- .../dialogs/dialogdimensioncustomnames.cpp | 2 +- .../tape/dialogs/dialogdimensionlabels.cpp | 9 +- .../dialogknownmeasurementscsvcolumns.cpp | 4 +- .../dialogs/dialogmeasurementscsvcolumns.cpp | 8 +- .../tape/dialogs/dialognewmeasurements.cpp | 16 ++-- src/app/tape/tkmmainwindow.cpp | 10 +-- src/app/tape/tmainwindow.cpp | 14 ++-- src/app/valentina/core/vapplication.cpp | 12 +-- .../dialogs/dialogfinalmeasurements.cpp | 6 +- .../valentina/dialogs/dialogincrements.cpp | 6 +- .../dialogs/dialoglayoutprogress.cpp | 2 +- .../dialogs/dialoglayoutsettings.cpp | 2 +- .../valentina/dialogs/dialogsavelayout.cpp | 10 +-- .../dialogs/vwidgetbackgroundimages.cpp | 4 +- src/app/valentina/dialogs/vwidgetgroups.cpp | 8 +- src/app/valentina/mainwindow.cpp | 18 ++-- src/app/valentina/mainwindowsnogui.cpp | 2 +- src/app/valentina/xml/vpattern.cpp | 20 ++--- src/libs/fervor/fvupdater.cpp | 6 +- src/libs/ifc/xml/vabstractmconverter.cpp | 7 +- src/libs/ifc/xml/vabstractpattern.cpp | 2 +- src/libs/ifc/xml/vpatternconverter.cpp | 6 +- src/libs/ifc/xml/vvitconverter.cpp | 4 +- src/libs/ifc/xml/vvstconverter.cpp | 16 ++-- src/libs/qmuparser/qmuformulabase.cpp | 4 +- src/libs/vdxf/libdxfrw/drw_entities.cpp | 2 +- src/libs/vformat/vsinglelineoutlinechar.cpp | 4 +- src/libs/vganalytics/vganalytics.cpp | 2 +- src/libs/vganalytics/vganalyticsworker.cpp | 4 +- src/libs/vgeometry/vabstractarc.cpp | 2 +- src/libs/vgeometry/vabstractcurve.cpp | 2 +- src/libs/vgeometry/varc.cpp | 2 +- src/libs/vgeometry/vellipticalarc.cpp | 2 +- .../vlayout/dialogs/dialoglayoutscale.cpp | 8 +- .../vlayout/dialogs/vabstractlayoutdialog.cpp | 4 +- src/libs/vlayout/vrawlayout.cpp | 2 +- src/libs/vlayout/vtextmanager.cpp | 4 +- src/libs/vmisc/crashhandler/crashhandler.cpp | 18 ++-- src/libs/vmisc/crashhandler/vcrashpaths.cpp | 6 +- src/libs/vmisc/def.cpp | 12 +-- src/libs/vmisc/dialogs/dialogexporttocsv.cpp | 2 +- src/libs/vmisc/svgfont/vsvgfontdatabase.cpp | 2 +- src/libs/vmisc/svgfont/vsvgfontengine.cpp | 2 +- src/libs/vmisc/theme/vapplicationstyle.cpp | 2 +- src/libs/vmisc/theme/vstylesheetstyle.cpp | 2 +- src/libs/vmisc/theme/vtheme.cpp | 4 +- src/libs/vmisc/vabstractapplication.cpp | 6 +- src/libs/vmisc/vcommonsettings.cpp | 2 +- src/libs/vobj/vobjengine.cpp | 4 +- src/libs/vpatterndb/vpiece.cpp | 2 +- src/libs/vpatterndb/vtranslatevars.cpp | 6 +- src/libs/vtest/abstracttest.cpp | 84 +++++++++---------- src/libs/vtest/abstracttest.h | 4 +- .../support/dialogeditwrongformula.cpp | 4 +- .../vtools/dialogs/tools/dialogalongline.cpp | 2 +- src/libs/vtools/dialogs/tools/dialogarc.cpp | 6 +- .../dialogs/tools/dialogarcwithlength.cpp | 6 +- .../vtools/dialogs/tools/dialogbisector.cpp | 2 +- .../tools/dialogcurveintersectaxis.cpp | 2 +- .../vtools/dialogs/tools/dialogcutarc.cpp | 2 +- .../vtools/dialogs/tools/dialogcutspline.cpp | 2 +- .../dialogs/tools/dialogcutsplinepath.cpp | 2 +- .../dialogs/tools/dialogellipticalarc.cpp | 6 +- .../vtools/dialogs/tools/dialogendline.cpp | 6 +- .../dialogs/tools/dialoglineintersectaxis.cpp | 2 +- src/libs/vtools/dialogs/tools/dialogmove.cpp | 6 +- .../vtools/dialogs/tools/dialognormal.cpp | 2 +- .../tools/dialogpointfromcircleandtangent.cpp | 2 +- .../dialogs/tools/dialogpointofcontact.cpp | 2 +- .../dialogpointofintersectioncircles.cpp | 6 +- .../vtools/dialogs/tools/dialogrotation.cpp | 2 +- .../dialogs/tools/dialogshoulderpoint.cpp | 2 +- .../vtools/dialogs/tools/dialogspline.cpp | 6 +- .../vtools/dialogs/tools/dialogsplinepath.cpp | 6 +- .../dialogs/tools/piece/dialogpiecepath.cpp | 6 +- .../dialogs/tools/piece/dialogplacelabel.cpp | 6 +- .../tools/piece/dialogseamallowance.cpp | 6 +- .../vbackgroundimagecontrols.cpp | 14 ++-- src/libs/vwidgets/fancytabbar/fancytabbar.cpp | 2 +- src/libs/vwidgets/global.cpp | 2 +- src/libs/vwidgets/vabstractmainwindow.cpp | 2 +- src/libs/vwidgets/vcomboboxdelegate.cpp | 6 +- src/libs/vwidgets/vlineedit.cpp | 2 +- src/libs/vwidgets/vmaingraphicsview.cpp | 2 +- .../tst_valentinacommandline.cpp | 2 +- .../TranslationsTest/tst_abstractregexp.cpp | 10 +-- .../TranslationsTest/tst_buitinregexp.cpp | 6 +- .../tst_qmuparsererrormsg.cpp | 2 +- .../tst_tslocaletranslation.cpp | 12 +-- .../TranslationsTest/tst_tstranslation.cpp | 7 +- src/test/ValentinaTest/tst_readval.cpp | 4 +- src/test/ValentinaTest/tst_vellipticalarc.cpp | 2 +- src/test/ValentinaTest/tst_vpointf.cpp | 2 +- src/test/ValentinaTest/tst_vspline.cpp | 2 +- src/test/ValentinaTest/tst_vsplinepath.cpp | 2 +- .../ValentinaTest/tst_vsvgpathtokenizer.cpp | 2 +- src/test/ValentinaTest/tst_vtranslatevars.cpp | 2 +- 107 files changed, 322 insertions(+), 327 deletions(-) diff --git a/src/app/puzzle/carousel/vpcarrouselpiece.cpp b/src/app/puzzle/carousel/vpcarrouselpiece.cpp index 7450a7d5d..e8aec3773 100644 --- a/src/app/puzzle/carousel/vpcarrouselpiece.cpp +++ b/src/app/puzzle/carousel/vpcarrouselpiece.cpp @@ -92,7 +92,7 @@ auto VPCarrouselPiece::CreatePieceIcon(const QSize &size, bool isDragIcon) const QRectF const boundingRect = piece->DetailBoundingRect(); qreal const canvasSize = qMax(boundingRect.height(), boundingRect.width()); - QRectF const canvas = QRectF(0, 0, canvasSize, canvasSize); + auto const canvas = QRectF(0, 0, canvasSize, canvasSize); qreal const dx = canvas.center().x() - boundingRect.center().x(); qreal const dy = canvas.center().y() - boundingRect.center().y(); diff --git a/src/app/puzzle/dialogs/configpages/puzzlepreferenceslayoutpage.cpp b/src/app/puzzle/dialogs/configpages/puzzlepreferenceslayoutpage.cpp index f946cc70a..eb48ec6db 100644 --- a/src/app/puzzle/dialogs/configpages/puzzlepreferenceslayoutpage.cpp +++ b/src/app/puzzle/dialogs/configpages/puzzlepreferenceslayoutpage.cpp @@ -689,7 +689,7 @@ void PuzzlePreferencesLayoutPage::FindTemplate(QComboBox *box, qreal width, qrea SCASSERT(box != nullptr) const Unit paperUnit = LayoutUnit(); - const int max = static_cast(VAbstractLayoutDialog::PaperSizeTemplate::Custom); + const auto max = static_cast(VAbstractLayoutDialog::PaperSizeTemplate::Custom); for (int i = 0; i < max; ++i) { const QSizeF tmplSize = diff --git a/src/app/puzzle/layout/vppiece.cpp b/src/app/puzzle/layout/vppiece.cpp index fd4346363..2937511d1 100644 --- a/src/app/puzzle/layout/vppiece.cpp +++ b/src/app/puzzle/layout/vppiece.cpp @@ -559,7 +559,7 @@ auto VPPiece::StickySheet(VStickyDistance &match) const -> bool } const qreal stickyDistance = maxStickyDistance; - if (QRectF const stickyZone = + if (auto const stickyZone = QRectF(boundingRect.topLeft().x() - stickyDistance, boundingRect.topLeft().y() - stickyDistance, boundingRect.width() + stickyDistance * 2, boundingRect.height() + stickyDistance * 2); !stickyZone.intersects(sheetRect)) @@ -664,7 +664,7 @@ auto VPPiece::StickyPieces(VStickyDistance &match) const -> bool CastTo(GetMappedExternalContourPoints(), path); QRectF const boundingRect = VLayoutPiece::BoundingRect(path); const qreal stickyDistance = pieceGap + minStickyDistance; - QRectF const stickyZone = + auto const stickyZone = QRectF(boundingRect.topLeft().x() - stickyDistance, boundingRect.topLeft().y() - stickyDistance, boundingRect.width() + stickyDistance * 2, boundingRect.height() + stickyDistance * 2); diff --git a/src/app/puzzle/layout/vpsheet.cpp b/src/app/puzzle/layout/vpsheet.cpp index 57d25c45f..dd99d29b3 100644 --- a/src/app/puzzle/layout/vpsheet.cpp +++ b/src/app/puzzle/layout/vpsheet.cpp @@ -725,8 +725,8 @@ auto VPSheet::GetMarginsRect() const -> QRectF { if (not m_ignoreMargins) { - QRectF rect = QRectF(QPointF(m_margins.left(), m_margins.top()), - QPointF(m_size.width() - m_margins.right(), m_size.height() - m_margins.bottom())); + auto rect = QRectF(QPointF(m_margins.left(), m_margins.top()), + QPointF(m_size.width() - m_margins.right(), m_size.height() - m_margins.bottom())); return rect; } @@ -984,7 +984,7 @@ auto VPSheet::GetSheetSize() const -> QSizeF auto VPSheet::GetSheetSizeConverted() const -> QSizeF { Unit const unit = SheetUnits(); - QSizeF convertedSize = + auto convertedSize = QSizeF(UnitConvertor(m_size.width(), Unit::Px, unit), UnitConvertor(m_size.height(), Unit::Px, unit)); return convertedSize; diff --git a/src/app/puzzle/scene/vpgraphicspiece.cpp b/src/app/puzzle/scene/vpgraphicspiece.cpp index 7a0b32f98..3542b0b6d 100644 --- a/src/app/puzzle/scene/vpgraphicspiece.cpp +++ b/src/app/puzzle/scene/vpgraphicspiece.cpp @@ -396,7 +396,7 @@ void VPGraphicsPiece::InitPieceLabelSVGFont(const QVector &labelShape, VSvgFont const svgFont = engine.Font(); if (!svgFont.IsValid()) { - QString const errorMsg = QStringLiteral("Invalid SVG font '%1'. Fallback to outline font.").arg(svgFont.Name()); + auto const errorMsg = QStringLiteral("Invalid SVG font '%1'. Fallback to outline font.").arg(svgFont.Name()); qDebug() << errorMsg; InitPieceLabelOutlineFont(labelShape, tm); return; diff --git a/src/app/puzzle/scene/vpgraphicspiececontrols.cpp b/src/app/puzzle/scene/vpgraphicspiececontrols.cpp index 1861ad4fa..4dc38af06 100644 --- a/src/app/puzzle/scene/vpgraphicspiececontrols.cpp +++ b/src/app/puzzle/scene/vpgraphicspiececontrols.cpp @@ -283,8 +283,8 @@ auto VPGraphicsTransformationOrigin::Center2() const -> QPainterPath const qreal scale = SceneScale(scene()); qreal const radius = centerRadius2 / scale; VPTransformationOrigon const transformationOrigin = TransformationOrigin(m_layout, QRectF()); - QRectF const rect = QRectF(transformationOrigin.origin.x() - radius, transformationOrigin.origin.y() - radius, - radius * 2., radius * 2.); + auto const rect = QRectF(transformationOrigin.origin.x() - radius, transformationOrigin.origin.y() - radius, + radius * 2., radius * 2.); QPainterPath center2; center2.addEllipse(rect); @@ -567,22 +567,22 @@ void VPGraphicsPieceControls::InitPixmaps() auto InitPixmap = [this](VPHandleCornerType type, const QString &imageName) { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); - const QString fileName = QStringLiteral("32x32/%1.png").arg(imageName); + const auto fileName = QStringLiteral("32x32/%1.png").arg(imageName); QPixmap const handlePixmap = VTheme::GetPixmapResource(resource, fileName); if (QGuiApplication::primaryScreen()->devicePixelRatio() >= 2) { - const QString fileName2x = QStringLiteral("32x32/%1@2x.png").arg(imageName); - const QString fileName2xHover = QStringLiteral("32x32/%1-hover@2x.png").arg(imageName); + const auto fileName2x = QStringLiteral("32x32/%1@2x.png").arg(imageName); + const auto fileName2xHover = QStringLiteral("32x32/%1-hover@2x.png").arg(imageName); m_handlePixmaps.insert(type, VTheme::GetPixmapResource(resource, fileName2x)); m_handleHoverPixmaps.insert(type, VTheme::GetPixmapResource(resource, fileName2xHover)); } else { - const QString fileNameHover = QStringLiteral("32x32/%1-hover.png").arg(imageName); + const auto fileNameHover = QStringLiteral("32x32/%1-hover.png").arg(imageName); m_handlePixmaps.insert(type, handlePixmap); m_handleHoverPixmaps.insert(type, VTheme::GetPixmapResource(resource, fileNameHover)); diff --git a/src/app/puzzle/scene/vpgraphicssheet.cpp b/src/app/puzzle/scene/vpgraphicssheet.cpp index b44497881..df05b9e65 100644 --- a/src/app/puzzle/scene/vpgraphicssheet.cpp +++ b/src/app/puzzle/scene/vpgraphicssheet.cpp @@ -387,7 +387,7 @@ void VPGraphicsSheet::PaintGrid(QPainter *painter) const qreal colX = colWidth; while (colX < sheetRect.right()) { - QLineF const line = QLineF(colX, 0, colX, sheetRect.bottom()); + auto const line = QLineF(colX, 0, colX, sheetRect.bottom()); painter->drawLine(line); colX += colWidth; } @@ -399,7 +399,7 @@ void VPGraphicsSheet::PaintGrid(QPainter *painter) const while (rowY < sheetRect.bottom()) { - QLineF const line = QLineF(0, rowY, sheetRect.right(), rowY); + auto const line = QLineF(0, rowY, sheetRect.right(), rowY); painter->drawLine(line); rowY += rowHeight; } diff --git a/src/app/puzzle/vpmainwindow.cpp b/src/app/puzzle/vpmainwindow.cpp index 612ac3d1f..c2f465d0d 100644 --- a/src/app/puzzle/vpmainwindow.cpp +++ b/src/app/puzzle/vpmainwindow.cpp @@ -1922,7 +1922,7 @@ void VPMainWindow::CreateWindowMenu(QMenu *menu) { VPMainWindow *window = windows.at(i); - QString title = QStringLiteral("%1. %2").arg(i + 1).arg(window->windowTitle()); + auto title = QStringLiteral("%1. %2").arg(i + 1).arg(window->windowTitle()); if (const vsizetype index = title.lastIndexOf("[*]"_L1); index != -1) { window->isWindowModified() ? title.replace(index, 3, '*'_L1) : title.replace(index, 3, QString()); @@ -2210,7 +2210,7 @@ void VPMainWindow::FindTemplate(QComboBox *box, qreal width, qreal height) SCASSERT(box != nullptr) const Unit paperUnit = LayoutUnit(); - const int max = static_cast(VAbstractLayoutDialog::PaperSizeTemplate::Custom); + const auto max = static_cast(VAbstractLayoutDialog::PaperSizeTemplate::Custom); for (int i = 0; i < max; ++i) { const QSizeF tmplSize = @@ -2907,7 +2907,7 @@ auto VPMainWindow::DrawTilesScheme(QPrinter *printer, QPainter *painter, const V if (sheet->GetSheetOrientation() == QPageLayout::Landscape) { - QPointF const shift = QPointF(0, textHeight); + auto const shift = QPointF(0, textHeight); source = QRectF(sheetRect.topLeft() - shift, QSizeF(tilesWidth, tilesHeight + textHeight)); } else @@ -3603,7 +3603,7 @@ void VPMainWindow::RotatePieces() //--------------------------------------------------------------------------------------------------------------------- void VPMainWindow::InitIcons() { - const QString resource = QStringLiteral("puzzleicon"); + const auto resource = QStringLiteral("puzzleicon"); auto SetTabIcon = [resource, this](QWidget *tab, const QString &iconName) { @@ -3747,7 +3747,7 @@ auto VPMainWindow::on_actionSave_triggered() -> bool auto VPMainWindow::on_actionSaveAs_triggered() -> bool { QString const filters = tr("Layout files") + QStringLiteral(" (*.vlt)"); - QString const suffix = QStringLiteral("vlt"); + auto const suffix = QStringLiteral("vlt"); QString const fName = tr("layout") + '.'_L1 + suffix; QString dir; diff --git a/src/app/puzzle/vptilefactory.cpp b/src/app/puzzle/vptilefactory.cpp index 4590633c0..220aeb69a 100644 --- a/src/app/puzzle/vptilefactory.cpp +++ b/src/app/puzzle/vptilefactory.cpp @@ -49,11 +49,11 @@ auto WatermarkImageFromCache(const VWatermarkData &watermarkData, const QString QPixmap pixmap; QString const imagePath = AbsoluteMPath(watermarkPath, watermarkData.path); - if (QString const imageCacheKey = QStringLiteral("puzzle=path%1+rotation%3+grayscale%4+xscale%5+yxcale%6") - .arg(imagePath, QString::number(watermarkData.imageRotation), - watermarkData.grayscale ? trueStr : falseStr) - .arg(xScale) - .arg(yScale); + if (auto const imageCacheKey = QStringLiteral("puzzle=path%1+rotation%3+grayscale%4+xscale%5+yxcale%6") + .arg(imagePath, QString::number(watermarkData.imageRotation), + watermarkData.grayscale ? trueStr : falseStr) + .arg(xScale) + .arg(yScale); not QPixmapCache::find(imageCacheKey, &pixmap)) { QImageReader imageReader(imagePath); @@ -91,8 +91,8 @@ auto WatermarkImageFromCache(const VWatermarkData &watermarkData, const QString auto TriangleBasic() -> QPainterPath { // ------------- prepare triangles for position marks - QRectF const rectBasic = QRectF(-UnitConvertor(0.5, Unit::Cm, Unit::Px), 0, UnitConvertor(1, Unit::Cm, Unit::Px), - UnitConvertor(0.5, Unit::Cm, Unit::Px)); + auto const rectBasic = QRectF(-UnitConvertor(0.5, Unit::Cm, Unit::Px), 0, UnitConvertor(1, Unit::Cm, Unit::Px), + UnitConvertor(0.5, Unit::Cm, Unit::Px)); QPainterPath triangleBasic; triangleBasic.moveTo(rectBasic.topLeft()); triangleBasic.lineTo(rectBasic.topRight()); @@ -408,7 +408,7 @@ void VPTileFactory::DrawTilePageContent(QPainter *painter, const VPSheetPtr &she sheetMargins = sheet->GetSheetMargins(); } - QPen const penTileDrawing = + auto const penTileDrawing = QPen(Qt::black, m_commonSettings->WidthMainLine(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); painter->setPen(penTileDrawing); @@ -416,11 +416,11 @@ void VPTileFactory::DrawTilePageContent(QPainter *painter, const VPSheetPtr &she // paint the content of the page const qreal xScale = layout->LayoutSettings().HorizontalScale(); const qreal yScale = layout->LayoutSettings().VerticalScale(); - QRectF const source = QRectF(sheetMargins.left() + col * (m_drawingAreaWidth - tileStripeWidth) / xScale, - sheetMargins.top() + row * (m_drawingAreaHeight - tileStripeWidth) / yScale, - m_drawingAreaWidth / xScale, m_drawingAreaHeight / yScale); + auto const source = QRectF(sheetMargins.left() + col * (m_drawingAreaWidth - tileStripeWidth) / xScale, + sheetMargins.top() + row * (m_drawingAreaHeight - tileStripeWidth) / yScale, + m_drawingAreaWidth / xScale, m_drawingAreaHeight / yScale); - QRectF const target = QRectF(0, 0, m_drawingAreaWidth, m_drawingAreaHeight); + auto const target = QRectF(0, 0, m_drawingAreaWidth, m_drawingAreaHeight); sheet->SceneData()->Scene()->render(painter, VPrintLayout::SceneTargetRect(printer, target), source, Qt::IgnoreAspectRatio); } @@ -616,7 +616,7 @@ void VPTileFactory::DrawTextInformation(QPainter *painter, int row, int col, int td.setPageSize(QSizeF(m_drawingAreaHeight - UnitConvertor(2, Unit::Cm, Unit::Px), m_drawingAreaWidth)); - QFontMetrics const metrix = QFontMetrics(td.defaultFont()); + auto const metrix = QFontMetrics(td.defaultFont()); int const maxWidth = metrix.horizontalAdvance(QString().fill('z', 50)); QString const clippedSheetName = metrix.elidedText(sheetName, Qt::ElideMiddle, maxWidth); @@ -683,7 +683,7 @@ void VPTileFactory::PaintWatermarkImage(QPainter *painter, const QRectF &img, co const qreal opacity = watermarkData.opacity / 100.; auto BrokenImage = [&img, &watermarkData, watermarkPath, opacity, folowColorScheme]() { - QString colorScheme = QStringLiteral("light"); + auto colorScheme = QStringLiteral("light"); if (folowColorScheme) { diff --git a/src/app/puzzle/xml/vplayoutfilereader.cpp b/src/app/puzzle/xml/vplayoutfilereader.cpp index 7da06e962..be960400f 100644 --- a/src/app/puzzle/xml/vplayoutfilereader.cpp +++ b/src/app/puzzle/xml/vplayoutfilereader.cpp @@ -999,7 +999,7 @@ void VPLayoutFileReader::ReadLayoutMargins(const VPLayoutPtr &layout) { QXmlStreamAttributes const attribs = attributes(); - QMarginsF margins = QMarginsF(); + QMarginsF margins; margins.setLeft(ReadAttributeDouble(attribs, ML::AttrLeft, QChar('0'))); margins.setTop(ReadAttributeDouble(attribs, ML::AttrTop, QChar('0'))); margins.setRight(ReadAttributeDouble(attribs, ML::AttrRight, QChar('0'))); @@ -1016,7 +1016,7 @@ void VPLayoutFileReader::ReadSheetMargins(const VPSheetPtr &sheet) { QXmlStreamAttributes const attribs = attributes(); - QMarginsF margins = QMarginsF(); + QMarginsF margins; margins.setLeft(ReadAttributeDouble(attribs, ML::AttrLeft, QChar('0'))); margins.setTop(ReadAttributeDouble(attribs, ML::AttrTop, QChar('0'))); margins.setRight(ReadAttributeDouble(attribs, ML::AttrRight, QChar('0'))); diff --git a/src/app/tape/dialogs/dialogdimensioncustomnames.cpp b/src/app/tape/dialogs/dialogdimensioncustomnames.cpp index aebaaa656..5dfeac098 100644 --- a/src/app/tape/dialogs/dialogdimensioncustomnames.cpp +++ b/src/app/tape/dialogs/dialogdimensioncustomnames.cpp @@ -73,7 +73,7 @@ void DialogDimensionCustomNames::InitTable(const QMapType()), i.value()->Axis()); auto *itemValue = new QTableWidgetItem(name); itemValue->setTextAlignment(Qt::AlignHCenter | Qt::AlignCenter); diff --git a/src/app/tape/dialogs/dialogdimensionlabels.cpp b/src/app/tape/dialogs/dialogdimensionlabels.cpp index 6300b4c70..08ed5e99a 100644 --- a/src/app/tape/dialogs/dialogdimensionlabels.cpp +++ b/src/app/tape/dialogs/dialogdimensionlabels.cpp @@ -59,8 +59,7 @@ void DialogDimensionLabels::changeEvent(QEvent *event) // retranslate designer form (single inheritance approach) ui->retranslateUi(this); - MeasurementDimension const type = - static_cast(ui->comboBoxDimensionLabels->currentData().toInt()); + auto const type = static_cast(ui->comboBoxDimensionLabels->currentData().toInt()); InitDimensions(); @@ -94,8 +93,7 @@ void DialogDimensionLabels::LabelChanged(QTableWidgetItem *item) { if (item != nullptr) { - MeasurementDimension const type = - static_cast(ui->comboBoxDimensionLabels->currentData().toInt()); + auto const type = static_cast(ui->comboBoxDimensionLabels->currentData().toInt()); qreal const value = item->data(Qt::UserRole).toDouble(); DimesionLabels labels = m_labels.value(type); @@ -138,8 +136,7 @@ void DialogDimensionLabels::InitTable() ui->tableWidget->blockSignals(true); ui->tableWidget->clearContents(); - const MeasurementDimension type = - static_cast(ui->comboBoxDimensionLabels->currentData().toInt()); + const auto type = static_cast(ui->comboBoxDimensionLabels->currentData().toInt()); MeasurementDimension_p dimension; diff --git a/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.cpp b/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.cpp index fb1d13f06..108b8d326 100644 --- a/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.cpp +++ b/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.cpp @@ -519,7 +519,7 @@ void DialogKnownMeasurementsCSVColumns::CheckStatus() //--------------------------------------------------------------------------------------------------------------------- template auto DialogKnownMeasurementsCSVColumns::ColumnValid(T column) const -> bool { - const int columnNumber = static_cast(column); + const auto columnNumber = static_cast(column); int const value = m_columnsMap.at(columnNumber); if (value == -1 && not ColumnMandatory(columnNumber)) @@ -548,7 +548,7 @@ template void DialogKnownMeasurementsCSVColumns::SaveColum(QComboBox * { SCASSERT(control != nullptr) - const int columnNumber = static_cast(column); + const auto columnNumber = static_cast(column); m_columnsMap[columnNumber] = control->currentData().toInt(); ShowImportPreview(); CheckStatus(); diff --git a/src/app/tape/dialogs/dialogmeasurementscsvcolumns.cpp b/src/app/tape/dialogs/dialogmeasurementscsvcolumns.cpp index 88ab25f54..832815e0a 100644 --- a/src/app/tape/dialogs/dialogmeasurementscsvcolumns.cpp +++ b/src/app/tape/dialogs/dialogmeasurementscsvcolumns.cpp @@ -253,7 +253,7 @@ auto DialogMeasurementsCSVColumns::ColumnHeader(int column) const -> QString } else { - const QString suffix = QStringLiteral(" (%1):"); + const auto suffix = QStringLiteral(" (%1):"); const auto multisizeColumn = static_cast(column); switch (multisizeColumn) { @@ -746,7 +746,7 @@ void DialogMeasurementsCSVColumns::RetranslateLabels() ui->labelValue->setText( QCoreApplication::translate("DialogMeasurementsCSVColumns", "Base value", "measurement column") + "*:"_L1); - const QString suffix = QStringLiteral(" (%1)"); + const auto suffix = QStringLiteral(" (%1)"); if (not m_dimensions.empty()) { @@ -878,7 +878,7 @@ template void DialogMeasurementsCSVColumns::HackWidget(T **widget) //--------------------------------------------------------------------------------------------------------------------- template auto DialogMeasurementsCSVColumns::ColumnValid(T column) const -> bool { - const int columnNumber = static_cast(column); + const auto columnNumber = static_cast(column); int const value = m_columnsMap.at(columnNumber); if (value == -1 && not ColumnMandatory(columnNumber)) @@ -907,7 +907,7 @@ template void DialogMeasurementsCSVColumns::SaveColum(QComboBox *contr { SCASSERT(control != nullptr) - const int columnNumber = static_cast(column); + const auto columnNumber = static_cast(column); m_columnsMap[columnNumber] = control->currentData().toInt(); ShowImportPreview(); CheckStatus(); diff --git a/src/app/tape/dialogs/dialognewmeasurements.cpp b/src/app/tape/dialogs/dialognewmeasurements.cpp index c1002a09a..260bd4642 100644 --- a/src/app/tape/dialogs/dialognewmeasurements.cpp +++ b/src/app/tape/dialogs/dialognewmeasurements.cpp @@ -33,9 +33,9 @@ //--------------------------------------------------------------------------------------------------------------------- DialogNewMeasurements::DialogNewMeasurements(QWidget *parent) - :QDialog(parent), - ui(new Ui::DialogNewMeasurements), - m_isInitialized(false) + : QDialog(parent), + ui(new Ui::DialogNewMeasurements), + m_isInitialized(false) { ui->setupUi(this); @@ -79,8 +79,8 @@ void DialogNewMeasurements::changeEvent(QEvent *event) //--------------------------------------------------------------------------------------------------------------------- void DialogNewMeasurements::showEvent(QShowEvent *event) { - QDialog::showEvent( event ); - if ( event->spontaneous() ) + QDialog::showEvent(event); + if (event->spontaneous()) { return; } @@ -94,13 +94,13 @@ void DialogNewMeasurements::showEvent(QShowEvent *event) setMaximumSize(size()); setMinimumSize(size()); - m_isInitialized = true;//first show windows are held + m_isInitialized = true; // first show windows are held } //--------------------------------------------------------------------------------------------------------------------- void DialogNewMeasurements::InitMTypes() { - int val = static_cast(MeasurementsType::Unknown); + auto val = static_cast(MeasurementsType::Unknown); if (ui->comboBoxMType->currentIndex() != -1) { val = ui->comboBoxMType->currentData().toInt(); @@ -122,7 +122,7 @@ void DialogNewMeasurements::InitMTypes() //--------------------------------------------------------------------------------------------------------------------- void DialogNewMeasurements::InitUnits() { - int val = static_cast(Unit::Cm); + auto val = static_cast(Unit::Cm); if (ui->comboBoxUnit->currentIndex() != -1) { val = ui->comboBoxUnit->currentData().toInt(); diff --git a/src/app/tape/tkmmainwindow.cpp b/src/app/tape/tkmmainwindow.cpp index ccf54a797..1091cb7f2 100644 --- a/src/app/tape/tkmmainwindow.cpp +++ b/src/app/tape/tkmmainwindow.cpp @@ -575,7 +575,7 @@ auto TKMMainWindow::FileSaveAs() -> bool QString const filters = tr("Known measurements") + QStringLiteral(" (*.vkm)"); QString fName = tr("known measurements"); - QString const suffix = QStringLiteral("vkm"); + auto const suffix = QStringLiteral("vkm"); fName += '.'_L1 + suffix; @@ -693,7 +693,7 @@ void TKMMainWindow::ImportDataFromCSV() } const QString filters = tr("Comma-Separated Values") + QStringLiteral(" (*.csv)"); - const QString suffix = QStringLiteral("csv"); + const auto suffix = QStringLiteral("csv"); QString fileName = QFileDialog::getOpenFileName(this, tr("Import from CSV"), QDir::homePath(), filters, nullptr, VAbstractApplication::VApp()->NativeFileDialog()); @@ -2033,7 +2033,7 @@ void TKMMainWindow::WriteSettings() //--------------------------------------------------------------------------------------------------------------------- void TKMMainWindow::InitIcons() { - QString const iconResource = QStringLiteral("icon"); + auto const iconResource = QStringLiteral("icon"); ui->toolButtonAddImage->setIcon(VTheme::GetIconResource(iconResource, QStringLiteral("16x16/insert-image.png"))); ui->toolButtonRemoveImage->setIcon(VTheme::GetIconResource(iconResource, QStringLiteral("16x16/remove-image.png"))); @@ -2042,7 +2042,7 @@ void TKMMainWindow::InitIcons() ui->tabWidget->setTabIcon(index, VTheme::GetIconResource(iconResource, QStringLiteral("16x16/viewimage.png"))); } - QString const tapeIconResource = QStringLiteral("tapeicon"); + auto const tapeIconResource = QStringLiteral("tapeicon"); ui->actionMeasurementDiagram->setIcon( VTheme::GetIconResource(tapeIconResource, QStringLiteral("24x24/mannequin.png"))); } @@ -2150,7 +2150,7 @@ void TKMMainWindow::CreateWindowMenu(QMenu *menu) { TKMMainWindow *window = windows.at(i); - QString title = QStringLiteral("%1. %2").arg(i + 1).arg(window->windowTitle()); + auto title = QStringLiteral("%1. %2").arg(i + 1).arg(window->windowTitle()); if (const auto index = title.lastIndexOf("[*]"_L1); index != -1) { window->isWindowModified() ? title.replace(index, 3, '*'_L1) : title.replace(index, 3, QString()); diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 0811fe055..ca802d0db 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -1090,7 +1090,7 @@ void TMainWindow::ImportDataFromCSV() } const QString filters = tr("Comma-Separated Values") + QStringLiteral(" (*.csv)"); - const QString suffix = QStringLiteral("csv"); + const auto suffix = QStringLiteral("csv"); QString fileName = QFileDialog::getOpenFileName(this, tr("Import from CSV"), QDir::homePath(), filters, nullptr, VAbstractApplication::VApp()->NativeFileDialog()); @@ -2596,7 +2596,7 @@ void TMainWindow::ExportToIndividual() return; } - QString const suffix = QStringLiteral("vit"); + auto const suffix = QStringLiteral("vit"); if (QFileInfo const f(fileName); f.suffix().isEmpty() && f.suffix() != suffix) { fileName += '.'_L1 + suffix; @@ -3370,7 +3370,7 @@ void TMainWindow::ShowHeaderUnits(QTableWidget *table, int column, const QString { header.remove(index - 1, 100); } - const QString unitHeader = QStringLiteral("%1 (%2)").arg(header, unit); + const auto unitHeader = QStringLiteral("%1 (%2)").arg(header, unit); table->horizontalHeaderItem(column)->setText(unitHeader); } @@ -4197,7 +4197,7 @@ void TMainWindow::CreateWindowMenu(QMenu *menu) { TMainWindow *window = windows.at(i); - QString title = QStringLiteral("%1. %2").arg(i + 1).arg(window->windowTitle()); + auto title = QStringLiteral("%1. %2").arg(i + 1).arg(window->windowTitle()); if (const auto index = title.lastIndexOf("[*]"_L1); index != -1) { window->isWindowModified() ? title.replace(index, 3, '*'_L1) : title.replace(index, 3, QString()); @@ -4697,12 +4697,12 @@ auto TMainWindow::OrderedMeasurements() const -> QMaptoolButtonExpr->setIcon(VTheme::GetIconResource(iconResource, QStringLiteral("24x24/fx.png"))); ui->toolButtonAddImage->setIcon(VTheme::GetIconResource(iconResource, QStringLiteral("16x16/insert-image.png"))); ui->toolButtonRemoveImage->setIcon(VTheme::GetIconResource(iconResource, QStringLiteral("16x16/remove-image.png"))); - QString const tapeIconResource = QStringLiteral("tapeicon"); + auto const tapeIconResource = QStringLiteral("tapeicon"); ui->actionMeasurementDiagram->setIcon( VTheme::GetIconResource(tapeIconResource, QStringLiteral("24x24/mannequin.png"))); } @@ -4846,7 +4846,7 @@ auto TMainWindow::CSVColumnHeader(int column) const -> QString } const QList dimensions = m_m->Dimensions().values(); - const QString suffix = QStringLiteral(" (%1):"); + const auto suffix = QStringLiteral(" (%1):"); if (column == 4) { diff --git a/src/app/valentina/core/vapplication.cpp b/src/app/valentina/core/vapplication.cpp index fafcf0662..cc2485b5f 100644 --- a/src/app/valentina/core/vapplication.cpp +++ b/src/app/valentina/core/vapplication.cpp @@ -97,7 +97,7 @@ namespace auto AppFilePath(const QString &appName) -> QString { #ifdef Q_OS_WIN - const QString executableSuffix = QStringLiteral(".exe"); + const auto executableSuffix = QStringLiteral(".exe"); #else const QString executableSuffix; #endif @@ -416,7 +416,7 @@ void VApplication::NewValentina(const QString &fileName) } else { - const QString run = QStringLiteral("\"%1\" \"%2\"").arg(QCoreApplication::applicationFilePath(), fileName); + const auto run = QStringLiteral("\"%1\" \"%2\"").arg(QCoreApplication::applicationFilePath(), fileName); qCDebug(vApp, "New process with arguments. program = %s", qUtf8Printable(run)); if (QProcess::startDetached(QCoreApplication::applicationFilePath(), QStringList{fileName})) { @@ -518,9 +518,9 @@ auto VApplication::notify(QObject *receiver, QEvent *event) -> bool auto VApplication::TapeFilePath() -> QString { #ifdef Q_OS_MACOS - const QString appName = QStringLiteral("Tape"); + const auto appName = QStringLiteral("Tape"); #else - const QString appName = QStringLiteral("tape"); + const auto appName = QStringLiteral("tape"); #endif return AppFilePath(appName); } @@ -529,9 +529,9 @@ auto VApplication::TapeFilePath() -> QString auto VApplication::PuzzleFilePath() -> QString { #ifdef Q_OS_MACOS - const QString appName = QStringLiteral("Puzzle"); + const auto appName = QStringLiteral("Puzzle"); #else - const QString appName = QStringLiteral("puzzle"); + const auto appName = QStringLiteral("puzzle"); #endif return AppFilePath(appName); } diff --git a/src/app/valentina/dialogs/dialogfinalmeasurements.cpp b/src/app/valentina/dialogs/dialogfinalmeasurements.cpp index 51d019fa7..6a82af603 100644 --- a/src/app/valentina/dialogs/dialogfinalmeasurements.cpp +++ b/src/app/valentina/dialogs/dialogfinalmeasurements.cpp @@ -551,14 +551,14 @@ void DialogFinalMeasurements::ShowUnits() { // calculated value const QString header = ui->tableWidget->horizontalHeaderItem(1)->text(); - const QString unitHeader = QStringLiteral("%1 (%2)").arg(header, unit); + const auto unitHeader = QStringLiteral("%1 (%2)").arg(header, unit); ui->tableWidget->horizontalHeaderItem(1)->setText(unitHeader); } { // formula const QString header = ui->tableWidget->horizontalHeaderItem(2)->text(); - const QString unitHeader = QStringLiteral("%1 (%2)").arg(header, unit); + const auto unitHeader = QStringLiteral("%1 (%2)").arg(header, unit); ui->tableWidget->horizontalHeaderItem(2)->setText(unitHeader); } } @@ -960,7 +960,7 @@ void DialogFinalMeasurements::UpdateSearchControlsTooltips() //--------------------------------------------------------------------------------------------------------------------- void DialogFinalMeasurements::InitIcons() { - QString const resource = QStringLiteral("icon"); + auto const resource = QStringLiteral("icon"); ui->toolButtonExpr->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png"))); } diff --git a/src/app/valentina/dialogs/dialogincrements.cpp b/src/app/valentina/dialogs/dialogincrements.cpp index e8149bc3e..92ddbaac9 100644 --- a/src/app/valentina/dialogs/dialogincrements.cpp +++ b/src/app/valentina/dialogs/dialogincrements.cpp @@ -317,7 +317,7 @@ void DialogIncrements::ShowHeaderUnits(QTableWidget *table, int column, const QS SCASSERT(table != nullptr) const QString header = table->horizontalHeaderItem(column)->text(); - const QString unitHeader = QStringLiteral("%1 (%2)").arg(header, unit); + const auto unitHeader = QStringLiteral("%1 (%2)").arg(header, unit); table->horizontalHeaderItem(column)->setText(unitHeader); } @@ -1306,8 +1306,8 @@ void DialogIncrements::InitIncrementUnits(QComboBox *combo) //--------------------------------------------------------------------------------------------------------------------- void DialogIncrements::InitIcons() { - const QString resource = QStringLiteral("icon"); - const QString fxIcon = QStringLiteral("24x24/fx.png"); + const auto resource = QStringLiteral("icon"); + const auto fxIcon = QStringLiteral("24x24/fx.png"); ui->toolButtonExpr->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprPC->setIcon(VTheme::GetIconResource(resource, fxIcon)); diff --git a/src/app/valentina/dialogs/dialoglayoutprogress.cpp b/src/app/valentina/dialogs/dialoglayoutprogress.cpp index d399fcc4a..4a3b68512 100644 --- a/src/app/valentina/dialogs/dialoglayoutprogress.cpp +++ b/src/app/valentina/dialogs/dialoglayoutprogress.cpp @@ -75,7 +75,7 @@ DialogLayoutProgress::DialogLayoutProgress(QElapsedTimer timer, qint64 timeout, [this]() { const qint64 elapsed = m_timer.elapsed(); - const int timeout = static_cast(m_timeout - elapsed); + const auto timeout = static_cast(m_timeout - elapsed); QTime t(0, 0); t = t.addMSecs(timeout); ui->labelTimeLeft->setText(tr("Time left: %1").arg(t.toString())); diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.cpp b/src/app/valentina/dialogs/dialoglayoutsettings.cpp index a463f0ae1..cfbdb1acc 100644 --- a/src/app/valentina/dialogs/dialoglayoutsettings.cpp +++ b/src/app/valentina/dialogs/dialoglayoutsettings.cpp @@ -450,7 +450,7 @@ void DialogLayoutSettings::FindTemplate() const Unit paperUnit = PaperUnit(); - const int max = static_cast(PaperSizeTemplate::Custom); + const auto max = static_cast(PaperSizeTemplate::Custom); for (int i = 0; i < max; ++i) { const QSizeF tmplSize = GetTemplateSize(static_cast(i), paperUnit); diff --git a/src/app/valentina/dialogs/dialogsavelayout.cpp b/src/app/valentina/dialogs/dialogsavelayout.cpp index e5cc545da..3caf758cd 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.cpp +++ b/src/app/valentina/dialogs/dialogsavelayout.cpp @@ -628,8 +628,8 @@ void DialogSaveLayout::SetTiledMargins(QMarginsF margins) //--------------------------------------------------------------------------------------------------------------------- auto DialogSaveLayout::GetTiledMargins() const -> QMarginsF { - QMarginsF const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(), - ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value()); + auto const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(), + ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value()); return UnitConvertor(margins, VAbstractValApplication::VApp()->patternUnits(), Unit::Mm); } @@ -821,7 +821,7 @@ void DialogSaveLayout::ReadSettings() const QSizeF size = VAbstractLayoutDialog::RoundTemplateSize(settings->GetTiledPDFPaperWidth(Unit::Mm), settings->GetTiledPDFPaperHeight(Unit::Mm), Unit::Mm); - const int max = static_cast(PaperSizeTemplate::Custom); + const auto max = static_cast(PaperSizeTemplate::Custom); for (int i = 0; i < max; ++i) { @@ -886,8 +886,8 @@ void DialogSaveLayout::WriteSettings() const const Unit unit = VAbstractValApplication::VApp()->patternUnits(); // write Margins top, right, bottom, left - QMarginsF const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(), - ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value()); + auto const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(), + ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value()); settings->SetTiledPDFMargins(margins, unit); // write Template diff --git a/src/app/valentina/dialogs/vwidgetbackgroundimages.cpp b/src/app/valentina/dialogs/vwidgetbackgroundimages.cpp index 18e9bc7d2..83a621d5b 100644 --- a/src/app/valentina/dialogs/vwidgetbackgroundimages.cpp +++ b/src/app/valentina/dialogs/vwidgetbackgroundimages.cpp @@ -63,7 +63,7 @@ void SetImageHold(QTableWidgetItem *item, const VBackgroundPatternImage &image) { if (item) { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); (image.Hold()) ? item->setIcon(VTheme::GetIconResource(resource, QStringLiteral("16x16/hold_image.png"))) : item->setIcon(VTheme::GetIconResource(resource, QStringLiteral("16x16/not_hold_image.png"))); } @@ -74,7 +74,7 @@ void SetImageVisibility(QTableWidgetItem *item, const VBackgroundPatternImage &i { if (item) { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); item->setIcon(image.Visible() ? VTheme::GetIconResource(resource, QStringLiteral("16x16/open_eye.png")) : VTheme::GetIconResource(resource, QStringLiteral("16x16/closed_eye.png"))); } diff --git a/src/app/valentina/dialogs/vwidgetgroups.cpp b/src/app/valentina/dialogs/vwidgetgroups.cpp index 70461cbf7..e1ffa8325 100644 --- a/src/app/valentina/dialogs/vwidgetgroups.cpp +++ b/src/app/valentina/dialogs/vwidgetgroups.cpp @@ -79,7 +79,7 @@ void VWidgetGroups::SetGroupVisibility(vidtype id, bool visible) const QTableWidgetItem *item = ui->tableWidget->item(row, 0); if (item) { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); item->setIcon(visible ? VTheme::GetIconResource(resource, QStringLiteral("16x16/open_eye.png")) : VTheme::GetIconResource(resource, QStringLiteral("16x16/closed_eye.png"))); } @@ -106,7 +106,7 @@ void VWidgetGroups::SetMultipleGroupsVisibility(const QVector &groups, if (QTableWidgetItem *item = ui->tableWidget->item(row, 0); item) { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); item->setIcon(i.value() ? VTheme::GetIconResource(resource, QStringLiteral("16x16/open_eye.png")) : VTheme::GetIconResource(resource, QStringLiteral("16x16/closed_eye.png"))); @@ -287,7 +287,7 @@ void VWidgetGroups::CtxMenu(const QPoint &pos) }; QScopedPointer const menu(new QMenu()); - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); QAction *triggerVisibilityMenu = m_doc->GetGroupVisibility(id) ? menu->addAction(VTheme::GetIconResource(resource, QStringLiteral("16x16/closed_eye.png")), tr("Hide")) @@ -352,7 +352,7 @@ void VWidgetGroups::FillTable(QMap groups) ++currentRow; const VGroupData data = i.value(); - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); auto *item = new QTableWidgetItem(); item->setTextAlignment(Qt::AlignHCenter); (data.visible) ? item->setIcon(VTheme::GetIconResource(resource, QStringLiteral("16x16/open_eye.png"))) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 3bf7cdc7a..a05be55cd 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -837,7 +837,7 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons if (VValentinaSettings *settings = VAbstractValApplication::VApp()->ValentinaSettings(); settings->GetPointerMode() == VToolPointerMode::ToolIcon) { - const QString resource = QStringLiteral("toolcursor"); + const auto resource = QStringLiteral("toolcursor"); auto cursorResource = VTheme::GetResourceName(resource, cursor); if (qApp->devicePixelRatio() >= 2) // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast) { @@ -2904,7 +2904,7 @@ void MainWindow::ToolBarOption() //--------------------------------------------------------------------------------------------------------------------- void MainWindow::ToolBarStages() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); m_leftGoToStage = new QLabel(this); m_leftGoToStage->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/go-next-skip.png"))); @@ -3648,7 +3648,7 @@ void MainWindow::CancelTool() //--------------------------------------------------------------------------------------------------------------------- void MainWindow::SetupDrawToolsIcons() { - const QString resource = QStringLiteral("toolicon"); + const auto resource = QStringLiteral("toolicon"); // This check helps to find missed tools Q_STATIC_ASSERT_X(static_cast(Tool::LAST_ONE_DO_NOT_USE) == 61, "Not all tools were handled."); @@ -3840,7 +3840,7 @@ void MainWindow::ActionDraw(bool checked) qCDebug(vMainWindow, "Show draw scene"); ArrowTool(true); - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); m_leftGoToStage->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/go-next-skip.png"))); m_rightGoToStage->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/go-next.png"))); @@ -3900,7 +3900,7 @@ void MainWindow::ActionDetails(bool checked) } m_comboBoxDraws->setCurrentIndex(m_comboBoxDraws->count() - 1); // Need to get data about all details - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); m_leftGoToStage->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/go-previous.png"))); m_rightGoToStage->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/go-next.png"))); @@ -3982,7 +3982,7 @@ void MainWindow::ActionLayout(bool checked) } m_comboBoxDraws->setCurrentIndex(m_comboBoxDraws->count() - 1); // Need to get data about all details - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); m_leftGoToStage->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/go-previous.png"))); m_rightGoToStage->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/go-previous-skip.png"))); @@ -6478,7 +6478,7 @@ auto MainWindow::LoadPattern(QString fileName, const QString &customMeasureFile) // See issue #976. Pattern can lost link to measurements if (path.isEmpty() && doc->RequiresMeasurements()) { - const QString fakeName = QStringLiteral("unknown_measurements.vit"); + const auto fakeName = QStringLiteral("unknown_measurements.vit"); // Check if exist fixedMPath = CheckPathToMeasurements(fileName, fakeName); if (fixedMPath.isEmpty()) @@ -7546,7 +7546,7 @@ auto MainWindow::GetMeasurementFileName() -> QString return {}; } - QString shownName = QStringLiteral(" ["); + auto shownName = QStringLiteral(" ["); shownName += QFileInfo(AbsoluteMPath(VAbstractValApplication::VApp()->GetPatternPath(), doc->MPath())).fileName(); if (m_mChanges) @@ -7903,7 +7903,7 @@ void MainWindow::PrintPatternMessage(QEvent *event) } const QString time = QDateTime::currentDateTime().toString(QStringLiteral("hh:mm:ss")); - const QString message = QStringLiteral("%1: [%2] %3").arg(time, severity, patternMessage->Message()); + const auto message = QStringLiteral("%1: [%2] %3").arg(time, severity, patternMessage->Message()); ui->plainTextEditPatternMessages->appendPlainText(message); if (not m_unreadPatternMessage.isNull()) { diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index 101fbbb5d..3d71b40cc 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -226,7 +226,7 @@ auto MainWindowsNoGUI::GenerateLayout(VLayoutGenerator &lGenerator) -> bool connect(progressTimer, &QTimer::timeout, this, [timer, &lGenerator, progressTimer]() { - const int timeout = static_cast(lGenerator.GetNestingTimeMSecs() - timer.elapsed()); + const auto timeout = static_cast(lGenerator.GetNestingTimeMSecs() - timer.elapsed()); if (timeout <= 1000) { diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 07d843b0d..c6c13394f 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -1566,52 +1566,52 @@ auto VPattern::GetLabelBase(quint32 index) const -> QString { case 0: // de { - const QString al = QStringLiteral("A,Ä,B,C,D,E,F,G,H,I,J,K,L,M,N,O,Ö,P,Q,R,S,ß,T,U,Ü,V,W,X,Y,Z"); + const auto al = QStringLiteral("A,Ä,B,C,D,E,F,G,H,I,J,K,L,M,N,O,Ö,P,Q,R,S,ß,T,U,Ü,V,W,X,Y,Z"); alphabet = al.split(','_L1); break; } case 2: // fr { - const QString al = QStringLiteral("A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"); + const auto al = QStringLiteral("A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"); alphabet = al.split(','_L1); break; } case 3: // ru { - const QString al = QStringLiteral("А,Б,В,Г,Д,Е,Ж,З,И,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Э,Ю,Я"); + const auto al = QStringLiteral("А,Б,В,Г,Д,Е,Ж,З,И,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Э,Ю,Я"); alphabet = al.split(','_L1); break; } case 4: // uk { - const QString al = QStringLiteral("А,Б,В,Г,Д,Е,Ж,З,І,Ї,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Є,Ю,Я"); + const auto al = QStringLiteral("А,Б,В,Г,Д,Е,Ж,З,І,Ї,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Є,Ю,Я"); alphabet = al.split(','_L1); break; } case 5: // hr case 7: // bs { - const QString al = QStringLiteral("A,B,C,Č,Ć,D,Dž,Ð,E,F,G,H,I,J,K,L,Lj,M,N,Nj,O,P,R,S,Š,T,U,V,Z,Ž"); + const auto al = QStringLiteral("A,B,C,Č,Ć,D,Dž,Ð,E,F,G,H,I,J,K,L,Lj,M,N,Nj,O,P,R,S,Š,T,U,V,Z,Ž"); alphabet = al.split(','_L1); break; } case 6: // sr { - const QString al = QStringLiteral("А,Б,В,Г,Д,Ђ,Е,Ж,З,И,Ј,К,Л,Љ,М,Н,Њ,О,П,Р,С,Т,Ћ,У,Ф,Х,Ц,Ч,Џ,Ш"); + const auto al = QStringLiteral("А,Б,В,Г,Д,Ђ,Е,Ж,З,И,Ј,К,Л,Љ,М,Н,Њ,О,П,Р,С,Т,Ћ,У,Ф,Х,Ц,Ч,Џ,Ш"); alphabet = al.split(','_L1); break; } case 8: // cs { - const QString al = QStringLiteral("a,á,b,c,č,d,ď,e,é,ě,f,g,h,ch,i,í,j,k,l,m,n,ň,o,ó,p,q,r,ř,s,š,t,ť,u,ú,ů," - "v,w,x,y,ý,z,ž"); + const auto al = QStringLiteral("a,á,b,c,č,d,ď,e,é,ě,f,g,h,ch,i,í,j,k,l,m,n,ň,o,ó,p,q,r,ř,s,š,t,ť,u,ú,ů," + "v,w,x,y,ý,z,ž"); alphabet = al.split(','_L1); break; } case 1: // en default: // en { - const QString al = QStringLiteral("A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"); + const auto al = QStringLiteral("A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"); alphabet = al.split(','_L1); break; } @@ -1619,7 +1619,7 @@ auto VPattern::GetLabelBase(quint32 index) const -> QString QString base; const int count = qFloor(index / static_cast(alphabet.size())); - const int number = static_cast(index) - static_cast(alphabet.size()) * count; + const auto number = static_cast(index) - static_cast(alphabet.size()) * count; int i = 0; do { diff --git a/src/libs/fervor/fvupdater.cpp b/src/libs/fervor/fvupdater.cpp index 6aa73dd14..85ff35146 100644 --- a/src/libs/fervor/fvupdater.cpp +++ b/src/libs/fervor/fvupdater.cpp @@ -429,7 +429,7 @@ auto FvUpdater::xmlParseFeed() -> bool else if (m_xml.name() == "enclosure"_L1) { const QXmlStreamAttributes attribs = m_xml.attributes(); - const QString fervorPlatform = QStringLiteral("fervor:platform"); + const auto fervorPlatform = QStringLiteral("fervor:platform"); if (attribs.hasAttribute(fervorPlatform)) { @@ -437,7 +437,7 @@ auto FvUpdater::xmlParseFeed() -> bool { xmlEnclosurePlatform = attribs.value(fervorPlatform).toString().trimmed(); - const QString attributeUrl = QStringLiteral("url"); + const auto attributeUrl = QStringLiteral("url"); if (attribs.hasAttribute(attributeUrl)) { xmlEnclosureUrl = attribs.value(attributeUrl).toString().trimmed(); @@ -447,7 +447,7 @@ auto FvUpdater::xmlParseFeed() -> bool xmlEnclosureUrl.clear(); } - const QString fervorVersion = QStringLiteral("fervor:version"); + const auto fervorVersion = QStringLiteral("fervor:version"); if (attribs.hasAttribute(fervorVersion)) { const QString candidateVersion = attribs.value(fervorVersion).toString().trimmed(); diff --git a/src/libs/ifc/xml/vabstractmconverter.cpp b/src/libs/ifc/xml/vabstractmconverter.cpp index 1a83a8f55..f698e7727 100644 --- a/src/libs/ifc/xml/vabstractmconverter.cpp +++ b/src/libs/ifc/xml/vabstractmconverter.cpp @@ -34,7 +34,7 @@ //--------------------------------------------------------------------------------------------------------------------- VAbstractMConverter::VAbstractMConverter(const QString &fileName) - :VAbstractConverter(fileName) + : VAbstractConverter(fileName) { m_ver = GetFormatVersion(GetFormatVersionStr()); } @@ -55,8 +55,7 @@ auto VAbstractMConverter::Units() const -> Unit //--------------------------------------------------------------------------------------------------------------------- void VAbstractMConverter::AddRootComment() { - const QString rootComment = - QStringLiteral("Measurements created with Valentina (https://smart-pattern.com.ua/)."); + const auto rootComment = QStringLiteral("Measurements created with Valentina (https://smart-pattern.com.ua/)."); QDomElement rootElement = this->documentElement(); rootElement.insertBefore(createComment(rootComment), rootElement.firstChild()); @@ -79,7 +78,7 @@ auto VAbstractMConverter::OldNamesToNewNames_InV0_3_0() -> QMultiMap QMap(GetParametrUInt(tagMaterial, AttrNumber, QChar('0'))); + const auto number = static_cast(GetParametrUInt(tagMaterial, AttrNumber, QChar('0'))); const QString name = GetParametrEmptyString(tagMaterial, AttrName); if (number > 0 && number <= userMaterialPlaceholdersQuantity) diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index b7cf3e387..d2d8e24d5 100644 --- a/src/libs/ifc/xml/vpatternconverter.cpp +++ b/src/libs/ifc/xml/vpatternconverter.cpp @@ -1262,7 +1262,7 @@ auto VPatternConverter::OldNamesToNewNames_InV0_2_0() -> QMap names.insert(QStringLiteral("front_waist_to_floor"), QStringLiteral("height_waist_front")); names.insert(QStringLiteral("height_nipple_point"), QStringLiteral("height_bustpoint")); - QString name = QStringLiteral("height_shoulder_tip"); + auto name = QStringLiteral("height_shoulder_tip"); names.insert(QStringLiteral("shoulder_height"), name); names.insert(QStringLiteral("height_shoulder_point"), name); @@ -1965,7 +1965,7 @@ void VPatternConverter::PortPieceLabelstoV0_6_0() QString line; - const int material = static_cast(GetParametrUInt(domMCP, *strMaterial, QChar('0'))); + const auto material = static_cast(GetParametrUInt(domMCP, *strMaterial, QChar('0'))); switch (material) { case 0: @@ -1988,7 +1988,7 @@ void VPatternConverter::PortPieceLabelstoV0_6_0() line.append(", %wCut% "); - const int cutNumber = static_cast(GetParametrUInt(domMCP, *strCutNumber, QChar('1'))); + const auto cutNumber = static_cast(GetParametrUInt(domMCP, *strCutNumber, QChar('1'))); if (firstLine) { diff --git a/src/libs/ifc/xml/vvitconverter.cpp b/src/libs/ifc/xml/vvitconverter.cpp index f690e01ed..5475333ba 100644 --- a/src/libs/ifc/xml/vvitconverter.cpp +++ b/src/libs/ifc/xml/vvitconverter.cpp @@ -196,7 +196,7 @@ void VVITConverter::ConvertMeasurementsToV0_3_0() // TODO. Delete if minimal supported version is 0.3.0 Q_STATIC_ASSERT_X(VVITConverter::MeasurementMinVer < FormatVersion(0, 3, 0), "Time to refactor the code."); - const QString tagBM = QStringLiteral("body-measurements"); + const auto tagBM = QStringLiteral("body-measurements"); QDomElement bm = createElement(tagBM); @@ -293,7 +293,7 @@ void VVITConverter::ConvertMeasurementsToV0_3_3() for (int ii = 0; ii < nodeList.size(); ++ii) { - const QString attrName = QStringLiteral("name"); + const auto attrName = QStringLiteral("name"); QDomElement element = nodeList.at(ii).toElement(); const QString name = GetParametrString(element, attrName); if (name == i.value()) diff --git a/src/libs/ifc/xml/vvstconverter.cpp b/src/libs/ifc/xml/vvstconverter.cpp index 5b9e47a26..9c7f7993d 100644 --- a/src/libs/ifc/xml/vvstconverter.cpp +++ b/src/libs/ifc/xml/vvstconverter.cpp @@ -214,7 +214,7 @@ void VVSTConverter::ConvertMeasurementsToV0_4_0() // TODO. Delete if minimal supported version is 0.4.0 Q_STATIC_ASSERT_X(VVSTConverter::MeasurementMinVer < FormatVersion(0, 4, 0), "Time to refactor the code."); - const QString tagBM = QStringLiteral("body-measurements"); + const auto tagBM = QStringLiteral("body-measurements"); QDomElement bm = createElement(tagBM); @@ -309,7 +309,7 @@ void VVSTConverter::ConvertMeasurementsToV0_4_2() for (int ii = 0; ii < nodeList.size(); ++ii) { - const QString attrName = QStringLiteral("name"); + const auto attrName = QStringLiteral("name"); QDomElement element = nodeList.at(ii).toElement(); const QString name = GetParametrString(element, attrName); if (name == i.value()) @@ -352,9 +352,9 @@ void VVSTConverter::AddNewTagsForV0_5_0() const Unit units = Units(); { - const int step = static_cast(UnitConvertor(6, Unit::Cm, units)); - const int min = static_cast(UnitConvertor(50, Unit::Cm, units)); - const int max = static_cast(UnitConvertor(200, Unit::Cm, units)); + const auto step = static_cast(UnitConvertor(6, Unit::Cm, units)); + const auto min = static_cast(UnitConvertor(50, Unit::Cm, units)); + const auto max = static_cast(UnitConvertor(200, Unit::Cm, units)); QDomElement dimensionX = createElement(QStringLiteral("dimension")); SetAttribute(dimensionX, QStringLiteral("type"), QChar('x')); @@ -366,9 +366,9 @@ void VVSTConverter::AddNewTagsForV0_5_0() } { - const int step = static_cast(UnitConvertor(2, Unit::Cm, units)); - const int min = static_cast(UnitConvertor(22, Unit::Cm, units)); - const int max = static_cast(UnitConvertor(72, Unit::Cm, units)); + const auto step = static_cast(UnitConvertor(2, Unit::Cm, units)); + const auto min = static_cast(UnitConvertor(22, Unit::Cm, units)); + const auto max = static_cast(UnitConvertor(72, Unit::Cm, units)); QDomElement dimensionY = createElement(QStringLiteral("dimension")); SetAttribute(dimensionY, QStringLiteral("type"), QChar('y')); diff --git a/src/libs/qmuparser/qmuformulabase.cpp b/src/libs/qmuparser/qmuformulabase.cpp index 335e8fded..6117b2773 100644 --- a/src/libs/qmuparser/qmuformulabase.cpp +++ b/src/libs/qmuparser/qmuformulabase.cpp @@ -92,7 +92,7 @@ void QmuFormulaBase::InitCharSets() }; // Defining identifier character sets - QString nameChars = QStringLiteral("0123456789\\_@#'") + symbolsStr; + auto nameChars = QStringLiteral("0123456789\\_@#'") + symbolsStr; AddNotCanonical(nameChars, sign0, '0'); AddNotCanonical(nameChars, sign1, '1'); @@ -107,7 +107,7 @@ void QmuFormulaBase::InitCharSets() DefineNameChars(nameChars); - const QString opChars = QStringLiteral("+-*^/?<>=!$%&|~'_"); + const auto opChars = QStringLiteral("+-*^/?<>=!$%&|~'_"); QString oprtChars = symbolsStr + opChars; AddNotCanonical(oprtChars, positiveSign, '+'); diff --git a/src/libs/vdxf/libdxfrw/drw_entities.cpp b/src/libs/vdxf/libdxfrw/drw_entities.cpp index f908dacf9..56e5a958a 100644 --- a/src/libs/vdxf/libdxfrw/drw_entities.cpp +++ b/src/libs/vdxf/libdxfrw/drw_entities.cpp @@ -415,7 +415,7 @@ void DRW_Ellipse::toPolyline(DRW_Polyline *pol, int parts) sinRot = sin(incAngle); incAngle = M_PIx2 / parts; curAngle = staparam; - int i = static_cast(curAngle / incAngle); + auto i = static_cast(curAngle / incAngle); do { if (curAngle > endparam) diff --git a/src/libs/vformat/vsinglelineoutlinechar.cpp b/src/libs/vformat/vsinglelineoutlinechar.cpp index 431ad5e58..75e000f8e 100644 --- a/src/libs/vformat/vsinglelineoutlinechar.cpp +++ b/src/libs/vformat/vsinglelineoutlinechar.cpp @@ -140,7 +140,7 @@ void VSingleLineOutlineChar::ExportCorrections(const QString &dirPath) const } } - QString const filename = QStringLiteral("%1/%2.json").arg(dirPath, m_font.family()); + auto const filename = QStringLiteral("%1/%2.json").arg(dirPath, m_font.family()); QFile jsonFile(filename); if (!jsonFile.open(QIODevice::WriteOnly | QIODevice::Text)) { @@ -158,7 +158,7 @@ void VSingleLineOutlineChar::ExportCorrections(const QString &dirPath) const //--------------------------------------------------------------------------------------------------------------------- void VSingleLineOutlineChar::LoadCorrections(const QString &dirPath) const { - QString const fileName = QStringLiteral("%1.json").arg(m_font.family()); + auto const fileName = QStringLiteral("%1.json").arg(m_font.family()); QDir directory(dirPath); directory.setNameFilters(QStringList(fileName)); diff --git a/src/libs/vganalytics/vganalytics.cpp b/src/libs/vganalytics/vganalytics.cpp index 703c60dee..f868c77ec 100644 --- a/src/libs/vganalytics/vganalytics.cpp +++ b/src/libs/vganalytics/vganalytics.cpp @@ -478,7 +478,7 @@ auto VGAnalytics::CountryCode() -> QString eventLoop.exec(); - QString country = QStringLiteral("Unknown"); + auto country = QStringLiteral("Unknown"); if (timer.isActive()) { diff --git a/src/libs/vganalytics/vganalyticsworker.cpp b/src/libs/vganalytics/vganalyticsworker.cpp index b0c8dde63..19d134e9a 100644 --- a/src/libs/vganalytics/vganalyticsworker.cpp +++ b/src/libs/vganalytics/vganalyticsworker.cpp @@ -215,7 +215,7 @@ auto VGAnalyticsWorker::SendAnalytics() -> QNetworkReply * // queue has messages -> stop timer and start sending m_timer.stop(); - QString connection = QStringLiteral("close"); + auto connection = QStringLiteral("close"); if (m_messageQueue.count() > 1) { connection = "keep-alive"_L1; @@ -245,7 +245,7 @@ auto VGAnalyticsWorker::SendAnalytics() -> QNetworkReply * LogMessage(VGAnalytics::Error, QStringLiteral("google analytics api seceret was not set!")); } - QString requestUrl = QStringLiteral("https://www.google-analytics.com/mp/collect?measurement_id=%1&api_secret=%2"); + auto requestUrl = QStringLiteral("https://www.google-analytics.com/mp/collect?measurement_id=%1&api_secret=%2"); requestUrl = requestUrl.arg(m_measurementId, m_apiSecret); m_request.setUrl(QUrl(requestUrl)); diff --git a/src/libs/vgeometry/vabstractarc.cpp b/src/libs/vgeometry/vabstractarc.cpp index 8d6a9925a..b1aa86920 100644 --- a/src/libs/vgeometry/vabstractarc.cpp +++ b/src/libs/vgeometry/vabstractarc.cpp @@ -243,7 +243,7 @@ auto VAbstractArc::GetPath() const -> QPainterPath else { QPointF const center = GetCenter().toQPointF(); - QRectF rec = QRectF(center.x(), center.y(), accuracyPointOnLine * 2, accuracyPointOnLine * 2); + auto rec = QRectF(center.x(), center.y(), accuracyPointOnLine * 2, accuracyPointOnLine * 2); rec.translate(-rec.center().x(), -rec.center().y()); path.addEllipse(rec); } diff --git a/src/libs/vgeometry/vabstractcurve.cpp b/src/libs/vgeometry/vabstractcurve.cpp index a3d991892..b4572d282 100644 --- a/src/libs/vgeometry/vabstractcurve.cpp +++ b/src/libs/vgeometry/vabstractcurve.cpp @@ -492,7 +492,7 @@ auto VAbstractCurve::CurveIntersectAxis(const QPointF &point, qreal angle, const angle = line.angle(); } - QRectF rec = QRectF(0, 0, INT_MAX, INT_MAX); + auto rec = QRectF(0, 0, INT_MAX, INT_MAX); rec.translate(-INT_MAX / 2.0, -INT_MAX / 2.0); // Instead of using axis compare two rays. See issue #963. diff --git a/src/libs/vgeometry/varc.cpp b/src/libs/vgeometry/varc.cpp index 1d09729fb..bebfca3a3 100644 --- a/src/libs/vgeometry/varc.cpp +++ b/src/libs/vgeometry/varc.cpp @@ -435,7 +435,7 @@ auto VArc::OptimalApproximationScale(qreal radius, qreal f1, qreal f2, qreal tol void VArc::CreateName() { QString name = ARC_ + this->GetCenter().name(); - const QString nameStr = QStringLiteral("_%1"); + const auto nameStr = QStringLiteral("_%1"); if (getMode() == Draw::Modeling && getIdObject() != NULL_ID) { diff --git a/src/libs/vgeometry/vellipticalarc.cpp b/src/libs/vgeometry/vellipticalarc.cpp index f8f33cee3..b88f95a86 100644 --- a/src/libs/vgeometry/vellipticalarc.cpp +++ b/src/libs/vgeometry/vellipticalarc.cpp @@ -613,7 +613,7 @@ auto VEllipticalArc::CutArc(qreal length, const QString &pointName) const -> QPo void VEllipticalArc::CreateName() { QString name = ELARC_ + this->GetCenter().name(); - const QString nameStr = QStringLiteral("_%1"); + const auto nameStr = QStringLiteral("_%1"); if (getMode() == Draw::Modeling && getIdObject() != NULL_ID) { diff --git a/src/libs/vlayout/dialogs/dialoglayoutscale.cpp b/src/libs/vlayout/dialogs/dialoglayoutscale.cpp index cc28037ec..944184705 100644 --- a/src/libs/vlayout/dialogs/dialoglayoutscale.cpp +++ b/src/libs/vlayout/dialogs/dialoglayoutscale.cpp @@ -84,8 +84,8 @@ void DialogLayoutScale::SetTiledMargins(QMarginsF margins) //--------------------------------------------------------------------------------------------------------------------- auto DialogLayoutScale::GetTiledMargins() const -> QMarginsF { - QMarginsF const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(), - ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value()); + auto const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(), + ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value()); return UnitConvertor(margins, VAbstractValApplication::VApp()->patternUnits(), Unit::Mm); } @@ -202,7 +202,7 @@ void DialogLayoutScale::WriteSettings() const const Unit unit = VAbstractValApplication::VApp()->patternUnits(); // write Margins top, right, bottom, left - QMarginsF const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(), - ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value()); + auto const margins = QMarginsF(ui->doubleSpinBoxLeftField->value(), ui->doubleSpinBoxTopField->value(), + ui->doubleSpinBoxRightField->value(), ui->doubleSpinBoxBottomField->value()); settings->SetTiledPDFMargins(margins, unit); } diff --git a/src/libs/vlayout/dialogs/vabstractlayoutdialog.cpp b/src/libs/vlayout/dialogs/vabstractlayoutdialog.cpp index 180e313d8..233e0a021 100644 --- a/src/libs/vlayout/dialogs/vabstractlayoutdialog.cpp +++ b/src/libs/vlayout/dialogs/vabstractlayoutdialog.cpp @@ -50,7 +50,7 @@ void VAbstractLayoutDialog::InitTemplates(QComboBox *comboBoxTemplates) SCASSERT(comboBoxTemplates != nullptr) const QIcon icoPaper("://icon/16x16/template.png"_L1); const QIcon icoRoll("://icon/16x16/roll.png"_L1); - const QString pdi = QStringLiteral("(%1ppi)").arg(PrintDPI); + const auto pdi = QStringLiteral("(%1ppi)").arg(PrintDPI); auto cntr = static_cast(PaperSizeTemplate::A0); for (const auto &v : PageFormatNames()) @@ -79,7 +79,7 @@ void VAbstractLayoutDialog::InitTileTemplates(QComboBox *comboBoxTemplates, bool InitTemplates(comboBoxTemplates); // remove unused formats - for (int i = static_cast(PaperSizeTemplate::Roll24in); i <= static_cast(PaperSizeTemplate::Custom); ++i) + for (auto i = static_cast(PaperSizeTemplate::Roll24in); i <= static_cast(PaperSizeTemplate::Custom); ++i) { if (keepCustom && i == static_cast(PaperSizeTemplate::Custom)) { diff --git a/src/libs/vlayout/vrawlayout.cpp b/src/libs/vlayout/vrawlayout.cpp index 69be4ade5..6c80be069 100644 --- a/src/libs/vlayout/vrawlayout.cpp +++ b/src/libs/vlayout/vrawlayout.cpp @@ -156,7 +156,7 @@ auto VRawLayout::ReadFile(QIODevice *ioDevice, VRawLayoutData &data) -> bool // bytes of the stream will be the size of the array, we might end up attempting to allocate // a large amount of memory if the wrong file type was read. Instead, we'll just read the // same number of bytes that are in the array we are comparing it to. No size was written. - const int len = static_cast(fileHeaderByteArray.size()); + const auto len = static_cast(fileHeaderByteArray.size()); QByteArray actualFileHeaderByteArray(len, '\0'); dataStream.readRawData(actualFileHeaderByteArray.data(), len); diff --git a/src/libs/vlayout/vtextmanager.cpp b/src/libs/vlayout/vtextmanager.cpp index e60aa3579..478ed8914 100644 --- a/src/libs/vlayout/vtextmanager.cpp +++ b/src/libs/vlayout/vtextmanager.cpp @@ -98,7 +98,7 @@ auto SplitTextByWidth(const QString &text, const QFont &font, int maxWidth) -> Q QStringList substrings; substrings.reserve(2); - const int textLength = static_cast(text.length()); + const auto textLength = static_cast(text.length()); int lineWidth = 0; for (int endIndex = 0; endIndex < textLength; ++endIndex) @@ -141,7 +141,7 @@ auto SplitTextByWidth(const QString &text, const VSvgFont &font, int maxWidth, q QStringList substrings; substrings.reserve(2); - const int textLength = static_cast(text.length()); + const auto textLength = static_cast(text.length()); qreal lineWidth = 0; for (int endIndex = 0; endIndex < textLength; ++endIndex) diff --git a/src/libs/vmisc/crashhandler/crashhandler.cpp b/src/libs/vmisc/crashhandler/crashhandler.cpp index e33a38997..4f120544e 100644 --- a/src/libs/vmisc/crashhandler/crashhandler.cpp +++ b/src/libs/vmisc/crashhandler/crashhandler.cpp @@ -75,24 +75,24 @@ Q_REQUIRED_RESULT auto AppSettings(const QString &appName) -> VCommonSettings * //--------------------------------------------------------------------------------------------------------------------- auto AppCrashVersion() -> QString { - QString const version = QStringLiteral("%1_%2_%3").arg(MAJOR_VERSION).arg(MINOR_VERSION).arg(DEBUG_VERSION); - QString const qtVersion = QStringLiteral("Qt_%1_%2").arg(QT_VERSION_MAJOR).arg(QT_VERSION_MINOR); + auto const version = QStringLiteral("%1_%2_%3").arg(MAJOR_VERSION).arg(MINOR_VERSION).arg(DEBUG_VERSION); + auto const qtVersion = QStringLiteral("Qt_%1_%2").arg(QT_VERSION_MAJOR).arg(QT_VERSION_MINOR); QString multibundle; // NOLINT(misc-const-correctness) #if defined(Q_OS_MACOS) - QString const platform = QStringLiteral("macos"); + auto const platform = QStringLiteral("macos"); #if defined(MULTI_BUNDLE) multibundle = QStringLiteral("-multibundle"); #endif #elif defined(Q_OS_WIN) - QString const platform = QStringLiteral("windows"); + auto const platform = QStringLiteral("windows"); #elif defined(Q_OS_LINUX) - QString const platform = QStringLiteral("linux"); + auto const platform = QStringLiteral("linux"); #else - QString const platform = QStringLiteral("unknown"); + auto const platform = QStringLiteral("unknown"); #endif - QString revision = QStringLiteral(VCS_REPO_STATE_REVISION); + auto revision = QStringLiteral(VCS_REPO_STATE_REVISION); if (!revision.startsWith('g')) { // assume always git revision.prepend('g'); @@ -226,9 +226,9 @@ auto InitializeCrashpad(const QString &appName) -> bool MakeDir(metricsPath); base::FilePath const metricsDir(VCrashPaths::GetPlatformString(metricsPath)); - QString const dbName = QStringLiteral("valentina"); + auto const dbName = QStringLiteral("valentina"); // Configure url with your BugSplat database - QString const url = QStringLiteral("https://%1.bugsplat.com/post/bp/crash/crashpad.php").arg(dbName); + auto const url = QStringLiteral("https://%1.bugsplat.com/post/bp/crash/crashpad.php").arg(dbName); // Metadata that will be posted to BugSplat QMap annotations; diff --git a/src/libs/vmisc/crashhandler/vcrashpaths.cpp b/src/libs/vmisc/crashhandler/vcrashpaths.cpp index a49e3b525..28e13a1f4 100644 --- a/src/libs/vmisc/crashhandler/vcrashpaths.cpp +++ b/src/libs/vmisc/crashhandler/vcrashpaths.cpp @@ -43,7 +43,7 @@ namespace { auto LogDirPath(const QString &appName) -> QString { - const QString logs = QStringLiteral("Logs"); + const auto logs = QStringLiteral("Logs"); QString logDirPath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation); if (logDirPath.isEmpty()) @@ -81,9 +81,9 @@ auto VCrashPaths::GetAttachmentPath(const QString &appName) -> QString auto VCrashPaths::GetHandlerPath() const -> QString { #if defined(Q_OS_WINDOWS) - const QString handler = QStringLiteral("crashpad_handler.exe"); + const auto handler = QStringLiteral("crashpad_handler.exe"); #elif defined(Q_OS_MAC) || defined(Q_OS_LINUX) - const QString handler = QStringLiteral("crashpad_handler"); + const auto handler = QStringLiteral("crashpad_handler"); #else #error GetHandlerPath not implemented on this platform #endif diff --git a/src/libs/vmisc/def.cpp b/src/libs/vmisc/def.cpp index fa6a3ad0b..1d8046dba 100644 --- a/src/libs/vmisc/def.cpp +++ b/src/libs/vmisc/def.cpp @@ -119,7 +119,7 @@ void InitLanguageList(QComboBox *combobox) // English language is internal and doesn't have own *.qm file. // Since Qt 5.12 country names have spaces QIcon const ico(u"://flags/%1.png"_s.arg(TerritoryToString(QLocale::UnitedStates))); - const QString en_US = QStringLiteral("en_US"); + const auto en_US = QStringLiteral("en_US"); QString const lang = QLocale(en_US).nativeLanguageName(); combobox->addItem(ico, lang, en_US); } @@ -265,11 +265,11 @@ void ShowInGraphicalShell(const QString &filePath) QProcess::startDetached(QStringLiteral("explorer"), QStringList{"/select", QDir::toNativeSeparators(filePath)}); #else const int timeout = 1000; // ms - QString const command = QStringLiteral("dbus-send --reply-timeout=%1 --session --dest=org.freedesktop.FileManager1 " - "--type=method_call /org/freedesktop/FileManager1 " - "org.freedesktop.FileManager1.ShowItems array:string:\"%2\" string:\"\"") - .arg(timeout) - .arg(QUrl::fromLocalFile(filePath).toString()); + auto const command = QStringLiteral("dbus-send --reply-timeout=%1 --session --dest=org.freedesktop.FileManager1 " + "--type=method_call /org/freedesktop/FileManager1 " + "org.freedesktop.FileManager1.ShowItems array:string:\"%2\" string:\"\"") + .arg(timeout) + .arg(QUrl::fromLocalFile(filePath).toString()); // Sending message through dbus will highlighting file QProcess dbus; diff --git a/src/libs/vmisc/dialogs/dialogexporttocsv.cpp b/src/libs/vmisc/dialogs/dialogexporttocsv.cpp index 31ff04747..b4158ba35 100644 --- a/src/libs/vmisc/dialogs/dialogexporttocsv.cpp +++ b/src/libs/vmisc/dialogs/dialogexporttocsv.cpp @@ -287,7 +287,7 @@ void DialogExportToCSV::ShowFilePreview(const QString &fileName) //--------------------------------------------------------------------------------------------------------------------- auto DialogExportToCSV::MakeHelpCodecsList() -> QString { - QString out = QStringLiteral("\n"); + auto out = QStringLiteral("\n"); const QList list = VTextCodec::availableMibs(); for (int i = 0; i < list.size(); ++i) { diff --git a/src/libs/vmisc/svgfont/vsvgfontdatabase.cpp b/src/libs/vmisc/svgfont/vsvgfontdatabase.cpp index bd04d0adf..dfcf39877 100644 --- a/src/libs/vmisc/svgfont/vsvgfontdatabase.cpp +++ b/src/libs/vmisc/svgfont/vsvgfontdatabase.cpp @@ -205,7 +205,7 @@ auto VSvgFontDatabase::Italic(const QString &family, SVGFontStyle style) const - //--------------------------------------------------------------------------------------------------------------------- auto VSvgFontDatabase::SystemSVGFontPath() -> QString { - const QString fontPath = QStringLiteral("/svgfonts"); + const auto fontPath = QStringLiteral("/svgfonts"); #ifdef Q_OS_WIN return QCoreApplication::applicationDirPath() + fontPath; #elif defined(Q_OS_MAC) diff --git a/src/libs/vmisc/svgfont/vsvgfontengine.cpp b/src/libs/vmisc/svgfont/vsvgfontengine.cpp index 057268756..980b46f28 100644 --- a/src/libs/vmisc/svgfont/vsvgfontengine.cpp +++ b/src/libs/vmisc/svgfont/vsvgfontengine.cpp @@ -418,7 +418,7 @@ auto VSvgFontEngine::ElidedText(const QString &text, SVGTextElideMode mode, int // Perform middle ellipsis by splitting the text and keeping the first and last characters qreal remainingWidth = availableWidth; int leftIndex = 1; - int rightIndex = static_cast(elidedText.length() - 2); + auto rightIndex = static_cast(elidedText.length() - 2); while (leftIndex < rightIndex && remainingWidth > 0) { diff --git a/src/libs/vmisc/theme/vapplicationstyle.cpp b/src/libs/vmisc/theme/vapplicationstyle.cpp index c67db2f4f..7db48c926 100644 --- a/src/libs/vmisc/theme/vapplicationstyle.cpp +++ b/src/libs/vmisc/theme/vapplicationstyle.cpp @@ -256,7 +256,7 @@ auto VApplicationStyle::StylesheetIcon(StandardPixmap standardIcon, const QStyle const QWidget *widget) const -> QIcon { static QHash const icons = StandardIconPaths(); - QString const resource = QStringLiteral("://%1/%2").arg(VTheme::ThemeStylesheet(), icons.value(standardIcon)); + auto const resource = QStringLiteral("://%1/%2").arg(VTheme::ThemeStylesheet(), icons.value(standardIcon)); if (QFileInfo::exists(resource)) { return QIcon(resource); diff --git a/src/libs/vmisc/theme/vstylesheetstyle.cpp b/src/libs/vmisc/theme/vstylesheetstyle.cpp index f67384cb2..bc1741d9f 100644 --- a/src/libs/vmisc/theme/vstylesheetstyle.cpp +++ b/src/libs/vmisc/theme/vstylesheetstyle.cpp @@ -83,7 +83,7 @@ void VStylesheetStyle::SetExportColorScheme(ExportColorScheme colorScheme) //--------------------------------------------------------------------------------------------------------------------- auto VStylesheetStyle::GetResourceName() -> QString { - const QString light = QStringLiteral("light"); + const auto light = QStringLiteral("light"); QString colorSheme; if (exportColorScheme == ExportColorScheme::BackAndWhite) diff --git a/src/libs/vmisc/theme/vtheme.cpp b/src/libs/vmisc/theme/vtheme.cpp index a90cf76ba..e567c2840 100644 --- a/src/libs/vmisc/theme/vtheme.cpp +++ b/src/libs/vmisc/theme/vtheme.cpp @@ -512,8 +512,8 @@ void VTheme::ResetThemeSettings() const auto VTheme::GetFallbackThemeIcon(const QString &iconName, QSize iconSize) -> QIcon { const QString themePrefix = (ColorSheme() == VColorSheme::Light ? QStringLiteral("Light") : QStringLiteral("Dark")); - const QString themeName = QStringLiteral("Eleven-%1").arg(themePrefix); - const QString filePath = QStringLiteral(":icons/%1/%2.svg").arg(themeName, iconName); + const auto themeName = QStringLiteral("Eleven-%1").arg(themePrefix); + const auto filePath = QStringLiteral(":icons/%1/%2.svg").arg(themeName, iconName); QIcon icon; icon.addFile(filePath, iconSize, QIcon::Normal, QIcon::On); diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp index d7427190a..f6b6af816 100644 --- a/src/libs/vmisc/vabstractapplication.cpp +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -187,7 +187,7 @@ VAbstractApplication::~VAbstractApplication() */ auto VAbstractApplication::translationsPath(const QString &locale) -> QString { - const QString trPath = QStringLiteral("/translations"); + const auto trPath = QStringLiteral("/translations"); #ifdef Q_OS_WIN Q_UNUSED(locale) return QCoreApplication::applicationDirPath() + trPath; @@ -255,7 +255,7 @@ auto VAbstractApplication::translationsPath(const QString &locale) -> QString auto VAbstractApplication::QtTranslationsPath(const QString &locale) -> QString { #if defined(Q_OS_LINUX) - const QString trPath = QStringLiteral("/translations"); + const auto trPath = QStringLiteral("/translations"); QDir dir(QCoreApplication::applicationDirPath() + trPath); if (dir.exists()) @@ -650,7 +650,7 @@ void VAbstractApplication::InitHighDpiScaling(int argc, char *argv[]) //--------------------------------------------------------------------------------------------------------------------- auto VAbstractApplication::LogDirPath() -> QString { - const QString logs = QStringLiteral("Logs"); + const auto logs = QStringLiteral("Logs"); QString const logDirPath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation); if (logDirPath.isEmpty()) diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp index f371f8dd2..a1e56be40 100644 --- a/src/libs/vmisc/vcommonsettings.cpp +++ b/src/libs/vmisc/vcommonsettings.cpp @@ -506,7 +506,7 @@ void VCommonSettings::SetAutosaveTime(const int &value) //--------------------------------------------------------------------------------------------------------------------- auto VCommonSettings::IsLocaleSelected() const -> bool { - const QString fakeLocale = QStringLiteral("Fake"); + const auto fakeLocale = QStringLiteral("Fake"); QString const locale = value(*settingConfigurationLocale, fakeLocale).toString(); return locale != fakeLocale; diff --git a/src/libs/vobj/vobjengine.cpp b/src/libs/vobj/vobjengine.cpp index bbb98011f..a77b4ea0f 100644 --- a/src/libs/vobj/vobjengine.cpp +++ b/src/libs/vobj/vobjengine.cpp @@ -203,11 +203,11 @@ void VObjEngine::drawPath(const QPainterPath &path) { skipFace = false; } - int const num_verts = static_cast(res->faces[offset]); + auto const num_verts = static_cast(res->faces[offset]); offset++; for (int j = 0; j < num_verts; j++) { - int const p0 = static_cast(res->faces[offset + j]); + auto const p0 = static_cast(res->faces[offset + j]); pf[j] = QPointF(points[p0].x, points[p0].y); } if (skipFace == false) diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index 75e9b688b..494936c1b 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -1678,7 +1678,7 @@ auto VPiece::SeamAllowanceMirrorLine(const VContainer *data) const -> QLineF return seamMirrorLine; } - QRectF rec = QRectF(0, 0, INT_MAX, INT_MAX); + auto rec = QRectF(0, 0, INT_MAX, INT_MAX); rec.translate(-INT_MAX / 2.0, -INT_MAX / 2.0); QLineF axis = diff --git a/src/libs/vpatterndb/vtranslatevars.cpp b/src/libs/vpatterndb/vtranslatevars.cpp index 73d8bdf7f..994e0f8a5 100644 --- a/src/libs/vpatterndb/vtranslatevars.cpp +++ b/src/libs/vpatterndb/vtranslatevars.cpp @@ -101,9 +101,9 @@ void VTranslateVars::InitVariables() //--------------------------------------------------------------------------------------------------------------------- void VTranslateVars::InitFunctions() { - const QString oneArgument = QStringLiteral("()"); - const QString twoArguments = QStringLiteral("(;)"); - const QString threeArguments = QStringLiteral("(;;)"); + const auto oneArgument = QStringLiteral("()"); + const auto twoArguments = QStringLiteral("(;)"); + const auto threeArguments = QStringLiteral("(;;)"); functions.insert(degTorad_F, translate("VTranslateVars", "degTorad", "converts degrees to radian")); functionsDescriptions.insert(degTorad_F, diff --git a/src/libs/vtest/abstracttest.cpp b/src/libs/vtest/abstracttest.cpp index 7c7ee762f..ec16500d5 100644 --- a/src/libs/vtest/abstracttest.cpp +++ b/src/libs/vtest/abstracttest.cpp @@ -106,9 +106,9 @@ void AbstractTest::PieceFromJson(const QString &json, VPiece &piece, QSharedPoin PrepareDocument(json, saveData); QJsonDocument const loadDoc(QJsonDocument::fromJson(saveData)); - const QString testCaseKey = QStringLiteral("testCase"); - const QString bdKey = QStringLiteral("bd"); - const QString pieceKey = QStringLiteral("piece"); + const auto testCaseKey = QStringLiteral("testCase"); + const auto bdKey = QStringLiteral("bd"); + const auto pieceKey = QStringLiteral("piece"); QJsonObject testCaseObject = loadDoc.object(); TestRoot(testCaseObject, testCaseKey, json); @@ -121,7 +121,7 @@ void AbstractTest::PieceFromJson(const QString &json, VPiece &piece, QSharedPoin } else { - const QString error = QStringLiteral("Test case json object does not contain db data."); + const auto error = QStringLiteral("Test case json object does not contain db data."); QFAIL(qUtf8Printable(error)); } @@ -131,7 +131,7 @@ void AbstractTest::PieceFromJson(const QString &json, VPiece &piece, QSharedPoin } else { - const QString error = QStringLiteral("Test case json object does not contain piece data."); + const auto error = QStringLiteral("Test case json object does not contain piece data."); QFAIL(qUtf8Printable(error)); } } @@ -143,7 +143,7 @@ void AbstractTest::PassmarkDataFromJson(const QString &json, VPiecePassmarkData PrepareDocument(json, saveData); QJsonDocument const loadDoc(QJsonDocument::fromJson(saveData)); - const QString dataKey = QStringLiteral("data"); + const auto dataKey = QStringLiteral("data"); QJsonObject dataObject = loadDoc.object(); TestRoot(dataObject, dataKey, json); @@ -166,7 +166,7 @@ void AbstractTest::PassmarkDataFromJson(const QString &json, VPiecePassmarkData } catch (const VException &e) { - const QString error = QStringLiteral("Invalid json file '%1'. %2").arg(json, e.ErrorMessage()); + const auto error = QStringLiteral("Invalid json file '%1'. %2").arg(json, e.ErrorMessage()); QFAIL(qUtf8Printable(error)); } @@ -226,8 +226,8 @@ void AbstractTest::PassmarkShapeFromJson(const QString &json, QVector &s PrepareDocument(json, saveData); QJsonDocument const loadDoc(QJsonDocument::fromJson(saveData)); - const QString shapeKey = QStringLiteral("shape"); - const QString typeKey = QStringLiteral("type"); + const auto shapeKey = QStringLiteral("shape"); + const auto typeKey = QStringLiteral("type"); QJsonObject shapeObject = loadDoc.object(); TestRoot(shapeObject, shapeKey, json); @@ -242,8 +242,8 @@ void AbstractTest::PassmarkShapeFromJson(const QString &json, QVector &s if (type != "QLineF"_L1) { - const QString error = QStringLiteral("Invalid json file '%1'. Unexpected class '%2'.") - .arg(json, lineObject[typeKey].toString()); + const auto error = QStringLiteral("Invalid json file '%1'. Unexpected class '%2'.") + .arg(json, lineObject[typeKey].toString()); QFAIL(qUtf8Printable(error)); } @@ -299,12 +299,12 @@ void AbstractTest::ComparePathsDistance(const QVector &ekv, const QVect //--------------------------------------------------------------------------------------------------------------------- void AbstractTest::ComparePointsDistance(const QPointF &result, const QPointF &expected, qreal testAccuracy) const { - const QString msg = QStringLiteral("Actual '%1;%2', Expected '%3;%4'. Distance between points %5 mm.") - .arg(result.x()) - .arg(result.y()) - .arg(expected.x()) - .arg(expected.y()) - .arg(UnitConvertor(QLineF(result, expected).length(), Unit::Px, Unit::Mm)); + const auto msg = QStringLiteral("Actual '%1;%2', Expected '%3;%4'. Distance between points %5 mm.") + .arg(result.x()) + .arg(result.y()) + .arg(expected.x()) + .arg(expected.y()) + .arg(UnitConvertor(QLineF(result, expected).length(), Unit::Px, Unit::Mm)); // Check each point. Don't use comparison float values QVERIFY2(VFuzzyComparePoints(result, expected, testAccuracy), qUtf8Printable(msg)); } @@ -341,7 +341,7 @@ auto AbstractTest::PuzzlePath() const -> QString #ifdef QBS_BUILD return QStringLiteral(PUZZLE_BUILDDIR); #else - const QString path = QStringLiteral("/../../../app/puzzle/bin/puzzle"); + const auto path = QStringLiteral("/../../../app/puzzle/bin/puzzle"); #ifdef Q_OS_WIN return QCoreApplication::applicationDirPath() + path + ".exe"_L1; #else @@ -356,7 +356,7 @@ auto AbstractTest::ValentinaPath() const -> QString #ifdef QBS_BUILD return QStringLiteral(VALENTINA_BUILDDIR); #else - const QString path = QStringLiteral("/../../../app/valentina/bin/valentina"); + const auto path = QStringLiteral("/../../../app/valentina/bin/valentina"); #ifdef Q_OS_WIN return QCoreApplication::applicationDirPath() + path + ".exe"_L1; #else @@ -371,7 +371,7 @@ auto AbstractTest::TapePath() const -> QString #ifdef QBS_BUILD return QStringLiteral(TAPE_BUILDDIR); #else - const QString path = QStringLiteral("/../../../app/tape/bin/tape"); + const auto path = QStringLiteral("/../../../app/tape/bin/tape"); #ifdef Q_OS_WIN return QCoreApplication::applicationDirPath() + path + ".exe"_L1; #else @@ -522,7 +522,7 @@ void AbstractTest::PrepareDocument(const QString &json, QByteArray &data) QFile loadFile(json); if (not loadFile.open(QIODevice::ReadOnly)) { - const QString error = QStringLiteral("Couldn't open json file. %1").arg(loadFile.errorString()); + const auto error = QStringLiteral("Couldn't open json file. %1").arg(loadFile.errorString()); QFAIL(qUtf8Printable(error)); } @@ -534,7 +534,7 @@ void AbstractTest::TestRoot(const QJsonObject &root, const QString &attribute, c { if (not root.contains(attribute)) { - const QString error = QStringLiteral("Invalid json file '%1'. File doesn't contain root object.").arg(file); + const auto error = QStringLiteral("Invalid json file '%1'. File doesn't contain root object.").arg(file); QFAIL(qUtf8Printable(error)); } } @@ -552,7 +552,7 @@ void AbstractTest::ReadStringValue(const QJsonObject &itemObject, const QString } else { - const QString error = QStringLiteral("%1 is not string '%2'.").arg(attribute, attributeValue.toString()); + const auto error = QStringLiteral("%1 is not string '%2'.").arg(attribute, attributeValue.toString()); QFAIL(qUtf8Printable(error)); } } @@ -564,7 +564,7 @@ void AbstractTest::ReadStringValue(const QJsonObject &itemObject, const QString } else { - const QString error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute); + const auto error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute); QFAIL(qUtf8Printable(error)); } } @@ -583,7 +583,7 @@ void AbstractTest::ReadBooleanValue(const QJsonObject &itemObject, const QString } else { - const QString error = + const auto error = QStringLiteral("%1 is not boolean value '%2'.").arg(attribute, attributeValue.toString()); QFAIL(qUtf8Printable(error)); } @@ -597,7 +597,7 @@ void AbstractTest::ReadBooleanValue(const QJsonObject &itemObject, const QString if (not ok) { - const QString error = QStringLiteral("Cannot convert default value '%1' to int.").arg(defaultValue); + const auto error = QStringLiteral("Cannot convert default value '%1' to int.").arg(defaultValue); QFAIL(qUtf8Printable(error)); } @@ -605,7 +605,7 @@ void AbstractTest::ReadBooleanValue(const QJsonObject &itemObject, const QString } else { - const QString error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute); + const auto error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute); QFAIL(qUtf8Printable(error)); } } @@ -620,7 +620,7 @@ void AbstractTest::ReadPointValue(const QJsonObject &itemObject, const QString & } else { - const QString error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute); + const auto error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute); QFAIL(qUtf8Printable(error)); } } @@ -643,7 +643,7 @@ void AbstractTest::ReadSplinePointValues(const QJsonObject &itemObject, const QS } else { - const QString error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute); + const auto error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute); QFAIL(qUtf8Printable(error)); } } @@ -711,7 +711,7 @@ void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString } else { - const QString error = QStringLiteral("%1 is not double '%2'.").arg(attribute, attributeValue.toString()); + const auto error = QStringLiteral("%1 is not double '%2'.").arg(attribute, attributeValue.toString()); QFAIL(qUtf8Printable(error)); } } @@ -724,13 +724,13 @@ void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString if (not ok) { - const QString error = QStringLiteral("Cannot convert default value '%1' to double.").arg(defaultValue); + const auto error = QStringLiteral("Cannot convert default value '%1' to double.").arg(defaultValue); QFAIL(qUtf8Printable(error)); } } else { - const QString error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute); + const auto error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute); QFAIL(qUtf8Printable(error)); } } @@ -750,7 +750,7 @@ void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString } else { - const QString error = QStringLiteral("%1 is not double '%2'.").arg(attribute, attributeValue.toString()); + const auto error = QStringLiteral("%1 is not double '%2'.").arg(attribute, attributeValue.toString()); QFAIL(qUtf8Printable(error)); } } @@ -763,13 +763,13 @@ void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString if (not ok) { - const QString error = QStringLiteral("Cannot convert default value '%1' to int.").arg(defaultValue); + const auto error = QStringLiteral("Cannot convert default value '%1' to int.").arg(defaultValue); QFAIL(qUtf8Printable(error)); } } else { - const QString error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute); + const auto error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute); QFAIL(qUtf8Printable(error)); } } @@ -789,7 +789,7 @@ void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString } else { - const QString error = QStringLiteral("%1 is not double '%2'.").arg(attribute, attributeValue.toString()); + const auto error = QStringLiteral("%1 is not double '%2'.").arg(attribute, attributeValue.toString()); QFAIL(qUtf8Printable(error)); } } @@ -802,13 +802,13 @@ void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString if (not ok) { - const QString error = QStringLiteral("Cannot convert default value '%1' to int.").arg(defaultValue); + const auto error = QStringLiteral("Cannot convert default value '%1' to int.").arg(defaultValue); QFAIL(qUtf8Printable(error)); } } else { - const QString error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute); + const auto error = QStringLiteral("Json object does not contain attribute '%1'.").arg(attribute); QFAIL(qUtf8Printable(error)); } } @@ -895,7 +895,7 @@ void AbstractTest::SplinePathFromJson(const QJsonObject &itemObject, QSharedPoin //--------------------------------------------------------------------------------------------------------------------- void AbstractTest::DBFromJson(const QJsonObject &dbObject, QSharedPointer &data) { - const QString itemsKey = QStringLiteral("items"); + const auto itemsKey = QStringLiteral("items"); if (dbObject.contains(itemsKey)) { @@ -932,7 +932,7 @@ void AbstractTest::DBFromJson(const QJsonObject &dbObject, QSharedPointer inline auto AbstractTest::VectorFromJson(const QString &json) PrepareDocument(json, saveData); QJsonDocument const loadDoc(QJsonDocument::fromJson(saveData)); - const QString vectorKey = QStringLiteral("vector"); + const auto vectorKey = QStringLiteral("vector"); QJsonObject vectorObject = loadDoc.object(); TestRoot(vectorObject, vectorKey, json); @@ -182,7 +182,7 @@ template inline auto AbstractTest::VectorFromJson(const QString &json) //--------------------------------------------------------------------------------------------------------------------- template inline void AbstractTest::CheckClassType(const QJsonObject &itemObject) { - const QString typeKey = QStringLiteral("type"); + const auto typeKey = QStringLiteral("type"); QString type; AbstractTest::ReadStringValue(itemObject, typeKey, type); diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp index 11ab38db9..33e7cb112 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp @@ -596,7 +596,7 @@ void DialogEditWrongFormula::SetDescription(const QString &name, qreal value, bo } const QString unit = specialUnits ? degreeSymbol : ' ' + unitName; - const QString desc = QStringLiteral("%1(%2%3) - %4").arg(name).arg(value).arg(unit, description); + const auto desc = QStringLiteral("%1(%2%3) - %4").arg(name).arg(value).arg(unit, description); ui->labelDescription->setText(desc); } @@ -611,7 +611,7 @@ auto DialogEditWrongFormula::Eval(const FormulaData &formulaData, bool &flag) -> //--------------------------------------------------------------------------------------------------------------------- void DialogEditWrongFormula::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); ui->label->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png"))); } diff --git a/src/libs/vtools/dialogs/tools/dialogalongline.cpp b/src/libs/vtools/dialogs/tools/dialogalongline.cpp index b0720fb77..f1b142e70 100644 --- a/src/libs/vtools/dialogs/tools/dialogalongline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogalongline.cpp @@ -341,7 +341,7 @@ void DialogAlongLine::FinishCreating() //--------------------------------------------------------------------------------------------------------------------- void DialogAlongLine::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png"))); ui->labelEqual->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png"))); diff --git a/src/libs/vtools/dialogs/tools/dialogarc.cpp b/src/libs/vtools/dialogs/tools/dialogarc.cpp index b7ccce813..49cd9e457 100644 --- a/src/libs/vtools/dialogs/tools/dialogarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogarc.cpp @@ -565,14 +565,14 @@ void DialogArc::FinishCreating() //--------------------------------------------------------------------------------------------------------------------- void DialogArc::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); - const QString fxIcon = QStringLiteral("24x24/fx.png"); + const auto fxIcon = QStringLiteral("24x24/fx.png"); ui->toolButtonExprRadius->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprF1->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprF2->setIcon(VTheme::GetIconResource(resource, fxIcon)); - const QString equalIcon = QStringLiteral("24x24/equal.png"); + const auto equalIcon = QStringLiteral("24x24/equal.png"); ui->label_2->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_5->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); diff --git a/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp index 2b253795c..f57ee2863 100644 --- a/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp +++ b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp @@ -569,14 +569,14 @@ void DialogArcWithLength::FinishCreating() //--------------------------------------------------------------------------------------------------------------------- void DialogArcWithLength::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); - const QString fxIcon = QStringLiteral("24x24/fx.png"); + const auto fxIcon = QStringLiteral("24x24/fx.png"); ui->toolButtonExprRadius->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprF1->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, fxIcon)); - const QString equalIcon = QStringLiteral("24x24/equal.png"); + const auto equalIcon = QStringLiteral("24x24/equal.png"); ui->label_6->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_9->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_10->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); diff --git a/src/libs/vtools/dialogs/tools/dialogbisector.cpp b/src/libs/vtools/dialogs/tools/dialogbisector.cpp index b505b6d59..a01a54dfe 100644 --- a/src/libs/vtools/dialogs/tools/dialogbisector.cpp +++ b/src/libs/vtools/dialogs/tools/dialogbisector.cpp @@ -475,7 +475,7 @@ void DialogBisector::FinishCreating() //--------------------------------------------------------------------------------------------------------------------- void DialogBisector::InitIcons() { - QString const resource = QStringLiteral("icon"); + auto const resource = QStringLiteral("icon"); ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png"))); ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png"))); diff --git a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp index 7627c77ac..5f89ab0ed 100644 --- a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp @@ -420,7 +420,7 @@ void DialogCurveIntersectAxis::ValidateAlias() //--------------------------------------------------------------------------------------------------------------------- void DialogCurveIntersectAxis::InitIcons() { - QString const resource = QStringLiteral("icon"); + auto const resource = QStringLiteral("icon"); ui->toolButtonExprAngle->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png"))); ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png"))); diff --git a/src/libs/vtools/dialogs/tools/dialogcutarc.cpp b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp index 7d9aa95f6..772cfaf11 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp @@ -308,7 +308,7 @@ void DialogCutArc::FinishCreating() //--------------------------------------------------------------------------------------------------------------------- void DialogCutArc::InitIcons() { - QString const resource = QStringLiteral("icon"); + auto const resource = QStringLiteral("icon"); ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png"))); ui->label_4->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png"))); diff --git a/src/libs/vtools/dialogs/tools/dialogcutspline.cpp b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp index 8af930cf1..f101cf1c8 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutspline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp @@ -297,7 +297,7 @@ void DialogCutSpline::FinishCreating() //--------------------------------------------------------------------------------------------------------------------- void DialogCutSpline::InitIcons() { - QString const resource = QStringLiteral("icon"); + auto const resource = QStringLiteral("icon"); ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png"))); ui->label_4->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png"))); diff --git a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp index a48250782..1e7801f7e 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp @@ -297,7 +297,7 @@ void DialogCutSplinePath::FinishCreating() //--------------------------------------------------------------------------------------------------------------------- void DialogCutSplinePath::InitIcons() { - QString const resource = QStringLiteral("icon"); + auto const resource = QStringLiteral("icon"); ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png"))); ui->label_4->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png"))); diff --git a/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp b/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp index 383c09d4c..233544849 100644 --- a/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp @@ -450,16 +450,16 @@ void DialogEllipticalArc::FinishCreating() //--------------------------------------------------------------------------------------------------------------------- void DialogEllipticalArc::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); - const QString fxIcon = QStringLiteral("24x24/fx.png"); + const auto fxIcon = QStringLiteral("24x24/fx.png"); ui->toolButtonExprRadius1->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprRadius2->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprF1->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprF2->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprRotationAngle->setIcon(VTheme::GetIconResource(resource, fxIcon)); - const QString equalIcon = QStringLiteral("24x24/equal.png"); + const auto equalIcon = QStringLiteral("24x24/equal.png"); ui->label_1->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_7->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_8->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); diff --git a/src/libs/vtools/dialogs/tools/dialogendline.cpp b/src/libs/vtools/dialogs/tools/dialogendline.cpp index dc2af6a17..5a5d9b293 100644 --- a/src/libs/vtools/dialogs/tools/dialogendline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogendline.cpp @@ -427,13 +427,13 @@ void DialogEndLine::FinishCreating() //--------------------------------------------------------------------------------------------------------------------- void DialogEndLine::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); - const QString fxIcon = QStringLiteral("24x24/fx.png"); + const auto fxIcon = QStringLiteral("24x24/fx.png"); ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprAngle->setIcon(VTheme::GetIconResource(resource, fxIcon)); - const QString equalIcon = QStringLiteral("24x24/equal.png"); + const auto equalIcon = QStringLiteral("24x24/equal.png"); ui->label_4->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_5->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); } diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp index bac7052f2..90acd3771 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.cpp @@ -449,7 +449,7 @@ void DialogLineIntersectAxis::changeEvent(QEvent *event) //--------------------------------------------------------------------------------------------------------------------- void DialogLineIntersectAxis::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); ui->toolButtonExprAngle->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png"))); ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png"))); diff --git a/src/libs/vtools/dialogs/tools/dialogmove.cpp b/src/libs/vtools/dialogs/tools/dialogmove.cpp index 66459d0a9..b5ccac12b 100644 --- a/src/libs/vtools/dialogs/tools/dialogmove.cpp +++ b/src/libs/vtools/dialogs/tools/dialogmove.cpp @@ -911,14 +911,14 @@ void DialogMove::SetAliasValid(quint32 id, bool valid) //--------------------------------------------------------------------------------------------------------------------- void DialogMove::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); - const QString fxIcon = QStringLiteral("24x24/fx.png"); + const auto fxIcon = QStringLiteral("24x24/fx.png"); ui->toolButtonExprAngle->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprRotationAngle->setIcon(VTheme::GetIconResource(resource, fxIcon)); - const QString equalIcon = QStringLiteral("24x24/equal.png"); + const auto equalIcon = QStringLiteral("24x24/equal.png"); ui->label_2->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_4->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); diff --git a/src/libs/vtools/dialogs/tools/dialognormal.cpp b/src/libs/vtools/dialogs/tools/dialognormal.cpp index ec48b75e6..fe839aaa1 100644 --- a/src/libs/vtools/dialogs/tools/dialognormal.cpp +++ b/src/libs/vtools/dialogs/tools/dialognormal.cpp @@ -300,7 +300,7 @@ void DialogNormal::FinishCreating() //--------------------------------------------------------------------------------------------------------------------- void DialogNormal::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png"))); ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png"))); diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp index 7662c71ed..287addb68 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp @@ -404,7 +404,7 @@ void DialogPointFromCircleAndTangent::FinishCreating() //--------------------------------------------------------------------------------------------------------------------- void DialogPointFromCircleAndTangent::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); ui->toolButtonExprRadius->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png"))); ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png"))); diff --git a/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp b/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp index 8824563c5..ff1803fa0 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp @@ -343,7 +343,7 @@ void DialogPointOfContact::FinishCreating() //--------------------------------------------------------------------------------------------------------------------- void DialogPointOfContact::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); ui->toolButtonExprRadius->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png"))); ui->label->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png"))); diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp index 1081101a5..aef5d96bb 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp @@ -523,13 +523,13 @@ void DialogPointOfIntersectionCircles::FinishCreating() //--------------------------------------------------------------------------------------------------------------------- void DialogPointOfIntersectionCircles::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); - const QString fxIcon = QStringLiteral("24x24/fx.png"); + const auto fxIcon = QStringLiteral("24x24/fx.png"); ui->toolButtonExprCircle1Radius->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprCircle2Radius->setIcon(VTheme::GetIconResource(resource, fxIcon)); - const QString equalIcon = QStringLiteral("24x24/equal.png"); + const auto equalIcon = QStringLiteral("24x24/equal.png"); ui->label_2->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); } diff --git a/src/libs/vtools/dialogs/tools/dialogrotation.cpp b/src/libs/vtools/dialogs/tools/dialogrotation.cpp index eb16148d4..6de48f046 100644 --- a/src/libs/vtools/dialogs/tools/dialogrotation.cpp +++ b/src/libs/vtools/dialogs/tools/dialogrotation.cpp @@ -644,7 +644,7 @@ void DialogRotation::SetAliasValid(quint32 id, bool valid) //--------------------------------------------------------------------------------------------------------------------- void DialogRotation::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); ui->toolButtonExprAngle->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png"))); ui->label_2->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png"))); diff --git a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp index fafbe67b8..d0fbb52d0 100644 --- a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp @@ -317,7 +317,7 @@ void DialogShoulderPoint::FinishCreating() //--------------------------------------------------------------------------------------------------------------------- void DialogShoulderPoint::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); ui->toolButtonExprLength->setIcon(VTheme::GetIconResource(resource, QStringLiteral("24x24/fx.png"))); ui->label_3->setPixmap(VTheme::GetPixmapResource(resource, QStringLiteral("24x24/equal.png"))); diff --git a/src/libs/vtools/dialogs/tools/dialogspline.cpp b/src/libs/vtools/dialogs/tools/dialogspline.cpp index eb8fd9a59..9339e7e2f 100644 --- a/src/libs/vtools/dialogs/tools/dialogspline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogspline.cpp @@ -491,15 +491,15 @@ auto DialogSpline::CurrentSpline() const -> VSpline //--------------------------------------------------------------------------------------------------------------------- void DialogSpline::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); - const QString fxIcon = QStringLiteral("24x24/fx.png"); + const auto fxIcon = QStringLiteral("24x24/fx.png"); ui->toolButtonExprLength1->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprAngle1->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprLength2->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprAngle2->setIcon(VTheme::GetIconResource(resource, fxIcon)); - const QString equalIcon = QStringLiteral("24x24/equal.png"); + const auto equalIcon = QStringLiteral("24x24/equal.png"); ui->label_5->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_8->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_9->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); diff --git a/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp b/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp index d169de9dd..8cfe28e79 100644 --- a/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp @@ -1100,15 +1100,15 @@ void DialogSplinePath::ShowPointIssue(const QString &pName) //--------------------------------------------------------------------------------------------------------------------- void DialogSplinePath::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); - const QString fxIcon = QStringLiteral("24x24/fx.png"); + const auto fxIcon = QStringLiteral("24x24/fx.png"); ui->toolButtonExprLength1->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprAngle1->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprLength2->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprAngle2->setIcon(VTheme::GetIconResource(resource, fxIcon)); - const QString equalIcon = QStringLiteral("24x24/equal.png"); + const auto equalIcon = QStringLiteral("24x24/equal.png"); ui->label_8->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_9->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_10->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); diff --git a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp index b7d296dd4..56b43e1ec 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp @@ -2245,9 +2245,9 @@ void DialogPiecePath::InitPassmarkAngleType(const VPieceNode &node) //--------------------------------------------------------------------------------------------------------------------- void DialogPiecePath::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); - const QString fxIcon = QStringLiteral("24x24/fx.png"); + const auto fxIcon = QStringLiteral("24x24/fx.png"); ui->toolButtonExprWidth->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprBefore->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprAfter->setIcon(VTheme::GetIconResource(resource, fxIcon)); @@ -2256,7 +2256,7 @@ void DialogPiecePath::InitIcons() ui->toolButtonExprAngle->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprVisible->setIcon(VTheme::GetIconResource(resource, fxIcon)); - const QString equalIcon = QStringLiteral("24x24/equal.png"); + const auto equalIcon = QStringLiteral("24x24/equal.png"); ui->label_2->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_6->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_10->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); diff --git a/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp b/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp index e6022c0ff..8fa656083 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp @@ -556,15 +556,15 @@ void DialogPlaceLabel::CheckPoint() //--------------------------------------------------------------------------------------------------------------------- void DialogPlaceLabel::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); - const QString fxIcon = QStringLiteral("24x24/fx.png"); + const auto fxIcon = QStringLiteral("24x24/fx.png"); ui->toolButtonExprWidth->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprHeight->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprAngle->setIcon(VTheme::GetIconResource(resource, fxIcon)); ui->toolButtonExprVisible->setIcon(VTheme::GetIconResource(resource, fxIcon)); - const QString equalIcon = QStringLiteral("24x24/equal.png"); + const auto equalIcon = QStringLiteral("24x24/equal.png"); ui->label_4->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_5->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); ui->label_6->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); diff --git a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp index 86fc1a7f5..9ca9c2ba1 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp @@ -5264,9 +5264,9 @@ void DialogSeamAllowance::InitPassmarkAngleType(const VPieceNode &node) //--------------------------------------------------------------------------------------------------------------------- void DialogSeamAllowance::InitIcons() { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); - const QString fxIcon = QStringLiteral("24x24/fx.png"); + const auto fxIcon = QStringLiteral("24x24/fx.png"); uiTabGrainline->pushButtonRot->setIcon(VTheme::GetIconResource(resource, fxIcon)); uiTabGrainline->pushButtonLen->setIcon(VTheme::GetIconResource(resource, fxIcon)); uiTabLabels->pushButtonDLWidth->setIcon(VTheme::GetIconResource(resource, fxIcon)); @@ -5282,7 +5282,7 @@ void DialogSeamAllowance::InitIcons() uiTabPaths->toolButtonExprBefore->setIcon(VTheme::GetIconResource(resource, fxIcon)); uiTabPaths->toolButtonExprAfter->setIcon(VTheme::GetIconResource(resource, fxIcon)); - const QString equalIcon = QStringLiteral("24x24/equal.png"); + const auto equalIcon = QStringLiteral("24x24/equal.png"); uiTabGrainline->labelEqual->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); uiTabGrainline->labelEqual_2->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); uiTabLabels->labelEqual_3->setPixmap(VTheme::GetPixmapResource(resource, equalIcon)); diff --git a/src/libs/vtools/tools/backgroundimage/vbackgroundimagecontrols.cpp b/src/libs/vtools/tools/backgroundimage/vbackgroundimagecontrols.cpp index 849060efb..b67b0d2ca 100644 --- a/src/libs/vtools/tools/backgroundimage/vbackgroundimagecontrols.cpp +++ b/src/libs/vtools/tools/backgroundimage/vbackgroundimagecontrols.cpp @@ -482,16 +482,16 @@ void VBackgroundImageControls::InitPixmaps() auto InitPixmap = [this](BIHandleCornerType type, const QString &imageName) { - const QString resource = QStringLiteral("icon"); + const auto resource = QStringLiteral("icon"); - const QString fileName = QStringLiteral("32x32/%1.png").arg(imageName); + const auto fileName = QStringLiteral("32x32/%1.png").arg(imageName); QPixmap const handlePixmap = VTheme::GetPixmapResource(resource, fileName); if (QGuiApplication::primaryScreen()->devicePixelRatio() >= 2) { - const QString fileName2x = QStringLiteral("32x32/%1@2x.png").arg(imageName); - const QString fileName2xHover = QStringLiteral("32x32/%1-hover@2x.png").arg(imageName); - const QString fileName2xDisabled = QStringLiteral("32x32/%1-disabled@2x.png").arg(imageName); + const auto fileName2x = QStringLiteral("32x32/%1@2x.png").arg(imageName); + const auto fileName2xHover = QStringLiteral("32x32/%1-hover@2x.png").arg(imageName); + const auto fileName2xDisabled = QStringLiteral("32x32/%1-disabled@2x.png").arg(imageName); m_handlePixmaps.insert(type, VTheme::GetPixmapResource(resource, fileName2x)); m_handleHoverPixmaps.insert(type, VTheme::GetPixmapResource(resource, fileName2xHover)); @@ -499,8 +499,8 @@ void VBackgroundImageControls::InitPixmaps() } else { - const QString fileNameHover = QStringLiteral("32x32/%1-hover.png").arg(imageName); - const QString fileNameDisabled = QStringLiteral("32x32/%1-disabled.png").arg(imageName); + const auto fileNameHover = QStringLiteral("32x32/%1-hover.png").arg(imageName); + const auto fileNameDisabled = QStringLiteral("32x32/%1-disabled.png").arg(imageName); m_handlePixmaps.insert(type, handlePixmap); m_handleHoverPixmaps.insert(type, VTheme::GetPixmapResource(resource, fileNameHover)); diff --git a/src/libs/vwidgets/fancytabbar/fancytabbar.cpp b/src/libs/vwidgets/fancytabbar/fancytabbar.cpp index c402eabd4..75b7c5460 100644 --- a/src/libs/vwidgets/fancytabbar/fancytabbar.cpp +++ b/src/libs/vwidgets/fancytabbar/fancytabbar.cpp @@ -528,7 +528,7 @@ void FancyTabBar::PaintTab(QPainter *painter, int tabIndex) const if (!selected && enabled) { painter->save(); - int const fader = static_cast(m_attachedTabs[tabIndex]->fader()); + auto const fader = static_cast(m_attachedTabs[tabIndex]->fader()); QLinearGradient grad(GetCorner(rect, OutsideBeginning), GetCorner(rect, InsideBeginning)); grad.setColorAt(0, Qt::transparent); diff --git a/src/libs/vwidgets/global.cpp b/src/libs/vwidgets/global.cpp index dbd40b36f..33c34be95 100644 --- a/src/libs/vwidgets/global.cpp +++ b/src/libs/vwidgets/global.cpp @@ -65,7 +65,7 @@ auto SceneScale(QGraphicsScene *scene) -> qreal //--------------------------------------------------------------------------------------------------------------------- auto PointRect(qreal radius) -> QRectF { - QRectF rec = QRectF(0, 0, radius * 2, radius * 2); + auto rec = QRectF(0, 0, radius * 2, radius * 2); rec.translate(-rec.center().x(), -rec.center().y()); return rec; } diff --git a/src/libs/vwidgets/vabstractmainwindow.cpp b/src/libs/vwidgets/vabstractmainwindow.cpp index 779c97345..843ac9655 100644 --- a/src/libs/vwidgets/vabstractmainwindow.cpp +++ b/src/libs/vwidgets/vabstractmainwindow.cpp @@ -243,7 +243,7 @@ void VAbstractMainWindow::UpdateRecentFileActions() const QString &recent = recentFiles.at(i); if (not recent.isEmpty()) { - const QString text = QStringLiteral("&%1. %2").arg(i + 1).arg(recentFiles.at(i)); + const auto text = QStringLiteral("&%1. %2").arg(i + 1).arg(recentFiles.at(i)); m_recentFileActs.at(i)->setText(text); m_recentFileActs.at(i)->setData(files.at(i)); m_recentFileActs.at(i)->setVisible(true); diff --git a/src/libs/vwidgets/vcomboboxdelegate.cpp b/src/libs/vwidgets/vcomboboxdelegate.cpp index be681a049..7ab5de32b 100644 --- a/src/libs/vwidgets/vcomboboxdelegate.cpp +++ b/src/libs/vwidgets/vcomboboxdelegate.cpp @@ -31,10 +31,10 @@ //--------------------------------------------------------------------------------------------------------------------- VComboBoxDelegate::VComboBoxDelegate(const QStringList &items, QObject *parent) - : QItemDelegate(parent), - m_items(items) + : QItemDelegate(parent), + m_items(items) { - const QString dashDash = QStringLiteral("--"); + const auto dashDash = QStringLiteral("--"); m_items.prepend(dashDash + tr("Select material") + dashDash); } diff --git a/src/libs/vwidgets/vlineedit.cpp b/src/libs/vwidgets/vlineedit.cpp index 838363bc2..562da64f5 100644 --- a/src/libs/vwidgets/vlineedit.cpp +++ b/src/libs/vwidgets/vlineedit.cpp @@ -123,7 +123,7 @@ void VLineEdit::focusInEvent(QFocusEvent *e) void VLineEdit::focusOutEvent(QFocusEvent *e) { const int start = selectionStart(); - const int selectionLength = static_cast(selectedText().length()); + const auto selectionLength = static_cast(selectedText().length()); const bool wasTextSelected = hasSelectedText(); QLineEdit::focusOutEvent(e); diff --git a/src/libs/vwidgets/vmaingraphicsview.cpp b/src/libs/vwidgets/vmaingraphicsview.cpp index efe3b40bc..80347f1af 100644 --- a/src/libs/vwidgets/vmaingraphicsview.cpp +++ b/src/libs/vwidgets/vmaingraphicsview.cpp @@ -331,7 +331,7 @@ void GraphicsViewZoom::FictiveSceneRect(QGraphicsScene *sc, QGraphicsView *view) // to receive the currently visible area, map the widgets bounds to the scene const QPointF a = view->mapToScene(0, 0); const QPointF b = view->mapToScene(view->viewport()->width(), view->viewport()->height()); - QRectF viewRect = QRectF(a, b); + auto viewRect = QRectF(a, b); // Scale view QLineF topLeftRay(viewRect.center(), viewRect.topLeft()); diff --git a/src/test/CollectionTest/tst_valentinacommandline.cpp b/src/test/CollectionTest/tst_valentinacommandline.cpp index 1b5e4dcf1..660a57453 100644 --- a/src/test/CollectionTest/tst_valentinacommandline.cpp +++ b/src/test/CollectionTest/tst_valentinacommandline.cpp @@ -214,7 +214,7 @@ void TST_ValentinaCommandLine::TestOpenCollection_data() const const QString tmp = QCoreApplication::applicationDirPath() + QDir::separator() + *tmpTestCollectionFolder; const QString testGOST = u"--test;;-m;;%1"_s.arg(tmp + QDir::separator() + "GOST_man_ru.vst"_L1); - const QString keyTest = QStringLiteral("--test"); + const auto keyTest = QStringLiteral("--test"); QTest::newRow("bra") << "bra.val" << keyTest << V_EX_OK; #ifdef Q_OS_WIN diff --git a/src/test/TranslationsTest/tst_abstractregexp.cpp b/src/test/TranslationsTest/tst_abstractregexp.cpp index edbf8ffdd..e5861463c 100644 --- a/src/test/TranslationsTest/tst_abstractregexp.cpp +++ b/src/test/TranslationsTest/tst_abstractregexp.cpp @@ -191,11 +191,11 @@ void TST_AbstractRegExp::CallTestForValidCharacters() const vsizetype pos = FindFirstNotOf(translated, validNameChars); if (pos != -1) { - const QString message = QStringLiteral("Translated string '%1' contains invalid character '%2' at " - "position '%3'.") - .arg(translated) - .arg(translated.at(pos)) - .arg(pos); + const auto message = QStringLiteral("Translated string '%1' contains invalid character '%2' at " + "position '%3'.") + .arg(translated) + .arg(translated.at(pos)) + .arg(pos); QFAIL(qUtf8Printable(message)); } } diff --git a/src/test/TranslationsTest/tst_buitinregexp.cpp b/src/test/TranslationsTest/tst_buitinregexp.cpp index 0f5609e78..63242857f 100644 --- a/src/test/TranslationsTest/tst_buitinregexp.cpp +++ b/src/test/TranslationsTest/tst_buitinregexp.cpp @@ -231,7 +231,7 @@ void TST_BuitInRegExp::TestCheckInternalVaribleRegExp() QFETCH(QString, var); QFETCH(QString, originalName); - static const QString regex = QStringLiteral("(.){1,}_(.){1,}$"); + static const auto regex = QStringLiteral("(.){1,}_(.){1,}$"); const QString sourceRegex = '^'_L1 + var + regex; const QRegularExpression sourceRe(sourceRegex); @@ -243,14 +243,14 @@ void TST_BuitInRegExp::TestCheckInternalVaribleRegExp() { if (sourceRe.match(originalName).hasMatch() || translationRe.match(originalName).hasMatch()) { - const QString message = QStringLiteral("Invalid original string '%1'").arg(originalName); + const auto message = QStringLiteral("Invalid original string '%1'").arg(originalName); QFAIL(qUtf8Printable(message)); } const QString translatedMessage = m_trMs->VarToUser(originalName); if (sourceRe.match(translatedMessage).hasMatch() || translationRe.match(translatedMessage).hasMatch()) { - const QString message = QStringLiteral("Invalid translation string '%1'").arg(translatedMessage); + const auto message = QStringLiteral("Invalid translation string '%1'").arg(translatedMessage); QFAIL(qUtf8Printable(message)); } } diff --git a/src/test/TranslationsTest/tst_qmuparsererrormsg.cpp b/src/test/TranslationsTest/tst_qmuparsererrormsg.cpp index eb938ba20..73a37c94d 100644 --- a/src/test/TranslationsTest/tst_qmuparsererrormsg.cpp +++ b/src/test/TranslationsTest/tst_qmuparsererrormsg.cpp @@ -133,7 +133,7 @@ void TST_QmuParserErrorMsg::TestEErrorCodes() const QString translated = (*msg)[code]; // cppcheck-suppress unreadVariable - const QString message = QStringLiteral("String: '%1'.").arg(translated); + const auto message = QStringLiteral("String: '%1'.").arg(translated); QVERIFY2((translated.indexOf("$TOK$"_L1) != -1) == tok, qUtf8Printable(message)); QVERIFY2((translated.indexOf("$POS$"_L1) != -1) == pos, qUtf8Printable(message)); diff --git a/src/test/TranslationsTest/tst_tslocaletranslation.cpp b/src/test/TranslationsTest/tst_tslocaletranslation.cpp index b090ddc50..b08b4fb1f 100644 --- a/src/test/TranslationsTest/tst_tslocaletranslation.cpp +++ b/src/test/TranslationsTest/tst_tslocaletranslation.cpp @@ -50,7 +50,7 @@ void TST_TSLocaleTranslation::CheckPlaceMarkerExist_data() QTest::addColumn("translation"); QTest::addColumn("direction"); - const QString filename = QStringLiteral("valentina_%1.ts").arg(m_locale); + const auto filename = QStringLiteral("valentina_%1.ts").arg(m_locale); QLocale const locale(m_locale); const QDomNodeList messages = LoadTSFile(filename); @@ -91,7 +91,7 @@ void TST_TSLocaleTranslation::CheckPlaceMarkerExist_data() } else { - const QString caseName = QStringLiteral("File '%2'. Message %1 is null.").arg(i).arg(filename); + const auto caseName = QStringLiteral("File '%2'. Message %1 is null.").arg(i).arg(filename); QFAIL(qUtf8Printable(caseName)); } } @@ -187,12 +187,12 @@ void TST_TSLocaleTranslation::TestPunctuation_data() continue; } - const QString caseName = QStringLiteral("File '%1'.").arg(filename); + const auto caseName = QStringLiteral("File '%1'.").arg(filename); QTest::newRow(qUtf8Printable(caseName)) << m_locale << source << translation; } else { - const QString caseName = QStringLiteral("File '%2'. Message %1 is null.").arg(i).arg(filename); + const auto caseName = QStringLiteral("File '%2'. Message %1 is null.").arg(i).arg(filename); QFAIL(qUtf8Printable(caseName)); } } @@ -296,12 +296,12 @@ void TST_TSLocaleTranslation::TestHTMLTags_data() continue; } - const QString caseName = QStringLiteral("File '%1'.").arg(filename); + const auto caseName = QStringLiteral("File '%1'.").arg(filename); QTest::newRow(qUtf8Printable(caseName)) << source << translation; } else { - const QString caseName = QStringLiteral("File '%2'. Message %1 is null.").arg(i).arg(filename); + const auto caseName = QStringLiteral("File '%2'. Message %1 is null.").arg(i).arg(filename); QFAIL(qUtf8Printable(caseName)); } } diff --git a/src/test/TranslationsTest/tst_tstranslation.cpp b/src/test/TranslationsTest/tst_tstranslation.cpp index 9d0f6cdff..aa34cc0ce 100644 --- a/src/test/TranslationsTest/tst_tstranslation.cpp +++ b/src/test/TranslationsTest/tst_tstranslation.cpp @@ -151,7 +151,7 @@ void TST_TSTranslation::PrepareOriginalStrings() QTest::addColumn("source"); QTest::addColumn("message"); - const QString fileName = QStringLiteral("valentina.ts"); + const auto fileName = QStringLiteral("valentina.ts"); const QDomNodeList messages = LoadTSFile(fileName); if (messages.isEmpty()) { @@ -169,13 +169,12 @@ void TST_TSTranslation::PrepareOriginalStrings() continue; } - const QString tag = - QStringLiteral("File '%1'. Check modification source message '%2'.").arg(fileName, source); + const auto tag = QStringLiteral("File '%1'. Check modification source message '%2'.").arg(fileName, source); QTest::newRow(qUtf8Printable(tag)) << source << message; } else { - const QString errorMessage = QStringLiteral("Message %1 is null.").arg(i); + const auto errorMessage = QStringLiteral("Message %1 is null.").arg(i); QFAIL(qUtf8Printable(errorMessage)); } } diff --git a/src/test/ValentinaTest/tst_readval.cpp b/src/test/ValentinaTest/tst_readval.cpp index c26ce4800..0a494a047 100644 --- a/src/test/ValentinaTest/tst_readval.cpp +++ b/src/test/ValentinaTest/tst_readval.cpp @@ -131,7 +131,7 @@ void TST_ReadVal::PrepareVal(qreal val, const QLocale &locale) //--------------------------------------------------------------------------------------------------------------------- void TST_ReadVal::PrepareString(const QString &str, const QLocale &locale, qreal val, vsizetype count) { - const QString tag = QStringLiteral("%1. String '%2'").arg(locale.name(), str); + const auto tag = QStringLiteral("%1. String '%2'").arg(locale.name(), str); QTest::newRow(qUtf8Printable(tag)) << str << count << val << locale; } @@ -150,7 +150,7 @@ void TST_ReadVal::TestVal() ReadVal(formula, resVal, locale, LocaleDecimalPoint(locale), LocaleGroupSeparator(locale)); // cppcheck-suppress unreadVariable - QString errorMsg = QStringLiteral("Conversion failed. Locale: '%1'.").arg(locale.name()); + auto errorMsg = QStringLiteral("Conversion failed. Locale: '%1'.").arg(locale.name()); QVERIFY2(resCount == expCount, qUtf8Printable(errorMsg)); if (resCount != -1) diff --git a/src/test/ValentinaTest/tst_vellipticalarc.cpp b/src/test/ValentinaTest/tst_vellipticalarc.cpp index e1d74b54a..a73cebf33 100644 --- a/src/test/ValentinaTest/tst_vellipticalarc.cpp +++ b/src/test/ValentinaTest/tst_vellipticalarc.cpp @@ -1140,7 +1140,7 @@ void TST_VEllipticalArc::TestFlip() const VEllipticalArc res = elArc.Flip(axis, prefix); // cppcheck-suppress unreadVariable - const QString errorMsg = QStringLiteral("The name doesn't contain the prefix '%1'.").arg(prefix); + const auto errorMsg = QStringLiteral("The name doesn't contain the prefix '%1'.").arg(prefix); QVERIFY2(res.name().endsWith(prefix), qUtf8Printable(errorMsg)); QCOMPARE(qRound(elArc.GetLength() * -1), qRound(res.GetLength())); diff --git a/src/test/ValentinaTest/tst_vpointf.cpp b/src/test/ValentinaTest/tst_vpointf.cpp index 3511765fe..16eb062bb 100644 --- a/src/test/ValentinaTest/tst_vpointf.cpp +++ b/src/test/ValentinaTest/tst_vpointf.cpp @@ -53,7 +53,7 @@ void TST_VPointF::TestFlip_data() VPointF const originPoint; QLineF axis = QLineF(QPointF(5, 0), QPointF(5, 10)); - QPointF flipped = QPointF(10, 0); + auto flipped = QPointF(10, 0); QTest::newRow("Vertical axis") << originPoint << axis << flipped << "a2"; diff --git a/src/test/ValentinaTest/tst_vspline.cpp b/src/test/ValentinaTest/tst_vspline.cpp index e9cdc1e15..37c0b89fb 100644 --- a/src/test/ValentinaTest/tst_vspline.cpp +++ b/src/test/ValentinaTest/tst_vspline.cpp @@ -839,7 +839,7 @@ void TST_VSpline::TestFlip() const VSpline res = spl.Flip(axis, prefix); // cppcheck-suppress unreadVariable - const QString errorMsg = QStringLiteral("The name doesn't contain the prefix '%1'.").arg(prefix); + const auto errorMsg = QStringLiteral("The name doesn't contain the prefix '%1'.").arg(prefix); QVERIFY2(res.name().endsWith(prefix), qUtf8Printable(errorMsg)); QCOMPARE(spl.GetLength(), res.GetLength()); diff --git a/src/test/ValentinaTest/tst_vsplinepath.cpp b/src/test/ValentinaTest/tst_vsplinepath.cpp index b8ffcca1f..78e97dc55 100644 --- a/src/test/ValentinaTest/tst_vsplinepath.cpp +++ b/src/test/ValentinaTest/tst_vsplinepath.cpp @@ -194,7 +194,7 @@ void TST_VSplinePath::TestFlip() const VSplinePath res = splPath.Flip(axis, prefix); // cppcheck-suppress unreadVariable - const QString errorMsg = QStringLiteral("The name doesn't contain the prefix '%1'.").arg(prefix); + const auto errorMsg = QStringLiteral("The name doesn't contain the prefix '%1'.").arg(prefix); QVERIFY2(res.name().endsWith(prefix), qUtf8Printable(errorMsg)); QCOMPARE(splPath.GetLength(), res.GetLength()); diff --git a/src/test/ValentinaTest/tst_vsvgpathtokenizer.cpp b/src/test/ValentinaTest/tst_vsvgpathtokenizer.cpp index b1d4c3dfc..e5c0d8d81 100644 --- a/src/test/ValentinaTest/tst_vsvgpathtokenizer.cpp +++ b/src/test/ValentinaTest/tst_vsvgpathtokenizer.cpp @@ -42,7 +42,7 @@ void CompareCommands(const VSVGPathCommand &actual, const VSVGPathCommand &expec QStringLiteral("Commands mismatch. Expected: %1, actual: %2").arg(expected.m_command).arg(actual.m_command); QVERIFY2(actual.m_command == expected.m_command, qUtf8Printable(msg)); - const QString msg2 = QStringLiteral("Commands %1 arguments mismatch.").arg(actual.m_command); + const auto msg2 = QStringLiteral("Commands %1 arguments mismatch.").arg(actual.m_command); QVERIFY2(actual.m_arguments.size() == expected.m_arguments.size(), qUtf8Printable(msg2)); // First check if sizes are equal diff --git a/src/test/ValentinaTest/tst_vtranslatevars.cpp b/src/test/ValentinaTest/tst_vtranslatevars.cpp index 958ce8388..9c9a20594 100644 --- a/src/test/ValentinaTest/tst_vtranslatevars.cpp +++ b/src/test/ValentinaTest/tst_vtranslatevars.cpp @@ -167,7 +167,7 @@ void TST_VTranslateVars::PrepareVal(const QString &inputFormula, const QString & auto PREPARE_CASE = [locale](const QString &inputString, const QString &outputString) { - QString const tag = QStringLiteral("%1. String '%2'").arg(locale.name(), inputString); + auto const tag = QStringLiteral("%1. String '%2'").arg(locale.name(), inputString); QTest::newRow(qUtf8Printable(tag)) << inputString << outputString << locale; };