Increased requirement for minimal Qt version.

This commit is contained in:
Roman Telezhynskyi 2023-08-12 12:03:28 +03:00
parent baf4f1a08b
commit a5bf891d43
154 changed files with 218 additions and 930 deletions

View file

@ -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.

View file

@ -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.

View file

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

View file

@ -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);
}

View file

@ -38,10 +38,6 @@
#include <QShowEvent>
#include <QtDebug>
#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

View file

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

View file

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

View file

@ -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 <QLoggingCategory>
QT_WARNING_PUSH
@ -659,7 +655,7 @@ void VPGraphicsPiece::PaintSeamLine(QPainter *painter, const VPPiecePtr &piece)
QVector<VLayoutPoint> 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<VLayoutPoint> 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);

View file

@ -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();

View file

@ -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 <QLoggingCategory>
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<VPPiecePtr> 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<VPPiecePtr> 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);

View file

@ -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)

View file

@ -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 <QCommandLineParser>
#include <QFileOpenEvent>
#include <QLocalServer>
@ -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<VPMainWindow *>
auto VPApplication::NewMainWindow() -> VPMainWindow *
{
VPCommandLinePtr cmd;
VPCommandLine::ProcessInstance(cmd, {ConstFirst<QString>(VPApplication::arguments())});
VPCommandLine::ProcessInstance(cmd, {VPApplication::arguments().constFirst()});
return NewMainWindow(cmd);
}

View file

@ -187,7 +187,7 @@ auto PreparePrinter(const QPrinterInfo &info, QPrinter::PrinterMode mode) -> QSh
return {};
}
tmpInfo = QPrinterInfo::printerInfo(ConstFirst<QString>(list));
tmpInfo = QPrinterInfo::printerInfo(list.constFirst());
}
auto printer = QSharedPointer<QPrinter>(new QPrinter(tmpInfo, mode));
@ -706,7 +706,7 @@ void VPMainWindow::InitPropertyTabCurrentPiece()
QList<VPPiecePtr> 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<VPPiecePtr> 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<VPSheetPtr> 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<VPSheetPtr> 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<VPSheetPtr> 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<VPSheetPtr> 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");

View file

@ -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 <QMarginsF>
namespace

View file

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

View file

@ -878,7 +878,7 @@ auto VPLayoutFileReader::ReadLabelLines() -> VTextManager
QStringList svgFontData = ReadAttributeEmptyString(attribs, ML::AttrSVGFont).split(',');
if (!svgFontData.isEmpty())
{
text.SetSVGFontFamily(ConstFirst<QString>(svgFontData));
text.SetSVGFontFamily(svgFontData.constFirst());
if (svgFontData.size() > 1)
{

View file

@ -30,7 +30,7 @@
#include "../mapplication.h"
#include "../vpatterndb/measurements.h"
#include "ui_dialogmdatabase.h"
#include "../vmisc/compatibility.h"
#include <QKeyEvent>
#include <QMenu>
@ -372,7 +372,7 @@ void DialogMDataBase::FilterMeasurements(const QString &search)
FilterGroup(m_groupQ, search);
const QList<QTreeWidgetItem *> list = ui->treeWidget->selectedItems();
list.isEmpty() ? ShowDescription(nullptr, -1) : ShowDescription(ConstFirst(list), 0);
list.isEmpty() ? ShowDescription(nullptr, -1) : ShowDescription(list.constFirst(), 0);
}
//---------------------------------------------------------------------------------------------------------------------

View file

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

View file

@ -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 <QCommandLineParser>
#include <QDir>
#include <QFileOpenEvent>
@ -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;

View file

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

View file

@ -32,10 +32,6 @@
#include <QGlobalStatic>
#include <QVariant>
#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

View file

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

View file

@ -420,7 +420,7 @@ auto VCommandLine::OptUserMaterials() const -> QMap<int, QString>
}
bool ok = false;
const int number = ConstFirst<QString>(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<int, QString>
const_cast<VCommandLine *>(this)->parser.showHelp(V_EX_USAGE);
}
userMaterials.insert(number, ConstLast<QString>(parts));
userMaterials.insert(number, parts.constLast());
}
return userMaterials;

View file

@ -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 <QComboBox>
#include <QDebug>
#include <QDockWidget>

View file

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

View file

@ -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 <QDir>
#include <QFileDialog>
#include <QGlobalStatic>

View file

@ -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 <QMenu>
#include <QTimer>
#include <QUndoStack>

View file

@ -134,7 +134,7 @@ auto VWidgetGroups::FilterGroups(const QMap<quint32, VGroupData> &groups) -> QMa
{
const VGroupData &data = i.value();
QSet<QString> groupCategories = ConvertToSet<QString>(data.tags);
if (SetIntersects(filterCategories, groupCategories))
if (filterCategories.intersects(groupCategories))
{
filtered.insert(i.key(), data);
}

View file

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

View file

@ -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<QString>(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<QString>(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;
}

View file

@ -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<VToolRecord> localHistory = getLocalHistory(name);
return (not localHistory.isEmpty() ? ConstLast(localHistory).getId() : NULL_ID);
return (not localHistory.isEmpty() ? localHistory.constLast().getId() : NULL_ID);
}
//---------------------------------------------------------------------------------------------------------------------

View file

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

View file

@ -35,10 +35,6 @@
#include <QPen>
#include <QPixmap>
#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("#");

View file

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

View file

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

View file

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

View file

@ -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())));
}
}
}

View file

@ -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;
/*

View file

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

View file

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

View file

@ -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) \

View file

@ -25,12 +25,9 @@
#ifndef QMUPARSERCALLBACK_P_H
#define QMUPARSERCALLBACK_P_H
#include "qmudef.h"
#include "qmuparserdef.h"
#include <QSharedData>
#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
{

View file

@ -33,10 +33,6 @@
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
#include <QTextStream>
#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

View file

@ -16,10 +16,6 @@
#include "intern/drw_dbg.h"
#include "intern/dxfreader.h"
#include <cstdlib>
#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
/*!

View file

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