From aaa40a566293666852b3f964dd86fe90e0e9d8dd Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 30 Apr 2024 11:48:51 +0300 Subject: [PATCH] Refactoring. Replace the redundant type with "auto". --- src/app/puzzle/vpmainwindow.cpp | 2 +- .../tape/dialogs/dialogrestrictdimension.cpp | 2 +- src/app/tape/tkmmainwindow.cpp | 8 +-- src/app/tape/tmainwindow.cpp | 10 ++-- .../configpages/preferencespatternpage.cpp | 2 +- .../valentina/dialogs/dialogincrements.cpp | 2 +- .../dialogs/dialoglayoutsettings.cpp | 2 +- .../valentina/dialogs/dialogsavelayout.cpp | 4 +- src/app/valentina/mainwindow.cpp | 2 +- src/libs/qmuparser/qmuformulabase.cpp | 2 +- src/libs/vganalytics/vganalytics.cpp | 2 +- src/libs/vgeometry/varc.cpp | 2 +- src/libs/vgeometry/vcubicbezierpath.cpp | 2 +- src/libs/vgeometry/vellipticalarc.cpp | 2 +- src/libs/vgeometry/vspline.cpp | 8 +-- src/libs/vlayout/dialogs/watermarkwindow.cpp | 2 +- src/libs/vmisc/def.cpp | 2 +- src/libs/vmisc/svgfont/vsvgpathtokenizer.cpp | 2 +- src/libs/vmisc/vcommonsettings.cpp | 4 +- src/libs/vpatterndb/vpiecepath.cpp | 4 +- src/libs/vpatterndb/vtranslatevars.cpp | 4 +- .../vtools/dialogs/tools/dialogheight.cpp | 6 +-- .../dialogs/tools/piece/dialogpiecepath.cpp | 2 +- .../flipping/vtoolflippingbyaxis.cpp | 2 +- .../flipping/vtoolflippingbyline.cpp | 4 +- .../drawTools/operation/vtoolrotation.cpp | 2 +- .../tools/drawTools/toolcurve/vtoolspline.cpp | 4 +- .../drawTools/toolcurve/vtoolsplinepath.cpp | 4 +- .../toollinepoint/vtoollinepoint.cpp | 8 +-- .../vtoolpointfromarcandtangent.cpp | 43 ++++++++-------- .../vtoolpointofintersectionarcs.cpp | 49 ++++++++++--------- .../vtools/tools/nodeDetails/vnodepoint.cpp | 2 +- src/libs/vtools/tools/vtooluniondetails.cpp | 16 +++--- .../line/vistoolpointfromarcandtangent.cpp | 2 +- .../path/vistoolcubicbezierpath.cpp | 2 +- src/libs/vwidgets/fancytabbar/stylehelper.cpp | 2 +- src/libs/vwidgets/vplaintextedit.cpp | 2 +- 37 files changed, 111 insertions(+), 109 deletions(-) diff --git a/src/app/puzzle/vpmainwindow.cpp b/src/app/puzzle/vpmainwindow.cpp index 7dcf5aef1..88457cae4 100644 --- a/src/app/puzzle/vpmainwindow.cpp +++ b/src/app/puzzle/vpmainwindow.cpp @@ -1768,7 +1768,7 @@ void VPMainWindow::UpdateWindowTitle() setWindowFilePath(curFile); #if defined(Q_OS_MAC) - static QIcon fileIcon = QIcon(QCoreApplication::applicationDirPath() + "/../Resources/layout.icns"_L1); + static auto fileIcon = QIcon(QCoreApplication::applicationDirPath() + "/../Resources/layout.icns"_L1); QIcon icon; if (not curFile.isEmpty()) { diff --git a/src/app/tape/dialogs/dialogrestrictdimension.cpp b/src/app/tape/dialogs/dialogrestrictdimension.cpp index 7991b55ce..adc6fbbcb 100644 --- a/src/app/tape/dialogs/dialogrestrictdimension.cpp +++ b/src/app/tape/dialogs/dialogrestrictdimension.cpp @@ -103,7 +103,7 @@ void InitMinMax(qreal &min, qreal &max, const MeasurementDimension_p &dimension, void SetCellIcon(QTableWidgetItem *item, const QVector &validRows, qreal rowValue, qreal columnValue, const VDimensionRestriction &restriction, qreal min, qreal max) { - const QIcon closeIcon = QIcon(QStringLiteral("://icon/24x24/close.png")); + const auto closeIcon = QIcon(QStringLiteral("://icon/24x24/close.png")); if (VFuzzyContains(validRows, rowValue)) { diff --git a/src/app/tape/tkmmainwindow.cpp b/src/app/tape/tkmmainwindow.cpp index b9bb11260..c8b676576 100644 --- a/src/app/tape/tkmmainwindow.cpp +++ b/src/app/tape/tkmmainwindow.cpp @@ -315,7 +315,7 @@ void TKMMainWindow::UpdateWindowTitle() setWindowFilePath(m_curFile); #if defined(Q_OS_MAC) - static QIcon fileIcon = QIcon(QCoreApplication::applicationDirPath() + "/../Resources/measurements.icns"_L1); + static auto fileIcon = QIcon(QCoreApplication::applicationDirPath() + "/../Resources/measurements.icns"_L1); QIcon icon; if (not m_curFile.isEmpty()) { @@ -1346,7 +1346,7 @@ void TKMMainWindow::SaveMUnits() } const QTableWidgetItem *nameField = ui->tableWidget->item(ui->tableWidget->currentRow(), ColumnName); - const MUnits units = static_cast(ui->comboBoxMUnits->currentData().toInt()); + const auto units = static_cast(ui->comboBoxMUnits->currentData().toInt()); m_m->SetMSpecialUnits(nameField->data(Qt::UserRole).toString(), units == MUnits::Degrees); MeasurementsWereSaved(false); @@ -2234,8 +2234,8 @@ void TKMMainWindow::RefreshImages() QSize const size = i.value().Size(); QSize const targetSize = ui->listWidget->iconSize(); - double const scalingFactorWidth = static_cast(targetSize.width()) / size.width(); - double const scalingFactorHeight = static_cast(targetSize.height()) / size.height(); + auto const scalingFactorWidth = static_cast(targetSize.width()) / size.width(); + auto const scalingFactorHeight = static_cast(targetSize.height()) / size.height(); int newWidth; int newHeight; diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 3bfa5f603..372320b8e 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -1207,7 +1207,7 @@ void TMainWindow::SaveEmail() //--------------------------------------------------------------------------------------------------------------------- void TMainWindow::SaveGender(int index) { - const GenderType type = static_cast(ui->comboBoxGender->itemData(index).toInt()); + const auto type = static_cast(ui->comboBoxGender->itemData(index).toInt()); if (m_m->Gender() != type) { m_m->SetGender(type); @@ -2521,7 +2521,7 @@ void TMainWindow::SaveMUnits() } const QTableWidgetItem *nameField = ui->tableWidget->item(ui->tableWidget->currentRow(), ColumnName); - const MUnits units = static_cast(ui->comboBoxMUnits->currentData().toInt()); + const auto units = static_cast(ui->comboBoxMUnits->currentData().toInt()); m_m->SetMSpecialUnits(nameField->data(Qt::UserRole).toString(), units == MUnits::Degrees); MeasurementsWereSaved(false); @@ -2547,7 +2547,7 @@ void TMainWindow::SaveMDimension() } const QTableWidgetItem *nameField = ui->tableWidget->item(ui->tableWidget->currentRow(), ColumnName); - const IMD dimension = static_cast(ui->comboBoxDimension->currentData().toInt()); + const auto dimension = static_cast(ui->comboBoxDimension->currentData().toInt()); m_m->SetMDimension(nameField->data(Qt::UserRole).toString(), dimension); MeasurementsWereSaved(false); @@ -3013,7 +3013,7 @@ void TMainWindow::InitWindow() ui->comboBoxGender->setCurrentIndex(index); { - const QLocale dateLocale = QLocale(VAbstractApplication::VApp()->Settings()->GetLocale()); + const auto dateLocale = QLocale(VAbstractApplication::VApp()->Settings()->GetLocale()); ui->dateEditBirthDate->setLocale(dateLocale); ui->dateEditBirthDate->setDisplayFormat(dateLocale.dateFormat()); ui->dateEditBirthDate->setDate(m_m->BirthDate()); @@ -3801,7 +3801,7 @@ void TMainWindow::UpdateWindowTitle() setWindowFilePath(m_curFile); #if defined(Q_OS_MAC) - static QIcon fileIcon = QIcon(QCoreApplication::applicationDirPath() + "/../Resources/measurements.icns"_L1); + static auto fileIcon = QIcon(QCoreApplication::applicationDirPath() + "/../Resources/measurements.icns"_L1); QIcon icon; if (not m_curFile.isEmpty()) { diff --git a/src/app/valentina/dialogs/configpages/preferencespatternpage.cpp b/src/app/valentina/dialogs/configpages/preferencespatternpage.cpp index d89d891da..b2e5ad3af 100644 --- a/src/app/valentina/dialogs/configpages/preferencespatternpage.cpp +++ b/src/app/valentina/dialogs/configpages/preferencespatternpage.cpp @@ -107,7 +107,7 @@ PreferencesPatternPage::PreferencesPatternPage(QWidget *parent) connect(ui->comboBoxLineWidthUnit, QOverload::of(&QComboBox::currentIndexChanged), this, [this]() { - const Unit lineUnit = static_cast(ui->comboBoxLineWidthUnit->currentData().toInt()); + const auto lineUnit = static_cast(ui->comboBoxLineWidthUnit->currentData().toInt()); const qreal value = UnitConvertor(ui->doubleSpinBoxLineWidth->value(), m_oldLineUnit, lineUnit); ui->doubleSpinBoxLineWidth->setDecimals(lineUnit == Unit::Mm ? 1 : 6); ui->doubleSpinBoxLineWidth->setMinimum( diff --git a/src/app/valentina/dialogs/dialogincrements.cpp b/src/app/valentina/dialogs/dialogincrements.cpp index 92ddbaac9..ca2087278 100644 --- a/src/app/valentina/dialogs/dialogincrements.cpp +++ b/src/app/valentina/dialogs/dialogincrements.cpp @@ -1700,7 +1700,7 @@ void DialogIncrements::SaveIncrUnits() const QTableWidgetItem *nameField = table->item(row, 0); - const IncrUnits units = static_cast(combo->currentData().toInt()); + const auto units = static_cast(combo->currentData().toInt()); m_doc->SetIncrementSpecialUnits(nameField->text(), units == IncrUnits::Degrees); LocalUpdateTree(); diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.cpp b/src/app/valentina/dialogs/dialoglayoutsettings.cpp index cfbdb1acc..369ee18ae 100644 --- a/src/app/valentina/dialogs/dialoglayoutsettings.cpp +++ b/src/app/valentina/dialogs/dialoglayoutsettings.cpp @@ -900,7 +900,7 @@ auto DialogLayoutSettings::MakeHelpTiledPdfTemplateList() -> QString //--------------------------------------------------------------------------------------------------------------------- auto DialogLayoutSettings::Template() -> QSizeF { - const PaperSizeTemplate temp = static_cast(ui->comboBoxTemplates->currentData().toInt()); + const auto temp = static_cast(ui->comboBoxTemplates->currentData().toInt()); const Unit paperUnit = PaperUnit(); diff --git a/src/app/valentina/dialogs/dialogsavelayout.cpp b/src/app/valentina/dialogs/dialogsavelayout.cpp index 3caf758cd..4d8b436e7 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.cpp +++ b/src/app/valentina/dialogs/dialogsavelayout.cpp @@ -330,7 +330,7 @@ auto DialogSaveLayout::IsShowGrainline() const -> bool //--------------------------------------------------------------------------------------------------------------------- auto DialogSaveLayout::MakeHelpFormatList() -> QString { - QString out(QStringLiteral("\n")); + auto out = QStringLiteral("\n"); const auto formats = InitFormats(); for (int i = 0; i < formats.size(); ++i) { @@ -891,7 +891,7 @@ void DialogSaveLayout::WriteSettings() const settings->SetTiledPDFMargins(margins, unit); // write Template - const PaperSizeTemplate temp = static_cast(ui->comboBoxTemplates->currentData().toInt()); + const auto temp = static_cast(ui->comboBoxTemplates->currentData().toInt()); const QSizeF size = GetTemplateSize(temp, Unit::Mm); settings->SetTiledPDFPaperHeight(size.height(), Unit::Mm); diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 06d88c3b9..5fc93a687 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -7567,7 +7567,7 @@ void MainWindow::UpdateWindowTitle() setWindowFilePath(VAbstractValApplication::VApp()->GetPatternPath()); #if defined(Q_OS_MAC) - static QIcon fileIcon = QIcon(QCoreApplication::applicationDirPath() + "/../Resources/Valentina.icns"_L1); + static auto fileIcon = QIcon(QCoreApplication::applicationDirPath() + "/../Resources/Valentina.icns"_L1); QIcon icon; if (not VAbstractValApplication::VApp()->GetPatternPath().isEmpty()) { diff --git a/src/libs/qmuparser/qmuformulabase.cpp b/src/libs/qmuparser/qmuformulabase.cpp index 6117b2773..676bd1401 100644 --- a/src/libs/qmuparser/qmuformulabase.cpp +++ b/src/libs/qmuparser/qmuformulabase.cpp @@ -144,7 +144,7 @@ void QmuFormulaBase::SetSepForTr(bool osSeparator, bool fromUser) { if (fromUser) { - const QLocale loc = QLocale(); + const QLocale loc; setLocale(loc); SetArgSep(';'); setCNumbers(not osSeparator); diff --git a/src/libs/vganalytics/vganalytics.cpp b/src/libs/vganalytics/vganalytics.cpp index f868c77ec..aca9f1a9b 100644 --- a/src/libs/vganalytics/vganalytics.cpp +++ b/src/libs/vganalytics/vganalytics.cpp @@ -97,7 +97,7 @@ auto GetSystemMemorySize() -> qint64 host_statistics64(machPort, HOST_VM_INFO, reinterpret_cast(&vmStats), &count); - qulonglong freeMemory = static_cast(vmStats.free_count) * static_cast(pageSize); + auto freeMemory = static_cast(vmStats.free_count) * static_cast(pageSize); qulonglong totalMemoryUsed = (static_cast(vmStats.active_count) + static_cast(vmStats.inactive_count) + static_cast(vmStats.wire_count)) * diff --git a/src/libs/vgeometry/varc.cpp b/src/libs/vgeometry/varc.cpp index bebfca3a3..4fc8b9730 100644 --- a/src/libs/vgeometry/varc.cpp +++ b/src/libs/vgeometry/varc.cpp @@ -308,7 +308,7 @@ auto VArc::GetPoints() const -> QVector { const qreal lDistance = qAbs(d->radius) * 4.0 / 3.0 * qTan(qDegreesToRadians(sectionAngle.at(i)) * 0.25); - const QPointF center = static_cast(GetCenter()); + const auto center = static_cast(GetCenter()); QLineF lineP1P2(pStart, center); lineP1P2.setAngle(lineP1P2.angle() - 90.0); diff --git a/src/libs/vgeometry/vcubicbezierpath.cpp b/src/libs/vgeometry/vcubicbezierpath.cpp index 61a3d020f..0df9562af 100644 --- a/src/libs/vgeometry/vcubicbezierpath.cpp +++ b/src/libs/vgeometry/vcubicbezierpath.cpp @@ -216,7 +216,7 @@ auto VCubicBezierPath::GetSpline(vsizetype index) const -> VSpline auto p2 = static_cast(d->path.at(base + 1)); if (base + 1 > 1) { - const QPointF b = static_cast(d->path.at(base)); + const auto b = static_cast(d->path.at(base)); QLineF const foot1(b, static_cast(d->path.at(base - 1))); QLineF foot2(b, p2); diff --git a/src/libs/vgeometry/vellipticalarc.cpp b/src/libs/vgeometry/vellipticalarc.cpp index b88f95a86..a90aa3275 100644 --- a/src/libs/vgeometry/vellipticalarc.cpp +++ b/src/libs/vgeometry/vellipticalarc.cpp @@ -126,7 +126,7 @@ auto EllipseCore(fpm::fixed_16_16 xC, fpm::fixed_16_16 yC, fpm::fixed_16_16 xP, -> QVector { uint const k = qMin(static_cast(AngularInc(xP, yP, xQ, yQ, flatness)), 16U); - const uint count = static_cast(sweep.raw_value()) >> (16 - k); + const auto count = static_cast(sweep.raw_value()) >> (16 - k); QVector arc; arc.reserve(static_cast(count) + 1); diff --git a/src/libs/vgeometry/vspline.cpp b/src/libs/vgeometry/vspline.cpp index f9e5ba059..8dce4e366 100644 --- a/src/libs/vgeometry/vspline.cpp +++ b/src/libs/vgeometry/vspline.cpp @@ -564,10 +564,10 @@ auto VSpline::ParamT(const QPointF &pBt) const -> qreal // Here we try find closest to our point. for (auto t : qAsConst(ts)) { - const QPointF p0 = static_cast(GetP1()); - const QPointF p1 = static_cast(GetP2()); - const QPointF p2 = static_cast(GetP3()); - const QPointF p3 = static_cast(GetP4()); + const auto p0 = static_cast(GetP1()); + const auto p1 = static_cast(GetP2()); + const auto p2 = static_cast(GetP3()); + const auto p3 = static_cast(GetP4()); // The explicit form of the Cubic Bézier curve const qreal pointX = pow(1 - t, 3) * p0.x() + 3 * pow(1 - t, 2) * t * p1.x() + 3 * (1 - t) * pow(t, 2) * p2.x() + pow(t, 3) * p3.x(); diff --git a/src/libs/vlayout/dialogs/watermarkwindow.cpp b/src/libs/vlayout/dialogs/watermarkwindow.cpp index e63ac1d63..dfe96cecb 100644 --- a/src/libs/vlayout/dialogs/watermarkwindow.cpp +++ b/src/libs/vlayout/dialogs/watermarkwindow.cpp @@ -552,7 +552,7 @@ void WatermarkWindow::UpdateWindowTitle() setWindowFilePath(m_curFile); #if defined(Q_OS_MAC) - static QIcon fileIcon = QIcon(QCoreApplication::applicationDirPath() + "/../Resources/Valentina.icns"_L1); + static auto fileIcon = QIcon(QCoreApplication::applicationDirPath() + "/../Resources/Valentina.icns"_L1); QIcon icon; if (not m_curFile.isEmpty()) { diff --git a/src/libs/vmisc/def.cpp b/src/libs/vmisc/def.cpp index 1d8046dba..15149a980 100644 --- a/src/libs/vmisc/def.cpp +++ b/src/libs/vmisc/def.cpp @@ -104,7 +104,7 @@ void InitLanguageList(QComboBox *combobox) continue; } - QLocale const loc = QLocale(locale); + auto const loc = QLocale(locale); QString const lang = loc.nativeLanguageName(); QString country = TerritoryToString(loc); if (country == "Czechia"_L1) diff --git a/src/libs/vmisc/svgfont/vsvgpathtokenizer.cpp b/src/libs/vmisc/svgfont/vsvgpathtokenizer.cpp index 3493187b5..d556ffe2b 100644 --- a/src/libs/vmisc/svgfont/vsvgpathtokenizer.cpp +++ b/src/libs/vmisc/svgfont/vsvgpathtokenizer.cpp @@ -45,7 +45,7 @@ Q_GLOBAL_STATIC(QMutex, svgPathTokenizerMutex) // NOLINT QT_WARNING_POP -const qreal V_PI = static_cast(M_PI); // pi +const auto V_PI = static_cast(M_PI); // pi //--------------------------------------------------------------------------------------------------------------------- auto IsCommand(const QChar &ch) -> bool diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp index a1e56be40..6ed17934e 100644 --- a/src/libs/vmisc/vcommonsettings.cpp +++ b/src/libs/vmisc/vcommonsettings.cpp @@ -1051,7 +1051,7 @@ void VCommonSettings::SetCSVSeparator(const QChar &separator) auto VCommonSettings::GetCSVSeparator() const -> QChar { QSettings const settings(this->format(), this->scope(), this->organizationName(), *commonIniFilename); - const quint8 separator = static_cast(settings.value(*settingCSVSeparator, 3).toUInt()); + const auto separator = static_cast(settings.value(*settingCSVSeparator, 3).toUInt()); switch (separator) { case 0: @@ -1596,7 +1596,7 @@ void VCommonSettings::SetTiledPDFMargins(const QMarginsF &value, const Unit &uni //--------------------------------------------------------------------------------------------------------------------- auto VCommonSettings::GetTiledPDFOrientation() const -> PageOrientation { - bool const defaultValue = static_cast(PageOrientation::Portrait); + auto const defaultValue = static_cast(PageOrientation::Portrait); bool const result = value(*settingTiledPDFOrientation, defaultValue).toBool(); return static_cast(result); } diff --git a/src/libs/vpatterndb/vpiecepath.cpp b/src/libs/vpatterndb/vpiecepath.cpp index 0e811ce00..e900b32b7 100644 --- a/src/libs/vpatterndb/vpiecepath.cpp +++ b/src/libs/vpatterndb/vpiecepath.cpp @@ -46,7 +46,7 @@ auto CurvePoint(VSAPoint candidate, const VContainer *data, const VPieceNode &no { if (node.GetTypeTool() == Tool::NodePoint) { - const QPointF p = static_cast(*data->GeometricObject(node.GetId())); + const auto p = static_cast(*data->GeometricObject(node.GetId())); if (VAbstractCurve::IsPointOnCurve(curvePoints, p)) { candidate = VSAPoint(p); @@ -864,7 +864,7 @@ auto VPiecePath::RemoveEdge(quint32 index) const -> VPiecePath path.Clear(); // Edge can be only segment. We ignore all curves inside segments. - const quint32 edges = static_cast(ListNodePoint().size()); + const auto edges = static_cast(ListNodePoint().size()); for (quint32 i = 0; i < edges; ++i) { VPieceNode p1; diff --git a/src/libs/vpatterndb/vtranslatevars.cpp b/src/libs/vpatterndb/vtranslatevars.cpp index 994e0f8a5..4f593d7d2 100644 --- a/src/libs/vpatterndb/vtranslatevars.cpp +++ b/src/libs/vpatterndb/vtranslatevars.cpp @@ -375,7 +375,7 @@ void VTranslateVars::TranslateVarsFromUser(QString &newFormula, QMap &tokens, QMap &numbers, bool osSeparator) { - QLocale loc = QLocale(); // User locale + QLocale loc; // User locale if (loc != QLocale::c() && osSeparator) { // User want use Os separator QList nKeys = numbers.keys(); // Positions for all numbers in expression @@ -453,7 +453,7 @@ void VTranslateVars::TranslateVarsToUser(QString &newFormula, QMap &tokens, QMap &numbers, bool osSeparator) { - QLocale loc = QLocale(); // User locale + QLocale loc; // User locale if (loc != QLocale::C && osSeparator) { // User want use Os separator QList nKeys = numbers.keys(); // Positions for all numbers in expression diff --git a/src/libs/vtools/dialogs/tools/dialogheight.cpp b/src/libs/vtools/dialogs/tools/dialogheight.cpp index 04844fa5d..f2eb1b965 100644 --- a/src/libs/vtools/dialogs/tools/dialogheight.cpp +++ b/src/libs/vtools/dialogs/tools/dialogheight.cpp @@ -269,9 +269,9 @@ void DialogHeight::PointNameChanged() try { - const QPointF basePoint = static_cast(*data->GeometricObject(basePointId)); - const QPointF p1Line = static_cast(*data->GeometricObject(p1LineId)); - const QPointF p2Line = static_cast(*data->GeometricObject(p2LineId)); + const auto basePoint = static_cast(*data->GeometricObject(basePointId)); + const auto p1Line = static_cast(*data->GeometricObject(p1LineId)); + const auto p2Line = static_cast(*data->GeometricObject(p2LineId)); if (set.size() != 3 || VGObject::ClosestPoint(QLineF(p1Line, p2Line), basePoint) == QPointF()) { diff --git a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp index c2d29ef41..df6343604 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp @@ -1436,7 +1436,7 @@ void DialogPiecePath::NodeAngleChanged(int index) QListWidgetItem *rowItem = GetItemById(ui->comboBoxNodes->currentData().toUInt()); if (rowItem) { - const PieceNodeAngle angle = static_cast(ui->comboBoxAngle->currentData().toUInt()); + const auto angle = static_cast(ui->comboBoxAngle->currentData().toUInt()); auto rowNode = qvariant_cast(rowItem->data(Qt::UserRole)); rowNode.SetAngleType(angle); rowItem->setData(Qt::UserRole, QVariant::fromValue(rowNode)); diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp index 877deb27c..2c3085ba8 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp @@ -111,7 +111,7 @@ auto VToolFlippingByAxis::Create(const QPointer &dialog, VMainGraphi auto VToolFlippingByAxis::Create(VToolFlippingByAxisInitData initData) -> VToolFlippingByAxis * { const auto originPoint = *initData.data->GeometricObject(initData.originPointId); - const QPointF fPoint = static_cast(originPoint); + const auto fPoint = static_cast(originPoint); QPointF sPoint; if (initData.axisType == AxisType::VerticalAxis) diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp index 466ada4d2..bdf86a815 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp @@ -111,10 +111,10 @@ auto VToolFlippingByLine::Create(const QPointer &dialog, VMainGraphi auto VToolFlippingByLine::Create(VToolFlippingByLineInitData initData) -> VToolFlippingByLine * { const auto firstPoint = *initData.data->GeometricObject(initData.firstLinePointId); - const QPointF fPoint = static_cast(firstPoint); + const auto fPoint = static_cast(firstPoint); const auto secondPoint = *initData.data->GeometricObject(initData.secondLinePointId); - const QPointF sPoint = static_cast(secondPoint); + const auto sPoint = static_cast(secondPoint); CreateDestination(initData, fPoint, sPoint); diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp index 338d77ed2..d0981a69d 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp @@ -135,7 +135,7 @@ auto VToolRotation::Create(VToolRotationInitData &initData) -> VToolRotation * calcAngle = CheckFormula(initData.id, initData.angle, initData.data); const auto originPoint = *initData.data->GeometricObject(initData.origin); - const QPointF oPoint = static_cast(originPoint); + const auto oPoint = static_cast(originPoint); if (initData.typeCreation == Source::FromGui) { diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp index 5cc162c83..d9fcaded3 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp @@ -465,8 +465,8 @@ void VToolSpline::mouseMoveEvent(QGraphicsSceneMouseEvent *event) const QPointF offset0 = ((1 - weight) / (3 * t * (1 - t) * (1 - t))) * delta; const QPointF offset1 = (weight / (3 * t * t * (1 - t))) * delta; - const QPointF p2 = static_cast(spline->GetP2()) + offset0; - const QPointF p3 = static_cast(spline->GetP3()) + offset1; + const auto p2 = static_cast(spline->GetP2()) + offset0; + const auto p3 = static_cast(spline->GetP3()) + offset1; oldPosition = event->scenePos(); // Now mouse here diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp index 6852eb09f..358c402a7 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp @@ -676,8 +676,8 @@ void VToolSplinePath::mouseMoveEvent(QGraphicsSceneMouseEvent *event) const QPointF offset0 = ((1 - weight) / (3 * t * (1 - t) * (1 - t))) * delta; const QPointF offset1 = (weight / (3 * t * t * (1 - t))) * delta; - const QPointF p2 = static_cast(spline.GetP2()) + offset0; - const QPointF p3 = static_cast(spline.GetP3()) + offset1; + const auto p2 = static_cast(spline.GetP2()) + offset0; + const auto p3 = static_cast(spline.GetP3()) + offset1; oldPosition = event->scenePos(); // Now mouse here diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp index cb68df19f..5f06fc2a3 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp @@ -81,8 +81,8 @@ VToolLinePoint::VToolLinePoint(VAbstractPattern *doc, VContainer *data, const qu { this->m_lineType = typeLine; Q_ASSERT_X(basePointId != 0, Q_FUNC_INFO, "basePointId == 0"); //-V654 //-V712 - QPointF const point1 = static_cast(*data->GeometricObject(basePointId)); - QPointF const point2 = static_cast(*data->GeometricObject(id)); + auto const point1 = static_cast(*data->GeometricObject(basePointId)); + auto const point2 = static_cast(*data->GeometricObject(id)); QLineF const line(point1 - point2, QPointF()); mainLine = new VScaledLine(line, VColorRole::CustomColor, this); mainLine->SetBoldLine(false); @@ -115,8 +115,8 @@ void VToolLinePoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *op void VToolLinePoint::RefreshGeometry() { VToolSinglePoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject(m_id)); - QPointF const point = static_cast(*VDrawTool::data.GeometricObject(m_id)); - QPointF const basePoint = static_cast(*VDrawTool::data.GeometricObject(basePointId)); + auto const point = static_cast(*VDrawTool::data.GeometricObject(m_id)); + auto const basePoint = static_cast(*VDrawTool::data.GeometricObject(basePointId)); QLineF const line(basePoint - point, QPointF()); mainLine->setLine(line); mainLine->setVisible(not line.isNull()); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp index 66ecc5fb5..d0a447bb8 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp @@ -34,8 +34,10 @@ #include "../../../../dialogs/tools/dialogpointfromarcandtangent.h" #include "../../../../dialogs/tools/dialogtool.h" -#include "../../../../visualization/visualization.h" #include "../../../../visualization/line/vistoolpointfromarcandtangent.h" +#include "../../../../visualization/visualization.h" +#include "../../../vabstracttool.h" +#include "../../vdrawtool.h" #include "../ifc/exception/vexception.h" #include "../ifc/exception/vexceptionobjecterror.h" #include "../ifc/ifcdef.h" @@ -44,8 +46,6 @@ #include "../vgeometry/vpointf.h" #include "../vpatterndb/vcontainer.h" #include "../vwidgets/vmaingraphicsscene.h" -#include "../../../vabstracttool.h" -#include "../../vdrawtool.h" #include "vtoolsinglepoint.h" template class QSharedPointer; @@ -55,10 +55,10 @@ const QString VToolPointFromArcAndTangent::ToolType = QStringLiteral("pointFromA //--------------------------------------------------------------------------------------------------------------------- VToolPointFromArcAndTangent::VToolPointFromArcAndTangent(const VToolPointFromArcAndTangentInitData &initData, QGraphicsItem *parent) - :VToolSinglePoint(initData.doc, initData.data, initData.id, initData.notes, parent), - arcId(initData.arcId), - tangentPointId(initData.tangentPointId), - crossPoint(initData.crossPoint) + : VToolSinglePoint(initData.doc, initData.data, initData.id, initData.notes, parent), + arcId(initData.arcId), + tangentPointId(initData.tangentPointId), + crossPoint(initData.crossPoint) { ToolCreation(initData.typeCreation); } @@ -112,15 +112,16 @@ auto VToolPointFromArcAndTangent::Create(VToolPointFromArcAndTangentInitData ini const VPointF tPoint = *initData.data->GeometricObject(initData.tangentPointId); QPointF point; - const bool success = VToolPointFromArcAndTangent::FindPoint(static_cast(tPoint), &arc, - initData.crossPoint, &point); + const bool success = + VToolPointFromArcAndTangent::FindPoint(static_cast(tPoint), &arc, initData.crossPoint, &point); if (not success) { const QString errorMsg = tr("Error calculating point '%1'. Tangent to arc '%2' from point '%3' cannot be found") - .arg(initData.name, arc.ObjectName(), tPoint.name()); - VAbstractApplication::VApp()->IsPedantic() ? throw VExceptionObjectError(errorMsg) : - qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; + .arg(initData.name, arc.ObjectName(), tPoint.name()); + VAbstractApplication::VApp()->IsPedantic() + ? throw VExceptionObjectError(errorMsg) + : qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; } auto *p = new VPointF(point, initData.name, initData.mx, initData.my); @@ -160,17 +161,17 @@ auto VToolPointFromArcAndTangent::FindPoint(const QPointF &p, const VArc *arc, c SCASSERT(intersectionPoint != nullptr) QPointF p1, p2; - const QPointF center = static_cast(arc->GetCenter()); + const auto center = static_cast(arc->GetCenter()); const qreal radius = arc->GetRadius(); - const int res = VGObject::ContactPoints (p, center, radius, p1, p2); + const int res = VGObject::ContactPoints(p, center, radius, p1, p2); QLineF r1Arc(center, p1); - r1Arc.setLength(radius+10); + r1Arc.setLength(radius + 10); QLineF r2Arc(center, p2); - r2Arc.setLength(radius+10); + r2Arc.setLength(radius + 10); - switch(res) + switch (res) { case 2: { @@ -188,7 +189,7 @@ auto VToolPointFromArcAndTangent::FindPoint(const QPointF &p, const VArc *arc, c ++localRes; } - switch(localRes) + switch (localRes) { case 2: *intersectionPoint = (pType == CrossCirclesPoint::FirstPoint ? p1 : p2); @@ -261,10 +262,10 @@ void VToolPointFromArcAndTangent::ShowContextMenu(QGraphicsSceneContextMenuEvent { ContextMenu(event, id); } - catch(const VExceptionToolWasDeleted &e) + catch (const VExceptionToolWasDeleted &e) { Q_UNUSED(e) - return;//Leave this method immediately!!! + return; // Leave this method immediately!!! } } @@ -298,7 +299,7 @@ void VToolPointFromArcAndTangent::SaveDialog(QDomElement &domElement, QList(dialogTool->GetCrossCirclesPoint()))); doc->SetAttributeOrRemoveIf(domElement, AttrNotes, dialogTool->GetNotes(), - [](const QString ¬es) noexcept {return notes.isEmpty();}); + [](const QString ¬es) noexcept { return notes.isEmpty(); }); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp index 2a46eb7ce..ed9888514 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp @@ -33,7 +33,11 @@ #include #include "../../../../dialogs/tools/dialogpointofintersectionarcs.h" +#include "../../../../dialogs/tools/dialogtool.h" #include "../../../../visualization/line/vistoolpointofintersectionarcs.h" +#include "../../../../visualization/visualization.h" +#include "../../../vabstracttool.h" +#include "../../vdrawtool.h" #include "../ifc/exception/vexception.h" #include "../ifc/exception/vexceptionobjecterror.h" #include "../ifc/ifcdef.h" @@ -42,10 +46,6 @@ #include "../vgeometry/vpointf.h" #include "../vpatterndb/vcontainer.h" #include "../vwidgets/vmaingraphicsscene.h" -#include "../../../../dialogs/tools/dialogtool.h" -#include "../../../../visualization/visualization.h" -#include "../../../vabstracttool.h" -#include "../../vdrawtool.h" #include "vtoolsinglepoint.h" template class QSharedPointer; @@ -55,10 +55,10 @@ const QString VToolPointOfIntersectionArcs::ToolType = QStringLiteral("pointOfIn //--------------------------------------------------------------------------------------------------------------------- VToolPointOfIntersectionArcs::VToolPointOfIntersectionArcs(const VToolPointOfIntersectionArcsInitData &initData, QGraphicsItem *parent) - :VToolSinglePoint(initData.doc, initData.data, initData.id, initData.notes, parent), - firstArcId(initData.firstArcId), - secondArcId(initData.secondArcId), - crossPoint(initData.pType) + : VToolSinglePoint(initData.doc, initData.data, initData.id, initData.notes, parent), + firstArcId(initData.firstArcId), + secondArcId(initData.secondArcId), + crossPoint(initData.pType) { ToolCreation(initData.typeCreation); } @@ -118,9 +118,10 @@ auto VToolPointOfIntersectionArcs::Create(VToolPointOfIntersectionArcsInitData i if (not success) { const QString errorMsg = tr("Error calculating point '%1'. Arcs '%2' and '%3' have no point of intersection") - .arg(initData.name, firstArc->ObjectName(), secondArc->ObjectName()); - VAbstractApplication::VApp()->IsPedantic() ? throw VExceptionObjectError(errorMsg) : - qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; + .arg(initData.name, firstArc->ObjectName(), secondArc->ObjectName()); + VAbstractApplication::VApp()->IsPedantic() + ? throw VExceptionObjectError(errorMsg) + : qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; } auto *p = new VPointF(point, initData.name, initData.mx, initData.my); @@ -160,41 +161,41 @@ auto VToolPointOfIntersectionArcs::FindPoint(const VArc *arc1, const VArc *arc2, SCASSERT(intersectionPoint != nullptr) QPointF p1, p2; - const QPointF centerArc1 = static_cast(arc1->GetCenter()); - const QPointF centerArc2 = static_cast(arc2->GetCenter()); + const auto centerArc1 = static_cast(arc1->GetCenter()); + const auto centerArc2 = static_cast(arc2->GetCenter()); const int res = VGObject::IntersectionCircles(centerArc1, arc1->GetRadius(), centerArc2, arc2->GetRadius(), p1, p2); QLineF r1Arc1(centerArc1, p1); - r1Arc1.setLength(r1Arc1.length()+10); + r1Arc1.setLength(r1Arc1.length() + 10); QLineF r1Arc2(centerArc2, p1); - r1Arc2.setLength(r1Arc2.length()+10); + r1Arc2.setLength(r1Arc2.length() + 10); QLineF r2Arc1(centerArc1, p2); - r2Arc1.setLength(r2Arc1.length()+10); + r2Arc1.setLength(r2Arc1.length() + 10); QLineF r2Arc2(centerArc2, p2); - r2Arc2.setLength(r2Arc2.length()+10); + r2Arc2.setLength(r2Arc2.length() + 10); - switch(res) + switch (res) { case 2: { int localRes = 0; bool flagP1 = false; - if (arc1->IsIntersectLine(r1Arc1) && arc2->IsIntersectLine(r1Arc2)) + if (arc1->IsIntersectLine(r1Arc1) && arc2->IsIntersectLine(r1Arc2)) { ++localRes; flagP1 = true; } - if (arc1->IsIntersectLine(r2Arc1) && arc2->IsIntersectLine(r2Arc2)) + if (arc1->IsIntersectLine(r2Arc1) && arc2->IsIntersectLine(r2Arc2)) { ++localRes; } - switch(localRes) + switch (localRes) { case 2: if (pType == CrossCirclesPoint::FirstPoint) @@ -284,10 +285,10 @@ void VToolPointOfIntersectionArcs::ShowContextMenu(QGraphicsSceneContextMenuEven { ContextMenu(event, id); } - catch(const VExceptionToolWasDeleted &e) + catch (const VExceptionToolWasDeleted &e) { Q_UNUSED(e) - return;//Leave this method immediately!!! + return; // Leave this method immediately!!! } } @@ -319,7 +320,7 @@ void VToolPointOfIntersectionArcs::SaveDialog(QDomElement &domElement, QListSetAttribute(domElement, AttrSecondArc, QString().setNum(dialogTool->GetSecondArcId())); doc->SetAttribute(domElement, AttrCrossPoint, QString().setNum(static_cast(dialogTool->GetCrossArcPoint()))); doc->SetAttributeOrRemoveIf(domElement, AttrNotes, dialogTool->GetNotes(), - [](const QString ¬es) noexcept {return notes.isEmpty();}); + [](const QString ¬es) noexcept { return notes.isEmpty(); }); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp index fa630936c..48be73fd5 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp @@ -584,7 +584,7 @@ void VNodePoint::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) }; QAction *selectedAction = menu.exec(event->screenPos()); - ContextMenuOption const selectedOption = static_cast( + auto const selectedOption = static_cast( contextMenu.key(selectedAction, static_cast(ContextMenuOption::NoSelection))); Q_STATIC_ASSERT_X(static_cast(ContextMenuOption::LAST_ONE_DO_NOT_USE) == 35, "Not all options were handled."); diff --git a/src/libs/vtools/tools/vtooluniondetails.cpp b/src/libs/vtools/tools/vtooluniondetails.cpp index 38aa20139..09c762629 100644 --- a/src/libs/vtools/tools/vtooluniondetails.cpp +++ b/src/libs/vtools/tools/vtooluniondetails.cpp @@ -503,7 +503,7 @@ auto AddNodeArc(const VPieceNode &node, const VToolUnionDetailsInitData &initDat if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - const QPointF p = static_cast(*initData.data->GeometricObject(pRotate)); + const auto p = static_cast(*initData.data->GeometricObject(pRotate)); BiasRotatePoint(&p1, dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); @@ -554,7 +554,7 @@ auto AddNodeElArc(const VPieceNode &node, const VToolUnionDetailsInitData &initD if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - const QPointF p = static_cast(*initData.data->GeometricObject(pRotate)); + const auto p = static_cast(*initData.data->GeometricObject(pRotate)); BiasRotatePoint(&p1, dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); @@ -609,7 +609,7 @@ auto AddNodeSpline(const VPieceNode &node, const VToolUnionDetailsInitData &init if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - const QPointF p = static_cast(*initData.data->GeometricObject(pRotate)); + const auto p = static_cast(*initData.data->GeometricObject(pRotate)); BiasRotatePoint(p1.data(), dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); @@ -658,7 +658,7 @@ auto AddNodeSplinePath(const VPieceNode &node, const VToolUnionDetailsInitData & QScopedPointer const p4(new VPointF(spline.GetP4())); if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - const QPointF p = static_cast(*initData.data->GeometricObject(pRotate)); + const auto p = static_cast(*initData.data->GeometricObject(pRotate)); BiasRotatePoint(p1.data(), dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); @@ -943,7 +943,7 @@ void UpdateNodeArc(VContainer *data, const VPieceNode &node, QVector &c if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - const QPointF p = static_cast(*data->GeometricObject(pRotate)); + const auto p = static_cast(*data->GeometricObject(pRotate)); BiasRotatePoint(&p1, dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); @@ -970,7 +970,7 @@ void UpdateNodeElArc(VContainer *data, const VPieceNode &node, QVector if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - const QPointF p = static_cast(*data->GeometricObject(pRotate)); + const auto p = static_cast(*data->GeometricObject(pRotate)); BiasRotatePoint(&p1, dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); @@ -1000,7 +1000,7 @@ void UpdateNodeSpline(VContainer *data, const VPieceNode &node, QVector if (not qFuzzyIsNull(dx) || not qFuzzyIsNull(dy) || pRotate != NULL_ID) { - const QPointF p = static_cast(*data->GeometricObject(pRotate)); + const auto p = static_cast(*data->GeometricObject(pRotate)); BiasRotatePoint(p1.data(), dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); @@ -1033,7 +1033,7 @@ void UpdateNodeSplinePath(VContainer *data, const VPieceNode &node, QVector(*data->GeometricObject(pRotate)); + const auto p = static_cast(*data->GeometricObject(pRotate)); BiasRotatePoint(p1.data(), dx, dy, p, angle); BiasRotatePoint(&p2, dx, dy, p, angle); diff --git a/src/libs/vtools/visualization/line/vistoolpointfromarcandtangent.cpp b/src/libs/vtools/visualization/line/vistoolpointfromarcandtangent.cpp index c101a57be..db31d28ac 100644 --- a/src/libs/vtools/visualization/line/vistoolpointfromarcandtangent.cpp +++ b/src/libs/vtools/visualization/line/vistoolpointfromarcandtangent.cpp @@ -88,7 +88,7 @@ void VisToolPointFromArcAndTangent::VisualMode(quint32 id) void VisToolPointFromArcAndTangent::FindRays(const QPointF &p, const VArc *arc) { QPointF p1, p2; - const QPointF center = static_cast(arc->GetCenter()); + const auto center = static_cast(arc->GetCenter()); const qreal radius = arc->GetRadius(); const int res = VGObject::ContactPoints(p, center, radius, p1, p2); diff --git a/src/libs/vtools/visualization/path/vistoolcubicbezierpath.cpp b/src/libs/vtools/visualization/path/vistoolcubicbezierpath.cpp index 883e03c2e..0f9c4cc0b 100644 --- a/src/libs/vtools/visualization/path/vistoolcubicbezierpath.cpp +++ b/src/libs/vtools/visualization/path/vistoolcubicbezierpath.cpp @@ -239,7 +239,7 @@ void VisToolCubicBezierPath::Creating(const QVector &pathPoints, vsizet { const VPointF &p1 = pathPoints.at(subSplPoints + pointsLeft - 2); auto p2 = static_cast(pathPoints.at(subSplPoints + pointsLeft - 1)); - const QPointF p3 = static_cast(pathPoints.at(subSplPoints + pointsLeft)); + const auto p3 = static_cast(pathPoints.at(subSplPoints + pointsLeft)); if (subSplCount >= 1) { diff --git a/src/libs/vwidgets/fancytabbar/stylehelper.cpp b/src/libs/vwidgets/fancytabbar/stylehelper.cpp index 3af528d64..d6f1eaa31 100644 --- a/src/libs/vwidgets/fancytabbar/stylehelper.cpp +++ b/src/libs/vwidgets/fancytabbar/stylehelper.cpp @@ -147,7 +147,7 @@ void StyleHelper::drawIconWithShadow(const QIcon &icon, const QRect &rect, QPain for (int x = 0; x < im.width(); ++x) { QRgb const pixel = *scanLine; - char const intensity = static_cast(qGray(pixel)); + auto const intensity = static_cast(qGray(pixel)); *scanLine = qRgba(intensity, intensity, intensity, qAlpha(pixel)); ++scanLine; } diff --git a/src/libs/vwidgets/vplaintextedit.cpp b/src/libs/vwidgets/vplaintextedit.cpp index 1d0b16b7b..932592894 100644 --- a/src/libs/vwidgets/vplaintextedit.cpp +++ b/src/libs/vwidgets/vplaintextedit.cpp @@ -104,7 +104,7 @@ void VPlainTextEdit::MatchParentheses() QList const selections; setExtraSelections(selections); - VTextBlockData *data = static_cast(textCursor().block().userData()); + auto *data = static_cast(textCursor().block().userData()); if (data) {