From a5bf891d433b0b93ad3b7ac6e6ae7c79c67dd9aa Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 12 Aug 2023 12:03:28 +0300 Subject: [PATCH] Increased requirement for minimal Qt version. --- ChangeLog.txt | 1 + Valentina.pro | 6 +- qbs/modules/buildconfig/buildconfig.qbs | 5 +- .../puzzle/carousel/vpcarrouselpiecelist.cpp | 7 +- .../puzzle/dialogs/dialogsavemanuallayout.cpp | 4 - src/app/puzzle/layout/vplayout.cpp | 4 +- src/app/puzzle/main.cpp | 2 +- src/app/puzzle/scene/vpgraphicspiece.cpp | 12 +- .../puzzle/scene/vpgraphicspiececontrols.cpp | 13 +-- src/app/puzzle/scene/vpmaingraphicsview.cpp | 14 +-- src/app/puzzle/undocommands/vpundocommand.cpp | 4 - src/app/puzzle/vpapplication.cpp | 12 +- src/app/puzzle/vpmainwindow.cpp | 24 ++-- src/app/puzzle/vpsettings.cpp | 4 - src/app/puzzle/vptilefactory.cpp | 4 - src/app/puzzle/xml/vplayoutfilereader.cpp | 2 +- src/app/tape/dialogs/dialogmdatabase.cpp | 4 +- src/app/tape/main.cpp | 2 +- src/app/tape/mapplication.cpp | 11 +- src/app/tape/tmainwindow.cpp | 4 - src/app/tape/vtapesettings.cpp | 4 - src/app/valentina/core/vapplication.cpp | 6 +- src/app/valentina/core/vcmdexport.cpp | 4 +- .../core/vtooloptionspropertybrowser.cpp | 4 - .../dialogs/dialogfinalmeasurements.cpp | 5 +- .../valentina/dialogs/dialogsavelayout.cpp | 4 - src/app/valentina/dialogs/vwidgetdetails.cpp | 4 - src/app/valentina/dialogs/vwidgetgroups.cpp | 2 +- src/app/valentina/main.cpp | 2 +- src/app/valentina/mainwindow.cpp | 10 +- src/app/valentina/xml/vpattern.cpp | 8 +- src/libs/fervor/fvupdater.cpp | 4 - src/libs/ifc/ifcdef.cpp | 4 - src/libs/ifc/ifcdef.h | 3 - src/libs/ifc/xml/vabstractpattern.cpp | 4 - src/libs/ifc/xml/vdomdocument.h | 3 - src/libs/ifc/xml/vlayoutconverter.cpp | 7 +- src/libs/ifc/xml/vpatternconverter.cpp | 4 - src/libs/ifc/xml/vvitconverter.cpp | 4 - src/libs/ifc/xml/vvstconverter.cpp | 4 - src/libs/qmuparser/qmudef.h | 58 ---------- src/libs/qmuparser/qmuparsercallback_p.h | 5 +- src/libs/qmuparser/text.h | 4 - src/libs/vdxf/libdxfrw/drw_entities.cpp | 4 - src/libs/vdxf/libdxfrw/drw_interface.h | 4 - src/libs/vdxf/libdxfrw/libdxfrw.cpp | 3 - src/libs/vdxf/vdxfengine.cpp | 26 ++--- src/libs/vdxf/vdxfpaintdevice.cpp | 2 - src/libs/vformat/vmeasurements.cpp | 4 - src/libs/vformat/vsinglelineoutlinechar.cpp | 6 +- src/libs/vgeometry/vabstractarc_p.h | 5 +- src/libs/vgeometry/vabstractcurve.cpp | 12 +- src/libs/vgeometry/vabstractcurve_p.h | 3 - src/libs/vgeometry/varc_p.h | 3 - src/libs/vgeometry/vcubicbezier_p.h | 3 - src/libs/vgeometry/vcubicbezierpath.cpp | 3 +- src/libs/vgeometry/vcubicbezierpath_p.h | 3 - src/libs/vgeometry/vellipticalarc.cpp | 2 +- src/libs/vgeometry/vellipticalarc_p.h | 4 +- src/libs/vgeometry/vgobject_p.h | 3 - src/libs/vgeometry/vplacelabelitem_p.h | 3 - src/libs/vgeometry/vpointf.h | 3 - src/libs/vgeometry/vpointf_p.h | 5 +- src/libs/vgeometry/vsplinepath.cpp | 17 ++- src/libs/vhpgl/vhpglengine.cpp | 4 - src/libs/vlayout/vabstractpiece.cpp | 36 +++--- src/libs/vlayout/vabstractpiece.h | 18 +-- src/libs/vlayout/vabstractpiece_p.h | 4 - src/libs/vlayout/vbestsquare_p.h | 5 +- src/libs/vlayout/vcontour.cpp | 6 +- src/libs/vlayout/vcontour_p.h | 3 - src/libs/vlayout/vlayoutexporter.cpp | 9 +- src/libs/vlayout/vlayoutgenerator.cpp | 2 +- src/libs/vlayout/vlayoutpiece.cpp | 14 +-- src/libs/vlayout/vlayoutpiece_p.h | 7 +- src/libs/vlayout/vlayoutpiecepath_p.h | 4 - src/libs/vlayout/vlayoutpoint.h | 4 - src/libs/vlayout/vposition.cpp | 2 +- src/libs/vlayout/vposter.cpp | 5 - src/libs/vlayout/vprintlayout.cpp | 3 +- src/libs/vlayout/vrawsapoint.h | 3 - src/libs/vlayout/vsapoint.h | 4 - src/libs/vlayout/vtextmanager.cpp | 16 +-- src/libs/vmisc/backport/qoverload.h | 4 - src/libs/vmisc/backport/text.h | 4 - src/libs/vmisc/compatibility.h | 104 ------------------ src/libs/vmisc/def.cpp | 4 - src/libs/vmisc/def.h | 19 ---- src/libs/vmisc/diagnostic.h | 96 ---------------- src/libs/vmisc/fpm/math.hpp | 4 - src/libs/vmisc/qxtcsvmodel.cpp | 4 - src/libs/vmisc/svgfont/vsvgfont_p.h | 4 +- src/libs/vmisc/svgfont/vsvgfontdatabase.cpp | 4 - src/libs/vmisc/svgfont/vsvgfontengine_p.h | 4 +- src/libs/vmisc/svgfont/vsvgglyph_p.h | 4 +- src/libs/vmisc/svgfont/vsvgpathtokenizer.cpp | 4 - src/libs/vmisc/theme/vmanuallayoutstyle.cpp | 4 - src/libs/vmisc/theme/vpatternpiecestyle.cpp | 4 - src/libs/vmisc/theme/vtoolstyle.cpp | 4 - src/libs/vmisc/vabstractapplication.cpp | 13 +-- src/libs/vmisc/vcommonsettings.cpp | 12 +- src/libs/vmisc/vlockguard.h | 4 - src/libs/vmisc/vmisc.pri | 1 - src/libs/vmisc/vmisc.qbs | 1 - src/libs/vmisc/vtablesearch.cpp | 3 +- src/libs/vmisc/vtextcodec.cpp | 5 +- src/libs/vmisc/vvalentinasettings.cpp | 4 - src/libs/vobj/delaunay.cpp | 3 - src/libs/vobj/vobjengine.cpp | 4 - src/libs/vobj/vobjpaintdevice.cpp | 2 - .../floatItemData/vabstractfloatitemdata_p.h | 3 - .../floatItemData/vgrainlinedata_p.h | 3 - .../floatItemData/vpatternlabeldata_p.h | 3 - src/libs/vpatterndb/variables/vincrement_p.h | 3 - .../vpatterndb/variables/vmeasurement_p.h | 3 - src/libs/vpatterndb/vcontainer.h | 3 - src/libs/vpatterndb/vformula_p.h | 3 - src/libs/vpatterndb/vnodedetail_p.h | 3 - src/libs/vpatterndb/vpassmark.cpp | 26 ++--- src/libs/vpatterndb/vpiece.cpp | 14 +-- src/libs/vpatterndb/vpiece_p.h | 3 - src/libs/vpatterndb/vpiecenode_p.h | 3 - src/libs/vpatterndb/vpiecepath.cpp | 12 +- src/libs/vpatterndb/vpiecepath_p.h | 3 - .../plugins/vfilepropertyeditor.h | 4 - .../vabstractpropertyfactory.h | 3 - .../vpropertyexplorer/vpropertyformview_p.h | 3 - .../vpropertyexplorer/vpropertyformwidget_p.h | 3 - .../vpropertyexplorer/vwidgetproperty_p.h | 3 - src/libs/vtest/abstracttest.cpp | 2 +- .../dialogs/tools/dialogflippingbyline.cpp | 6 - .../vbackgroundimagecontrols.cpp | 9 +- .../flipping/vtoolflippingbyline.cpp | 3 - .../tools/drawTools/operation/vtoolmove.cpp | 7 +- .../drawTools/operation/vtoolrotation.cpp | 3 - src/libs/vtools/tools/vabstracttool.h | 3 - .../vtools/undocommands/savepieceoptions.cpp | 30 +++-- .../vtools/undocommands/savetooloptions.cpp | 13 +-- .../line/operation/vistoolmove.cpp | 3 - .../line/operation/vistoolrotation.cpp | 3 - .../path/vistoolcubicbezierpath.cpp | 3 +- .../visualization/path/vistoolpiece.cpp | 4 +- .../visualization/path/vistoolpiecepath.cpp | 3 +- src/libs/vwidgets/global.cpp | 3 +- src/libs/vwidgets/vabstractmainwindow.cpp | 3 +- src/libs/vwidgets/vabstractmainwindow.h | 4 - src/libs/vwidgets/vgraphicssimpletextitem.h | 4 - .../CollectionTest/tst_tapecommandline.cpp | 4 - .../tst_valentinacommandline.cpp | 4 - .../tst_tslocaletranslation.cpp | 4 - src/test/ValentinaTest/tst_dxf.cpp | 25 ++--- src/test/ValentinaTest/tst_vabstractpiece.cpp | 6 +- src/test/ValentinaTest/tst_varc.cpp | 4 +- src/test/ValentinaTest/tst_vellipticalarc.cpp | 8 +- 154 files changed, 218 insertions(+), 930 deletions(-) delete mode 100644 src/libs/vmisc/diagnostic.h diff --git a/ChangeLog.txt b/ChangeLog.txt index 085ca7902..57bb3b47d 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -33,6 +33,7 @@ - Export to HP-GL format. - Fix crash after using tool Union of details. - Tool box redesign. +- Increased requirement for minimal Qt version. # Valentina 0.7.52 September 12, 2022 - Fix crash when default locale is ru. diff --git a/Valentina.pro b/Valentina.pro index 01558d0f6..b77394d6f 100644 --- a/Valentina.pro +++ b/Valentina.pro @@ -1,9 +1,9 @@ include(common.pri) -#Check if Qt version >= 5.4.0 -!minQtVersion(5, 4, 0) { +#Check if Qt version >= 5.6.0 +!minQtVersion(5, 6, 0) { message("Cannot build Valentina with Qt version $${QT_VERSION}.") - error("Use at least Qt 5.4.0.") + error("Use at least Qt 5.6.0.") } #These checks need because we can quote all paths that contain space. diff --git a/qbs/modules/buildconfig/buildconfig.qbs b/qbs/modules/buildconfig/buildconfig.qbs index 73108c58a..325f8ca1a 100644 --- a/qbs/modules/buildconfig/buildconfig.qbs +++ b/qbs/modules/buildconfig/buildconfig.qbs @@ -175,10 +175,7 @@ Module { if (Qt.core.versionMinor >= 7) // Qt 5.7 return "10.8"; - if (Qt.core.versionMinor >= 4) // Qt 5.4 - return "10.7"; - - return "10.6"; + return "10.7"; } return undefined; diff --git a/src/app/puzzle/carousel/vpcarrouselpiecelist.cpp b/src/app/puzzle/carousel/vpcarrouselpiecelist.cpp index a8f6be62e..b91c0fa78 100644 --- a/src/app/puzzle/carousel/vpcarrouselpiecelist.cpp +++ b/src/app/puzzle/carousel/vpcarrouselpiecelist.cpp @@ -145,7 +145,8 @@ void VPCarrouselPieceList::mouseMoveEvent(QMouseEvent *event) if (((event->buttons() & Qt::LeftButton) != 0U) && ((event->pos() - m_dragStart).manhattanLength() >= QApplication::startDragDistance()) && (selectedItems().count() > 0) && - (not m_pieceList.isEmpty() && ConstFirst(m_pieceList)->Sheet() == nullptr)) // only if it's from unplaced pieces + (not m_pieceList.isEmpty() && + m_pieceList.constFirst()->Sheet() == nullptr)) // only if it's from unplaced pieces { startDrag(Qt::MoveAction); } @@ -262,13 +263,13 @@ void VPCarrouselPieceList::contextMenuEvent(QContextMenuEvent *event) QAction *removeAction = menu.addAction(tr("Remove from Sheet")); removeAction->setVisible(false); - if (not m_pieceList.isEmpty() && ConstFirst(m_pieceList)->Sheet() == nullptr) + if (not m_pieceList.isEmpty() && m_pieceList.constFirst()->Sheet() == nullptr) { moveAction->setVisible(true); deleteAction->setVisible(true); } - if (not m_pieceList.isEmpty() && ConstFirst(m_pieceList)->Sheet() != nullptr) + if (not m_pieceList.isEmpty() && m_pieceList.constFirst()->Sheet() != nullptr) { removeAction->setVisible(true); } diff --git a/src/app/puzzle/dialogs/dialogsavemanuallayout.cpp b/src/app/puzzle/dialogs/dialogsavemanuallayout.cpp index 47908cfc8..b2618780f 100644 --- a/src/app/puzzle/dialogs/dialogsavemanuallayout.cpp +++ b/src/app/puzzle/dialogs/dialogsavemanuallayout.cpp @@ -38,10 +38,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace { QT_WARNING_PUSH diff --git a/src/app/puzzle/layout/vplayout.cpp b/src/app/puzzle/layout/vplayout.cpp index 7fedb1e18..027bc93e6 100644 --- a/src/app/puzzle/layout/vplayout.cpp +++ b/src/app/puzzle/layout/vplayout.cpp @@ -197,7 +197,7 @@ auto VPLayout::IsSheetsUniform() const -> bool return true; } - const VPSheetPtr &sheet = ConstFirst(sheets); + const VPSheetPtr &sheet = sheets.constFirst(); if (sheet.isNull()) { return false; @@ -312,7 +312,7 @@ void VPLayout::SetFocusedSheet(const VPSheetPtr &focusedSheet) } else { - m_focusedSheet = focusedSheet.isNull() ? ConstFirst(m_sheets) : focusedSheet; + m_focusedSheet = focusedSheet.isNull() ? m_sheets.constFirst() : focusedSheet; } emit ActiveSheetChanged(m_focusedSheet); diff --git a/src/app/puzzle/main.cpp b/src/app/puzzle/main.cpp index e3c0b992e..9da485e01 100644 --- a/src/app/puzzle/main.cpp +++ b/src/app/puzzle/main.cpp @@ -93,7 +93,7 @@ auto main(int argc, char *argv[]) -> int VPApplication app(argc, argv); app.InitOptions(); - QT_REQUIRE_VERSION(argc, argv, "5.4.0") // clazy:exclude=qstring-arg,qstring-allocations NOLINT + QT_REQUIRE_VERSION(argc, argv, "5.6.0") // clazy:exclude=qstring-arg,qstring-allocations NOLINT #if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) VPApplication::setDesktopFileName(QStringLiteral("ua.com.smart-pattern.puzzle.desktop")); diff --git a/src/app/puzzle/scene/vpgraphicspiece.cpp b/src/app/puzzle/scene/vpgraphicspiece.cpp index d4e57fb2f..fcb84f138 100644 --- a/src/app/puzzle/scene/vpgraphicspiece.cpp +++ b/src/app/puzzle/scene/vpgraphicspiece.cpp @@ -57,10 +57,6 @@ #include "undocommands/vpundopiecemove.h" #include "vpiecegrainline.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #include QT_WARNING_PUSH @@ -659,7 +655,7 @@ void VPGraphicsPiece::PaintSeamLine(QPainter *painter, const VPPiecePtr &piece) QVector seamLinePoints = piece->GetMappedContourPoints(); if (!seamLinePoints.isEmpty()) { - m_seamLine.moveTo(ConstFirst(seamLinePoints)); + m_seamLine.moveTo(seamLinePoints.constFirst()); for (int i = 1; i < seamLinePoints.size(); i++) { m_seamLine.lineTo(seamLinePoints.at(i)); @@ -684,7 +680,7 @@ void VPGraphicsPiece::PaintCuttingLine(QPainter *painter, const VPPiecePtr &piec QVector cuttingLinepoints = piece->GetMappedSeamAllowancePoints(); if (!cuttingLinepoints.isEmpty()) { - m_cuttingLine.moveTo(ConstFirst(cuttingLinepoints)); + m_cuttingLine.moveTo(cuttingLinepoints.constFirst()); for (int i = 1; i < cuttingLinepoints.size(); i++) { m_cuttingLine.lineTo(cuttingLinepoints.at(i)); @@ -773,7 +769,7 @@ void VPGraphicsPiece::PaintStickyPath(QPainter *painter) { if (not m_stickyPoints.isEmpty()) { - m_stickyPath.moveTo(ConstFirst(m_stickyPoints)); + m_stickyPath.moveTo(m_stickyPoints.constFirst()); for (int i = 1; i < m_stickyPoints.size(); i++) { m_stickyPath.lineTo(m_stickyPoints.at(i)); @@ -833,7 +829,7 @@ void VPGraphicsPiece::GroupMove(const QPointF &pos) if (pieces.size() == 1) { - const VPPiecePtr &p = ConstFirst(pieces); + const VPPiecePtr &p = pieces.constFirst(); auto *command = new VPUndoPieceMove(piece, newPos.x(), newPos.y(), m_allowChangeMerge); layout->UndoStack()->push(command); diff --git a/src/app/puzzle/scene/vpgraphicspiececontrols.cpp b/src/app/puzzle/scene/vpgraphicspiececontrols.cpp index 45b2c8da2..5a5c70893 100644 --- a/src/app/puzzle/scene/vpgraphicspiececontrols.cpp +++ b/src/app/puzzle/scene/vpgraphicspiececontrols.cpp @@ -43,15 +43,10 @@ #include "../layout/vpsheet.h" #include "../undocommands/vpundooriginmove.h" #include "../undocommands/vpundopiecerotate.h" -#include "../vmisc/compatibility.h" #include "../vmisc/theme/vscenestylesheet.h" #include "../vmisc/theme/vtheme.h" #include "../vwidgets/global.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace { constexpr qreal penWidth = 2; @@ -469,7 +464,7 @@ void VPGraphicsPieceControls::mouseMoveEvent(QGraphicsSceneMouseEvent *event) if (pieces.size() == 1) { - auto *command = new VPUndoPieceRotate(ConstFirst(pieces), rotationOrigin, rotateOn, m_rotationSum, + auto *command = new VPUndoPieceRotate(pieces.constFirst(), rotationOrigin, rotateOn, m_rotationSum, allowChangeMerge); layout->UndoStack()->push(command); } @@ -576,7 +571,6 @@ void VPGraphicsPieceControls::InitPixmaps() const QString resource = QStringLiteral("icon"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) if (QGuiApplication::primaryScreen()->devicePixelRatio() >= 2) { const QString fileName2x = QStringLiteral("32x32/%1@2x.png").arg(imageName); @@ -590,10 +584,7 @@ void VPGraphicsPieceControls::InitPixmaps() m_handlePixmaps.insert(type, VTheme::GetPixmapResource(resource, fileName)); m_handleHoverPixmaps.insert(type, VTheme::GetPixmapResource(resource, fileNameHover)); } -#else - m_handlePixmaps.insert(type, VTheme::GetPixmapResource(resource, fileName)); - m_handleHoverPixmaps.insert(type, VTheme::GetPixmapResource(resource, fileNameHover)); -#endif + QPainterPath p = PixmapToPainterPath(m_handlePixmaps.value(type)); p.setFillRule(Qt::WindingFill); p.closeSubpath(); diff --git a/src/app/puzzle/scene/vpmaingraphicsview.cpp b/src/app/puzzle/scene/vpmaingraphicsview.cpp index 4c6025775..86bb02ba6 100644 --- a/src/app/puzzle/scene/vpmaingraphicsview.cpp +++ b/src/app/puzzle/scene/vpmaingraphicsview.cpp @@ -49,10 +49,6 @@ #include "../undocommands/vpundopiecerotate.h" #include "../undocommands/vpundoremovesheet.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #include QT_WARNING_PUSH @@ -466,7 +462,7 @@ void VPMainGraphicsView::RotatePiecesByAngle(qreal angle) if (pieces.size() == 1) { - auto *command = new VPUndoPieceRotate(ConstFirst(pieces), origin, angle, m_rotationSum, m_allowChangeMerge); + auto *command = new VPUndoPieceRotate(pieces.constFirst(), origin, angle, m_rotationSum, m_allowChangeMerge); layout->UndoStack()->push(command); } else if (pieces.size() > 1) @@ -500,7 +496,7 @@ void VPMainGraphicsView::TranslatePiecesOn(qreal dx, qreal dy) return; } - VPPiecePtr piece = ConstFirst(graphicsPieces)->GetPiece(); + VPPiecePtr piece = graphicsPieces.constFirst()->GetPiece(); if (piece.isNull()) { return; @@ -525,7 +521,7 @@ void VPMainGraphicsView::TranslatePiecesOn(qreal dx, qreal dy) QList pieces = PreparePieces(); if (pieces.size() == 1) { - const VPPiecePtr &p = ConstFirst(pieces); + const VPPiecePtr &p = pieces.constFirst(); auto *command = new VPUndoPieceMove(p, dx, dy, m_allowChangeMerge); layout->UndoStack()->push(command); @@ -627,7 +623,7 @@ void VPMainGraphicsView::ZValueMove(int move) if (selectedPieces.size() == 1) { - layout->UndoStack()->push(new VPUndoPieceZValueMove(ConstFirst(selectedPieces), zMove)); + layout->UndoStack()->push(new VPUndoPieceZValueMove(selectedPieces.constFirst(), zMove)); } else if (selectedPieces.size() > 1) { @@ -708,7 +704,7 @@ void VPMainGraphicsView::MovePiece(QKeyEvent *event) QList pieces = PreparePieces(); if (pieces.size() == 1) { - const VPPiecePtr &p = ConstFirst(pieces); + const VPPiecePtr &p = pieces.constFirst(); auto *command = new VPUndoPieceMove(p, m_stickyTranslateX, m_stickyTranslateY, m_allowChangeMerge); layout->UndoStack()->push(command); diff --git a/src/app/puzzle/undocommands/vpundocommand.cpp b/src/app/puzzle/undocommands/vpundocommand.cpp index c6f8786f0..ff7d9f749 100644 --- a/src/app/puzzle/undocommands/vpundocommand.cpp +++ b/src/app/puzzle/undocommands/vpundocommand.cpp @@ -27,10 +27,6 @@ *************************************************************************/ #include "vpundocommand.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - QT_WARNING_PUSH QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes") QT_WARNING_DISABLE_INTEL(1418) diff --git a/src/app/puzzle/vpapplication.cpp b/src/app/puzzle/vpapplication.cpp index 55dcedf33..4c5da2a44 100644 --- a/src/app/puzzle/vpapplication.cpp +++ b/src/app/puzzle/vpapplication.cpp @@ -41,10 +41,6 @@ #include "version.h" #include "vpmainwindow.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #include #include #include @@ -106,7 +102,7 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con #endif // defined(V_NO_ASSERT) #if defined(Q_OS_MAC) -#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) && QT_VERSION < QT_VERSION_CHECK(5, 7, 0) +#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) // Try hide very annoying, Qt related, warnings in Mac OS X // QNSView mouseDragged: Internal mouse button tracking invalid (missing Qt::LeftButton) // https://bugreports.qt.io/browse/QTBUG-42846 @@ -179,11 +175,9 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con case QtFatalMsg: vStdErr() << QApplication::translate("mNoisyHandler", "FATAL:") << msg << "\n"; break; -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) case QtInfoMsg: vStdOut() << QApplication::translate("mNoisyHandler", "INFO:") << msg << "\n"; break; -#endif default: break; } @@ -212,12 +206,10 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con messageBox.setWindowTitle(QApplication::translate("mNoisyHandler", "Fatal error")); messageBox.setIcon(QMessageBox::Critical); break; -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) case QtInfoMsg: messageBox.setWindowTitle(QApplication::translate("mNoisyHandler", "Information")); messageBox.setIcon(QMessageBox::Information); break; -#endif case QtDebugMsg: Q_UNREACHABLE(); //-V501 break; @@ -397,7 +389,7 @@ auto VPApplication::MainWindows() -> QList auto VPApplication::NewMainWindow() -> VPMainWindow * { VPCommandLinePtr cmd; - VPCommandLine::ProcessInstance(cmd, {ConstFirst(VPApplication::arguments())}); + VPCommandLine::ProcessInstance(cmd, {VPApplication::arguments().constFirst()}); return NewMainWindow(cmd); } diff --git a/src/app/puzzle/vpmainwindow.cpp b/src/app/puzzle/vpmainwindow.cpp index 7de08866c..09bd644a7 100644 --- a/src/app/puzzle/vpmainwindow.cpp +++ b/src/app/puzzle/vpmainwindow.cpp @@ -187,7 +187,7 @@ auto PreparePrinter(const QPrinterInfo &info, QPrinter::PrinterMode mode) -> QSh return {}; } - tmpInfo = QPrinterInfo::printerInfo(ConstFirst(list)); + tmpInfo = QPrinterInfo::printerInfo(list.constFirst()); } auto printer = QSharedPointer(new QPrinter(tmpInfo, mode)); @@ -706,7 +706,7 @@ void VPMainWindow::InitPropertyTabCurrentPiece() QList selectedPieces = SelectedPieces(); if (selectedPieces.size() == 1) { - const VPPiecePtr &selectedPiece = ConstFirst(selectedPieces); + const VPPiecePtr &selectedPiece = selectedPieces.constFirst(); if (not selectedPiece.isNull()) { selectedPiece->SetHideMainPath(not checked); @@ -723,7 +723,7 @@ void VPMainWindow::InitPropertyTabCurrentPiece() QList selectedPieces = SelectedPieces(); if (selectedPieces.size() == 1) { - const VPPiecePtr &selectedPiece = ConstFirst(selectedPieces); + const VPPiecePtr &selectedPiece = selectedPieces.constFirst(); if (not selectedPiece.isNull()) { if (selectedPiece->IsMirror() != checked) @@ -1212,7 +1212,7 @@ void VPMainWindow::SetPropertyTabCurrentPieceData() ui->groupBoxCurrentPieceSeamline->setVisible(true); ui->groupBoxCurrentPieceGeometry->setVisible(true); - const VPPiecePtr &selectedPiece = ConstFirst(selectedPieces); + const VPPiecePtr &selectedPiece = selectedPieces.constFirst(); // set the value to the current piece SetLineEditValue(ui->lineEditCurrentPieceName, selectedPiece->GetName()); @@ -1769,11 +1769,7 @@ void VPMainWindow::CreateWindowMenu(QMenu *menu) window->isWindowModified() ? title.replace(index, 3, QChar('*')) : title.replace(index, 3, QString()); } -#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) - QAction *action = menu->addAction(title, this, SLOT(ShowWindow())); -#else QAction *action = menu->addAction(title, this, &VPMainWindow::ShowWindow); -#endif // QT_VERSION < QT_VERSION_CHECK(5, 6, 0) action->setData(i); action->setCheckable(true); action->setMenuRole(QAction::NoRole); @@ -3137,7 +3133,7 @@ void VPMainWindow::ZValueMove(int move) if (selectedPieces.size() == 1) { - m_layout->UndoStack()->push(new VPUndoPieceZValueMove(ConstFirst(selectedPieces), zMove)); + m_layout->UndoStack()->push(new VPUndoPieceZValueMove(selectedPieces.constFirst(), zMove)); } else if (selectedPieces.size() > 1) { @@ -3247,7 +3243,7 @@ void VPMainWindow::TranslatePieces() if (selectedPieces.size() == 1) { - auto *command = new VPUndoPieceMove(ConstFirst(selectedPieces), pieceDx, pieceDy); + auto *command = new VPUndoPieceMove(selectedPieces.constFirst(), pieceDx, pieceDy); m_layout->UndoStack()->push(command); } else @@ -4195,7 +4191,7 @@ void VPMainWindow::on_actionPrintLayout_triggered() QCoreApplication::applicationVersion()); QList sheets = m_layout->GetSheets(); - const VPSheetPtr &firstSheet = ConstFirst(sheets); + const VPSheetPtr &firstSheet = sheets.constFirst(); if (firstSheet.isNull()) { qCritical() << tr("Unable to get sheet page settings"); @@ -4246,7 +4242,7 @@ void VPMainWindow::on_actionPrintPreviewLayout_triggered() QCoreApplication::applicationVersion()); QList sheets = m_layout->GetSheets(); - const VPSheetPtr &firstSheet = ConstFirst(sheets); + const VPSheetPtr &firstSheet = sheets.constFirst(); if (firstSheet.isNull()) { qCritical() << tr("Unable to get sheet page settings"); @@ -4281,7 +4277,7 @@ void VPMainWindow::on_actionPrintTiledLayout_triggered() QCoreApplication::applicationVersion()); QList sheets = m_layout->GetSheets(); - const VPSheetPtr &firstSheet = ConstFirst(sheets); + const VPSheetPtr &firstSheet = sheets.constFirst(); if (firstSheet.isNull()) { qCritical() << tr("Unable to get sheet page settings"); @@ -4319,7 +4315,7 @@ void VPMainWindow::on_actionPrintPreviewTiledLayout_triggered() QCoreApplication::applicationVersion()); QList sheets = m_layout->GetSheets(); - const VPSheetPtr &firstSheet = ConstFirst(sheets); + const VPSheetPtr &firstSheet = sheets.constFirst(); if (firstSheet.isNull()) { qCritical() << tr("Unable to get sheet page settings"); diff --git a/src/app/puzzle/vpsettings.cpp b/src/app/puzzle/vpsettings.cpp index a9a862110..a6943233e 100644 --- a/src/app/puzzle/vpsettings.cpp +++ b/src/app/puzzle/vpsettings.cpp @@ -28,10 +28,6 @@ #include "vpsettings.h" #include "../vmisc/compatibility.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #include namespace diff --git a/src/app/puzzle/vptilefactory.cpp b/src/app/puzzle/vptilefactory.cpp index b426732e5..5aeaf5e81 100644 --- a/src/app/puzzle/vptilefactory.cpp +++ b/src/app/puzzle/vptilefactory.cpp @@ -12,10 +12,6 @@ #include "layout/vpsheet.h" #include "theme/vtheme.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace { QT_WARNING_PUSH diff --git a/src/app/puzzle/xml/vplayoutfilereader.cpp b/src/app/puzzle/xml/vplayoutfilereader.cpp index 96bfc0ce0..a3e63dec6 100644 --- a/src/app/puzzle/xml/vplayoutfilereader.cpp +++ b/src/app/puzzle/xml/vplayoutfilereader.cpp @@ -878,7 +878,7 @@ auto VPLayoutFileReader::ReadLabelLines() -> VTextManager QStringList svgFontData = ReadAttributeEmptyString(attribs, ML::AttrSVGFont).split(','); if (!svgFontData.isEmpty()) { - text.SetSVGFontFamily(ConstFirst(svgFontData)); + text.SetSVGFontFamily(svgFontData.constFirst()); if (svgFontData.size() > 1) { diff --git a/src/app/tape/dialogs/dialogmdatabase.cpp b/src/app/tape/dialogs/dialogmdatabase.cpp index 3b0c8526b..fcea308dc 100644 --- a/src/app/tape/dialogs/dialogmdatabase.cpp +++ b/src/app/tape/dialogs/dialogmdatabase.cpp @@ -30,7 +30,7 @@ #include "../mapplication.h" #include "../vpatterndb/measurements.h" #include "ui_dialogmdatabase.h" -#include "../vmisc/compatibility.h" + #include #include @@ -372,7 +372,7 @@ void DialogMDataBase::FilterMeasurements(const QString &search) FilterGroup(m_groupQ, search); const QList list = ui->treeWidget->selectedItems(); - list.isEmpty() ? ShowDescription(nullptr, -1) : ShowDescription(ConstFirst(list), 0); + list.isEmpty() ? ShowDescription(nullptr, -1) : ShowDescription(list.constFirst(), 0); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tape/main.cpp b/src/app/tape/main.cpp index fea64545f..e737bdd04 100644 --- a/src/app/tape/main.cpp +++ b/src/app/tape/main.cpp @@ -91,7 +91,7 @@ auto main(int argc, char *argv[]) -> int MApplication app(argc, argv); app.InitOptions(); - QT_REQUIRE_VERSION(argc, argv, "5.4.0") // clazy:exclude=qstring-arg,qstring-allocations NOLINT + QT_REQUIRE_VERSION(argc, argv, "5.6.0") // clazy:exclude=qstring-arg,qstring-allocations NOLINT #if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) MApplication::setDesktopFileName(QStringLiteral("ua.com.smart-pattern.tape.desktop")); diff --git a/src/app/tape/mapplication.cpp b/src/app/tape/mapplication.cpp index 3d481229b..498a89836 100644 --- a/src/app/tape/mapplication.cpp +++ b/src/app/tape/mapplication.cpp @@ -38,16 +38,11 @@ #include "../vganalytics/vganalytics.h" #include "../vmisc/projectversion.h" #include "../vmisc/qt_dispatch/qt_dispatch.h" -#include "../vmisc/theme/vapplicationstyle.h" #include "../vmisc/theme/vtheme.h" #include "../vmisc/vsysexits.h" #include "tmainwindow.h" #include "version.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #include #include #include @@ -142,7 +137,7 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con #endif // defined(V_NO_ASSERT) #if defined(Q_OS_MAC) -#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) && QT_VERSION < QT_VERSION_CHECK(5, 7, 0) +#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) // Try hide very annoying, Qt related, warnings in Mac OS X // QNSView mouseDragged: Internal mouse button tracking invalid (missing Qt::LeftButton) // https://bugreports.qt.io/browse/QTBUG-42846 @@ -222,11 +217,9 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con case QtFatalMsg: vStdErr() << QApplication::translate("mNoisyHandler", "FATAL:") << logMsg << "\n"; break; -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) case QtInfoMsg: vStdOut() << QApplication::translate("mNoisyHandler", "INFO:") << logMsg << "\n"; break; -#endif default: break; } @@ -255,12 +248,10 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con messageBox.setWindowTitle(QApplication::translate("mNoisyHandler", "Fatal error")); messageBox.setIcon(QMessageBox::Critical); break; -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) case QtInfoMsg: messageBox.setWindowTitle(QApplication::translate("mNoisyHandler", "Information")); messageBox.setIcon(QMessageBox::Information); break; -#endif case QtDebugMsg: Q_UNREACHABLE(); //-V501 break; diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 1fdcb2443..cf30446e5 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -3884,11 +3884,7 @@ void TMainWindow::CreateWindowMenu(QMenu *menu) window->isWindowModified() ? title.replace(index, 3, QChar('*')) : title.replace(index, 3, QString()); } -#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) - QAction *action = menu->addAction(title, this, SLOT(ShowWindow())); -#else QAction *action = menu->addAction(title, this, &TMainWindow::ShowWindow); -#endif // QT_VERSION < QT_VERSION_CHECK(5, 6, 0) action->setData(i); action->setCheckable(true); action->setMenuRole(QAction::NoRole); diff --git a/src/app/tape/vtapesettings.cpp b/src/app/tape/vtapesettings.cpp index 199be23c6..ea6da80c5 100644 --- a/src/app/tape/vtapesettings.cpp +++ b/src/app/tape/vtapesettings.cpp @@ -32,10 +32,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace { QT_WARNING_PUSH diff --git a/src/app/valentina/core/vapplication.cpp b/src/app/valentina/core/vapplication.cpp index 3a9fa593a..caee44263 100644 --- a/src/app/valentina/core/vapplication.cpp +++ b/src/app/valentina/core/vapplication.cpp @@ -168,7 +168,7 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con #endif // defined(V_NO_ASSERT) #if defined(Q_OS_MAC) -#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) && QT_VERSION < QT_VERSION_CHECK(5, 7, 0) +#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) // Try hide very annoying, Qt related, warnings in Mac OS X // QNSView mouseDragged: Internal mouse button tracking invalid (missing Qt::LeftButton) // https://bugreports.qt.io/browse/QTBUG-42846 @@ -275,7 +275,6 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con .arg(context.function, context.category, logMsg); vStdErr() << QApplication::translate("vNoisyHandler", "FATAL:") << logMsg << "\n"; break; -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) case QtInfoMsg: if (isPatternMessage) { @@ -287,7 +286,6 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con .arg(context.function, context.category, logMsg); vStdOut() << QApplication::translate("vNoisyHandler", "INFO:") << logMsg << "\n"; break; -#endif default: break; } @@ -325,12 +323,10 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con messageBox.setWindowTitle(QApplication::translate("vNoisyHandler", "Fatal error")); messageBox.setIcon(QMessageBox::Critical); break; -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) case QtInfoMsg: messageBox.setWindowTitle(QApplication::translate("vNoisyHandler", "Information")); messageBox.setIcon(QMessageBox::Information); break; -#endif case QtDebugMsg: default: break; diff --git a/src/app/valentina/core/vcmdexport.cpp b/src/app/valentina/core/vcmdexport.cpp index 9fdc45d73..ded397260 100644 --- a/src/app/valentina/core/vcmdexport.cpp +++ b/src/app/valentina/core/vcmdexport.cpp @@ -420,7 +420,7 @@ auto VCommandLine::OptUserMaterials() const -> QMap } bool ok = false; - const int number = ConstFirst(parts).toInt(&ok); + const int number = parts.constFirst().toInt(&ok); if (not ok or number < 1 or number > userMaterialPlaceholdersQuantity) { @@ -429,7 +429,7 @@ auto VCommandLine::OptUserMaterials() const -> QMap const_cast(this)->parser.showHelp(V_EX_USAGE); } - userMaterials.insert(number, ConstLast(parts)); + userMaterials.insert(number, parts.constLast()); } return userMaterials; diff --git a/src/app/valentina/core/vtooloptionspropertybrowser.cpp b/src/app/valentina/core/vtooloptionspropertybrowser.cpp index 04f413831..d25bf41c1 100644 --- a/src/app/valentina/core/vtooloptionspropertybrowser.cpp +++ b/src/app/valentina/core/vtooloptionspropertybrowser.cpp @@ -86,10 +86,6 @@ #include "../vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.h" #include "../vtools/tools/drawTools/vtoolline.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #include #include #include diff --git a/src/app/valentina/dialogs/dialogfinalmeasurements.cpp b/src/app/valentina/dialogs/dialogfinalmeasurements.cpp index 4737b6f05..6f856bed5 100644 --- a/src/app/valentina/dialogs/dialogfinalmeasurements.cpp +++ b/src/app/valentina/dialogs/dialogfinalmeasurements.cpp @@ -28,7 +28,6 @@ #include "dialogfinalmeasurements.h" #include "../qmuparser/qmudef.h" -#include "../vmisc/compatibility.h" #include "../vmisc/theme/vtheme.h" #include "../vmisc/vabstractvalapplication.h" #include "../vmisc/vvalentinasettings.h" @@ -296,7 +295,7 @@ void DialogFinalMeasurements::MoveUp() return; } - Move(m_measurements, row, row - 1); + m_measurements.move(row, row - 1); UpdateTree(); ui->tableWidget->selectRow(row - 1); @@ -313,7 +312,7 @@ void DialogFinalMeasurements::MoveDown() return; } - Move(m_measurements, row, row + 1); + m_measurements.move(row, row + 1); UpdateTree(); ui->tableWidget->selectRow(row + 1); diff --git a/src/app/valentina/dialogs/dialogsavelayout.cpp b/src/app/valentina/dialogs/dialogsavelayout.cpp index 37256c9cf..d00019bff 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.cpp +++ b/src/app/valentina/dialogs/dialogsavelayout.cpp @@ -37,10 +37,6 @@ #include "../vmisc/backport/qoverload.h" #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #include #include #include diff --git a/src/app/valentina/dialogs/vwidgetdetails.cpp b/src/app/valentina/dialogs/vwidgetdetails.cpp index 57a165a8b..9bbd18b21 100644 --- a/src/app/valentina/dialogs/vwidgetdetails.cpp +++ b/src/app/valentina/dialogs/vwidgetdetails.cpp @@ -35,10 +35,6 @@ #include "../vtools/undocommands/togglepiecestate.h" #include "ui_vwidgetdetails.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #include #include #include diff --git a/src/app/valentina/dialogs/vwidgetgroups.cpp b/src/app/valentina/dialogs/vwidgetgroups.cpp index f7874d824..5a888337b 100644 --- a/src/app/valentina/dialogs/vwidgetgroups.cpp +++ b/src/app/valentina/dialogs/vwidgetgroups.cpp @@ -134,7 +134,7 @@ auto VWidgetGroups::FilterGroups(const QMap &groups) -> QMa { const VGroupData &data = i.value(); QSet groupCategories = ConvertToSet(data.tags); - if (SetIntersects(filterCategories, groupCategories)) + if (filterCategories.intersects(groupCategories)) { filtered.insert(i.key(), data); } diff --git a/src/app/valentina/main.cpp b/src/app/valentina/main.cpp index c6d20c3d8..7052b4278 100644 --- a/src/app/valentina/main.cpp +++ b/src/app/valentina/main.cpp @@ -104,7 +104,7 @@ auto main(int argc, char *argv[]) -> int VApplication app(argc, argv); app.InitOptions(); - QT_REQUIRE_VERSION(argc, argv, "5.4.0") // clazy:exclude=qstring-arg,qstring-allocations NOLINT + QT_REQUIRE_VERSION(argc, argv, "5.6.0") // clazy:exclude=qstring-arg,qstring-allocations NOLINT #if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) VApplication::setDesktopFileName(QStringLiteral("ua.com.smart-pattern.valentina.desktop")); diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 76b8445d0..0651e00cc 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -203,10 +203,6 @@ #include "../vmisc/backport/qoverload.h" #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) #include "../vmisc/backport/qscopeguard.h" #else @@ -4044,7 +4040,7 @@ void MainWindow::on_actionOpen_triggered() else { // Absolute path to last open file - dir = QFileInfo(ConstFirst(files)).absolutePath(); + dir = QFileInfo(files.constFirst()).absolutePath(); } qCDebug(vMainWindow, "Run QFileDialog::getOpenFileName: dir = %s.", qUtf8Printable(dir)); const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), dir, filter, nullptr, @@ -7180,7 +7176,7 @@ void MainWindow::ProcessCMD() VAbstractValApplication::VApp()->SetUserMaterials(cmd->OptUserMaterials()); - const bool loaded = LoadPattern(ConstFirst(args), cmd->OptMeasurePath()); + const bool loaded = LoadPattern(args.constFirst(), cmd->OptMeasurePath()); if (not loaded) { @@ -7599,11 +7595,9 @@ void MainWindow::PrintPatternMessage(QEvent *event) case QtFatalMsg: severity = tr("FATAL"); break; -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) case QtInfoMsg: severity = tr("INFO"); break; -#endif default: break; } diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 059039f00..d770c910e 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -281,7 +281,7 @@ void VPattern::setCurrentData() return; } - const quint32 id = ConstLast(localHistory).getId(); + const quint32 id = localHistory.constLast().getId(); qCDebug(vXML, "Resoring data from tool with id %u", id); if (tools.isEmpty()) @@ -334,7 +334,7 @@ auto VPattern::GetCompleteData() const -> VContainer return (data != nullptr ? *data : VContainer(nullptr, nullptr, VContainer::UniqueNamespace())); } - const quint32 id = (countPP == 1 ? ConstLast(history).getId() : LastToolId()); + const quint32 id = (countPP == 1 ? history.constLast().getId() : LastToolId()); if (id == NULL_ID) { @@ -369,7 +369,7 @@ auto VPattern::GetCompletePPData(const QString &name) const -> VContainer return (data != nullptr ? *data : VContainer(nullptr, nullptr, VContainer::UniqueNamespace())); } - const quint32 id = (countPP == 1 ? ConstLast(history).getId() : PPLastToolId(name)); + const quint32 id = (countPP == 1 ? history.constLast().getId() : PPLastToolId(name)); if (id == NULL_ID) { @@ -3777,7 +3777,7 @@ auto VPattern::PPLastToolId(const QString &name) const -> quint32 { const QVector localHistory = getLocalHistory(name); - return (not localHistory.isEmpty() ? ConstLast(localHistory).getId() : NULL_ID); + return (not localHistory.isEmpty() ? localHistory.constLast().getId() : NULL_ID); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/fervor/fvupdater.cpp b/src/libs/fervor/fvupdater.cpp index 8e731954c..fa4dcba4e 100644 --- a/src/libs/fervor/fvupdater.cpp +++ b/src/libs/fervor/fvupdater.cpp @@ -49,10 +49,6 @@ #include "fvavailableupdate.h" #include "fvupdatewindow.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace { QT_WARNING_PUSH diff --git a/src/libs/ifc/ifcdef.cpp b/src/libs/ifc/ifcdef.cpp index 6c3ccf217..cae46f034 100644 --- a/src/libs/ifc/ifcdef.cpp +++ b/src/libs/ifc/ifcdef.cpp @@ -35,10 +35,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - const QString CustomMSign = QStringLiteral("@"); const QString CustomIncrSign = QStringLiteral("#"); diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index ff200bc3f..15dcbcbb1 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -42,9 +42,6 @@ #include "../vmisc/def.h" #include "../vmisc/typedef.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) extern const QString CustomMSign; extern const QString CustomIncrSign; diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index b6b52a745..5010c2c7b 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -59,10 +59,6 @@ #include "vtoolrecord.h" #include "vvalentinasettings.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - class QDomElement; const QString VAbstractPattern::TagPattern = QStringLiteral("pattern"); diff --git a/src/libs/ifc/xml/vdomdocument.h b/src/libs/ifc/xml/vdomdocument.h index 8a534ccc7..690e347fc 100644 --- a/src/libs/ifc/xml/vdomdocument.h +++ b/src/libs/ifc/xml/vdomdocument.h @@ -45,9 +45,6 @@ #include "../ifcdef.h" #include "../qmuparser/qmudef.h" #include "../vmisc/def.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vmisc/literals.h" class QDomElement; diff --git a/src/libs/ifc/xml/vlayoutconverter.cpp b/src/libs/ifc/xml/vlayoutconverter.cpp index 764158159..e9c29515b 100644 --- a/src/libs/ifc/xml/vlayoutconverter.cpp +++ b/src/libs/ifc/xml/vlayoutconverter.cpp @@ -29,11 +29,6 @@ #include "../exception/vexception.h" #include "../ifcdef.h" #include "../vlayout/vlayoutpoint.h" -#include "compatibility.h" - -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) /* * Version rules: @@ -367,7 +362,7 @@ void VLayoutConverter::ConvertPiecesToV0_1_5() return PointToString(line.p1()) + groupSep + PointToString(line.p2()); }; - node.firstChild().toText().setData(LineToString(QLineF(ConstFirst(path), ConstLast(path)))); + node.firstChild().toText().setData(LineToString(QLineF(path.constFirst(), path.constLast()))); } } } diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index 4a68a228b..51b9d9316 100644 --- a/src/libs/ifc/xml/vpatternconverter.cpp +++ b/src/libs/ifc/xml/vpatternconverter.cpp @@ -46,10 +46,6 @@ #include "../qmuparser/qmutokenparser.h" #include "../vmisc/def.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - class QDomElement; /* diff --git a/src/libs/ifc/xml/vvitconverter.cpp b/src/libs/ifc/xml/vvitconverter.cpp index 1940dd837..32d076fac 100644 --- a/src/libs/ifc/xml/vvitconverter.cpp +++ b/src/libs/ifc/xml/vvitconverter.cpp @@ -40,10 +40,6 @@ #include "vabstractmconverter.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - /* * Version rules: * 1. Version have three parts "major.minor.patch"; diff --git a/src/libs/ifc/xml/vvstconverter.cpp b/src/libs/ifc/xml/vvstconverter.cpp index 5eeb2c804..5e8189cb0 100644 --- a/src/libs/ifc/xml/vvstconverter.cpp +++ b/src/libs/ifc/xml/vvstconverter.cpp @@ -41,10 +41,6 @@ #include "../vmisc/def.h" #include "vabstractmconverter.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - /* * Version rules: * 1. Version have three parts "major.minor.patch"; diff --git a/src/libs/qmuparser/qmudef.h b/src/libs/qmuparser/qmudef.h index cbc3c0042..85cd7576d 100644 --- a/src/libs/qmuparser/qmudef.h +++ b/src/libs/qmuparser/qmudef.h @@ -25,64 +25,6 @@ #include "qmuparser_global.h" #include "qmuparserdef.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - -/* - * Warning/diagnostic handling - */ - -#define QT_DO_PRAGMA(text) _Pragma(#text) -#if defined(Q_CC_INTEL) && defined(Q_CC_MSVC) -/* icl.exe: Intel compiler on Windows */ -#undef QT_DO_PRAGMA /* not needed */ -#define QT_WARNING_PUSH __pragma(warning(push)) -#define QT_WARNING_POP __pragma(warning(pop)) -#define QT_WARNING_DISABLE_MSVC(number) -#define QT_WARNING_DISABLE_INTEL(number) __pragma(warning(disable : number)) -#define QT_WARNING_DISABLE_CLANG(text) -#define QT_WARNING_DISABLE_GCC(text) -#elif defined(Q_CC_INTEL) -/* icc: Intel compiler on Linux or OS X */ -#define QT_WARNING_PUSH QT_DO_PRAGMA(warning(push)) -#define QT_WARNING_POP QT_DO_PRAGMA(warning(pop)) -#define QT_WARNING_DISABLE_INTEL(number) QT_DO_PRAGMA(warning(disable : number)) -#define QT_WARNING_DISABLE_MSVC(number) -#define QT_WARNING_DISABLE_CLANG(text) -#define QT_WARNING_DISABLE_GCC(text) -#elif defined(Q_CC_MSVC) && _MSC_VER >= 1500 -#undef QT_DO_PRAGMA /* not needed */ -#define QT_WARNING_PUSH __pragma(warning(push)) -#define QT_WARNING_POP __pragma(warning(pop)) -#define QT_WARNING_DISABLE_MSVC(number) __pragma(warning(disable : number)) -#define QT_WARNING_DISABLE_INTEL(number) -#define QT_WARNING_DISABLE_CLANG(text) -#define QT_WARNING_DISABLE_GCC(text) -#elif defined(Q_CC_CLANG) -#define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push) -#define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop) -#define QT_WARNING_DISABLE_CLANG(text) QT_DO_PRAGMA(clang diagnostic ignored text) -#define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text) // GCC directives work in Clang too -#define QT_WARNING_DISABLE_INTEL(number) -#define QT_WARNING_DISABLE_MSVC(number) -#elif defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) -#define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push) -#define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop) -#define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text) -#define QT_WARNING_DISABLE_CLANG(text) -#define QT_WARNING_DISABLE_INTEL(number) -#define QT_WARNING_DISABLE_MSVC(number) -#else // All other compilers, GCC < 4.6 and MSVC < 2008 -#define QT_WARNING_DISABLE_GCC(text) -#define QT_WARNING_PUSH -#define QT_WARNING_POP -#define QT_WARNING_DISABLE_INTEL(number) -#define QT_WARNING_DISABLE_MSVC(number) -#define QT_WARNING_DISABLE_CLANG(text) -#define QT_WARNING_DISABLE_GCC(text) -#endif - -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) #define Q_DISABLE_COPY_MOVE(Class) \ Q_DISABLE_COPY(Class) \ diff --git a/src/libs/qmuparser/qmuparsercallback_p.h b/src/libs/qmuparser/qmuparsercallback_p.h index dd66211e6..70a81ddba 100644 --- a/src/libs/qmuparser/qmuparsercallback_p.h +++ b/src/libs/qmuparser/qmuparsercallback_p.h @@ -25,12 +25,9 @@ #ifndef QMUPARSERCALLBACK_P_H #define QMUPARSERCALLBACK_P_H +#include "qmudef.h" #include "qmuparserdef.h" #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/defglobal.h" namespace qmu { diff --git a/src/libs/qmuparser/text.h b/src/libs/qmuparser/text.h index ba801ed85..61fb23e12 100644 --- a/src/libs/qmuparser/text.h +++ b/src/libs/qmuparser/text.h @@ -33,10 +33,6 @@ #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "qmudef.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace Qt { QT_WARNING_PUSH diff --git a/src/libs/vdxf/libdxfrw/drw_entities.cpp b/src/libs/vdxf/libdxfrw/drw_entities.cpp index 9ff45b95b..3fb797023 100644 --- a/src/libs/vdxf/libdxfrw/drw_entities.cpp +++ b/src/libs/vdxf/libdxfrw/drw_entities.cpp @@ -16,10 +16,6 @@ #include "intern/drw_dbg.h" #include "intern/dxfreader.h" #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - //! Calculate arbitrary axis /*! diff --git a/src/libs/vdxf/libdxfrw/drw_interface.h b/src/libs/vdxf/libdxfrw/drw_interface.h index a62bb6f50..8e353ee5f 100644 --- a/src/libs/vdxf/libdxfrw/drw_interface.h +++ b/src/libs/vdxf/libdxfrw/drw_interface.h @@ -19,10 +19,6 @@ #include "drw_header.h" #include "drw_objects.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") diff --git a/src/libs/vdxf/libdxfrw/libdxfrw.cpp b/src/libs/vdxf/libdxfrw/libdxfrw.cpp index a89f94107..fc1510014 100644 --- a/src/libs/vdxf/libdxfrw/libdxfrw.cpp +++ b/src/libs/vdxf/libdxfrw/libdxfrw.cpp @@ -21,9 +21,6 @@ #include #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #define FIRSTHANDLE 48 diff --git a/src/libs/vdxf/vdxfengine.cpp b/src/libs/vdxf/vdxfengine.cpp index 9c28c0908..9f4ea2ad8 100644 --- a/src/libs/vdxf/vdxfengine.cpp +++ b/src/libs/vdxf/vdxfengine.cpp @@ -53,10 +53,6 @@ #include #endif -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #include "../vgeometry/vgeometrydef.h" #include "../vgeometry/vlayoutplacelabel.h" #include "../vlayout/vlayoutpiece.h" @@ -203,7 +199,7 @@ void VDxfEngine::drawPath(const QPainterPath &path) poly->lWeight = DRW_LW_Conv::widthByLayer; poly->lineType = GetPenStyle(); - if (polygon.size() > 1 && ConstFirst(polygon) == ConstLast(polygon)) + if (polygon.size() > 1 && polygon.constFirst() == polygon.constLast()) { poly->flags |= 0x1; // closed NOLINT(hicpp-signed-bitwise) } @@ -225,7 +221,7 @@ void VDxfEngine::drawPath(const QPainterPath &path) poly->color = GetPenColor(); poly->lWeight = DRW_LW_Conv::widthByLayer; poly->lineType = GetPenStyle(); - if (polygon.size() > 1 && ConstFirst(polygon) == ConstLast(polygon)) + if (polygon.size() > 1 && polygon.constFirst() == polygon.constLast()) { poly->flags |= 0x1; // closed NOLINT(hicpp-signed-bitwise) } @@ -1177,20 +1173,20 @@ void VDxfEngine::ExportASTMNotch(const QSharedPointer &detailBloc case PassmarkLineType::ExternalVMark: case PassmarkLineType::InternalVMark: { // V-Notch - QLineF boundaryLine(ConstFirst(passmark.lines).p1(), ConstLast(passmark.lines).p2()); + QLineF boundaryLine(passmark.lines.constFirst().p1(), passmark.lines.constLast().p2()); notch->thickness = FromPixel(boundaryLine.length(), m_varInsunits); // width notch->layer = *layer4; break; } case PassmarkLineType::TMark: // T-Notch - notch->thickness = FromPixel(ConstLast(passmark.lines).length(), m_varInsunits); // width + notch->thickness = FromPixel(passmark.lines.constLast().length(), m_varInsunits); // width notch->layer = *layer80; break; case PassmarkLineType::BoxMark: { // Castle Notch - QPointF start = ConstFirst(passmark.lines).p1(); - QPointF end = ConstLast(passmark.lines).p2(); + QPointF start = passmark.lines.constFirst().p1(); + QPointF end = passmark.lines.constLast().p2(); notch->layer = *layer81; notch->thickness = FromPixel(QLineF(start, end).length(), m_varInsunits); // width @@ -1198,8 +1194,8 @@ void VDxfEngine::ExportASTMNotch(const QSharedPointer &detailBloc } case PassmarkLineType::UMark: { // U-Notch - QPointF start = ConstFirst(passmark.lines).p1(); - QPointF end = ConstLast(passmark.lines).p2(); + QPointF start = passmark.lines.constFirst().p1(); + QPointF end = passmark.lines.constLast().p2(); notch->thickness = FromPixel(QLineF(start, end).length(), m_varInsunits); // width @@ -1208,8 +1204,8 @@ void VDxfEngine::ExportASTMNotch(const QSharedPointer &detailBloc } case PassmarkLineType::CheckMark: { // Check Notch - const QLineF &line1 = ConstFirst(passmark.lines); - const QLineF &line2 = ConstLast(passmark.lines); + const QLineF &line1 = passmark.lines.constFirst(); + const QLineF &line2 = passmark.lines.constLast(); qreal width = QLineF(line1.p1(), line2.p2()).length(); @@ -1346,7 +1342,7 @@ auto VDxfEngine::CreateAAMAPolygon(const QVector &polygon, const UTF8STRING & } else { - if (polygon.size() > 1 && ConstFirst(polygon) == ConstLast(polygon)) + if (polygon.size() > 1 && polygon.constFirst() == polygon.constLast()) { poly->flags |= 0x1; // closed NOLINT(hicpp-signed-bitwise) } diff --git a/src/libs/vdxf/vdxfpaintdevice.cpp b/src/libs/vdxf/vdxfpaintdevice.cpp index 358303fa8..379d1bd93 100644 --- a/src/libs/vdxf/vdxfpaintdevice.cpp +++ b/src/libs/vdxf/vdxfpaintdevice.cpp @@ -243,9 +243,7 @@ auto VDxfPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const -> in case QPaintDevice::PdmDpiY: return static_cast(m_engine->GetResolution()); case QPaintDevice::PdmDevicePixelRatio: -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) case QPaintDevice::PdmDevicePixelRatioScaled: -#endif return 1; default: qWarning("VDxfPaintDevice::metric(), unhandled metric %d\n", metric); diff --git a/src/libs/vformat/vmeasurements.cpp b/src/libs/vformat/vmeasurements.cpp index 15f7ffa02..c42e08074 100644 --- a/src/libs/vformat/vmeasurements.cpp +++ b/src/libs/vformat/vmeasurements.cpp @@ -54,10 +54,6 @@ #include "../vpatterndb/vcontainer.h" #include "def.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - const QString VMeasurements::TagVST = QStringLiteral("vst"); const QString VMeasurements::TagVIT = QStringLiteral("vit"); const QString VMeasurements::TagBodyMeasurements = QStringLiteral("body-measurements"); diff --git a/src/libs/vformat/vsinglelineoutlinechar.cpp b/src/libs/vformat/vsinglelineoutlinechar.cpp index 1358cced7..974ac22b4 100644 --- a/src/libs/vformat/vsinglelineoutlinechar.cpp +++ b/src/libs/vformat/vsinglelineoutlinechar.cpp @@ -28,10 +28,6 @@ #include "vsinglelineoutlinechar.h" #include "../vmisc/compatibility.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #include #include #include @@ -171,7 +167,7 @@ void VSingleLineOutlineChar::LoadCorrections(const QString &dirPath) const { return; } - QString filePath = directory.absoluteFilePath(ConstFirst(matchingFiles)); + QString filePath = directory.absoluteFilePath(matchingFiles.constFirst()); QFile jsonFile(filePath); if (!jsonFile.open(QIODevice::ReadOnly | QIODevice::Text)) diff --git a/src/libs/vgeometry/vabstractarc_p.h b/src/libs/vgeometry/vabstractarc_p.h index bebbb91db..1992c6c5f 100644 --- a/src/libs/vgeometry/vabstractarc_p.h +++ b/src/libs/vgeometry/vabstractarc_p.h @@ -29,11 +29,8 @@ #ifndef VABSTRACTARC_P_H #define VABSTRACTARC_P_H -#include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "vpointf.h" +#include QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") diff --git a/src/libs/vgeometry/vabstractcurve.cpp b/src/libs/vgeometry/vabstractcurve.cpp index dc72a5289..ee1ec3cf6 100644 --- a/src/libs/vgeometry/vabstractcurve.cpp +++ b/src/libs/vgeometry/vabstractcurve.cpp @@ -102,8 +102,8 @@ auto VAbstractCurve::GetSegmentPoints(const QVector &points, const QPoi if (begin == end) { - start = ConstFirst(segment); - finish = ConstLast(segment); + start = segment.constFirst(); + finish = segment.constLast(); } bool ok = false; @@ -176,7 +176,7 @@ auto VAbstractCurve::FromBegin(const QVector &points, const QPointF &be return points; } - if (ConstFirst(points).toPoint() == begin.toPoint()) + if (points.constFirst().toPoint() == begin.toPoint()) { SetResult(true); return points; @@ -240,9 +240,9 @@ auto VAbstractCurve::ClosestPoint(QPointF scenePoint) const -> QPointF return {}; } - if (VFuzzyComparePoints(ConstFirst(points), scenePoint)) + if (VFuzzyComparePoints(points.constFirst(), scenePoint)) { - return ConstFirst(points); + return points.constFirst(); } QPointF candidatePoint; @@ -301,7 +301,7 @@ auto VAbstractCurve::GetLengthByPoint(const QPointF &point) const -> qreal return -1; } - if (ConstFirst(points).toPoint() == point.toPoint()) + if (points.constFirst().toPoint() == point.toPoint()) { return 0; } diff --git a/src/libs/vgeometry/vabstractcurve_p.h b/src/libs/vgeometry/vabstractcurve_p.h index 2217b9a36..936dfade9 100644 --- a/src/libs/vgeometry/vabstractcurve_p.h +++ b/src/libs/vgeometry/vabstractcurve_p.h @@ -32,9 +32,6 @@ #include #include "../ifc/ifcdef.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") diff --git a/src/libs/vgeometry/varc_p.h b/src/libs/vgeometry/varc_p.h index 0bb327fa7..2f6f4bf4f 100644 --- a/src/libs/vgeometry/varc_p.h +++ b/src/libs/vgeometry/varc_p.h @@ -30,9 +30,6 @@ #define VARC_P_H #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vmisc/defglobal.h" diff --git a/src/libs/vgeometry/vcubicbezier_p.h b/src/libs/vgeometry/vcubicbezier_p.h index 28642b209..754855430 100644 --- a/src/libs/vgeometry/vcubicbezier_p.h +++ b/src/libs/vgeometry/vcubicbezier_p.h @@ -33,9 +33,6 @@ #include #include "vpointf.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") diff --git a/src/libs/vgeometry/vcubicbezierpath.cpp b/src/libs/vgeometry/vcubicbezierpath.cpp index 15570c402..d3ac24691 100644 --- a/src/libs/vgeometry/vcubicbezierpath.cpp +++ b/src/libs/vgeometry/vcubicbezierpath.cpp @@ -33,7 +33,6 @@ #include #include "../ifc/exception/vexception.h" -#include "../vmisc/compatibility.h" #include "vabstractcurve.h" #include "vcubicbezierpath_p.h" #include "vspline.h" @@ -350,7 +349,7 @@ auto VCubicBezierPath::FirstPoint() const -> VPointF { if (not d->path.isEmpty()) { - return ConstFirst(d->path); + return d->path.constFirst(); } return {}; } diff --git a/src/libs/vgeometry/vcubicbezierpath_p.h b/src/libs/vgeometry/vcubicbezierpath_p.h index d82287825..c6930a96f 100644 --- a/src/libs/vgeometry/vcubicbezierpath_p.h +++ b/src/libs/vgeometry/vcubicbezierpath_p.h @@ -32,9 +32,6 @@ #include #include "vpointf.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") diff --git a/src/libs/vgeometry/vellipticalarc.cpp b/src/libs/vgeometry/vellipticalarc.cpp index 246782a21..91e469342 100644 --- a/src/libs/vgeometry/vellipticalarc.cpp +++ b/src/libs/vgeometry/vellipticalarc.cpp @@ -218,7 +218,7 @@ auto JoinVectors(const QVector &v1, const QVector &v2) -> QVec for (auto p : v2) { - if (not VFuzzyComparePoints(ConstLast(v), p, accuracy)) + if (not VFuzzyComparePoints(v.constLast(), p, accuracy)) { v.append(p); } diff --git a/src/libs/vgeometry/vellipticalarc_p.h b/src/libs/vgeometry/vellipticalarc_p.h index 028eef9c5..f66e28754 100644 --- a/src/libs/vgeometry/vellipticalarc_p.h +++ b/src/libs/vgeometry/vellipticalarc_p.h @@ -3,9 +3,7 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) + #include "../vmisc/defglobal.h" QT_WARNING_PUSH diff --git a/src/libs/vgeometry/vgobject_p.h b/src/libs/vgeometry/vgobject_p.h index 54e9e2958..960110467 100644 --- a/src/libs/vgeometry/vgobject_p.h +++ b/src/libs/vgeometry/vgobject_p.h @@ -31,9 +31,6 @@ #include "vgeometrydef.h" #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vmisc/typedef.h" diff --git a/src/libs/vgeometry/vplacelabelitem_p.h b/src/libs/vgeometry/vplacelabelitem_p.h index a3beeb5d1..84fd2a655 100644 --- a/src/libs/vgeometry/vplacelabelitem_p.h +++ b/src/libs/vgeometry/vplacelabelitem_p.h @@ -30,9 +30,6 @@ #include "vgeometrydef.h" #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") diff --git a/src/libs/vgeometry/vpointf.h b/src/libs/vgeometry/vpointf.h index 99d99735f..996edd341 100644 --- a/src/libs/vgeometry/vpointf.h +++ b/src/libs/vgeometry/vpointf.h @@ -35,9 +35,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "vgobject.h" class VPointFData; diff --git a/src/libs/vgeometry/vpointf_p.h b/src/libs/vgeometry/vpointf_p.h index efb52e097..cf21ee52e 100644 --- a/src/libs/vgeometry/vpointf_p.h +++ b/src/libs/vgeometry/vpointf_p.h @@ -29,12 +29,9 @@ #ifndef VPOINTF_P_H #define VPOINTF_P_H -#include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vmisc/defglobal.h" #include +#include QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") diff --git a/src/libs/vgeometry/vsplinepath.cpp b/src/libs/vgeometry/vsplinepath.cpp index 275cb3388..76f1feeb7 100644 --- a/src/libs/vgeometry/vsplinepath.cpp +++ b/src/libs/vgeometry/vsplinepath.cpp @@ -33,7 +33,6 @@ #include #include "../ifc/exception/vexception.h" -#include "../vmisc/compatibility.h" #include "vabstractcurve.h" #include "vsplinepath_p.h" @@ -365,7 +364,7 @@ auto VSplinePath::ToJson() const -> QJsonObject //--------------------------------------------------------------------------------------------------------------------- auto VSplinePath::GetStartAngle() const -> qreal { - return CountPoints() > 0 ? ConstFirst(GetSplinePath()).Angle2() : 0; + return CountPoints() > 0 ? GetSplinePath().constFirst().Angle2() : 0; } //--------------------------------------------------------------------------------------------------------------------- @@ -373,30 +372,28 @@ auto VSplinePath::GetEndAngle() const -> qreal { if (CountPoints() > 0) { - return ConstLast(GetSplinePath()).Angle1(); - } - else - { - return 0; + return GetSplinePath().constLast().Angle1(); } + + return 0; } //--------------------------------------------------------------------------------------------------------------------- auto VSplinePath::GetC1Length() const -> qreal { - return CountPoints() > 0 ? ConstFirst(GetSplinePath()).Length2() : 0; + return CountPoints() > 0 ? GetSplinePath().constFirst().Length2() : 0; } //--------------------------------------------------------------------------------------------------------------------- auto VSplinePath::GetC2Length() const -> qreal { - return CountPoints() > 0 ? ConstFirst(GetSplinePath()).Length1() : 0; + return CountPoints() > 0 ? GetSplinePath().constFirst().Length1() : 0; } //--------------------------------------------------------------------------------------------------------------------- auto VSplinePath::FirstPoint() const -> VPointF { - return not d->path.isEmpty() ? ConstFirst(d->path).P() : VPointF(); + return not d->path.isEmpty() ? d->path.constFirst().P() : VPointF(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vhpgl/vhpglengine.cpp b/src/libs/vhpgl/vhpglengine.cpp index 9f8c1be03..e2aabf4ea 100644 --- a/src/libs/vhpgl/vhpglengine.cpp +++ b/src/libs/vhpgl/vhpglengine.cpp @@ -45,10 +45,6 @@ #include "../vmisc/backport/text.h" #endif -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #include #include #include diff --git a/src/libs/vlayout/vabstractpiece.cpp b/src/libs/vlayout/vabstractpiece.cpp index f39197ec6..18ebaf872 100644 --- a/src/libs/vlayout/vabstractpiece.cpp +++ b/src/libs/vlayout/vabstractpiece.cpp @@ -607,7 +607,7 @@ auto AngleBySecondRightAngle(QVector points, QPointF p1, QPointF p2 if (success) { points = temp; - px = ConstLast(points); + px = points.constLast(); } if (countBefore > 0) @@ -745,9 +745,9 @@ auto Rollback(QVector &points, const QLineF &edge) -> bool if (not points.isEmpty()) { - if (ConstLast(points).toPoint() != ConstFirst(points).toPoint()) + if (points.constLast().toPoint() != points.constFirst().toPoint()) { - points.append(ConstFirst(points)); // Should be always closed + points.append(points.constFirst()); // Should be always closed } } } @@ -810,7 +810,7 @@ void RollbackByPointsIntersection(QVector &ekvPoints, const QVector const QLineF bigLine1 = VAbstractPiece::ParallelLine(points.at(points.size() - 2), points.at(0), width); QVector temp = ekvPoints; temp.insert(ekvPoints.size() - 1, VRawSAPoint(bigLine1.p2(), points.at(0).CurvePoint(), points.at(0).TurnPoint())); - bool success = Rollback(temp, QLineF(ConstLast(points), points.at(1))); + bool success = Rollback(temp, QLineF(points.constLast(), points.at(1))); if (success) { @@ -829,7 +829,7 @@ void RollbackBySecondEdgeRightAngle(QVector &ekvPoints, const QVect { if (not ekvPoints.isEmpty()) { - const QLineF edge(ConstLast(points), points.at(1)); + const QLineF edge(points.constLast(), points.at(1)); const QLineF bigLine1 = VAbstractPiece::ParallelLine(points.at(points.size() - 2), points.at(0), width); QPointF px; @@ -841,7 +841,7 @@ void RollbackBySecondEdgeRightAngle(QVector &ekvPoints, const QVect { if (ekvPoints.size() > 3) { - const QLineF edge1(ekvPoints.at(ekvPoints.size() - 2), ConstLast(ekvPoints)); + const QLineF edge1(ekvPoints.at(ekvPoints.size() - 2), ekvPoints.constLast()); const QLineF edge2(ekvPoints.at(0), ekvPoints.at(1)); QPointF crosPoint; @@ -866,7 +866,7 @@ void RollbackBySecondEdgeRightAngle(QVector &ekvPoints, const QVect if (success) { ekvPoints = temp; - px = ConstLast(ekvPoints); + px = ekvPoints.constLast(); } QLineF seam(px, points.at(1)); @@ -876,15 +876,15 @@ void RollbackBySecondEdgeRightAngle(QVector &ekvPoints, const QVect if (not ekvPoints.isEmpty()) { - ekvPoints.append(ConstFirst(ekvPoints)); + ekvPoints.append(ekvPoints.constFirst()); } } if (not ekvPoints.isEmpty()) { - if (ConstLast(ekvPoints).toPoint() != ConstFirst(ekvPoints).toPoint()) + if (ekvPoints.constLast().toPoint() != ekvPoints.constFirst().toPoint()) { - ekvPoints.append(ConstFirst(ekvPoints)); // Should be always closed + ekvPoints.append(ekvPoints.constFirst()); // Should be always closed } } } @@ -1077,7 +1077,7 @@ auto VAbstractPiece::Equidistant(QVector points, qreal width, const QS return {}; } - if (ConstLast(points).toPoint() != ConstFirst(points).toPoint()) + if (points.constLast().toPoint() != points.constFirst().toPoint()) { points.append(points.at(0)); // Should be always closed } @@ -1097,7 +1097,7 @@ auto VAbstractPiece::Equidistant(QVector points, qreal width, const QS { // last point if (not ekvPoints.isEmpty()) { - ekvPoints.append(ConstFirst(ekvPoints)); + ekvPoints.append(ekvPoints.constFirst()); } continue; } @@ -1111,7 +1111,7 @@ auto VAbstractPiece::Equidistant(QVector points, qreal width, const QS QT_WARNING_DISABLE_GCC("-Wswitch-default") // This check helps to find missed angle types in the switch Q_STATIC_ASSERT_X(static_cast(PieceNodeAngle::LAST_ONE_DO_NOT_USE) == 7, "Not all types were handled."); - switch (ConstLast(points).GetAngleType()) + switch (points.constLast().GetAngleType()) { case PieceNodeAngle::LAST_ONE_DO_NOT_USE: case PieceNodeAngle::ByFirstEdgeRightAngle: @@ -1933,9 +1933,9 @@ auto VAbstractPiece::PlaceLabelShape(const VLayoutPlaceLabel &label) -> PlaceLab arc.SetApproximationScale(10); QVector points = arc.GetPoints(); - if (not points.isEmpty() && ConstFirst(points) != ConstLast(points)) + if (not points.isEmpty() && points.constFirst() != points.constLast()) { - points.append(ConstFirst(points)); + points.append(points.constFirst()); } QVector shape3; @@ -1959,9 +1959,9 @@ auto VAbstractPiece::PlaceLabelShape(const VLayoutPlaceLabel &label) -> PlaceLab arc.SetApproximationScale(10); QVector points = arc.GetPoints(); - if (not points.isEmpty() && ConstFirst(points) != ConstLast(points)) + if (not points.isEmpty() && points.constFirst() != points.constLast()) { - points.append(ConstFirst(points)); + points.append(points.constFirst()); } QVector circle; @@ -2021,7 +2021,7 @@ auto VAbstractPiece::LabelShapePath(const PlaceLabelImg &shape) -> QPainterPath { if (not p.isEmpty()) { - path.moveTo(ConstFirst(p)); + path.moveTo(p.constFirst()); QVector polygon; CastTo(p, polygon); path.addPolygon(polygon); diff --git a/src/libs/vlayout/vabstractpiece.h b/src/libs/vlayout/vabstractpiece.h index 380558aa3..2fd836257 100644 --- a/src/libs/vlayout/vabstractpiece.h +++ b/src/libs/vlayout/vabstractpiece.h @@ -274,9 +274,9 @@ inline auto VAbstractPiece::CorrectEquidistantPoints(const QVector &points, b } } - if (not buf2.isEmpty() && ConstFirst(buf2) != ConstLast(buf2)) + if (not buf2.isEmpty() && buf2.constFirst() != buf2.constLast()) { - buf2.append(ConstFirst(buf2)); + buf2.append(buf2.constFirst()); } buf2 = RemoveDublicates(buf2, false); @@ -297,7 +297,7 @@ inline auto VAbstractPiece::RemoveDublicates(const QVector &points, bool remo QVector p; p.reserve(points.size()); - p.append(ConstFirst(points)); + p.append(points.constFirst()); // Default accuracy is not enough constexpr qreal accuracy = MmToPixel(0.5); @@ -408,8 +408,8 @@ template inline auto VAbstractPiece::CompareFirstAndLastPoints(QVector return; } - const T &first = ConstFirst(points); - const T &last = ConstLast(points); + const T &first = points.constFirst(); + const T &last = points.constLast(); qreal testAccuracy = accuracy; if (last.TurnPoint()) @@ -441,8 +441,8 @@ template <> inline auto VAbstractPiece::CompareFirstAndLastPoints(QVector(QVector return; } - if (VFuzzyComparePoints(ConstFirst(points), ConstLast(points), accuracy)) + if (VFuzzyComparePoints(points.constFirst(), points.constLast(), accuracy)) { points.removeLast(); } @@ -581,7 +581,7 @@ template inline auto VAbstractPiece::CheckLoop(const QVector &point { loopFound = false; - const bool pathClosed = (ConstFirst(points) == ConstLast(points)); + const bool pathClosed = (points.constFirst() == points.constLast()); QVector ekvPoints; ekvPoints.reserve(points.size()); diff --git a/src/libs/vlayout/vabstractpiece_p.h b/src/libs/vlayout/vabstractpiece_p.h index 0e136d004..9a0e9f966 100644 --- a/src/libs/vlayout/vabstractpiece_p.h +++ b/src/libs/vlayout/vabstractpiece_p.h @@ -34,10 +34,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) #include "../vmisc/vdatastreamenum.h" #endif diff --git a/src/libs/vlayout/vbestsquare_p.h b/src/libs/vlayout/vbestsquare_p.h index 37f2af55a..133207f24 100644 --- a/src/libs/vlayout/vbestsquare_p.h +++ b/src/libs/vlayout/vbestsquare_p.h @@ -31,11 +31,8 @@ #include #include -#include "vlayoutdef.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vmisc/defglobal.h" +#include "vlayoutdef.h" QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") diff --git a/src/libs/vlayout/vcontour.cpp b/src/libs/vlayout/vcontour.cpp index 977bd285d..5d856b72e 100644 --- a/src/libs/vlayout/vcontour.cpp +++ b/src/libs/vlayout/vcontour.cpp @@ -48,7 +48,7 @@ void AppendToContour(QVector &contour, QPointF point) { if (not contour.isEmpty()) { - if (not VFuzzyComparePoints(ConstLast(contour), point)) + if (not VFuzzyComparePoints(contour.constLast(), point)) { contour.append(point); } @@ -67,7 +67,7 @@ auto OptimizeCombining(const QVector &contour, const QPointF &withdrawE return contour; } - QPointF withdrawFirst = ConstLast(contour); + QPointF withdrawFirst = contour.constLast(); bool optimize = false; int count = 0; vsizetype cutIndex = -1; @@ -143,7 +143,7 @@ void VContour::CeateEmptySheetContour() if (d->globalContour.isEmpty()) { d->globalContour = CutEmptySheetEdge(); - d->globalContour.append(ConstFirst(d->globalContour)); // Close path + d->globalContour.append(d->globalContour.constFirst()); // Close path ResetAttributes(); } diff --git a/src/libs/vlayout/vcontour_p.h b/src/libs/vlayout/vcontour_p.h index 26833e430..3d3b6024f 100644 --- a/src/libs/vlayout/vcontour_p.h +++ b/src/libs/vlayout/vcontour_p.h @@ -35,9 +35,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vmisc/defglobal.h" QT_WARNING_PUSH diff --git a/src/libs/vlayout/vlayoutexporter.cpp b/src/libs/vlayout/vlayoutexporter.cpp index 5c6160b86..5f6e57082 100644 --- a/src/libs/vlayout/vlayoutexporter.cpp +++ b/src/libs/vlayout/vlayoutexporter.cpp @@ -52,10 +52,6 @@ #include "vprintlayout.h" #include "vrawlayout.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace { QT_WARNING_PUSH @@ -457,11 +453,10 @@ void VLayoutExporter::PdfToPs(const QStringList ¶ms) QGuiApplication::restoreOverrideCursor(); #endif - QFile f(ConstLast(params)); + QFile f(params.constLast()); if (not f.exists()) { - qCritical() << qUtf8Printable( - tr("Creating file '%1' failed! %2").arg(ConstLast(params), proc.errorString())); + qCritical() << qUtf8Printable(tr("Creating file '%1' failed! %2").arg(params.constLast(), proc.errorString())); } } diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index 7203a26ba..c66ffb2d5 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -705,7 +705,7 @@ auto VLayoutGenerator::MasterPage() const -> VLayoutPaper { if (papers.size() < 2) { - return ConstFirst(papers); + return papers.constFirst(); } QList> nDetails; diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index 57e580436..c6ee8483b 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -276,11 +276,11 @@ auto PrepareSAPassmark(const VPiece &piece, const VContainer *pattern, const VPa if (side == PassmarkSide::All || side == PassmarkSide::Right) { - layoutPassmark.baseLine = ConstFirst(baseLines); + layoutPassmark.baseLine = baseLines.constFirst(); } else if (side == PassmarkSide::Right) { - layoutPassmark.baseLine = ConstLast(baseLines); + layoutPassmark.baseLine = baseLines.constLast(); } const QVector lines = passmark.SAPassmark(piece, pattern, side); @@ -358,7 +358,7 @@ auto PreapreBuiltInSAPassmark(const VPiece &piece, const VContainer *pattern, co return {}; } - layoutPassmark.baseLine = ConstFirst(baseLines); + layoutPassmark.baseLine = baseLines.constFirst(); layoutPassmark.type = pData.passmarkLineType; layoutPassmark.isBuiltIn = true; layoutPassmark.isClockwiseOpening = pData.passmarkSAPoint.IsPassmarkClockwiseOpening(); @@ -830,7 +830,7 @@ auto VLayoutPiece::GetPieceTextPosition() const -> QPointF { if (d->m_detailLabel.count() > 2) { - return d->m_matrix.map(ConstFirst(d->m_detailLabel)); + return d->m_matrix.map(d->m_detailLabel.constFirst()); } return {}; @@ -914,7 +914,7 @@ auto VLayoutPiece::GetPatternTextPosition() const -> QPointF { if (d->m_patternInfo.count() > 2) { - return d->m_matrix.map(ConstFirst(d->m_patternInfo)); + return d->m_matrix.map(d->m_patternInfo.constFirst()); } return {}; @@ -1383,7 +1383,7 @@ auto VLayoutPiece::ContourPath() const -> QPainterPath // Draw seam allowance QVector points = GetSeamAllowancePoints(); - if (ConstLast(points).toPoint() != ConstFirst(points).toPoint()) + if (points.constLast().toPoint() != points.constFirst().toPoint()) { points.append(points.at(0)); // Should be always closed } @@ -1527,7 +1527,7 @@ auto VLayoutPiece::MapPlaceLabelShape(PlaceLabelImg shape) const -> PlaceLabelIm //--------------------------------------------------------------------------------------------------------------------- auto VLayoutPiece::BoundingRect(QVector points) -> QRectF { - points.append(ConstFirst(points)); + points.append(points.constFirst()); return QPolygonF(points).boundingRect(); } diff --git a/src/libs/vlayout/vlayoutpiece_p.h b/src/libs/vlayout/vlayoutpiece_p.h index 1e28823fd..54f3753c9 100644 --- a/src/libs/vlayout/vlayoutpiece_p.h +++ b/src/libs/vlayout/vlayoutpiece_p.h @@ -36,11 +36,6 @@ #include "../vpatterndb/floatItemData/floatitemdef.h" #include "../vwidgets/vpiecegrainline.h" -#include "compatibility.h" - -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) #include "../vmisc/vdatastreamenum.h" @@ -262,7 +257,7 @@ inline auto operator>>(QDataStream &dataStream, VLayoutPieceData &piece) -> QDat { if (shape.size() >= 2) { - piece.m_grainline = VPieceGrainline(QLineF(ConstFirst(shape), ConstLast(shape)), arrowType); + piece.m_grainline = VPieceGrainline(QLineF(shape.constFirst(), shape.constLast()), arrowType); piece.m_grainline.SetEnabled(false); } else diff --git a/src/libs/vlayout/vlayoutpiecepath_p.h b/src/libs/vlayout/vlayoutpiecepath_p.h index a74d56adc..0aa1a0df9 100644 --- a/src/libs/vlayout/vlayoutpiecepath_p.h +++ b/src/libs/vlayout/vlayoutpiecepath_p.h @@ -34,10 +34,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) #include "../vmisc/vdatastreamenum.h" #endif diff --git a/src/libs/vlayout/vlayoutpoint.h b/src/libs/vlayout/vlayoutpoint.h index db9c83227..05693313b 100644 --- a/src/libs/vlayout/vlayoutpoint.h +++ b/src/libs/vlayout/vlayoutpoint.h @@ -33,10 +33,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor") diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index 1cbefb6d4..36594258d 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -280,7 +280,7 @@ void VPosition::SaveCandidate(VBestSquare &bestResult, const VLayoutPiece &detai } QVector newGContour = m_data.gContour.UniteWithContour(detail, globalI, detJ, type); - newGContour.append(ConstFirst(newGContour)); + newGContour.append(newGContour.constFirst()); const QSizeF size = QPolygonF(newGContour).boundingRect().size(); const QRectF boundingRect = detail.MappedDetailBoundingRect(); const qreal depthPosition = m_data.isOriginPaperOrientationPortrait ? boundingRect.y() : boundingRect.x(); diff --git a/src/libs/vlayout/vposter.cpp b/src/libs/vlayout/vposter.cpp index 80f2a690a..2359e6871 100644 --- a/src/libs/vlayout/vposter.cpp +++ b/src/libs/vlayout/vposter.cpp @@ -48,7 +48,6 @@ #include "../vmisc/compatibility.h" #include "../vmisc/def.h" #include "../vmisc/vabstractvalapplication.h" -#include "../vmisc/vmath.h" namespace { @@ -158,11 +157,7 @@ auto VPoster::Tile(QGraphicsItem *parent, const PosterData &img, vsizetype sheet const QString &watermarkPath) const -> QVector { QVector data; -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) data.append(Borders(parent, img, sheets)); -#else - data += Borders(parent, img, sheets); -#endif if (watermarkData.opacity > 0) { diff --git a/src/libs/vlayout/vprintlayout.cpp b/src/libs/vlayout/vprintlayout.cpp index 27b0677e8..7537aaed2 100644 --- a/src/libs/vlayout/vprintlayout.cpp +++ b/src/libs/vlayout/vprintlayout.cpp @@ -45,7 +45,6 @@ #include "../ifc/exception/vexception.h" #include "../ifc/xml/vwatermarkconverter.h" #include "../vformat/vwatermark.h" -#include "../vmisc/compatibility.h" #include "../vmisc/vabstractvalapplication.h" #include "../vpropertyexplorer/checkablemessagebox.h" #include "dialogs/dialoglayoutscale.h" @@ -126,7 +125,7 @@ auto PreparePrinter(const QPrinterInfo &info, QPrinter::PrinterMode mode) -> QSh return {}; } - tmpInfo = QPrinterInfo::printerInfo(ConstFirst(list)); + tmpInfo = QPrinterInfo::printerInfo(list.constFirst()); } auto printer = QSharedPointer(new QPrinter(tmpInfo, mode)); diff --git a/src/libs/vlayout/vrawsapoint.h b/src/libs/vlayout/vrawsapoint.h index 9b0614d7a..1667821f4 100644 --- a/src/libs/vlayout/vrawsapoint.h +++ b/src/libs/vlayout/vrawsapoint.h @@ -30,9 +30,6 @@ #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "vlayoutpoint.h" QT_WARNING_PUSH diff --git a/src/libs/vlayout/vsapoint.h b/src/libs/vlayout/vsapoint.h index 2a11ada18..babe85618 100644 --- a/src/libs/vlayout/vsapoint.h +++ b/src/libs/vlayout/vsapoint.h @@ -35,10 +35,6 @@ #include "../vmisc/def.h" #include "vlayoutpoint.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor") diff --git a/src/libs/vlayout/vtextmanager.cpp b/src/libs/vlayout/vtextmanager.cpp index cd5fa22d7..ae1637ee2 100644 --- a/src/libs/vlayout/vtextmanager.cpp +++ b/src/libs/vlayout/vtextmanager.cpp @@ -55,10 +55,6 @@ #include "../vpatterndb/vcontainer.h" #include "vtextmanager.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace { QT_WARNING_PUSH @@ -914,9 +910,9 @@ auto VTextManager::BreakTextIntoLines(const QString &text, const QFont &font, in } else { - const int width = TextWidth(fontMetrics, ConstFirst(subWords)); + const int width = TextWidth(fontMetrics, subWords.constFirst()); const int tWidth = !currentLine.isEmpty() ? currentLineWidth + spaceWidth + width : width; - AppendWord(ConstFirst(subWords), tWidth); + AppendWord(subWords.constFirst(), tWidth); lines.append(currentLine); if (subWords.size() == 2) @@ -925,7 +921,7 @@ auto VTextManager::BreakTextIntoLines(const QString &text, const QFont &font, in currentLineWidth = 0; // Insert the item after the current item - iterator.insert(ConstLast(subWords)); + iterator.insert(subWords.constLast()); iterator.previous(); } } @@ -1014,9 +1010,9 @@ auto VTextManager::BreakTextIntoLines(const QString &text, const VSvgFont &font, } else { - const int width = qRound(engine.TextWidth(ConstFirst(subWords), penWidth)); + const int width = qRound(engine.TextWidth(subWords.constFirst(), penWidth)); const int tWidth = !currentLine.isEmpty() ? currentLineWidth + spaceWidth + width : width; - AppendWord(ConstFirst(subWords), tWidth); + AppendWord(subWords.constFirst(), tWidth); lines.append(currentLine); if (subWords.size() == 2) @@ -1025,7 +1021,7 @@ auto VTextManager::BreakTextIntoLines(const QString &text, const VSvgFont &font, currentLineWidth = 0; // Insert the item after the current item - iterator.insert(ConstLast(subWords)); + iterator.insert(subWords.constLast()); iterator.previous(); } } diff --git a/src/libs/vmisc/backport/qoverload.h b/src/libs/vmisc/backport/qoverload.h index 77156d9d5..508cc926e 100644 --- a/src/libs/vmisc/backport/qoverload.h +++ b/src/libs/vmisc/backport/qoverload.h @@ -33,10 +33,6 @@ #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #if defined(Q_COMPILER_VARIADIC_TEMPLATES) -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") diff --git a/src/libs/vmisc/backport/text.h b/src/libs/vmisc/backport/text.h index 5d34659a2..7cf107266 100644 --- a/src/libs/vmisc/backport/text.h +++ b/src/libs/vmisc/backport/text.h @@ -33,10 +33,6 @@ #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace Qt { QT_WARNING_PUSH diff --git a/src/libs/vmisc/compatibility.h b/src/libs/vmisc/compatibility.h index e3a23d8a4..aa553e2c5 100644 --- a/src/libs/vmisc/compatibility.h +++ b/src/libs/vmisc/compatibility.h @@ -52,54 +52,9 @@ #define REGISTER_META_TYPE_STREAM_OPERATORS(TYPE) qRegisterMetaTypeStreamOperators(#TYPE); #endif // QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - class QPointF; // Contains helpful methods to hide version dependent code. It can be deprecation of method or change in API - -//--------------------------------------------------------------------------------------------------------------------- -template class Cont> inline auto ConstFirst(const Cont &container) -> const T & -{ -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) - return container.constFirst(); -#else - return container.first(); // clazy:exclude=detaching-temporary -#endif -} - -//--------------------------------------------------------------------------------------------------------------------- -template inline auto ConstFirst(const C &container) -> const T & -{ -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) - return container.constFirst(); -#else - return container.first(); // clazy:exclude=detaching-temporary -#endif -} - -//--------------------------------------------------------------------------------------------------------------------- -template class Cont> inline auto ConstLast(const Cont &container) -> const T & -{ -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) - return container.constLast(); -#else - return container.last(); // clazy:exclude=detaching-temporary -#endif -} - -//--------------------------------------------------------------------------------------------------------------------- -template inline auto ConstLast(const C &container) -> const T & -{ -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) - return container.constLast(); -#else - return container.last(); // clazy:exclude=detaching-temporary -#endif -} - //--------------------------------------------------------------------------------------------------------------------- template inline auto Intersects(const T &l1, const T &l2, QPointF *intersectionPoint) -> typename T::IntersectType @@ -179,29 +134,6 @@ template inline auto ConvertToVector(const QSet &container) -> Q // #endif //} -//--------------------------------------------------------------------------------------------------------------------- -template inline void Move(T &vector, int from, int to) -{ - QT_WARNING_PUSH - // cppcheck-suppress unknownMacro - QT_WARNING_DISABLE_GCC("-Wstrict-overflow") - -#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) - Q_ASSERT_X(from >= 0 && from < vector.size(), "QVector::move(int,int)", "'from' is out-of-range"); - Q_ASSERT_X(to >= 0 && to < vector.size(), "QVector::move(int,int)", "'to' is out-of-range"); - if (from == to) // don't detach when no-op - { - return; - } - typename T::iterator b = vector.begin(); - from < to ? std::rotate(b + from, b + from + 1, b + to + 1) : std::rotate(b + to, b + from, b + from + 1); -#else - vector.move(from, to); -#endif // QT_VERSION < QT_VERSION_CHECK(5, 6, 0) - - QT_WARNING_POP -} - //--------------------------------------------------------------------------------------------------------------------- template inline auto Reverse(const QVector &container) -> QVector { @@ -233,42 +165,6 @@ inline auto Reverse(const T &container) -> T return Reverse(container); } -//--------------------------------------------------------------------------------------------------------------------- -template inline void AppendTo(Cont &container, const Input &input) -{ -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) - container.append(input); -#else - for (auto &item : input) - { - container.append(item); - } -#endif // QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) -} - -//--------------------------------------------------------------------------------------------------------------------- -template inline auto SetIntersects(const QSet &set1, const QSet &set2) -> bool -{ -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) - return set1.intersects(set2); -#else - const bool otherIsBigger = set2.size() > set1.size(); - const QSet &smallestSet = otherIsBigger ? set1 : set2; - const QSet &biggestSet = otherIsBigger ? set2 : set1; - typename QSet::const_iterator i = smallestSet.cbegin(); - typename QSet::const_iterator e = smallestSet.cend(); - while (i != e) - { - if (biggestSet.contains(*i)) - { - return true; - } - ++i; - } - return false; -#endif -} - //--------------------------------------------------------------------------------------------------------------------- inline auto TextWidth(const QFontMetrics &fm, const QString &text, int len = -1) -> int { diff --git a/src/libs/vmisc/def.cpp b/src/libs/vmisc/def.cpp index ff2133e90..a13aa9413 100644 --- a/src/libs/vmisc/def.cpp +++ b/src/libs/vmisc/def.cpp @@ -61,10 +61,6 @@ #include "../ifc/exception/vexception.h" #include "literals.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace { //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index bd68ed367..c3d7b94b9 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -43,9 +43,6 @@ #include "debugbreak.h" #include "defglobal.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) template class QSharedPointer; @@ -54,22 +51,6 @@ template class QSharedPointer; #include // and, not, or #endif -// Backport of relaxed constexpr -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#if defined Q_COMPILER_CONSTEXPR -#if defined(__cpp_constexpr) && __cpp_constexpr - 0 >= 201304 -#define Q_DECL_RELAXED_CONSTEXPR constexpr -#define Q_RELAXED_CONSTEXPR constexpr -#else -#define Q_DECL_RELAXED_CONSTEXPR -#define Q_RELAXED_CONSTEXPR const -#endif -#else -#define Q_DECL_RELAXED_CONSTEXPR -#define Q_RELAXED_CONSTEXPR const -#endif -#endif - #if (defined(Q_CC_GNU) && Q_CC_GNU <= 409) && !defined(Q_CC_CLANG) // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define COPY_CONSTRUCTOR_IMPL(className) \ diff --git a/src/libs/vmisc/diagnostic.h b/src/libs/vmisc/diagnostic.h deleted file mode 100644 index dc6e968c4..000000000 --- a/src/libs/vmisc/diagnostic.h +++ /dev/null @@ -1,96 +0,0 @@ -/************************************************************************ - ** - ** @file diagnostic.h - ** @author Roman Telezhynskyi - ** @date 6 8, 2016 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentina project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2016 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#ifndef DIAGNOSTIC_H -#define DIAGNOSTIC_H - -#include - -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - -/* - * Warning/diagnostic handling - */ - -#define QT_DO_PRAGMA(text) _Pragma(#text) -#if defined(Q_CC_INTEL) && defined(Q_CC_MSVC) -/* icl.exe: Intel compiler on Windows */ -#undef QT_DO_PRAGMA /* not needed */ -#define QT_WARNING_PUSH __pragma(warning(push)) -#define QT_WARNING_POP __pragma(warning(pop)) -#define QT_WARNING_DISABLE_MSVC(number) -#define QT_WARNING_DISABLE_INTEL(number) __pragma(warning(disable : number)) -#define QT_WARNING_DISABLE_CLANG(text) -#define QT_WARNING_DISABLE_GCC(text) -#elif defined(Q_CC_INTEL) -/* icc: Intel compiler on Linux or OS X */ -#define QT_WARNING_PUSH QT_DO_PRAGMA(warning(push)) -#define QT_WARNING_POP QT_DO_PRAGMA(warning(pop)) -#define QT_WARNING_DISABLE_INTEL(number) QT_DO_PRAGMA(warning(disable : number)) -#define QT_WARNING_DISABLE_MSVC(number) -#define QT_WARNING_DISABLE_CLANG(text) -#define QT_WARNING_DISABLE_GCC(text) -#elif defined(Q_CC_MSVC) && _MSC_VER >= 1500 -#undef QT_DO_PRAGMA /* not needed */ -#define QT_WARNING_PUSH __pragma(warning(push)) -#define QT_WARNING_POP __pragma(warning(pop)) -#define QT_WARNING_DISABLE_MSVC(number) __pragma(warning(disable : number)) -#define QT_WARNING_DISABLE_INTEL(number) -#define QT_WARNING_DISABLE_CLANG(text) -#define QT_WARNING_DISABLE_GCC(text) -#elif defined(Q_CC_CLANG) -#define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push) -#define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop) -#define QT_WARNING_DISABLE_CLANG(text) QT_DO_PRAGMA(clang diagnostic ignored text) -#define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text) // GCC directives work in Clang too -#define QT_WARNING_DISABLE_INTEL(number) -#define QT_WARNING_DISABLE_MSVC(number) -#elif defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) -#define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push) -#define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop) -#define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text) -#define QT_WARNING_DISABLE_CLANG(text) -#define QT_WARNING_DISABLE_INTEL(number) -#define QT_WARNING_DISABLE_MSVC(number) -#else // All other compilers, GCC < 4.6 and MSVC < 2008 -#define QT_WARNING_DISABLE_GCC(text) -#define QT_WARNING_PUSH -#define QT_WARNING_POP -#define QT_WARNING_DISABLE_INTEL(number) -#define QT_WARNING_DISABLE_MSVC(number) -#define QT_WARNING_DISABLE_CLANG(text) -#define QT_WARNING_DISABLE_GCC(text) -#endif - -#else - -#include - -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - -#endif // DIAGNOSTIC_H diff --git a/src/libs/vmisc/fpm/math.hpp b/src/libs/vmisc/fpm/math.hpp index 5093c9ef5..6b7ca983f 100644 --- a/src/libs/vmisc/fpm/math.hpp +++ b/src/libs/vmisc/fpm/math.hpp @@ -10,10 +10,6 @@ #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace fpm { diff --git a/src/libs/vmisc/qxtcsvmodel.cpp b/src/libs/vmisc/qxtcsvmodel.cpp index 9ef111473..675eb44e1 100644 --- a/src/libs/vmisc/qxtcsvmodel.cpp +++ b/src/libs/vmisc/qxtcsvmodel.cpp @@ -46,10 +46,6 @@ #include #endif -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) #include "backport/text.h" #endif diff --git a/src/libs/vmisc/svgfont/vsvgfont_p.h b/src/libs/vmisc/svgfont/vsvgfont_p.h index f30321cda..b3c85090b 100644 --- a/src/libs/vmisc/svgfont/vsvgfont_p.h +++ b/src/libs/vmisc/svgfont/vsvgfont_p.h @@ -30,9 +30,7 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) + #include "../defglobal.h" #include "svgdef.h" diff --git a/src/libs/vmisc/svgfont/vsvgfontdatabase.cpp b/src/libs/vmisc/svgfont/vsvgfontdatabase.cpp index 3837bf0ba..d8b537540 100644 --- a/src/libs/vmisc/svgfont/vsvgfontdatabase.cpp +++ b/src/libs/vmisc/svgfont/vsvgfontdatabase.cpp @@ -38,10 +38,6 @@ #include "vsvgfontengine.h" #include "vsvgfontreader.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace { QT_WARNING_PUSH diff --git a/src/libs/vmisc/svgfont/vsvgfontengine_p.h b/src/libs/vmisc/svgfont/vsvgfontengine_p.h index e9f4fac60..db433307f 100644 --- a/src/libs/vmisc/svgfont/vsvgfontengine_p.h +++ b/src/libs/vmisc/svgfont/vsvgfontengine_p.h @@ -32,9 +32,7 @@ #include #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) + #include "../defglobal.h" #include "vsvgglyph.h" diff --git a/src/libs/vmisc/svgfont/vsvgglyph_p.h b/src/libs/vmisc/svgfont/vsvgglyph_p.h index 394ade356..3bbe4dc0d 100644 --- a/src/libs/vmisc/svgfont/vsvgglyph_p.h +++ b/src/libs/vmisc/svgfont/vsvgglyph_p.h @@ -31,9 +31,7 @@ #include #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) + #include "../defglobal.h" QT_WARNING_PUSH diff --git a/src/libs/vmisc/svgfont/vsvgpathtokenizer.cpp b/src/libs/vmisc/svgfont/vsvgpathtokenizer.cpp index 9d3a39cec..eb4e79a71 100644 --- a/src/libs/vmisc/svgfont/vsvgpathtokenizer.cpp +++ b/src/libs/vmisc/svgfont/vsvgpathtokenizer.cpp @@ -32,10 +32,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #include "../compatibility.h" namespace diff --git a/src/libs/vmisc/theme/vmanuallayoutstyle.cpp b/src/libs/vmisc/theme/vmanuallayoutstyle.cpp index d4f2732d6..74c3fb5d2 100644 --- a/src/libs/vmisc/theme/vmanuallayoutstyle.cpp +++ b/src/libs/vmisc/theme/vmanuallayoutstyle.cpp @@ -30,10 +30,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace { QT_WARNING_PUSH diff --git a/src/libs/vmisc/theme/vpatternpiecestyle.cpp b/src/libs/vmisc/theme/vpatternpiecestyle.cpp index 811c6b959..497ae725f 100644 --- a/src/libs/vmisc/theme/vpatternpiecestyle.cpp +++ b/src/libs/vmisc/theme/vpatternpiecestyle.cpp @@ -29,10 +29,6 @@ #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace { QT_WARNING_PUSH diff --git a/src/libs/vmisc/theme/vtoolstyle.cpp b/src/libs/vmisc/theme/vtoolstyle.cpp index 9cf139318..4e4337730 100644 --- a/src/libs/vmisc/theme/vtoolstyle.cpp +++ b/src/libs/vmisc/theme/vtoolstyle.cpp @@ -33,10 +33,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace { QT_WARNING_PUSH diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp index 0f68add98..7bc2805a9 100644 --- a/src/libs/vmisc/vabstractapplication.cpp +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -42,7 +42,6 @@ #include "QtConcurrent/qtconcurrentrun.h" #include "compatibility.h" -#include "literals.h" #include "svgfont/vsvgfontdatabase.h" #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) @@ -112,7 +111,6 @@ VAbstractApplication::VAbstractApplication(int &argc, char **argv) { QString rules; -#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 1) #if defined(V_NO_ASSERT) // Ignore SSL-related warnings // See issue #528: Error: QSslSocket: cannot resolve SSLv2_client_method. @@ -121,7 +119,6 @@ VAbstractApplication::VAbstractApplication(int &argc, char **argv) rules += QLatin1String("qt.network.ssl.critical=false\n" "qt.network.ssl.fatal=false\n"); #endif // defined(V_NO_ASSERT) -#endif // QT_VERSION >= QT_VERSION_CHECK(5, 4, 1) #if defined(V_NO_ASSERT) // See issue #992: QXcbConnection: XCB Error. @@ -135,7 +132,7 @@ VAbstractApplication::VAbstractApplication(int &argc, char **argv) QLoggingCategory::setFilterRules(rules); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // Enable support for HiDPI bitmap resources // The attribute is available since Qt 5.1, but by default disabled. // Because on Windows and Mac OS X we always use last version @@ -538,19 +535,11 @@ void VAbstractApplication::InitHighDpiScaling(int argc, char *argv[]) /* For more info see: http://doc.qt.io/qt-5/highdpi.html */ if (IsOptionSet(argc, argv, qPrintable(QLatin1String("--") + LONG_OPTION_NO_HDPI_SCALING))) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); -#else - qputenv("QT_DEVICE_PIXEL_RATIO", QByteArray("1")); -#endif } else { -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support -#else - qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", QByteArray("1")); -#endif } #else Q_UNUSED(argc); diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp index 44c56dc19..fe4773a3b 100644 --- a/src/libs/vmisc/vcommonsettings.cpp +++ b/src/libs/vmisc/vcommonsettings.cpp @@ -53,10 +53,6 @@ #include "defglobal.h" #include "literals.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - const int VCommonSettings::defaultScrollingDuration = 300; const int VCommonSettings::scrollingDurationMin = 100; const int VCommonSettings::scrollingDurationMax = 1000; @@ -1338,10 +1334,10 @@ void VCommonSettings::SetShowAccuracyRadius(bool value) auto VCommonSettings::GetLabelDateFormat() const -> QString { const QString format = - value(*settingLabelDateFormat, ConstFirst(VCommonSettings::PredefinedDateFormats())).toString(); + value(*settingLabelDateFormat, VCommonSettings::PredefinedDateFormats().constFirst()).toString(); const QStringList allFormats = VCommonSettings::PredefinedDateFormats() + GetUserDefinedDateFormats(); - return allFormats.contains(format) ? format : ConstFirst(VCommonSettings::PredefinedDateFormats()); + return allFormats.contains(format) ? format : VCommonSettings::PredefinedDateFormats().constFirst(); } //--------------------------------------------------------------------------------------------------------------------- @@ -1391,10 +1387,10 @@ void VCommonSettings::SetUserDefinedDateFormats(const QStringList &formats) auto VCommonSettings::GetLabelTimeFormat() const -> QString { const QString format = - value(*settingLabelTimeFormat, ConstFirst(VCommonSettings::PredefinedTimeFormats())).toString(); + value(*settingLabelTimeFormat, VCommonSettings::PredefinedTimeFormats().constFirst()).toString(); const QStringList allFormats = VCommonSettings::PredefinedTimeFormats() + GetUserDefinedTimeFormats(); - return allFormats.contains(format) ? format : ConstFirst(VCommonSettings::PredefinedTimeFormats()); + return allFormats.contains(format) ? format : VCommonSettings::PredefinedTimeFormats().constFirst(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vmisc/vlockguard.h b/src/libs/vmisc/vlockguard.h index 70a3e45bf..20ebd273d 100644 --- a/src/libs/vmisc/vlockguard.h +++ b/src/libs/vmisc/vlockguard.h @@ -38,10 +38,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) #include "../vmisc/defglobal.h" #endif diff --git a/src/libs/vmisc/vmisc.pri b/src/libs/vmisc/vmisc.pri index 6bc8c2368..14c03f1c5 100644 --- a/src/libs/vmisc/vmisc.pri +++ b/src/libs/vmisc/vmisc.pri @@ -109,7 +109,6 @@ HEADERS += \ $$PWD/commandoptions.h \ $$PWD/qxtcsvmodel.h \ $$PWD/vtablesearch.h \ - $$PWD/diagnostic.h \ $$PWD/dialogs/dialogexporttocsv.h \ $$PWD/customevents.h \ $$PWD/defglobal.h \ diff --git a/src/libs/vmisc/vmisc.qbs b/src/libs/vmisc/vmisc.qbs index fdae4369f..be41c89ce 100644 --- a/src/libs/vmisc/vmisc.qbs +++ b/src/libs/vmisc/vmisc.qbs @@ -34,7 +34,6 @@ VLib { "commandoptions.h", "qxtcsvmodel.h", "vtablesearch.h", - "diagnostic.h", "customevents.h", "defglobal.h", "testvapplication.h", diff --git a/src/libs/vmisc/vtablesearch.cpp b/src/libs/vmisc/vtablesearch.cpp index 2c1107718..ed7e26a9b 100644 --- a/src/libs/vmisc/vtablesearch.cpp +++ b/src/libs/vmisc/vtablesearch.cpp @@ -33,7 +33,6 @@ #include #include -#include "../vmisc/compatibility.h" #include "../vmisc/def.h" const int VTableSearch::MaxHistoryRecords = 10; @@ -161,7 +160,7 @@ auto VTableSearch::FindCurrentMatchIndex() const -> int return 0; } - QTableWidgetItem *selectedItem = ConstFirst(selectedItems); + QTableWidgetItem *selectedItem = selectedItems.constFirst(); for (int i = 0; i < searchList.size(); ++i) { diff --git a/src/libs/vmisc/vtextcodec.cpp b/src/libs/vmisc/vtextcodec.cpp index 4a8f212e3..e7c9c659a 100644 --- a/src/libs/vmisc/vtextcodec.cpp +++ b/src/libs/vmisc/vtextcodec.cpp @@ -31,7 +31,6 @@ #include #include "vabstractapplication.h" -#include "compatibility.h" namespace { @@ -134,7 +133,7 @@ auto VTextCodec::availableCodecs() -> QList auto i = codecs.constBegin(); while (i != codecs.constEnd()) { - names.append(ConstFirst(i.value()).toLatin1()); + names.append(i.value().constFirst().toLatin1()); ++i; } @@ -144,7 +143,7 @@ auto VTextCodec::availableCodecs() -> QList //--------------------------------------------------------------------------------------------------------------------- auto VTextCodec::name() const -> QString { - return ConstFirst(QtCodecs().value(m_encoding)); + return QtCodecs().value(m_encoding).constFirst(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vmisc/vvalentinasettings.cpp b/src/libs/vmisc/vvalentinasettings.cpp index 658bb0c56..411e4c527 100644 --- a/src/libs/vmisc/vvalentinasettings.cpp +++ b/src/libs/vmisc/vvalentinasettings.cpp @@ -43,10 +43,6 @@ #include "def.h" #include "qglobal.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #ifndef QPRINTENGINE_H Q_DECLARE_METATYPE(QMarginsF) // NOLINT #endif diff --git a/src/libs/vobj/delaunay.cpp b/src/libs/vobj/delaunay.cpp index 49e0f3620..64a3ef501 100644 --- a/src/libs/vobj/delaunay.cpp +++ b/src/libs/vobj/delaunay.cpp @@ -23,9 +23,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "delaunay.h" QT_WARNING_PUSH diff --git a/src/libs/vobj/vobjengine.cpp b/src/libs/vobj/vobjengine.cpp index 8683baf34..df8c6f63d 100644 --- a/src/libs/vobj/vobjengine.cpp +++ b/src/libs/vobj/vobjengine.cpp @@ -43,10 +43,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #include "../vmisc/defglobal.h" #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) diff --git a/src/libs/vobj/vobjpaintdevice.cpp b/src/libs/vobj/vobjpaintdevice.cpp index 35b0c7928..22ee91d91 100644 --- a/src/libs/vobj/vobjpaintdevice.cpp +++ b/src/libs/vobj/vobjpaintdevice.cpp @@ -160,9 +160,7 @@ auto VObjPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const -> in case QPaintDevice::PdmPhysicalDpiY: return engine->getResolution(); case QPaintDevice::PdmDevicePixelRatio: -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) case QPaintDevice::PdmDevicePixelRatioScaled: -#endif return 1; default: qWarning("VObjPaintDevice::metric(), unhandled metric %d\n", metric); diff --git a/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata_p.h b/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata_p.h index eb58a94c5..5588b8421 100644 --- a/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata_p.h +++ b/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata_p.h @@ -33,9 +33,6 @@ #include #include "../vmisc/defglobal.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") diff --git a/src/libs/vpatterndb/floatItemData/vgrainlinedata_p.h b/src/libs/vpatterndb/floatItemData/vgrainlinedata_p.h index 2ec463cc0..9fdf66dc4 100644 --- a/src/libs/vpatterndb/floatItemData/vgrainlinedata_p.h +++ b/src/libs/vpatterndb/floatItemData/vgrainlinedata_p.h @@ -34,9 +34,6 @@ #include "../vmisc/defglobal.h" #include "../vmisc/typedef.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "floatitemdef.h" QT_WARNING_PUSH diff --git a/src/libs/vpatterndb/floatItemData/vpatternlabeldata_p.h b/src/libs/vpatterndb/floatItemData/vpatternlabeldata_p.h index 4804a5ca1..a6d3c314e 100644 --- a/src/libs/vpatterndb/floatItemData/vpatternlabeldata_p.h +++ b/src/libs/vpatterndb/floatItemData/vpatternlabeldata_p.h @@ -35,9 +35,6 @@ #include "../vmisc/defglobal.h" #include "../vmisc/typedef.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") diff --git a/src/libs/vpatterndb/variables/vincrement_p.h b/src/libs/vpatterndb/variables/vincrement_p.h index ee2807542..ff7fe0512 100644 --- a/src/libs/vpatterndb/variables/vincrement_p.h +++ b/src/libs/vpatterndb/variables/vincrement_p.h @@ -32,9 +32,6 @@ #include #include "../vcontainer.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") diff --git a/src/libs/vpatterndb/variables/vmeasurement_p.h b/src/libs/vpatterndb/variables/vmeasurement_p.h index ccec91a42..15358f433 100644 --- a/src/libs/vpatterndb/variables/vmeasurement_p.h +++ b/src/libs/vpatterndb/variables/vmeasurement_p.h @@ -32,9 +32,6 @@ #include #include "../vcontainer.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") diff --git a/src/libs/vpatterndb/vcontainer.h b/src/libs/vpatterndb/vcontainer.h index e8fec7e2e..4a0e3ff48 100644 --- a/src/libs/vpatterndb/vcontainer.h +++ b/src/libs/vpatterndb/vcontainer.h @@ -48,9 +48,6 @@ #include "../vgeometry/vabstractcurve.h" #include "../vgeometry/vgobject.h" #include "../vmisc/def.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "variables/vinternalvariable.h" #include "vpiece.h" #include "vpiecepath.h" diff --git a/src/libs/vpatterndb/vformula_p.h b/src/libs/vpatterndb/vformula_p.h index 54408bbf4..2021b90af 100644 --- a/src/libs/vpatterndb/vformula_p.h +++ b/src/libs/vpatterndb/vformula_p.h @@ -32,9 +32,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vmisc/defglobal.h" #include "../vmisc/typedef.h" diff --git a/src/libs/vpatterndb/vnodedetail_p.h b/src/libs/vpatterndb/vnodedetail_p.h index 271382237..9f9fce485 100644 --- a/src/libs/vpatterndb/vnodedetail_p.h +++ b/src/libs/vpatterndb/vnodedetail_p.h @@ -30,9 +30,6 @@ #define VNODEDETAIL_P_H #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vmisc/def.h" #include "../vmisc/typedef.h" diff --git a/src/libs/vpatterndb/vpassmark.cpp b/src/libs/vpatterndb/vpassmark.cpp index ea9bf2539..834597ad3 100644 --- a/src/libs/vpatterndb/vpassmark.cpp +++ b/src/libs/vpatterndb/vpassmark.cpp @@ -69,7 +69,7 @@ auto GetSeamPassmarkSAPoint(const VPiecePassmarkData &passmarkData, const QVecto return PassmarkStatus::Error; // Something wrong } - point = ConstFirst(ekvPoints); // NOLINT(cppcoreguidelines-slicing) + point = ekvPoints.constFirst(); // NOLINT(cppcoreguidelines-slicing) return needRollback ? PassmarkStatus::Rollback : PassmarkStatus::Common; } @@ -197,7 +197,7 @@ auto FixNotchPoint(const QVector &seamAllowance, const VPiecePassmarkDa const QVector points = VAbstractCurve::CurveIntersectLine(seamAllowance, axis); if (points.size() == 1) { - *notch = ConstFirst(points); + *notch = points.constFirst(); } return true; } @@ -714,7 +714,7 @@ auto VPassmark::FindIntersection(const QLineF &line, const QVector &sea QVector intersections = VAbstractCurve::CurveIntersectLine(seamAllowance, testLine); if (not intersections.isEmpty()) { - return {line.p1(), ConstLast(intersections)}; + return {line.p1(), intersections.constLast()}; } return line; @@ -733,9 +733,9 @@ auto VPassmark::PassmarkIntersection(const QVector &path, QLineF line, if (not intersections.isEmpty()) { - if (ConstLast(intersections) != m_data.passmarkSAPoint) + if (intersections.constLast() != m_data.passmarkSAPoint) { - line = QLineF(ConstLast(intersections), m_data.passmarkSAPoint); + line = QLineF(intersections.constLast(), m_data.passmarkSAPoint); bool ok = false; const qreal length = PassmarkLength(m_data, width, ok); @@ -1081,19 +1081,19 @@ auto VPassmark::CreatePassmarkLines(const QVector &lines, const QVector< { if (m_data.passmarkAngleType == PassmarkAngleType::Straightforward) { - return (*create)(m_data, ConstFirst(lines), seamAllowance); + return (*create)(m_data, lines.constFirst(), seamAllowance); } QVector passmarksLines; if (side == PassmarkSide::All || side == PassmarkSide::Left) { - passmarksLines += (*create)(m_data, ConstFirst(lines), seamAllowance); + passmarksLines += (*create)(m_data, lines.constFirst(), seamAllowance); } if (side == PassmarkSide::All || side == PassmarkSide::Right) { - passmarksLines += (*create)(m_data, ConstLast(lines), seamAllowance); + passmarksLines += (*create)(m_data, lines.constLast(), seamAllowance); } return passmarksLines; @@ -1104,19 +1104,19 @@ auto VPassmark::CreatePassmarkLines(const QVector &lines, const QVector< { if (m_data.passmarkAngleType == PassmarkAngleType::Straightforward) { - return (*create)(m_data, ConstFirst(lines)); + return (*create)(m_data, lines.constFirst()); } QVector passmarksLines; if (side == PassmarkSide::All || side == PassmarkSide::Left) { - passmarksLines += (*create)(m_data, ConstFirst(lines)); + passmarksLines += (*create)(m_data, lines.constFirst()); } if (side == PassmarkSide::All || side == PassmarkSide::Right) { - passmarksLines += (*create)(m_data, ConstLast(lines)); + passmarksLines += (*create)(m_data, lines.constLast()); } return passmarksLines; @@ -1151,7 +1151,7 @@ auto VPassmark::CreatePassmarkLines(const QVector &lines, const QVector< switch (m_data.passmarkLineType) { case PassmarkLineType::TMark: - return CreateTMarkPassmark(m_data, ConstFirst(lines)); + return CreateTMarkPassmark(m_data, lines.constFirst()); case PassmarkLineType::OneLine: case PassmarkLineType::TwoLines: case PassmarkLineType::ThreeLines: @@ -1161,6 +1161,6 @@ auto VPassmark::CreatePassmarkLines(const QVector &lines, const QVector< case PassmarkLineType::BoxMark: case PassmarkLineType::CheckMark: default: - return {ConstFirst(lines)}; + return {lines.constFirst()}; } } diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index e3e71ad92..23a27953b 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -918,7 +918,7 @@ auto VPiece::GetPassmarkSAPoint(const QVector &path, vsizetype index return false; } - point = ConstFirst(points); + point = points.constFirst(); return true; } @@ -1090,11 +1090,7 @@ auto VPiece::CreatePassmark(const QVector &path, vsizetype previousI const QString infoMsg = tr("Notch for point '%1' in piece '%2' will be disabled. Manual length is less than " "allowed value.") .arg(VPiecePath::NodeName(path, passmarkIndex, data), GetName()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) qInfo() << VAbstractValApplication::warningMessageSignature + infoMsg; -#else - qWarning() << VAbstractValApplication::warningMessageSignature + infoMsg; -#endif return {}; } @@ -1157,7 +1153,7 @@ auto VPiece::Area(const QVector &shape, const VContainer *data) const - QVector points; CastTo(path.PathPoints(data, shape), points); - if (points.isEmpty() || not VFuzzyComparePoints(ConstFirst(points), ConstLast(points))) + if (points.isEmpty() || not VFuzzyComparePoints(points.constFirst(), points.constLast())) { continue; } @@ -1340,7 +1336,7 @@ void VPiece::TestInternalPathCuttingPathIntersection(const VContainer *data) con QVector points; CastTo(path.PathPoints(data, cuttingPoints), points); - if (points.isEmpty() || not VFuzzyComparePoints(ConstFirst(points), ConstLast(points))) + if (points.isEmpty() || not VFuzzyComparePoints(points.constFirst(), points.constLast())) { continue; } @@ -1398,7 +1394,7 @@ void VPiece::TestInternalPathsIntersections(const VContainer *data) const QVector pointsPath1; CastTo(path1.PathPoints(data, cuttingPoints), pointsPath1); - if (pointsPath1.isEmpty() || not VFuzzyComparePoints(ConstFirst(pointsPath1), ConstLast(pointsPath1))) + if (pointsPath1.isEmpty() || not VFuzzyComparePoints(pointsPath1.constFirst(), pointsPath1.constLast())) { continue; } @@ -1422,7 +1418,7 @@ void VPiece::TestInternalPathsIntersections(const VContainer *data) const QVector pointsPath2; CastTo(path2.PathPoints(data, cuttingPoints), pointsPath2); - if (pointsPath2.isEmpty() || not VFuzzyComparePoints(ConstFirst(pointsPath2), ConstLast(pointsPath2))) + if (pointsPath2.isEmpty() || not VFuzzyComparePoints(pointsPath2.constFirst(), pointsPath2.constLast())) { continue; } diff --git a/src/libs/vpatterndb/vpiece_p.h b/src/libs/vpatterndb/vpiece_p.h index 2f8490a1d..0026febe1 100644 --- a/src/libs/vpatterndb/vpiece_p.h +++ b/src/libs/vpatterndb/vpiece_p.h @@ -32,9 +32,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vmisc/def.h" #include "floatItemData/vgrainlinedata.h" #include "floatItemData/vpatternlabeldata.h" diff --git a/src/libs/vpatterndb/vpiecenode_p.h b/src/libs/vpatterndb/vpiecenode_p.h index f746decdc..50232a10d 100644 --- a/src/libs/vpatterndb/vpiecenode_p.h +++ b/src/libs/vpatterndb/vpiecenode_p.h @@ -35,9 +35,6 @@ #include "../ifc/exception/vexception.h" #include "../ifc/ifcdef.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) #include "../vmisc/vdatastreamenum.h" #endif diff --git a/src/libs/vpatterndb/vpiecepath.cpp b/src/libs/vpatterndb/vpiecepath.cpp index 3ee28d36f..2900497c7 100644 --- a/src/libs/vpatterndb/vpiecepath.cpp +++ b/src/libs/vpatterndb/vpiecepath.cpp @@ -86,7 +86,7 @@ auto CurveStartPoint(VSAPoint candidate, const VContainer *data, const VPieceNod for (auto &p : intersections) { - if (VFuzzyComparePoints(p, ConstFirst(curvePoints)) || VFuzzyComparePoints(p, ConstLast(curvePoints))) + if (VFuzzyComparePoints(p, curvePoints.constFirst()) || VFuzzyComparePoints(p, curvePoints.constLast())) { continue; } @@ -126,7 +126,7 @@ auto CurveEndPoint(VSAPoint candidate, const VContainer *data, const VPieceNode for (auto &p : intersections) { - if (VFuzzyComparePoints(p, ConstFirst(curvePoints)) || VFuzzyComparePoints(p, ConstLast(curvePoints))) + if (VFuzzyComparePoints(p, curvePoints.constFirst()) || VFuzzyComparePoints(p, curvePoints.constLast())) { continue; } @@ -181,7 +181,7 @@ template auto FindTipDirection(const QVector &points) -> qreal return 0; } - const T &first = ConstFirst(points); + const T &first = points.constFirst(); for (int i = 1; i < points.size(); ++i) { @@ -205,7 +205,7 @@ auto IntersectionWithCuttingContour(const QVector &cuttingPath, const Q return false; } - const QPointF &first = ConstFirst(points); + const QPointF &first = points.constFirst(); if (VAbstractCurve::IsPointOnCurve(cuttingPath, first)) { // Point is already part of a cutting contour @@ -615,7 +615,7 @@ auto VPiecePath::StartSegment(const VContainer *data, const QVector points = Reverse(points); } - VSAPoint begin(ConstFirst(points)); + VSAPoint begin(points.constFirst()); if (nodes.size() > 1) { @@ -650,7 +650,7 @@ auto VPiecePath::EndSegment(const VContainer *data, const QVector &n points = Reverse(points); } - VSAPoint end(ConstLast(points)); + VSAPoint end(points.constLast()); if (nodes.size() > 2) { diff --git a/src/libs/vpatterndb/vpiecepath_p.h b/src/libs/vpatterndb/vpiecepath_p.h index f6890730d..4d666de86 100644 --- a/src/libs/vpatterndb/vpiecepath_p.h +++ b/src/libs/vpatterndb/vpiecepath_p.h @@ -32,9 +32,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "vpiecenode.h" QT_WARNING_PUSH diff --git a/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.h b/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.h index d1551292c..ca95a306f 100644 --- a/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.h +++ b/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.h @@ -33,10 +33,6 @@ #include "../vpropertyexplorer_global.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - namespace VPE { diff --git a/src/libs/vpropertyexplorer/vabstractpropertyfactory.h b/src/libs/vpropertyexplorer/vabstractpropertyfactory.h index 541e526bf..c7d242ccc 100644 --- a/src/libs/vpropertyexplorer/vabstractpropertyfactory.h +++ b/src/libs/vpropertyexplorer/vabstractpropertyfactory.h @@ -22,9 +22,6 @@ #define VABSTRACTPROPERTYFACTORY_H #include "vpropertyexplorer_global.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include namespace VPE diff --git a/src/libs/vpropertyexplorer/vpropertyformview_p.h b/src/libs/vpropertyexplorer/vpropertyformview_p.h index b4c0e98c6..12e61c181 100644 --- a/src/libs/vpropertyexplorer/vpropertyformview_p.h +++ b/src/libs/vpropertyexplorer/vpropertyformview_p.h @@ -24,9 +24,6 @@ // ONLY INCLUDE THIS IN .CPP FILES #include "vpropertyformwidget_p.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) namespace VPE { diff --git a/src/libs/vpropertyexplorer/vpropertyformwidget_p.h b/src/libs/vpropertyexplorer/vpropertyformwidget_p.h index 9b9e1e8fc..a400a5129 100644 --- a/src/libs/vpropertyexplorer/vpropertyformwidget_p.h +++ b/src/libs/vpropertyexplorer/vpropertyformwidget_p.h @@ -25,9 +25,6 @@ #include "vproperty.h" #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) namespace VPE { diff --git a/src/libs/vpropertyexplorer/vwidgetproperty_p.h b/src/libs/vpropertyexplorer/vwidgetproperty_p.h index 402e49575..a5b34c5b8 100644 --- a/src/libs/vpropertyexplorer/vwidgetproperty_p.h +++ b/src/libs/vpropertyexplorer/vwidgetproperty_p.h @@ -24,9 +24,6 @@ // ONLY INCLUDE THIS IN .CPP FILES #include "vproperty_p.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include #include diff --git a/src/libs/vtest/abstracttest.cpp b/src/libs/vtest/abstracttest.cpp index 1dce86ce3..63a7c894a 100644 --- a/src/libs/vtest/abstracttest.cpp +++ b/src/libs/vtest/abstracttest.cpp @@ -81,7 +81,7 @@ auto FillPath(const QVector &path, qreal accuracy) -> QVector } } - pathFilled.append(ConstLast(path)); + pathFilled.append(path.constLast()); return pathFilled; } diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp b/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp index fcdf6a3b9..f8d240928 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp @@ -47,18 +47,12 @@ #include "../../visualization/line/operation/vistoolflippingbyline.h" #include "../../visualization/visualization.h" #include "../ifc/xml/vabstractpattern.h" -#include "../ifc/xml/vdomdocument.h" #include "../qmuparser/qmudef.h" -#include "../vgeometry/vpointf.h" -#include "../vmisc/compatibility.h" -#include "../vmisc/vabstractapplication.h" -#include "../vmisc/vcommonsettings.h" #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #include "../vmisc/backport/qoverload.h" #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #include "../../tools/drawTools/operation/vabstractoperation.h" #include "../vpatterndb/vcontainer.h" -#include "../vwidgets/vabstractmainwindow.h" #include "../vwidgets/vmaingraphicsscene.h" #include "../vwidgets/vmaingraphicsview.h" #include "ui_dialogflippingbyline.h" diff --git a/src/libs/vtools/tools/backgroundimage/vbackgroundimagecontrols.cpp b/src/libs/vtools/tools/backgroundimage/vbackgroundimagecontrols.cpp index 65ac11064..a2e950fb6 100644 --- a/src/libs/vtools/tools/backgroundimage/vbackgroundimagecontrols.cpp +++ b/src/libs/vtools/tools/backgroundimage/vbackgroundimagecontrols.cpp @@ -94,13 +94,11 @@ VBackgroundImageControls::VBackgroundImageControls(VAbstractPattern *doc, QGraph InitPixmaps(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) QGuiApplication *guiApp = qGuiApp; if (guiApp != nullptr) { connect(guiApp, &QGuiApplication::primaryScreenChanged, this, &VBackgroundImageControls::ScreenChanged); } -#endif } //--------------------------------------------------------------------------------------------------------------------- @@ -490,7 +488,6 @@ void VBackgroundImageControls::InitPixmaps() const QString resource = QStringLiteral("icon"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) if (QGuiApplication::primaryScreen()->devicePixelRatio() >= 2) { const QString fileName2x = QStringLiteral("32x32/%1@2x.png").arg(imageName); @@ -507,11 +504,7 @@ void VBackgroundImageControls::InitPixmaps() m_handleHoverPixmaps.insert(type, VTheme::GetPixmapResource(resource, fileNameHover)); m_handleDisabledPixmaps.insert(type, VTheme::GetPixmapResource(resource, fileNameDisabled)); } -#else - m_handlePixmaps.insert(type, VTheme::GetPixmapResource(resource, fileName)); - m_handleHoverPixmaps.insert(type, VTheme::GetPixmapResource(resource, fileNameHover)); - m_handleDisabledPixmaps.insert(type, VTheme::GetPixmapResource(resource, fileNameDisabled)); -#endif + QPainterPath p = PixmapToPainterPath(m_handlePixmaps.value(type)); p.setFillRule(Qt::WindingFill); p.closeSubpath(); diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp index eab756759..9d704bd27 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp @@ -51,9 +51,6 @@ #include "../vgeometry/vpointf.h" #include "../vmisc/vabstractapplication.h" #include "../vmisc/vcommonsettings.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vformula.h" #include "../vpatterndb/vtranslatevars.h" diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp index aa07d12e2..003c19418 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp @@ -57,16 +57,11 @@ #include "../vgeometry/vpointf.h" #include "../vgeometry/vspline.h" #include "../vgeometry/vsplinepath.h" -#include "../vmisc/compatibility.h" #include "../vmisc/vabstractapplication.h" #include "../vmisc/vcommonsettings.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vformula.h" #include "../vpatterndb/vtranslatevars.h" -#include "../vwidgets/vabstractsimple.h" #include "../vwidgets/vmaingraphicsscene.h" template class QSharedPointer; @@ -100,7 +95,7 @@ auto GetOriginPoint(const QVector &objects, const VContainer *data, case GOType::SplinePath: case GOType::CubicBezier: case GOType::CubicBezierPath: - AppendTo(originObjects, data->GeometricObject(object.id)->GetPoints()); + originObjects.append(data->GeometricObject(object.id)->GetPoints()); break; case GOType::Unknown: case GOType::PlaceLabel: diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp index 2d82e0ca7..2235966a4 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp @@ -60,9 +60,6 @@ #include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vformula.h" #include "../vpatterndb/vtranslatevars.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vwidgets/vmaingraphicsscene.h" class QDomElement; diff --git a/src/libs/vtools/tools/vabstracttool.h b/src/libs/vtools/tools/vabstracttool.h index 51723c542..29ae68cd2 100644 --- a/src/libs/vtools/tools/vabstracttool.h +++ b/src/libs/vtools/tools/vabstracttool.h @@ -40,9 +40,6 @@ #include "../vmisc/def.h" #include "../vtools/visualization/visualization.h" #include "../vwidgets/vmaingraphicsscene.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "vdatatool.h" class VGraphicsSimpleTextItem; diff --git a/src/libs/vtools/undocommands/savepieceoptions.cpp b/src/libs/vtools/undocommands/savepieceoptions.cpp index 089d388d0..f0fe427af 100644 --- a/src/libs/vtools/undocommands/savepieceoptions.cpp +++ b/src/libs/vtools/undocommands/savepieceoptions.cpp @@ -28,28 +28,24 @@ #include "savepieceoptions.h" +#include #include #include #include -#include #include "../ifc/xml/vabstractpattern.h" -#include "../ifc/ifcdef.h" -#include "../vmisc/def.h" -#include "../vmisc/compatibility.h" -#include "../vpatterndb/vpiecenode.h" -#include "../vpatterndb/floatItemData/vpatternlabeldata.h" -#include "../vpatterndb/floatItemData/vpiecelabeldata.h" -#include "../vpatterndb/floatItemData/vgrainlinedata.h" #include "../tools/vtoolseamallowance.h" +#include "../vmisc/compatibility.h" +#include "../vmisc/def.h" +#include "../vpatterndb/vpiecenode.h" #include "vundocommand.h" //--------------------------------------------------------------------------------------------------------------------- SavePieceOptions::SavePieceOptions(const VPiece &oldDet, const VPiece &newDet, VAbstractPattern *doc, quint32 id, QUndoCommand *parent) - : VUndoCommand(QDomElement(), doc, parent), - m_oldDet(oldDet), - m_newDet(newDet) + : VUndoCommand(QDomElement(), doc, parent), + m_oldDet(oldDet), + m_newDet(newDet) { setText(tr("save detail options")); nodeId = id; @@ -64,7 +60,7 @@ void SavePieceOptions::undo() if (domElement.isElement()) { VToolSeamAllowance::AddAttributes(doc, domElement, nodeId, m_oldDet); - doc->RemoveAllChildren(domElement);//Very important to clear before rewrite + doc->RemoveAllChildren(domElement); // Very important to clear before rewrite VToolSeamAllowance::AddPatternPieceData(doc, domElement, m_oldDet); VToolSeamAllowance::AddPatternInfo(doc, domElement, m_oldDet); VToolSeamAllowance::AddGrainline(doc, domElement, m_oldDet); @@ -88,7 +84,7 @@ void SavePieceOptions::undo() DecrementReferences(m_newDet.MissingPlaceLabels(m_oldDet)); IncrementReferences(m_oldDet.MissingPlaceLabels(m_newDet)); - + if (VToolSeamAllowance *tool = qobject_cast(VAbstractPattern::getTool(nodeId))) { tool->Update(m_oldDet); @@ -111,7 +107,7 @@ void SavePieceOptions::redo() if (domElement.isElement()) { VToolSeamAllowance::AddAttributes(doc, domElement, nodeId, m_newDet); - doc->RemoveAllChildren(domElement);//Very important to clear before rewrite + doc->RemoveAllChildren(domElement); // Very important to clear before rewrite VToolSeamAllowance::AddPatternPieceData(doc, domElement, m_newDet); VToolSeamAllowance::AddPatternInfo(doc, domElement, m_newDet); VToolSeamAllowance::AddGrainline(doc, domElement, m_newDet); @@ -181,9 +177,9 @@ auto SavePieceOptions::mergeWith(const QUndoCommand *command) -> bool for (int i = 0; i < nodes.size(); ++i) { - if (nodes.at(i).IsExcluded() != candidateNodes.at(i).IsExcluded() - || nodes.at(i).IsCheckUniqueness() != candidateNodes.at(i).IsCheckUniqueness() - || nodes.at(i).IsPassmark() != candidateNodes.at(i).IsPassmark()) + if (nodes.at(i).IsExcluded() != candidateNodes.at(i).IsExcluded() || + nodes.at(i).IsCheckUniqueness() != candidateNodes.at(i).IsCheckUniqueness() || + nodes.at(i).IsPassmark() != candidateNodes.at(i).IsPassmark()) { return false; } diff --git a/src/libs/vtools/undocommands/savetooloptions.cpp b/src/libs/vtools/undocommands/savetooloptions.cpp index 0480875b5..ef23215ea 100644 --- a/src/libs/vtools/undocommands/savetooloptions.cpp +++ b/src/libs/vtools/undocommands/savetooloptions.cpp @@ -30,20 +30,19 @@ #include -#include "../vmisc/def.h" -#include "../vmisc/compatibility.h" #include "../ifc/xml/vabstractpattern.h" +#include "../vmisc/compatibility.h" #include "vundocommand.h" //--------------------------------------------------------------------------------------------------------------------- SaveToolOptions::SaveToolOptions(const QDomElement &oldXml, const QDomElement &newXml, const QList &oldDependencies, const QList &newDependencies, VAbstractPattern *doc, const quint32 &id, QUndoCommand *parent) - : VUndoCommand(QDomElement(), doc, parent), - oldXml(oldXml), - newXml(newXml), - oldDependencies(oldDependencies), - newDependencies(newDependencies) + : VUndoCommand(QDomElement(), doc, parent), + oldXml(oldXml), + newXml(newXml), + oldDependencies(oldDependencies), + newDependencies(newDependencies) { setText(tr("save tool option")); nodeId = id; diff --git a/src/libs/vtools/visualization/line/operation/vistoolmove.cpp b/src/libs/vtools/visualization/line/operation/vistoolmove.cpp index d99e99ceb..c58a9ac38 100644 --- a/src/libs/vtools/visualization/line/operation/vistoolmove.cpp +++ b/src/libs/vtools/visualization/line/operation/vistoolmove.cpp @@ -38,9 +38,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vgeometry/vabstractcurve.h" #include "../vgeometry/varc.h" #include "../vgeometry/vcubicbezier.h" diff --git a/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp b/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp index 470b70579..37fae7d70 100644 --- a/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp +++ b/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp @@ -38,9 +38,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vgeometry/vabstractcurve.h" #include "../vgeometry/varc.h" #include "../vgeometry/vcubicbezier.h" diff --git a/src/libs/vtools/visualization/path/vistoolcubicbezierpath.cpp b/src/libs/vtools/visualization/path/vistoolcubicbezierpath.cpp index b05e5f0de..a9a6961fd 100644 --- a/src/libs/vtools/visualization/path/vistoolcubicbezierpath.cpp +++ b/src/libs/vtools/visualization/path/vistoolcubicbezierpath.cpp @@ -39,7 +39,6 @@ #include "../vgeometry/vpointf.h" #include "../vgeometry/vspline.h" #include "../visualization.h" -#include "../vmisc/compatibility.h" #include "../vmisc/vmodifierkey.h" #include "../vwidgets/scalesceneitems.h" #include "theme/themeDef.h" @@ -186,7 +185,7 @@ void VisToolCubicBezierPath::Creating(const QVector &pathPoints, vsizet { case 0: { - const VPointF &p1 = ConstLast(pathPoints); + const VPointF &p1 = pathPoints.constLast(); if (pathPoints.size() >= 4) { QLineF p1p2(static_cast(p1), ScenePos()); diff --git a/src/libs/vtools/visualization/path/vistoolpiece.cpp b/src/libs/vtools/visualization/path/vistoolpiece.cpp index b5617edb6..52f01296a 100644 --- a/src/libs/vtools/visualization/path/vistoolpiece.cpp +++ b/src/libs/vtools/visualization/path/vistoolpiece.cpp @@ -78,11 +78,11 @@ void VisToolPiece::RefreshGeometry() DrawPath(path, m_cachedCurvesPath.at(i)); } - DrawLine(m_line1, QLineF(ConstFirst(m_cachedMainPathPoints), ScenePos()), Qt::DashLine); + DrawLine(m_line1, QLineF(m_cachedMainPathPoints.constFirst(), ScenePos()), Qt::DashLine); if (m_cachedMainPathPoints.size() > 1) { - DrawLine(m_line2, QLineF(ConstLast(m_cachedMainPathPoints), ScenePos()), Qt::DashLine); + DrawLine(m_line2, QLineF(m_cachedMainPathPoints.constLast(), ScenePos()), Qt::DashLine); } } } diff --git a/src/libs/vtools/visualization/path/vistoolpiecepath.cpp b/src/libs/vtools/visualization/path/vistoolpiecepath.cpp index 6f3775a66..6a87760f1 100644 --- a/src/libs/vtools/visualization/path/vistoolpiecepath.cpp +++ b/src/libs/vtools/visualization/path/vistoolpiecepath.cpp @@ -29,7 +29,6 @@ #include "vistoolpiecepath.h" #include "../vgeometry/vpointf.h" #include "../vlayout/vlayoutpoint.h" -#include "../vmisc/compatibility.h" #include "../vwidgets/scalesceneitems.h" #include "../vwidgets/vsimplepoint.h" @@ -66,7 +65,7 @@ void VisToolPiecePath::RefreshGeometry() const QVector points = m_path.PathPoints(GetData()); if (not points.empty()) { - DrawLine(m_line, QLineF(ConstLast(points), ScenePos()), Qt::DashLine); + DrawLine(m_line, QLineF(points.constLast(), ScenePos()), Qt::DashLine); } } } diff --git a/src/libs/vwidgets/global.cpp b/src/libs/vwidgets/global.cpp index 03bebb2e4..f1bfbb694 100644 --- a/src/libs/vwidgets/global.cpp +++ b/src/libs/vwidgets/global.cpp @@ -27,7 +27,6 @@ *************************************************************************/ #include "global.h" -#include "../vmisc/compatibility.h" #include "../vmisc/def.h" #include "../vmisc/vabstractapplication.h" @@ -56,7 +55,7 @@ auto SceneScale(QGraphicsScene *scene) -> qreal const QList views = scene->views(); if (not views.isEmpty()) { - scale = ConstFirst(views)->transform().m11(); + scale = views.constFirst()->transform().m11(); } } diff --git a/src/libs/vwidgets/vabstractmainwindow.cpp b/src/libs/vwidgets/vabstractmainwindow.cpp index 7d0cb1fe6..e2bd018aa 100644 --- a/src/libs/vwidgets/vabstractmainwindow.cpp +++ b/src/libs/vwidgets/vabstractmainwindow.cpp @@ -112,8 +112,7 @@ auto RecentFiles(const QStringList &paths) -> QStringList if (optimized.size() >= 3) { - optimized = QStringList({ConstFirst(optimized), QStringLiteral("…"), - ConstLast(optimized)}); + optimized = QStringList({optimized.constFirst(), QStringLiteral("…"), optimized.constLast()}); } return optimized; diff --git a/src/libs/vwidgets/vabstractmainwindow.h b/src/libs/vwidgets/vabstractmainwindow.h index 431685eed..7e4ae2fd7 100644 --- a/src/libs/vwidgets/vabstractmainwindow.h +++ b/src/libs/vwidgets/vabstractmainwindow.h @@ -34,10 +34,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) #include "../vmisc/defglobal.h" #endif diff --git a/src/libs/vwidgets/vgraphicssimpletextitem.h b/src/libs/vwidgets/vgraphicssimpletextitem.h index b0633fd22..078cf7de5 100644 --- a/src/libs/vwidgets/vgraphicssimpletextitem.h +++ b/src/libs/vwidgets/vgraphicssimpletextitem.h @@ -41,10 +41,6 @@ #include "../vmisc/def.h" #include "../vmisc/theme/themeDef.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) -#include "../vmisc/defglobal.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - /** * @brief The VGraphicsSimpleTextItem class pointer label. */ diff --git a/src/test/CollectionTest/tst_tapecommandline.cpp b/src/test/CollectionTest/tst_tapecommandline.cpp index 52b00bf18..9279899a3 100644 --- a/src/test/CollectionTest/tst_tapecommandline.cpp +++ b/src/test/CollectionTest/tst_tapecommandline.cpp @@ -29,10 +29,6 @@ #include "tst_tapecommandline.h" #include "../vmisc/vsysexits.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #include #include diff --git a/src/test/CollectionTest/tst_valentinacommandline.cpp b/src/test/CollectionTest/tst_valentinacommandline.cpp index c4654af40..f2b241e64 100644 --- a/src/test/CollectionTest/tst_valentinacommandline.cpp +++ b/src/test/CollectionTest/tst_valentinacommandline.cpp @@ -29,10 +29,6 @@ #include "tst_valentinacommandline.h" #include "../vmisc/vsysexits.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#include "../vmisc/diagnostic.h" -#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - #include #include diff --git a/src/test/TranslationsTest/tst_tslocaletranslation.cpp b/src/test/TranslationsTest/tst_tslocaletranslation.cpp index 7dcb501a2..180843031 100644 --- a/src/test/TranslationsTest/tst_tslocaletranslation.cpp +++ b/src/test/TranslationsTest/tst_tslocaletranslation.cpp @@ -30,10 +30,6 @@ #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -Q_DECLARE_METATYPE(Qt::LayoutDirection) -#endif - //--------------------------------------------------------------------------------------------------------------------- TST_TSLocaleTranslation::TST_TSLocaleTranslation(const QString &locale, QObject *parent) : TST_AbstractTranslation(parent), diff --git a/src/test/ValentinaTest/tst_dxf.cpp b/src/test/ValentinaTest/tst_dxf.cpp index b6eb34024..4239f1e0d 100644 --- a/src/test/ValentinaTest/tst_dxf.cpp +++ b/src/test/ValentinaTest/tst_dxf.cpp @@ -29,10 +29,7 @@ #include -#include "../vmisc/def.h" #include "../vmisc/compatibility.h" -#include "../vdxf/dxfdef.h" -#include "../vdxf/libdxfrw/intern/drw_textcodec.h" #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include "../vmisc/vtextcodec.h" @@ -51,25 +48,26 @@ auto AvailableCodecs() -> QStringList { QList codecs = VTextCodec::availableCodecs(); QSet uniqueNames; - for(auto &codec: codecs) + for (auto &codec : codecs) { uniqueNames.insert(codec); } return ConvertToList(uniqueNames); } -} // namespace +} // namespace //--------------------------------------------------------------------------------------------------------------------- TST_DXF::TST_DXF(QObject *parent) - :QObject(parent) -{} + : QObject(parent) +{ +} //--------------------------------------------------------------------------------------------------------------------- void TST_DXF::initTestCase() { QTextStream ts(stdout); - ts << QStringLiteral("Available codecs:\n%2.").arg(AvailableCodecs().join(", "))<< Qt::endl; + ts << QStringLiteral("Available codecs:\n%2.").arg(AvailableCodecs().join(", ")) << Qt::endl; } //--------------------------------------------------------------------------------------------------------------------- @@ -80,7 +78,7 @@ void TST_DXF::TestCodecPage_data() QStringList locales = SupportedLocales(); - for (auto & locale : locales) + for (auto &locale : locales) { QTest::newRow(locale.toLatin1()) << locale; } @@ -93,14 +91,14 @@ void TST_DXF::TestCodecPage() #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QFETCH(QString, locale); - static QMap locMap = LocaleMap(); + static QMap locMap = LocaleMap(); locMap.insert("en", "ISO8859-1"); locMap.insert("en_US", "ISO8859-1"); locMap.insert("en_CA", "ISO8859-1"); locMap.insert("en_IN", "ISO8859-1"); QString language = QLocale(locale).name(); - QVERIFY (locMap.contains(language)); + QVERIFY(locMap.contains(language)); QString codePage = locMap.value(language); codePage = codePage.toUpper(); @@ -119,12 +117,11 @@ void TST_DXF::TestCodecPage() ++i; } - QVERIFY (not dxfCodePage.isEmpty()); + QVERIFY(not dxfCodePage.isEmpty()); VTextCodec *codec = DRW_TextCodec::CodecForName(dxfCodePage); - QVERIFY2(codec != nullptr, qUtf8Printable(QStringLiteral("No codec for dxf codepage %1 found.") - .arg(dxfCodePage))); + QVERIFY2(codec != nullptr, qUtf8Printable(QStringLiteral("No codec for dxf codepage %1 found.").arg(dxfCodePage))); #else QSKIP("No full support for old codecs since Qt6."); #endif diff --git a/src/test/ValentinaTest/tst_vabstractpiece.cpp b/src/test/ValentinaTest/tst_vabstractpiece.cpp index ff1e1fcc9..ff7794e82 100644 --- a/src/test/ValentinaTest/tst_vabstractpiece.cpp +++ b/src/test/ValentinaTest/tst_vabstractpiece.cpp @@ -349,9 +349,9 @@ void TST_VAbstractPiece::TestAreaCalculation_data() VArc circle(VPointF(100, 100, QChar('C'), 0, 0), 100, 35, 35); circle.SetApproximationScale(maxCurveApproximationScale); QVector circlePath = circle.GetPoints(); - if (not circlePath.isEmpty() && not VFuzzyComparePoints(ConstFirst(circlePath), ConstLast(circlePath))) + if (not circlePath.isEmpty() && not VFuzzyComparePoints(circlePath.constFirst(), circlePath.constLast())) { - circlePath.append(ConstFirst(circlePath)); + circlePath.append(circlePath.constFirst()); } QTest::newRow("Circle radis 100") << circlePath << M_PI * pow(100, 2); } @@ -362,7 +362,7 @@ void TST_VAbstractPiece::TestAreaCalculation_data() sector.SetApproximationScale(maxCurveApproximationScale); QVector sectorPath = sector.GetPoints(); sectorPath.append(sectorCenter.toQPointF()); - sectorPath.append(ConstFirst(sectorPath)); + sectorPath.append(sectorPath.constFirst()); QTest::newRow("Sector radius 100, 30 degree") << sectorPath << (M_PI * pow(100, 2) * 30.0) / 360.0; } } diff --git a/src/test/ValentinaTest/tst_varc.cpp b/src/test/ValentinaTest/tst_varc.cpp index 9f4d4785f..742c4aabf 100644 --- a/src/test/ValentinaTest/tst_varc.cpp +++ b/src/test/ValentinaTest/tst_varc.cpp @@ -47,13 +47,13 @@ void PrepareTestCase(const QPointF ¢er, qreal startAngle, qreal endAngle) .arg(radius) .arg(startAngle) .arg(endAngle); - QTest::newRow(qUtf8Printable(testStartAngle)) << center << startAngle << points << ConstFirst(points) << true; + QTest::newRow(qUtf8Printable(testStartAngle)) << center << startAngle << points << points.constFirst() << true; const QString testEndAngle = QString("Test end angel. Arc radius %1, start angle %2, end angle %3") .arg(radius) .arg(startAngle) .arg(endAngle); - QTest::newRow(qUtf8Printable(testEndAngle)) << center << endAngle << points << ConstLast(points) << true; + QTest::newRow(qUtf8Printable(testEndAngle)) << center << endAngle << points << points.constLast() << true; radius += UnitConvertor(5, Unit::Cm, Unit::Px); } diff --git a/src/test/ValentinaTest/tst_vellipticalarc.cpp b/src/test/ValentinaTest/tst_vellipticalarc.cpp index 6be82d326..1786def00 100644 --- a/src/test/ValentinaTest/tst_vellipticalarc.cpp +++ b/src/test/ValentinaTest/tst_vellipticalarc.cpp @@ -487,15 +487,15 @@ void TST_VEllipticalArc::TestGetPoints5() if (points.size() > 2 && qFuzzyIsNull(rotationAngle)) { const qreal testAccuracy = ToPixel(1.5, Unit::Mm); - ComparePointsDistance(arc.GetP1(), ConstFirst(points), testAccuracy); - ComparePointsDistance(arc.GetP2(), ConstLast(points), testAccuracy); + ComparePointsDistance(arc.GetP1(), points.constFirst(), testAccuracy); + ComparePointsDistance(arc.GetP2(), points.constLast(), testAccuracy); const qreal eps = 0.15; - f1 = QLineF(static_cast(center), ConstFirst(points)).angle(); + f1 = QLineF(static_cast(center), points.constFirst()).angle(); QVERIFY2(f1 - stAngle <= eps, qUtf8Printable(QStringLiteral("f1: %1; expected: %2").arg(f1).arg(stAngle))); - f2 = QLineF(static_cast(center), ConstLast(points)).angle(); + f2 = QLineF(static_cast(center), points.constLast()).angle(); QVERIFY2(f2 - enAngle <= eps, qUtf8Printable(QStringLiteral("f2: %1; expected: %2").arg(f2).arg(enAngle))); } }