Minimal Qt version increased to Qt 5.15. Minimal C++ standard to C++17.

This commit is contained in:
Roman Telezhynskyi 2024-01-23 15:57:23 +02:00
parent 35adb101ba
commit 38dbbe29ba
295 changed files with 689 additions and 15753 deletions

View File

@ -62,6 +62,7 @@
- Puzzle app. Horizontal piece flipping. - Puzzle app. Horizontal piece flipping.
- Mirror line. - Mirror line.
- Fold line. - Fold line.
- Minimal Qt version increased to Qt 5.15. Minimal C++ standard to C++17.
# Valentina 0.7.52 September 12, 2022 # Valentina 0.7.52 September 12, 2022
- Fix crash when default locale is ru. - Fix crash when default locale is ru.

View File

@ -159,18 +159,6 @@ environment:
DEPLOY: true DEPLOY: true
RUN_TESTS: true RUN_TESTS: true
- job_name: Windows_Qt_5_6_(GCC_x86)
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
COMPILER: mingw
QT: Qt\5.6\mingw49_32
QT_VERSION: Qt5_6
BUILD_SYSTEM: "make"
MINGW_PATH: C:\Qt\Tools\mingw492_32\bin
ARCH: x86
PYTHON: "C:\\Python38"
PLATFORM: "WindowsXP+"
DEPLOY: true
- job_name: Windows_Qt_5_15_(make_GCC_x86) - job_name: Windows_Qt_5_15_(make_GCC_x86)
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
COMPILER: mingw COMPILER: mingw
@ -259,18 +247,6 @@ environment:
PLATFORM: "macOS_10.13+" PLATFORM: "macOS_10.13+"
DEPLOY: false DEPLOY: false
- job_name: Windows_Qt_5_6_(MSVC_x64)
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
COMPILER: msvc
QT: Qt\5.6\msvc2015_64
QT_VERSION: Qt5_6
BUILD_SYSTEM: "nmake"
VSVER: 14
ARCH: x64
PYTHON: "C:\\Python38-x64"
PLATFORM: "WindowsXP+"
DEPLOY: false
matrix: matrix:
fast_finish: false fast_finish: false
exclude: exclude:
@ -286,8 +262,6 @@ matrix:
job_name: Windows_Qt_5_15_(qbs_GCC_x64) job_name: Windows_Qt_5_15_(qbs_GCC_x64)
- platform: x86 - platform: x86
job_name: Windows_Qt_5_15_(qbs_MSVC_x64) job_name: Windows_Qt_5_15_(qbs_MSVC_x64)
- platform: x86
job_name: Windows_Qt_5_6_(MSVC_x64)
- platform: x86 - platform: x86
job_name: MacOS_12_Qt_6_4 (multibundle) job_name: MacOS_12_Qt_6_4 (multibundle)
- platform: x86 - platform: x86
@ -302,8 +276,6 @@ matrix:
job_name: Windows_Qt_5_15_(make_GCC_x86) job_name: Windows_Qt_5_15_(make_GCC_x86)
- platform: x64 - platform: x64
job_name: Windows_Qt_5_15_(qbs_GCC_x86) job_name: Windows_Qt_5_15_(qbs_GCC_x86)
- platform: x64
job_name: Windows_Qt_5_6_(GCC_x86)
for: for:
@ -449,8 +421,6 @@ for:
- job_name: Windows_Qt_5_15_(make_GCC_x86) - job_name: Windows_Qt_5_15_(make_GCC_x86)
- job_name: Windows_Qt_5_15_(make_GCC_x64) - job_name: Windows_Qt_5_15_(make_GCC_x64)
- job_name: Windows_Qt_5_15_(nmake_MSVC_x64) - job_name: Windows_Qt_5_15_(nmake_MSVC_x64)
- job_name: Windows_Qt_5_6_(GCC_x86)
- job_name: Windows_Qt_5_6_(MSVC_x64)
# clone directory # clone directory
clone_folder: c:\projects\valentina clone_folder: c:\projects\valentina

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -42,9 +42,7 @@ CppApplication {
cpp.cxxLanguageVersion: { cpp.cxxLanguageVersion: {
if (Qt.core.versionMajor >= 6) // Start building with C++20 since Qt 6.0 if (Qt.core.versionMajor >= 6) // Start building with C++20 since Qt 6.0
return "c++20"; return "c++20";
else if(Qt.core.versionMajor >= 5 && Qt.core.versionMinor >= 12) // Since Qt 5.12 available support for C++17
return "c++17"; return "c++17";
return "c++11";
} }
Properties { Properties {
@ -52,11 +50,7 @@ CppApplication {
cpp.minimumWindowsVersion: { cpp.minimumWindowsVersion: {
if (Qt.core.versionMajor >= 6) if (Qt.core.versionMajor >= 6)
return "6.02"; // should be 10.0 return "6.02"; // should be 10.0
if (Qt.core.versionMajor >= 5 && Qt.core.versionMinor >= 7)
return "6.00"; return "6.00";
return "5.01";
} }
} }
@ -80,7 +74,6 @@ CppApplication {
files.push("msvcr120.dll"); files.push("msvcr120.dll");
// Minimal supported OpenSSL version since Qt 5.12.4 is 1.1.1. // Minimal supported OpenSSL version since Qt 5.12.4 is 1.1.1.
if (Utilities.versionCompare(Qt.core.version, "5.12.4") >= 0) {
if (qbs.architecture.contains("x86_64")) { if (qbs.architecture.contains("x86_64")) {
files.push( files.push(
"openssl/win64/libcrypto-1_1-x64.dll", "openssl/win64/libcrypto-1_1-x64.dll",
@ -92,19 +85,7 @@ CppApplication {
"openssl/win32/libssl-1_1.dll" "openssl/win32/libssl-1_1.dll"
); );
} }
} else {
if (qbs.architecture.contains("x86_64")) {
files.push(
"openssl/win64/libeay32.dll",
"openssl/win64/ssleay32.dll"
);
} else {
files.push(
"openssl/win32/libeay32.dll",
"openssl/win32/ssleay32.dll"
);
}
}
return files; return files;
} }
qbs.install: true qbs.install: true

View File

@ -26,9 +26,7 @@ Library {
cpp.cxxLanguageVersion: { cpp.cxxLanguageVersion: {
if (Qt.core.versionMajor >= 6) // Start building with C++20 since Qt 6.0 if (Qt.core.versionMajor >= 6) // Start building with C++20 since Qt 6.0
return "c++20"; return "c++20";
else if(Qt.core.versionMajor >= 5 && Qt.core.versionMinor >= 12) // Since Qt 5.12 available support for C++17
return "c++17"; return "c++17";
return "c++11";
} }
Properties { Properties {
@ -37,10 +35,7 @@ Library {
if (Qt.core.versionMajor >= 6) if (Qt.core.versionMajor >= 6)
return "6.02"; // should be 10.0 return "6.02"; // should be 10.0
if (Qt.core.versionMajor >= 5 && Qt.core.versionMinor >= 7)
return "6.00"; return "6.00";
return "5.01";
} }
} }

View File

@ -157,34 +157,8 @@ Module {
return "10.15"; // Qt 6.4 and above return "10.15"; // Qt 6.4 and above
} }
if (Qt.core.versionMajor >= 5) {
// See page https://doc.qt.io/qt-5.15/supported-platforms.html // See page https://doc.qt.io/qt-5.15/supported-platforms.html
// For qt 5.14 https://doc.qt.io/archives/qt-5.14/supported-platforms.html
if (Qt.core.versionMinor >= 14) // Qt 5.14
return "10.13"; return "10.13";
// For Qt 5.13 https://doc.qt.io/archives/qt-5.13/supported-platforms.html
// For Qt 5.12 https://doc.qt.io/archives/qt-5.12/supported-platforms.html
if (Qt.core.versionMinor >= 12) // Qt 5.12
return "10.12";
// For older versions https://doc.qt.io/archives/qt-5.11/supported-platforms-and-configurations.html
if (Qt.core.versionMinor >= 10) // Qt 5.11 and Qt 5.10
return "10.11";
if (Qt.core.versionMinor >= 9) // Qt 5.9
return "10.10";
if (Qt.core.versionMinor >= 8) // Qt 5.8
return "10.9";
if (Qt.core.versionMinor >= 7) // Qt 5.7
return "10.8";
return "10.7";
}
return undefined;
} }
cpp.separateDebugInformation: true cpp.separateDebugInformation: true

View File

@ -24,14 +24,8 @@ Module {
var enableCompression = input.moduleProperty("ebr", "enableCompression"); var enableCompression = input.moduleProperty("ebr", "enableCompression");
if (enableCompression) { if (enableCompression) {
var compressAlgorithm = input.moduleProperty("ebr", "compressAlgorithm"); var compressAlgorithm = input.moduleProperty("ebr", "compressAlgorithm");
if (product.Qt.core.versionMajor >= 5 && product.Qt.core.versionMinor >= 13) {
// Since Qt 5.13 we have option to select compress algorithm
if (compressAlgorithm !== "zstd") if (compressAlgorithm !== "zstd")
args.push("-compress-algo", compressAlgorithm); args.push("-compress-algo", compressAlgorithm);
} else {
if (compressAlgorithm !== "zlib")
compressAlgorithm = "zlib";
}
var thresholdLevel = input.moduleProperty("ebr", "thresholdLevel"); var thresholdLevel = input.moduleProperty("ebr", "thresholdLevel");
if (thresholdLevel !== 70) if (thresholdLevel !== 70)

View File

@ -32,9 +32,6 @@
#include <QScrollBar> #include <QScrollBar>
#include <QVBoxLayout> #include <QVBoxLayout>
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../layout/vplayout.h" #include "../layout/vplayout.h"
#include "../layout/vpsheet.h" #include "../layout/vpsheet.h"

View File

@ -35,9 +35,6 @@
#include <QWidget> #include <QWidget>
#include "../layout/layoutdef.h" #include "../layout/layoutdef.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {

View File

@ -32,9 +32,6 @@
#include <QMouseEvent> #include <QMouseEvent>
#include "../layout/layoutdef.h" #include "../layout/layoutdef.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class VPCarrouselPiece : public QListWidgetItem class VPCarrouselPiece : public QListWidgetItem
{ {

View File

@ -43,10 +43,6 @@
#include "vpcarrouselpiece.h" #include "vpcarrouselpiece.h"
#include "vpmimedatapiece.h" #include "vpmimedatapiece.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes") QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes")
QT_WARNING_DISABLE_INTEL(1418) QT_WARNING_DISABLE_INTEL(1418)

View File

@ -34,9 +34,6 @@
#include <QUuid> #include <QUuid>
#include "../layout/layoutdef.h" #include "../layout/layoutdef.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class VPMimeDataPiece : public QMimeData class VPMimeDataPiece : public QMimeData
{ {

View File

@ -34,10 +34,6 @@
#include "../vmisc/vabstractshortcutmanager.h" #include "../vmisc/vabstractshortcutmanager.h"
#include "ui_puzzlepreferencesconfigurationpage.h" #include "ui_puzzlepreferencesconfigurationpage.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 <QStyleHints> #include <QStyleHints>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -30,10 +30,6 @@
#include <QWidget> #include <QWidget>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class PuzzlePreferencesConfigurationPage; class PuzzlePreferencesConfigurationPage;

View File

@ -26,15 +26,12 @@
** **
*************************************************************************/ *************************************************************************/
#include "puzzlepreferenceslayoutpage.h" #include "puzzlepreferenceslayoutpage.h"
#include "ui_puzzlepreferenceslayoutpage.h"
#include "../../vpapplication.h" #include "../../vpapplication.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #include "ui_puzzlepreferenceslayoutpage.h"
#include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
PuzzlePreferencesLayoutPage::PuzzlePreferencesLayoutPage(QWidget *parent) : PuzzlePreferencesLayoutPage::PuzzlePreferencesLayoutPage(QWidget *parent)
QWidget(parent), : QWidget(parent),
ui(new Ui::PuzzlePreferencesLayoutPage) ui(new Ui::PuzzlePreferencesLayoutPage)
{ {
ui->setupUi(this); ui->setupUi(this);
@ -49,47 +46,48 @@ PuzzlePreferencesLayoutPage::PuzzlePreferencesLayoutPage(QWidget *parent) :
ReadSettings(); ReadSettings();
connect(ui->comboBoxLayoutUnit, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(ui->comboBoxLayoutUnit, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
this, &PuzzlePreferencesLayoutPage::ConvertPaperSize); &PuzzlePreferencesLayoutPage::ConvertPaperSize);
connect(ui->comboBoxSheetTemplates, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(ui->comboBoxSheetTemplates, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
this, [this] [this]
{ {
SheetSize(SheetTemplate()); m_settingsChanged = true; SheetSize(SheetTemplate());
m_settingsChanged = true;
}); });
connect(ui->comboBoxTileTemplates, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(ui->comboBoxTileTemplates, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
this, [this] [this]
{ {
TileSize(TileTemplate()); TileSize(TileTemplate());
m_settingsChanged = true; m_settingsChanged = true;
}); });
connect(ui->doubleSpinBoxSheetPaperWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxSheetPaperWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, &PuzzlePreferencesLayoutPage::SheetPaperSizeChanged); &PuzzlePreferencesLayoutPage::SheetPaperSizeChanged);
connect(ui->doubleSpinBoxSheetPaperHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxSheetPaperHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, &PuzzlePreferencesLayoutPage::SheetPaperSizeChanged); &PuzzlePreferencesLayoutPage::SheetPaperSizeChanged);
connect(ui->doubleSpinBoxTilePaperWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxTilePaperWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, &PuzzlePreferencesLayoutPage::TilePaperSizeChanged); &PuzzlePreferencesLayoutPage::TilePaperSizeChanged);
connect(ui->doubleSpinBoxTilePaperHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxTilePaperHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, &PuzzlePreferencesLayoutPage::TilePaperSizeChanged); &PuzzlePreferencesLayoutPage::TilePaperSizeChanged);
connect(ui->doubleSpinBoxSheetPaperWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxSheetPaperWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, &PuzzlePreferencesLayoutPage::FindSheetTemplate); &PuzzlePreferencesLayoutPage::FindSheetTemplate);
connect(ui->doubleSpinBoxSheetPaperHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxSheetPaperHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, &PuzzlePreferencesLayoutPage::FindSheetTemplate); &PuzzlePreferencesLayoutPage::FindSheetTemplate);
connect(ui->doubleSpinBoxTilePaperWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxTilePaperWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, &PuzzlePreferencesLayoutPage::FindTileTemplate); &PuzzlePreferencesLayoutPage::FindTileTemplate);
connect(ui->doubleSpinBoxTilePaperHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxTilePaperHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, &PuzzlePreferencesLayoutPage::FindTileTemplate); &PuzzlePreferencesLayoutPage::FindTileTemplate);
connect(ui->doubleSpinBoxSheetPaperWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxSheetPaperWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, &PuzzlePreferencesLayoutPage::CorrectMaxMargins); &PuzzlePreferencesLayoutPage::CorrectMaxMargins);
connect(ui->doubleSpinBoxSheetPaperHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxSheetPaperHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, &PuzzlePreferencesLayoutPage::CorrectMaxMargins); &PuzzlePreferencesLayoutPage::CorrectMaxMargins);
connect(ui->doubleSpinBoxTilePaperWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxTilePaperWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, &PuzzlePreferencesLayoutPage::CorrectMaxMargins); &PuzzlePreferencesLayoutPage::CorrectMaxMargins);
connect(ui->doubleSpinBoxTilePaperHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxTilePaperHeight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, &PuzzlePreferencesLayoutPage::CorrectMaxMargins); &PuzzlePreferencesLayoutPage::CorrectMaxMargins);
connect(ui->checkBoxLayoutIgnoreFileds, &QCheckBox::stateChanged, this, connect(ui->checkBoxLayoutIgnoreFileds, &QCheckBox::stateChanged, this,
&PuzzlePreferencesLayoutPage::LayoutSheetIgnoreMargins); &PuzzlePreferencesLayoutPage::LayoutSheetIgnoreMargins);
@ -105,28 +103,30 @@ PuzzlePreferencesLayoutPage::PuzzlePreferencesLayoutPage(QWidget *parent) :
connect(ui->toolButtonTileLandscapeOrientation, &QToolButton::toggled, this, connect(ui->toolButtonTileLandscapeOrientation, &QToolButton::toggled, this,
&PuzzlePreferencesLayoutPage::SwapTileOrientation); &PuzzlePreferencesLayoutPage::SwapTileOrientation);
connect(ui->doubleSpinBoxSheetMarginLeft, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxSheetMarginLeft, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, [this](){m_settingsChanged=true;}); [this]() { m_settingsChanged = true; });
connect(ui->doubleSpinBoxSheetMarginRight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxSheetMarginRight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, [this](){m_settingsChanged=true;}); [this]() { m_settingsChanged = true; });
connect(ui->doubleSpinBoxSheetMarginTop, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxSheetMarginTop, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, [this](){m_settingsChanged=true;}); [this]() { m_settingsChanged = true; });
connect(ui->doubleSpinBoxSheetMarginBottom, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxSheetMarginBottom, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, [this](){m_settingsChanged=true;}); [this]() { m_settingsChanged = true; });
connect(ui->checkBoxTileShowTiles, &QCheckBox::stateChanged, this, [this]() { m_settingsChanged = true; }); connect(ui->checkBoxTileShowTiles, &QCheckBox::stateChanged, this, [this]() { m_settingsChanged = true; });
connect(ui->checkBoxTileShowWatermark, &QCheckBox::stateChanged, this, [this]() { m_settingsChanged = true; }); connect(ui->checkBoxTileShowWatermark, &QCheckBox::stateChanged, this, [this]() { m_settingsChanged = true; });
connect(ui->checkBoxTileShowWatermark, &QCheckBox::stateChanged, this, [this]() { m_settingsChanged = true; }); connect(ui->checkBoxTileShowWatermark, &QCheckBox::stateChanged, this, [this]() { m_settingsChanged = true; });
connect(ui->doubleSpinBoxPiecesGap, QOverload<double>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxPiecesGap, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
this, [this](){m_settingsChanged=true;}); [this]() { m_settingsChanged = true; });
ui->doubleSpinBoxPiecesGap->setSuffix(UnitsToStr(m_oldLayoutUnit)); ui->doubleSpinBoxPiecesGap->setSuffix(UnitsToStr(m_oldLayoutUnit));
ui->spinBoxLineWidth->setSuffix(UnitsToStr(Unit::Px)); ui->spinBoxLineWidth->setSuffix(UnitsToStr(Unit::Px));
connect(ui->checkBoxWarningPiecesSuperposition, &QCheckBox::stateChanged, this, [this](){m_settingsChanged=true;}); connect(ui->checkBoxWarningPiecesSuperposition, &QCheckBox::stateChanged, this,
[this]() { m_settingsChanged = true; });
connect(ui->checkBoxStickyEdges, &QCheckBox::stateChanged, this, [this]() { m_settingsChanged = true; }); connect(ui->checkBoxStickyEdges, &QCheckBox::stateChanged, this, [this]() { m_settingsChanged = true; });
connect(ui->checkBoxWarningPiecesOutOfBound, &QCheckBox::stateChanged, this, [this](){m_settingsChanged=true;}); connect(ui->checkBoxWarningPiecesOutOfBound, &QCheckBox::stateChanged, this,
[this]() { m_settingsChanged = true; });
connect(ui->checkBoxFollowGrainline, &QCheckBox::stateChanged, this, [this]() { m_settingsChanged = true; }); connect(ui->checkBoxFollowGrainline, &QCheckBox::stateChanged, this, [this]() { m_settingsChanged = true; });
} }
@ -691,8 +691,8 @@ void PuzzlePreferencesLayoutPage::FindTemplate(QComboBox *box, qreal width, qrea
const int max = static_cast<int>(VAbstractLayoutDialog::PaperSizeTemplate::Custom); const int max = static_cast<int>(VAbstractLayoutDialog::PaperSizeTemplate::Custom);
for (int i = 0; i < max; ++i) for (int i = 0; i < max; ++i)
{ {
const QSizeF tmplSize = VAbstractLayoutDialog::GetTemplateSize( const QSizeF tmplSize =
static_cast<VAbstractLayoutDialog::PaperSizeTemplate>(i), paperUnit); VAbstractLayoutDialog::GetTemplateSize(static_cast<VAbstractLayoutDialog::PaperSizeTemplate>(i), paperUnit);
if (QSizeF(width, height) == tmplSize || QSizeF(height, width) == tmplSize) if (QSizeF(width, height) == tmplSize || QSizeF(height, width) == tmplSize)
{ {
box->blockSignals(true); box->blockSignals(true);

View File

@ -30,10 +30,6 @@
#include <QWidget> #include <QWidget>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class PuzzlePreferencesPathPage; class PuzzlePreferencesPathPage;

View File

@ -30,10 +30,6 @@
#include <QDialog> #include <QDialog>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class DialogPuzzlePreferences; class DialogPuzzlePreferences;

View File

@ -30,9 +30,6 @@
#include "../vlayout/vlayoutexporter.h" #include "../vlayout/vlayoutexporter.h"
#include "../vpapplication.h" #include "../vpapplication.h"
#include "ui_dialogsavemanuallayout.h" #include "ui_dialogsavemanuallayout.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 <QMessageBox> #include <QMessageBox>
#include <QShowEvent> #include <QShowEvent>

View File

@ -31,10 +31,6 @@
#include <QDialog> #include <QDialog>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class VPDialogAbout; class VPDialogAbout;

View File

@ -37,10 +37,6 @@
#include "../vlayout/vlayoutpiece.h" #include "../vlayout/vlayoutpiece.h"
#include "vpiecegrainline.h" #include "vpiecegrainline.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
class VPLayout; class VPLayout;
class VPSheet; class VPSheet;

View File

@ -39,10 +39,6 @@
#include "../vmisc/def.h" #include "../vmisc/def.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
class VPLayout; class VPLayout;
class VPPiece; class VPPiece;
class VMainGraphicsScene; class VMainGraphicsScene;

View File

@ -32,12 +32,8 @@
#include "vpapplication.h" #include "vpapplication.h"
#if defined(APPIMAGE) && defined(Q_OS_LINUX) #if defined(APPIMAGE) && defined(Q_OS_LINUX)
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
#include "../vmisc/backport/qscopeguard.h"
#else
#include <QScopeGuard>
#endif
#include "../vmisc/appimage.h" #include "../vmisc/appimage.h"
#include <QScopeGuard>
#endif // defined(APPIMAGE) && defined(Q_OS_LINUX) #endif // defined(APPIMAGE) && defined(Q_OS_LINUX)
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -121,11 +117,9 @@ auto main(int argc, char *argv[]) -> int
VPApplication app(argc, argv); VPApplication app(argc, argv);
app.InitOptions(); app.InitOptions();
QT_REQUIRE_VERSION(argc, argv, "5.6.0") // clazy:exclude=qstring-arg,qstring-allocations NOLINT QT_REQUIRE_VERSION(argc, argv, "5.15.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")); VPApplication::setDesktopFileName(QStringLiteral("ua.com.smart-pattern.puzzle.desktop"));
#endif
QTimer::singleShot(0, &app, &VPApplication::ProcessCMD); QTimer::singleShot(0, &app, &VPApplication::ProcessCMD);

View File

@ -135,7 +135,7 @@ inline auto LineFont(const TextLine &tl, const VSvgFont &base) -> VSvgFont
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
inline auto LineAlign(const TextLine &tl, const QString &text, const QFontMetrics &fm, qreal width) -> qreal inline auto LineAlign(const TextLine &tl, const QString &text, const QFontMetrics &fm, qreal width) -> qreal
{ {
const int lineWidth = TextWidth(fm, text); const int lineWidth = fm.horizontalAdvance(text);
qreal dX = 0; qreal dX = 0;
if (tl.m_eAlign == 0 || (tl.m_eAlign & Qt::AlignLeft) > 0) if (tl.m_eAlign == 0 || (tl.m_eAlign & Qt::AlignLeft) > 0)
@ -553,7 +553,7 @@ void VPGraphicsPiece::InitPieceLabelOutlineFont(const QVector<QPointF> &labelSha
for (auto c : qAsConst(tl.m_qsText)) for (auto c : qAsConst(tl.m_qsText))
{ {
path.addPath(corrector.DrawChar(w, static_cast<qreal>(fm.ascent()), c)); path.addPath(corrector.DrawChar(w, static_cast<qreal>(fm.ascent()), c));
w += TextWidth(fm, c); w += fm.horizontalAdvance(c);
} }
} }
else else

View File

@ -35,10 +35,6 @@
#include "../layout/layoutdef.h" #include "../layout/layoutdef.h"
#include "scenedef.h" #include "scenedef.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
class VTextManager; class VTextManager;
class VGraphicsFillItem; class VGraphicsFillItem;

View File

@ -34,10 +34,6 @@
#include "../layout/layoutdef.h" #include "../layout/layoutdef.h"
#include "scenedef.h" #include "scenedef.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
class VPLayout; class VPLayout;
class VPGraphicsPiece; class VPGraphicsPiece;
class QGraphicsView; class QGraphicsView;

View File

@ -34,9 +34,6 @@
#include <QPainter> #include <QPainter>
#include "../layout/layoutdef.h" #include "../layout/layoutdef.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class VPLayout; class VPLayout;

View File

@ -35,10 +35,6 @@
#include "../layout/layoutdef.h" #include "../layout/layoutdef.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
class VPTileFactory; class VPTileFactory;
class VPLayout; class VPLayout;
struct VWatermarkData; struct VWatermarkData;

View File

@ -28,13 +28,9 @@
#ifndef VPUNDOCOMMAND_H #ifndef VPUNDOCOMMAND_H
#define VPUNDOCOMMAND_H #define VPUNDOCOMMAND_H
#include <QLoggingCategory>
#include <QObject> #include <QObject>
#include <QUndoCommand> #include <QUndoCommand>
#include <QLoggingCategory>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
namespace ML namespace ML
{ {
@ -58,6 +54,7 @@ Q_DECLARE_LOGGING_CATEGORY(vpUndo) // NOLINT
class VPUndoCommand : public QObject, public QUndoCommand class VPUndoCommand : public QObject, public QUndoCommand
{ {
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
explicit VPUndoCommand(QUndoCommand *parent = nullptr); explicit VPUndoCommand(QUndoCommand *parent = nullptr);
explicit VPUndoCommand(bool allowMerge = false, QUndoCommand *parent = nullptr); explicit VPUndoCommand(bool allowMerge = false, QUndoCommand *parent = nullptr);
@ -72,7 +69,6 @@ private:
bool m_allowMerge{false}; bool m_allowMerge{false};
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
inline auto VPUndoCommand::AllowMerge() const -> bool inline auto VPUndoCommand::AllowMerge() const -> bool
{ {

View File

@ -28,12 +28,8 @@
#ifndef VPUNDOPIECEZVALUEMOVE_H #ifndef VPUNDOPIECEZVALUEMOVE_H
#define VPUNDOPIECEZVALUEMOVE_H #define VPUNDOPIECEZVALUEMOVE_H
#include "vpundocommand.h"
#include "../layout/layoutdef.h" #include "../layout/layoutdef.h"
#include "vpundocommand.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
namespace ML namespace ML
{ {
@ -49,6 +45,7 @@ enum class ZValueMove
class VPUndoPieceZValueMove : public VPUndoCommand class VPUndoPieceZValueMove : public VPUndoCommand
{ {
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
VPUndoPieceZValueMove(const VPPiecePtr &piece, ML::ZValueMove move, QUndoCommand *parent = nullptr); VPUndoPieceZValueMove(const VPPiecePtr &piece, ML::ZValueMove move, QUndoCommand *parent = nullptr);
~VPUndoPieceZValueMove() override = default; ~VPUndoPieceZValueMove() override = default;
@ -74,6 +71,7 @@ private:
class VPUndoPiecesZValueMove : public VPUndoCommand class VPUndoPiecesZValueMove : public VPUndoCommand
{ {
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
VPUndoPiecesZValueMove(const QList<VPPiecePtr> &pieces, ML::ZValueMove move, QUndoCommand *parent = nullptr); VPUndoPiecesZValueMove(const QList<VPPiecePtr> &pieces, ML::ZValueMove move, QUndoCommand *parent = nullptr);
~VPUndoPiecesZValueMove() override = default; ~VPUndoPiecesZValueMove() override = default;
@ -93,8 +91,8 @@ private:
auto Sheet() const -> VPSheetPtr; auto Sheet() const -> VPSheetPtr;
auto PieceIds() const -> QVector<QString>; auto PieceIds() const -> QVector<QString>;
static auto Levels(const QList<VPPiecePtr> &allPieces, const QVector<QString> &skipPieces, static auto Levels(const QList<VPPiecePtr> &allPieces, const QVector<QString> &skipPieces, bool skip)
bool skip) -> QList<QVector<QString>>; -> QList<QVector<QString>>;
static auto LevelStep(const QList<VPPiecePtr> &pieces) -> qreal; static auto LevelStep(const QList<VPPiecePtr> &pieces) -> qreal;
}; };

View File

@ -115,26 +115,6 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
#endif // defined(V_NO_ASSERT) #endif // defined(V_NO_ASSERT)
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
#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
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QNSView")))
{
type = QtDebugMsg;
}
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0)
// Hide Qt bug 'Assertion when reading an icns file'
// https://bugreports.qt.io/browse/QTBUG-45537
// Remove after Qt fix will be released
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QICNSHandler::read()")))
{
type = QtDebugMsg;
}
#endif
// Hide anything that starts with QMacCGContext // Hide anything that starts with QMacCGContext
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QMacCGContext::"))) if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QMacCGContext::")))
{ {

View File

@ -37,10 +37,6 @@
#include <ciso646> // and, not, or #include <ciso646> // and, not, or
#endif #endif
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class VPCommandLine; class VPCommandLine;
using VPCommandLinePtr = std::shared_ptr<VPCommandLine>; using VPCommandLinePtr = std::shared_ptr<VPCommandLine>;

View File

@ -36,6 +36,7 @@
#include <QPrintPreviewDialog> #include <QPrintPreviewDialog>
#include <QPrinterInfo> #include <QPrinterInfo>
#include <QSaveFile> #include <QSaveFile>
#include <QScopeGuard>
#include <QSvgGenerator> #include <QSvgGenerator>
#include <QTimer> #include <QTimer>
#include <QUndoStack> #include <QUndoStack>
@ -75,16 +76,6 @@
#include "xml/vplayoutfilereader.h" #include "xml/vplayoutfilereader.h"
#include "xml/vplayoutfilewriter.h" #include "xml/vplayoutfilewriter.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
#include "../vmisc/backport/qscopeguard.h"
#else
#include <QScopeGuard>
#endif
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes") QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes")
QT_WARNING_DISABLE_INTEL(1418) QT_WARNING_DISABLE_INTEL(1418)
@ -93,16 +84,7 @@ Q_LOGGING_CATEGORY(pWindow, "p.window") // NOLINT
QT_WARNING_POP QT_WARNING_POP
#if (defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG)
// DO NOT WORK WITH GCC 4.8
#else
#if __cplusplus >= 201402L
using namespace std::chrono_literals; using namespace std::chrono_literals;
#else
#include "../vmisc/bpstd/chrono.hpp"
using namespace bpstd::literals::chrono_literals;
#endif // __cplusplus >= 201402L
#endif //(defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG)
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
#include "../vmisc/compatibility.h" #include "../vmisc/compatibility.h"
@ -432,7 +414,7 @@ VPMainWindow::VPMainWindow(const VPCommandLinePtr &cmd, QWidget *parent)
if (m_cmd->IsGuiEnabled()) if (m_cmd->IsGuiEnabled())
{ {
QTimer::singleShot(V_SECONDS(1), this, &VPMainWindow::AskDefaultSettings); QTimer::singleShot(1s, this, &VPMainWindow::AskDefaultSettings);
} }
if (VAbstractShortcutManager *manager = VAbstractApplication::VApp()->GetShortcutManager()) if (VAbstractShortcutManager *manager = VAbstractApplication::VApp()->GetShortcutManager())
@ -3483,15 +3465,6 @@ void VPMainWindow::ShowToolTip(const QString &toolTip)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VPMainWindow::closeEvent(QCloseEvent *event) void VPMainWindow::closeEvent(QCloseEvent *event)
{ {
#if defined(Q_OS_MAC) && QT_VERSION < QT_VERSION_CHECK(5, 11, 1)
// Workaround for Qt bug https://bugreports.qt.io/browse/QTBUG-43344
static int numCalled = 0;
if (numCalled++ >= 1)
{
return;
}
#endif
if (MaybeSave()) if (MaybeSave())
{ {
WriteSettings(); WriteSettings();

View File

@ -102,11 +102,6 @@ auto TriangleBasic() -> QPainterPath
} }
} // namespace } // namespace
// See https://stackoverflow.com/a/46719572/3045403
#if __cplusplus < 201703L // C++17
constexpr qreal VPTileFactory::tileStripeWidth; // NOLINT(readability-redundant-declaration)
#endif
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VPTileFactory::VPTileFactory(const VPLayoutPtr &layout, VCommonSettings *commonSettings, QObject *parent) VPTileFactory::VPTileFactory(const VPLayoutPtr &layout, VCommonSettings *commonSettings, QObject *parent)
: QObject(parent), : QObject(parent),
@ -359,7 +354,7 @@ void VPTileFactory::DrawRuler(QPainter *painter, qreal scale) const
qreal unitsWidth = 0; qreal unitsWidth = 0;
QFontMetrics fm(fnt); QFontMetrics fm(fnt);
QString units = rulerUnits != Unit::Inch ? tr("cm", "unit") : tr("in", "unit"); QString units = rulerUnits != Unit::Inch ? tr("cm", "unit") : tr("in", "unit");
unitsWidth = TextWidth(fm, units); unitsWidth = fm.horizontalAdvance(units);
painter->drawText(QPointF(step * 0.5 - unitsWidth * 0.6, painter->drawText(QPointF(step * 0.5 - unitsWidth * 0.6,
m_drawingAreaHeight - tileStripeWidth + notchHeight + shortNotchHeight), m_drawingAreaHeight - tileStripeWidth + notchHeight + shortNotchHeight),
units); units);
@ -629,7 +624,7 @@ void VPTileFactory::DrawTextInformation(QPainter *painter, int row, int col, int
td.setPageSize(QSizeF(m_drawingAreaHeight - UnitConvertor(2, Unit::Cm, Unit::Px), m_drawingAreaWidth)); td.setPageSize(QSizeF(m_drawingAreaHeight - UnitConvertor(2, Unit::Cm, Unit::Px), m_drawingAreaWidth));
QFontMetrics metrix = QFontMetrics(td.defaultFont()); QFontMetrics metrix = QFontMetrics(td.defaultFont());
int maxWidth = TextWidth(metrix, QString().fill('z', 50)); int maxWidth = metrix.horizontalAdvance(QString().fill('z', 50));
QString clippedSheetName = metrix.elidedText(sheetName, Qt::ElideMiddle, maxWidth); QString clippedSheetName = metrix.elidedText(sheetName, Qt::ElideMiddle, maxWidth);
td.setHtml(QStringLiteral("<table width='100%' style='color:rgb(%1);'>" td.setHtml(QStringLiteral("<table width='100%' style='color:rgb(%1);'>"
@ -754,11 +749,7 @@ void VPTileFactory::PaintWatermarkImage(QPainter *painter, const QRectF &img, co
return; return;
} }
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
qint64 fileSize = watermarkImage.byteCount();
#else
qint64 fileSize = watermarkImage.sizeInBytes(); qint64 fileSize = watermarkImage.sizeInBytes();
#endif
qint64 pixelSize = fileSize / watermarkImage.height() / watermarkImage.width(); qint64 pixelSize = fileSize / watermarkImage.height() / watermarkImage.width();
QSize scaledSize(qRound(watermarkImage.width() / xScale), qRound(watermarkImage.height() / yScale)); QSize scaledSize(qRound(watermarkImage.width() / xScale), qRound(watermarkImage.height() / yScale));
qint64 scaledImageSize = pixelSize * scaledSize.width() * scaledSize.height() / 1024; qint64 scaledImageSize = pixelSize * scaledSize.width() * scaledSize.height() / 1024;

View File

@ -35,10 +35,6 @@
#include "../ifc/ifcdef.h" #include "../ifc/ifcdef.h"
#include "layout/layoutdef.h" #include "layout/layoutdef.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
class QGraphicsScene; class QGraphicsScene;
class VCommonSettings; class VCommonSettings;
class QPainter; class QPainter;

View File

@ -30,10 +30,6 @@
#include "../vmisc/vabstractshortcutmanager.h" #include "../vmisc/vabstractshortcutmanager.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class VPuzzleShortcutManager : public VAbstractShortcutManager class VPuzzleShortcutManager : public VAbstractShortcutManager
{ {
Q_OBJECT // NOLINT Q_OBJECT // NOLINT

View File

@ -37,10 +37,6 @@
#include "../vmisc/vabstractshortcutmanager.h" #include "../vmisc/vabstractshortcutmanager.h"
#include "ui_tapepreferencesconfigurationpage.h" #include "ui_tapepreferencesconfigurationpage.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 <QStyleHints> #include <QStyleHints>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -31,10 +31,6 @@
#include <QWidget> #include <QWidget>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class QComboBox; class QComboBox;
namespace Ui namespace Ui

View File

@ -30,10 +30,6 @@
#include <QWidget> #include <QWidget>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class TapePreferencesPathPage; class TapePreferencesPathPage;

View File

@ -31,10 +31,6 @@
#include <QDialog> #include <QDialog>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class DialogAboutTape; class DialogAboutTape;

View File

@ -32,10 +32,6 @@
#include "../vformat/vdimensions.h" #include "../vformat/vdimensions.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
namespace Ui namespace Ui
{ {
class DialogDimensionCustomNames; class DialogDimensionCustomNames;

View File

@ -27,9 +27,6 @@
*************************************************************************/ *************************************************************************/
#include "dialogdimensionlabels.h" #include "dialogdimensionlabels.h"
#include "ui_dialogdimensionlabels.h" #include "ui_dialogdimensionlabels.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogDimensionLabels::DialogDimensionLabels(const QMap<MeasurementDimension, MeasurementDimension_p> &dimensions, DialogDimensionLabels::DialogDimensionLabels(const QMap<MeasurementDimension, MeasurementDimension_p> &dimensions,
@ -212,7 +209,6 @@ auto DialogDimensionLabels::DimensionValue(const MeasurementDimension_p &dimensi
} }
return QString::number(value); return QString::number(value);
} }
if (dimension->Type() == MeasurementDimension::W || dimension->Type() == MeasurementDimension::Z) if (dimension->Type() == MeasurementDimension::W || dimension->Type() == MeasurementDimension::Z)

View File

@ -29,9 +29,6 @@
#include "ui_dialogknownmeasurementscsvcolumns.h" #include "ui_dialogknownmeasurementscsvcolumns.h"
#include "../vmisc/qxtcsvmodel.h" #include "../vmisc/qxtcsvmodel.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 "../vtools/dialogs/dialogtoolbox.h" #include "../vtools/dialogs/dialogtoolbox.h"
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)

View File

@ -30,10 +30,6 @@
#include <QDialog> #include <QDialog>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class QxtCsvModel; class QxtCsvModel;
class QComboBox; class QComboBox;

View File

@ -32,10 +32,6 @@
#include <QDialog> #include <QDialog>
#include <QUuid> #include <QUuid>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class DialogMDataBase; class DialogMDataBase;

View File

@ -27,12 +27,8 @@
*************************************************************************/ *************************************************************************/
#include "dialogmeasurementscsvcolumns.h" #include "dialogmeasurementscsvcolumns.h"
#include "../vmisc/qxtcsvmodel.h" #include "../vmisc/qxtcsvmodel.h"
#include "ui_dialogmeasurementscsvcolumns.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 "../vtools/dialogs/dialogtoolbox.h" #include "../vtools/dialogs/dialogtoolbox.h"
#include "ui_dialogmeasurementscsvcolumns.h"
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include "../vmisc/vtextcodec.h" #include "../vmisc/vtextcodec.h"

View File

@ -33,9 +33,6 @@
#include "../vpatterndb/variables/vmeasurement.h" #include "../vpatterndb/variables/vmeasurement.h"
#include "../vwidgets/vdecorationaligningdelegate.h" #include "../vwidgets/vdecorationaligningdelegate.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
#include "../vmisc/compatibility.h" #include "../vmisc/compatibility.h"

View File

@ -31,11 +31,6 @@
#include <QPushButton> #include <QPushButton>
#include <QShowEvent> #include <QShowEvent>
#include "../mapplication.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
namespace namespace
{ {
void InitDimensionTitle(QGroupBox *group, const MeasurementDimension_p &dimension) void InitDimensionTitle(QGroupBox *group, const MeasurementDimension_p &dimension)
@ -43,11 +38,11 @@ void InitDimensionTitle(QGroupBox *group, const MeasurementDimension_p &dimensio
SCASSERT(group != nullptr) SCASSERT(group != nullptr)
group->setTitle(QStringLiteral("%1 (%2)").arg(dimension->Name(), dimension->Axis())); group->setTitle(QStringLiteral("%1 (%2)").arg(dimension->Name(), dimension->Axis()));
} }
} } // namespace
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogSetupMultisize::DialogSetupMultisize(Unit unit, QWidget *parent) : DialogSetupMultisize::DialogSetupMultisize(Unit unit, QWidget *parent)
QDialog(parent), : QDialog(parent),
ui(new Ui::DialogSetupMultisize), ui(new Ui::DialogSetupMultisize),
m_xDimension(QSharedPointer<VXMeasurementDimension>::create(unit)), m_xDimension(QSharedPointer<VXMeasurementDimension>::create(unit)),
m_yDimension(QSharedPointer<VYMeasurementDimension>::create(unit)), m_yDimension(QSharedPointer<VYMeasurementDimension>::create(unit)),
@ -64,120 +59,100 @@ DialogSetupMultisize::DialogSetupMultisize(Unit unit, QWidget *parent) :
InitZDimension(); InitZDimension();
// height // height
connect(ui->doubleSpinBoxXDimensionMinValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxXDimensionMinValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), this,
this, [this](qreal value) [this](qreal value)
{ {
DimensionMinValueChanged(value, ui->doubleSpinBoxXDimensionMaxValue, ui->comboBoxXDimensionStep, DimensionMinValueChanged(value, ui->doubleSpinBoxXDimensionMaxValue, ui->comboBoxXDimensionStep,
ui->comboBoxXDimensionBase, m_xDimension); ui->comboBoxXDimensionBase, m_xDimension);
}); });
connect(ui->doubleSpinBoxXDimensionMaxValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxXDimensionMaxValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), this,
this, [this](qreal value) [this](qreal value)
{ {
DimensionMaxValueChanged(value, ui->doubleSpinBoxXDimensionMinValue, ui->comboBoxXDimensionStep, DimensionMaxValueChanged(value, ui->doubleSpinBoxXDimensionMinValue, ui->comboBoxXDimensionStep,
ui->comboBoxXDimensionBase, m_xDimension); ui->comboBoxXDimensionBase, m_xDimension);
}); });
connect(ui->comboBoxXDimensionStep, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(ui->comboBoxXDimensionStep, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
this, [this](int index) [this](int index)
{ { DimensionStepChanged(index, ui->comboBoxXDimensionStep, ui->comboBoxXDimensionBase, m_xDimension); });
DimensionStepChanged(index, ui->comboBoxXDimensionStep, ui->comboBoxXDimensionBase, m_xDimension); connect(ui->comboBoxXDimensionBase, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
}); [this](int index) { DimensionBaseChanged(index, ui->comboBoxXDimensionBase, m_xDimension); });
connect(ui->comboBoxXDimensionBase, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, [this](int index)
{
DimensionBaseChanged(index, ui->comboBoxXDimensionBase, m_xDimension);
});
// size // size
connect(ui->doubleSpinBoxYDimensionMinValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxYDimensionMinValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), this,
this, [this](qreal value) [this](qreal value)
{ {
DimensionMinValueChanged(value, ui->doubleSpinBoxYDimensionMaxValue, ui->comboBoxYDimensionStep, DimensionMinValueChanged(value, ui->doubleSpinBoxYDimensionMaxValue, ui->comboBoxYDimensionStep,
ui->comboBoxYDimensionBase, m_yDimension); ui->comboBoxYDimensionBase, m_yDimension);
}); });
connect(ui->doubleSpinBoxYDimensionMaxValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxYDimensionMaxValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), this,
this, [this](qreal value) [this](qreal value)
{ {
DimensionMaxValueChanged(value, ui->doubleSpinBoxYDimensionMinValue, ui->comboBoxYDimensionStep, DimensionMaxValueChanged(value, ui->doubleSpinBoxYDimensionMinValue, ui->comboBoxYDimensionStep,
ui->comboBoxYDimensionBase, m_yDimension); ui->comboBoxYDimensionBase, m_yDimension);
}); });
connect(ui->comboBoxYDimensionStep, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(ui->comboBoxYDimensionStep, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
this, [this](int index) [this](int index)
{ { DimensionStepChanged(index, ui->comboBoxYDimensionStep, ui->comboBoxYDimensionBase, m_yDimension); });
DimensionStepChanged(index, ui->comboBoxYDimensionStep, ui->comboBoxYDimensionBase, m_yDimension); connect(ui->comboBoxYDimensionBase, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
}); [this](int index) { DimensionBaseChanged(index, ui->comboBoxYDimensionBase, m_yDimension); });
connect(ui->comboBoxYDimensionBase, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, [this](int index)
{
DimensionBaseChanged(index, ui->comboBoxYDimensionBase, m_yDimension);
});
// hip // hip
connect(ui->doubleSpinBoxWDimensionMinValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxWDimensionMinValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), this,
this, [this](qreal value) [this](qreal value)
{ {
DimensionMinValueChanged(value, ui->doubleSpinBoxWDimensionMaxValue, ui->comboBoxWDimensionStep, DimensionMinValueChanged(value, ui->doubleSpinBoxWDimensionMaxValue, ui->comboBoxWDimensionStep,
ui->comboBoxWDimensionBase, m_wDimension); ui->comboBoxWDimensionBase, m_wDimension);
}); });
connect(ui->doubleSpinBoxWDimensionMaxValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxWDimensionMaxValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), this,
this, [this](qreal value) [this](qreal value)
{ {
DimensionMaxValueChanged(value, ui->doubleSpinBoxWDimensionMinValue, ui->comboBoxWDimensionStep, DimensionMaxValueChanged(value, ui->doubleSpinBoxWDimensionMinValue, ui->comboBoxWDimensionStep,
ui->comboBoxWDimensionBase, m_wDimension); ui->comboBoxWDimensionBase, m_wDimension);
}); });
connect(ui->comboBoxWDimensionStep, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(ui->comboBoxWDimensionStep, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
this, [this](int index) [this](int index)
{ { DimensionStepChanged(index, ui->comboBoxWDimensionStep, ui->comboBoxWDimensionBase, m_wDimension); });
DimensionStepChanged(index, ui->comboBoxWDimensionStep, ui->comboBoxWDimensionBase, m_wDimension); connect(ui->comboBoxWDimensionBase, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
}); [this](int index) { DimensionBaseChanged(index, ui->comboBoxWDimensionBase, m_wDimension); });
connect(ui->comboBoxWDimensionBase, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, [this](int index)
{
DimensionBaseChanged(index, ui->comboBoxWDimensionBase, m_wDimension);
});
// waist // waist
connect(ui->doubleSpinBoxZDimensionMinValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxZDimensionMinValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), this,
this, [this](qreal value) [this](qreal value)
{ {
DimensionMinValueChanged(value, ui->doubleSpinBoxZDimensionMaxValue, ui->comboBoxZDimensionStep, DimensionMinValueChanged(value, ui->doubleSpinBoxZDimensionMaxValue, ui->comboBoxZDimensionStep,
ui->comboBoxZDimensionBase, m_zDimension); ui->comboBoxZDimensionBase, m_zDimension);
}); });
connect(ui->doubleSpinBoxZDimensionMaxValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), connect(ui->doubleSpinBoxZDimensionMaxValue, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged), this,
this, [this](qreal value) [this](qreal value)
{ {
DimensionMaxValueChanged(value, ui->doubleSpinBoxZDimensionMinValue, ui->comboBoxZDimensionStep, DimensionMaxValueChanged(value, ui->doubleSpinBoxZDimensionMinValue, ui->comboBoxZDimensionStep,
ui->comboBoxZDimensionBase, m_zDimension); ui->comboBoxZDimensionBase, m_zDimension);
}); });
connect(ui->comboBoxZDimensionStep, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(ui->comboBoxZDimensionStep, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
this, [this](int index) [this](int index)
{ { DimensionStepChanged(index, ui->comboBoxZDimensionStep, ui->comboBoxZDimensionBase, m_zDimension); });
DimensionStepChanged(index, ui->comboBoxZDimensionStep, ui->comboBoxZDimensionBase, m_zDimension); connect(ui->comboBoxZDimensionBase, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
}); [this](int index) { DimensionBaseChanged(index, ui->comboBoxZDimensionBase, m_zDimension); });
connect(ui->comboBoxZDimensionBase, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, [this](int index)
{
DimensionBaseChanged(index, ui->comboBoxZDimensionBase, m_zDimension);
});
connect(ui->groupBoxXDimension, &QGroupBox::clicked, this, [this]() { CheckState(); }); connect(ui->groupBoxXDimension, &QGroupBox::clicked, this, [this]() { CheckState(); });
connect(ui->groupBoxYDimension, &QGroupBox::clicked, this, [this]() { CheckState(); }); connect(ui->groupBoxYDimension, &QGroupBox::clicked, this, [this]() { CheckState(); });
connect(ui->groupBoxWDimension, &QGroupBox::clicked, this, [this]() { CheckState(); }); connect(ui->groupBoxWDimension, &QGroupBox::clicked, this, [this]() { CheckState(); });
connect(ui->groupBoxZDimension, &QGroupBox::clicked, this, [this]() { CheckState(); }); connect(ui->groupBoxZDimension, &QGroupBox::clicked, this, [this]() { CheckState(); });
connect(ui->checkBoxFullCircumference, &QCheckBox::stateChanged, connect(ui->checkBoxFullCircumference, &QCheckBox::stateChanged, this,
this, &DialogSetupMultisize::ShowFullCircumference); &DialogSetupMultisize::ShowFullCircumference);
connect(ui->checkBoxXDimensionBodyMeasurement, &QCheckBox::stateChanged, connect(ui->checkBoxXDimensionBodyMeasurement, &QCheckBox::stateChanged, this,
this, &DialogSetupMultisize::XDimensionBodyMeasurementChanged); &DialogSetupMultisize::XDimensionBodyMeasurementChanged);
connect(ui->checkBoxYDimensionBodyMeasurement, &QCheckBox::stateChanged, connect(ui->checkBoxYDimensionBodyMeasurement, &QCheckBox::stateChanged, this,
this, &DialogSetupMultisize::YDimensionBodyMeasurementChanged); &DialogSetupMultisize::YDimensionBodyMeasurementChanged);
connect(ui->checkBoxWDimensionBodyMeasurement, &QCheckBox::stateChanged, connect(ui->checkBoxWDimensionBodyMeasurement, &QCheckBox::stateChanged, this,
this, &DialogSetupMultisize::WDimensionBodyMeasurementChanged); &DialogSetupMultisize::WDimensionBodyMeasurementChanged);
connect(ui->checkBoxZDimensionBodyMeasurement, &QCheckBox::stateChanged, connect(ui->checkBoxZDimensionBodyMeasurement, &QCheckBox::stateChanged, this,
this, &DialogSetupMultisize::ZDimensionBodyMeasurementChanged); &DialogSetupMultisize::ZDimensionBodyMeasurementChanged);
connect(ui->lineEditCustomXDimensionName, &QLineEdit::textChanged, this, [this](const QString &text) connect(ui->lineEditCustomXDimensionName, &QLineEdit::textChanged, this,
[this](const QString &text)
{ {
m_xDimension->SetCustomName(text); m_xDimension->SetCustomName(text);
InitDimensionTitle(ui->groupBoxXDimension, m_xDimension); InitDimensionTitle(ui->groupBoxXDimension, m_xDimension);
@ -185,7 +160,8 @@ DialogSetupMultisize::DialogSetupMultisize(Unit unit, QWidget *parent) :
CheckState(); CheckState();
}); });
connect(ui->lineEditCustomYDimensionName, &QLineEdit::textChanged, this, [this](const QString &text) connect(ui->lineEditCustomYDimensionName, &QLineEdit::textChanged, this,
[this](const QString &text)
{ {
m_yDimension->SetCustomName(text); m_yDimension->SetCustomName(text);
InitDimensionTitle(ui->groupBoxYDimension, m_yDimension); InitDimensionTitle(ui->groupBoxYDimension, m_yDimension);
@ -193,7 +169,8 @@ DialogSetupMultisize::DialogSetupMultisize(Unit unit, QWidget *parent) :
CheckState(); CheckState();
}); });
connect(ui->lineEditCustomWDimensionName, &QLineEdit::textChanged, this, [this](const QString &text) connect(ui->lineEditCustomWDimensionName, &QLineEdit::textChanged, this,
[this](const QString &text)
{ {
m_wDimension->SetCustomName(text); m_wDimension->SetCustomName(text);
InitDimensionTitle(ui->groupBoxWDimension, m_wDimension); InitDimensionTitle(ui->groupBoxWDimension, m_wDimension);
@ -201,7 +178,8 @@ DialogSetupMultisize::DialogSetupMultisize(Unit unit, QWidget *parent) :
CheckState(); CheckState();
}); });
connect(ui->lineEditCustomZDimensionName, &QLineEdit::textChanged, this, [this](const QString &text) connect(ui->lineEditCustomZDimensionName, &QLineEdit::textChanged, this,
[this](const QString &text)
{ {
m_zDimension->SetCustomName(text); m_zDimension->SetCustomName(text);
InitDimensionTitle(ui->groupBoxZDimension, m_zDimension); InitDimensionTitle(ui->groupBoxZDimension, m_zDimension);
@ -293,8 +271,8 @@ void DialogSetupMultisize::showEvent(QShowEvent *event)
void DialogSetupMultisize::ShowFullCircumference() void DialogSetupMultisize::ShowFullCircumference()
{ {
auto ShowDimensionFullCircumference = [this](QDoubleSpinBox *doubleSpinBoxMinValue, auto ShowDimensionFullCircumference = [this](QDoubleSpinBox *doubleSpinBoxMinValue,
QDoubleSpinBox *doubleSpinBoxMaxValue, QComboBox *comboBoxStep, QComboBox *comboBoxBase, QDoubleSpinBox *doubleSpinBoxMaxValue, QComboBox *comboBoxStep,
const MeasurementDimension_p &dimension) QComboBox *comboBoxBase, const MeasurementDimension_p &dimension)
{ {
SCASSERT(doubleSpinBoxMinValue != nullptr) SCASSERT(doubleSpinBoxMinValue != nullptr)
SCASSERT(doubleSpinBoxMaxValue != nullptr) SCASSERT(doubleSpinBoxMaxValue != nullptr)
@ -514,8 +492,7 @@ void DialogSetupMultisize::InitDimensionMinMax(QDoubleSpinBox *doubleSpinBoxMinV
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogSetupMultisize::InitDimensionStep(QComboBox *comboBoxStep, void DialogSetupMultisize::InitDimensionStep(QComboBox *comboBoxStep, const MeasurementDimension_p &dimension)
const MeasurementDimension_p &dimension)
{ {
SCASSERT(comboBoxStep != nullptr) SCASSERT(comboBoxStep != nullptr)
@ -663,8 +640,7 @@ void DialogSetupMultisize::DimensionBaseChanged(int index, QComboBox *comboBoxBa
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogSetupMultisize::UpdateSteps(QComboBox *comboBoxStep, void DialogSetupMultisize::UpdateSteps(QComboBox *comboBoxStep, const MeasurementDimension_p &dimension)
const MeasurementDimension_p &dimension)
{ {
SCASSERT(comboBoxStep != nullptr) SCASSERT(comboBoxStep != nullptr)
@ -697,8 +673,7 @@ void DialogSetupMultisize::UpdateSteps(QComboBox *comboBoxStep,
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogSetupMultisize::UpdateBase(QComboBox *comboBoxBase, void DialogSetupMultisize::UpdateBase(QComboBox *comboBoxBase, const MeasurementDimension_p &dimension)
const MeasurementDimension_p &dimension)
{ {
SCASSERT(comboBoxBase != nullptr) SCASSERT(comboBoxBase != nullptr)
@ -728,4 +703,3 @@ void DialogSetupMultisize::UpdateBase(QComboBox *comboBoxBase,
const qreal base = comboBoxBase->currentData().toDouble(&ok); const qreal base = comboBoxBase->currentData().toDouble(&ok);
dimension->SetBaseValue(ok ? base : -1); dimension->SetBaseValue(ok ? base : -1);
} }

View File

@ -33,10 +33,6 @@
#include "../vformat/vdimensions.h" #include "../vformat/vdimensions.h"
#include "../vmisc/def.h" #include "../vmisc/def.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
class QDoubleSpinBox; class QDoubleSpinBox;
class QGroupBox; class QGroupBox;
class QLineEdit; class QLineEdit;
@ -101,8 +97,7 @@ private:
void DimensionStepChanged(int index, QComboBox *comboBoxStep, QComboBox *comboBoxBase, void DimensionStepChanged(int index, QComboBox *comboBoxStep, QComboBox *comboBoxBase,
const MeasurementDimension_p &dimension); const MeasurementDimension_p &dimension);
void DimensionBaseChanged(int index, QComboBox *comboBoxBase, void DimensionBaseChanged(int index, QComboBox *comboBoxBase, const MeasurementDimension_p &dimension);
const MeasurementDimension_p &dimension);
void UpdateSteps(QComboBox *comboBoxStep, const MeasurementDimension_p &dimension); void UpdateSteps(QComboBox *comboBoxStep, const MeasurementDimension_p &dimension);
void UpdateBase(QComboBox *comboBoxBase, const MeasurementDimension_p &dimension); void UpdateBase(QComboBox *comboBoxBase, const MeasurementDimension_p &dimension);

View File

@ -31,10 +31,6 @@
#include <QDialog> #include <QDialog>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class DialogTapePreferences; class DialogTapePreferences;

View File

@ -32,12 +32,8 @@
#include <QTimer> #include <QTimer>
#if defined(APPIMAGE) && defined(Q_OS_LINUX) #if defined(APPIMAGE) && defined(Q_OS_LINUX)
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
#include "../vmisc/backport/qscopeguard.h"
#else
#include <QScopeGuard>
#endif
#include "../vmisc/appimage.h" #include "../vmisc/appimage.h"
#include <QScopeGuard>
#endif // defined(APPIMAGE) && defined(Q_OS_LINUX) #endif // defined(APPIMAGE) && defined(Q_OS_LINUX)
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -119,11 +115,9 @@ auto main(int argc, char *argv[]) -> int
MApplication app(argc, argv); MApplication app(argc, argv);
app.InitOptions(); app.InitOptions();
QT_REQUIRE_VERSION(argc, argv, "5.6.0"); // clazy:exclude=qstring-arg,qstring-allocations NOLINT QT_REQUIRE_VERSION(argc, argv, "5.15.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")); MApplication::setDesktopFileName(QStringLiteral("ua.com.smart-pattern.tape.desktop"));
#endif
QTimer::singleShot(0, &app, &MApplication::ProcessCMD); QTimer::singleShot(0, &app, &MApplication::ProcessCMD);

View File

@ -155,26 +155,6 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
#endif // defined(V_NO_ASSERT) #endif // defined(V_NO_ASSERT)
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
#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
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QNSView")))
{
type = QtDebugMsg;
}
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0)
// Hide Qt bug 'Assertion when reading an icns file'
// https://bugreports.qt.io/browse/QTBUG-45537
// Remove after Qt fix will be released
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QICNSHandler::read()")))
{
type = QtDebugMsg;
}
#endif
// Hide anything that starts with QMacCGContext // Hide anything that starts with QMacCGContext
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QMacCGContext::"))) if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QMacCGContext::")))
{ {

View File

@ -69,20 +69,7 @@
#include <QTextCodec> #include <QTextCodec>
#endif #endif
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#if (defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG)
// DO NOT WORK WITH GCC 4.8
#else
#if __cplusplus >= 201402L
using namespace std::chrono_literals; using namespace std::chrono_literals;
#else
#include "../vmisc/bpstd/chrono.hpp"
using namespace bpstd::literals::chrono_literals;
#endif // __cplusplus >= 201402L
#endif //(defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG)
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes") QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes")
@ -145,7 +132,7 @@ TKMMainWindow::TKMMainWindow(QWidget *parent)
if (MApplication::VApp()->IsAppInGUIMode()) if (MApplication::VApp()->IsAppInGUIMode())
{ {
QTimer::singleShot(V_SECONDS(1), this, &TKMMainWindow::AskDefaultSettings); QTimer::singleShot(1s, this, &TKMMainWindow::AskDefaultSettings);
} }
m_buttonShortcuts.insert(VShortcutAction::CaseSensitiveMatch, ui->toolButtonCaseSensitive); m_buttonShortcuts.insert(VShortcutAction::CaseSensitiveMatch, ui->toolButtonCaseSensitive);
@ -358,15 +345,6 @@ void TKMMainWindow::UpdateWindowTitle()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void TKMMainWindow::closeEvent(QCloseEvent *event) void TKMMainWindow::closeEvent(QCloseEvent *event)
{ {
#if defined(Q_OS_MAC) && QT_VERSION < QT_VERSION_CHECK(5, 11, 1)
// Workaround for Qt bug https://bugreports.qt.io/browse/QTBUG-43344
static int numCalled = 0;
if (numCalled++ >= 1)
{
return;
}
#endif
if (MaybeSave()) if (MaybeSave())
{ {
WriteSettings(); WriteSettings();

View File

@ -66,22 +66,12 @@
#include "vlitepattern.h" #include "vlitepattern.h"
#include "vtapesettings.h" #include "vtapesettings.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include "../vmisc/vtextcodec.h" #include "../vmisc/vtextcodec.h"
#else #else
#include <QTextCodec> #include <QTextCodec>
#endif #endif
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
#include "../vmisc/backport/qscopeguard.h"
#else
#include <QScopeGuard>
#endif
#include <QComboBox> #include <QComboBox>
#include <QCursor> #include <QCursor>
#include <QDesktopServices> #include <QDesktopServices>
@ -91,21 +81,13 @@
#include <QMimeType> #include <QMimeType>
#include <QPixmap> #include <QPixmap>
#include <QProcess> #include <QProcess>
#include <QScopeGuard>
#include <QTimer> #include <QTimer>
#include <QUuid> #include <QUuid>
#include <QtNumeric> #include <QtNumeric>
#include <chrono> #include <chrono>
#if (defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG)
// DO NOT WORK WITH GCC 4.8
#else
#if __cplusplus >= 201402L
using namespace std::chrono_literals; using namespace std::chrono_literals;
#else
#include "../vmisc/bpstd/chrono.hpp"
using namespace bpstd::literals::chrono_literals;
#endif // __cplusplus >= 201402L
#endif //(defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG)
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
#include <QDrag> #include <QDrag>
@ -313,7 +295,7 @@ TMainWindow::TMainWindow(QWidget *parent)
if (MApplication::VApp()->IsAppInGUIMode()) if (MApplication::VApp()->IsAppInGUIMode())
{ {
QTimer::singleShot(V_SECONDS(1), this, &TMainWindow::AskDefaultSettings); QTimer::singleShot(1s, this, &TMainWindow::AskDefaultSettings);
} }
m_buttonShortcuts.insert(VShortcutAction::CaseSensitiveMatch, ui->toolButtonCaseSensitive); m_buttonShortcuts.insert(VShortcutAction::CaseSensitiveMatch, ui->toolButtonCaseSensitive);
@ -732,15 +714,6 @@ void TMainWindow::ToolBarStyles()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void TMainWindow::closeEvent(QCloseEvent *event) void TMainWindow::closeEvent(QCloseEvent *event)
{ {
#if defined(Q_OS_MAC) && QT_VERSION < QT_VERSION_CHECK(5, 11, 1)
// Workaround for Qt bug https://bugreports.qt.io/browse/QTBUG-43344
static int numCalled = 0;
if (numCalled++ >= 1)
{
return;
}
#endif
if (MaybeSave()) if (MaybeSave())
{ {
WriteSettings(); WriteSettings();
@ -3278,7 +3251,7 @@ void TMainWindow::InitDimensionGradation(int index, const MeasurementDimension_p
int maxWidth = 0; int maxWidth = 0;
for (int i = 0; i < control->count(); ++i) for (int i = 0; i < control->count(); ++i)
{ {
int itemWidth = TextWidth(fontMetrics, control->itemText(i)); int itemWidth = fontMetrics.horizontalAdvance(control->itemText(i));
if (itemWidth > maxWidth) if (itemWidth > maxWidth)
{ {
maxWidth = itemWidth; maxWidth = itemWidth;

View File

@ -30,10 +30,6 @@
#include "../vmisc/vabstractshortcutmanager.h" #include "../vmisc/vabstractshortcutmanager.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class VTapeShortcutManager : public VAbstractShortcutManager class VTapeShortcutManager : public VAbstractShortcutManager
{ {
Q_OBJECT // NOLINT Q_OBJECT // NOLINT

View File

@ -45,13 +45,10 @@
#include "../vmisc/vvalentinasettings.h" #include "../vmisc/vvalentinasettings.h"
#include "vvalentinashortcutmanager.h" #include "vvalentinashortcutmanager.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
#include "../vmisc/backport/text.h"
#endif
#include "QtConcurrent/qtconcurrentrun.h" #include "QtConcurrent/qtconcurrentrun.h"
#include <QDateTime> #include <QDateTime>
#include <QDir> #include <QDir>
#include <QEvent>
#include <QFile> #include <QFile>
#include <QFileSystemWatcher> #include <QFileSystemWatcher>
#include <QFuture> #include <QFuture>
@ -60,6 +57,7 @@
#include <QMessageBox> #include <QMessageBox>
#include <QObject> #include <QObject>
#include <QProcess> #include <QProcess>
#include <QScopeGuard>
#include <QStandardPaths> #include <QStandardPaths>
#include <QStyleFactory> #include <QStyleFactory>
#include <QTemporaryFile> #include <QTemporaryFile>
@ -77,13 +75,6 @@
#define BUILD_REVISION VCS_REPO_STATE_REVISION #define BUILD_REVISION VCS_REPO_STATE_REVISION
#endif #endif
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
#include "../vmisc/backport/qscopeguard.h"
#else
#include <QEvent>
#include <QScopeGuard>
#endif
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
#include "../vmisc/compatibility.h" #include "../vmisc/compatibility.h"
#endif #endif
@ -181,26 +172,6 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
#endif // defined(V_NO_ASSERT) #endif // defined(V_NO_ASSERT)
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
#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
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QNSView")))
{
type = QtDebugMsg;
}
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0)
// Hide Qt bug 'Assertion when reading an icns file'
// https://bugreports.qt.io/browse/QTBUG-45537
// Remove after Qt fix will be released
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QICNSHandler::read()")))
{
type = QtDebugMsg;
}
#endif
// Hide anything that starts with QMacCGContext // Hide anything that starts with QMacCGContext
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QMacCGContext::"))) if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QMacCGContext::")))
{ {
@ -645,11 +616,7 @@ void VApplication::ClearOldLogs()
for (const auto &fn : allFiles) for (const auto &fn : allFiles)
{ {
QFileInfo info(fn); QFileInfo info(fn);
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
const QDateTime created = info.birthTime(); const QDateTime created = info.birthTime();
#else
const QDateTime created = info.created();
#endif
if (created.daysTo(QDateTime::currentDateTime()) >= DAYS_TO_KEEP_LOGS) if (created.daysTo(QDateTime::currentDateTime()) >= DAYS_TO_KEEP_LOGS)
{ {
VLockGuard<QFile> tmp(info.absoluteFilePath(), [&fn]() { return new QFile(fn); }); VLockGuard<QFile> tmp(info.absoluteFilePath(), [&fn]() { return new QFile(fn); });

View File

@ -35,9 +35,6 @@
#include <QWidget> #include <QWidget>
#include "../vpatterndb/vformula.h" #include "../vpatterndb/vformula.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class VFormulaPropertyEditor : public QWidget class VFormulaPropertyEditor : public QWidget
{ {

View File

@ -30,10 +30,6 @@
#include "../vmisc/vabstractshortcutmanager.h" #include "../vmisc/vabstractshortcutmanager.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class VValentinaShortcutManager : public VAbstractShortcutManager class VValentinaShortcutManager : public VAbstractShortcutManager
{ {
Q_OBJECT // NOLINT Q_OBJECT // NOLINT

View File

@ -35,16 +35,12 @@
#include "../vmisc/theme/vtheme.h" #include "../vmisc/theme/vtheme.h"
#include "../vmisc/vabstractshortcutmanager.h" #include "../vmisc/vabstractshortcutmanager.h"
#include "../vmisc/vvalentinasettings.h" #include "../vmisc/vvalentinasettings.h"
#include "qpushbutton.h"
#include "ui_preferencesconfigurationpage.h" #include "ui_preferencesconfigurationpage.h"
#include "vcommonsettings.h" #include "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 <QDir> #include <QDir>
#include <QDirIterator> #include <QDirIterator>
#include <QPushButton>
#include <QStyleHints> #include <QStyleHints>
#include <QTimer> #include <QTimer>

View File

@ -31,10 +31,6 @@
#include <QWidget> #include <QWidget>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class PreferencesConfigurationPage; class PreferencesConfigurationPage;

View File

@ -31,10 +31,6 @@
#include <QWidget> #include <QWidget>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class PreferencesPathPage; class PreferencesPathPage;

View File

@ -29,24 +29,21 @@
#include "preferencespatternpage.h" #include "preferencespatternpage.h"
#include "../dialogdatetimeformats.h" #include "../dialogdatetimeformats.h"
#include "../dialogknownmaterials.h" #include "../dialogknownmaterials.h"
#include "../ifc/xml/vabstractpattern.h"
#include "../vformat/vsinglelineoutlinechar.h"
#include "../vmisc/svgfont/vsvgfontdatabase.h" #include "../vmisc/svgfont/vsvgfontdatabase.h"
#include "../vmisc/vabstractvalapplication.h" #include "../vmisc/vabstractvalapplication.h"
#include "../vmisc/vvalentinasettings.h" #include "../vmisc/vvalentinasettings.h"
#include "../vwidgets/vmaingraphicsview.h"
#include "svgfont/svgdef.h" #include "svgfont/svgdef.h"
#include "svgfont/vsvgfont.h" #include "svgfont/vsvgfont.h"
#include "svgfont/vsvgfontengine.h" #include "svgfont/vsvgfontengine.h"
#include "ui_preferencespatternpage.h" #include "ui_preferencespatternpage.h"
#include "vabstractapplication.h" #include "vabstractapplication.h"
#include <QFontMetrics>
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../ifc/xml/vabstractpattern.h"
#include "../vformat/vsinglelineoutlinechar.h"
#include "../vwidgets/vmaingraphicsview.h"
#include <QCompleter> #include <QCompleter>
#include <QDate> #include <QDate>
#include <QFontMetrics>
#include <QMessageBox> #include <QMessageBox>
#include <QScreen> #include <QScreen>
#include <QStyledItemDelegate> #include <QStyledItemDelegate>

View File

@ -31,10 +31,6 @@
#include <QDialog> #include <QDialog>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class DialogAboutApp; class DialogAboutApp;

View File

@ -30,10 +30,6 @@
#include <QDialog> #include <QDialog>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
namespace Ui namespace Ui
{ {
class DialogAddBackgroundImage; class DialogAddBackgroundImage;

View File

@ -33,10 +33,6 @@
#include <QDialog> #include <QDialog>
#include <QTime> #include <QTime>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class DialogDateTimeFormats; class DialogDateTimeFormats;

View File

@ -27,14 +27,10 @@
*************************************************************************/ *************************************************************************/
#include "dialogincrements.h" #include "dialogincrements.h"
#include "../vmisc/vvalentinasettings.h"
#include "ui_dialogincrements.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 "../qmuparser/qmudef.h" #include "../qmuparser/qmudef.h"
#include "../qmuparser/qmutokenparser.h" #include "../qmuparser/qmutokenparser.h"
#include "../vmisc/theme/vtheme.h" #include "../vmisc/theme/vtheme.h"
#include "../vmisc/vvalentinasettings.h"
#include "../vpatterndb/calculator.h" #include "../vpatterndb/calculator.h"
#include "../vpatterndb/variables/varcradius.h" #include "../vpatterndb/variables/varcradius.h"
#include "../vpatterndb/variables/vcurveangle.h" #include "../vpatterndb/variables/vcurveangle.h"
@ -45,6 +41,7 @@
#include "../vpatterndb/variables/vlinelength.h" #include "../vpatterndb/variables/vlinelength.h"
#include "../vpatterndb/vtranslatevars.h" #include "../vpatterndb/vtranslatevars.h"
#include "../vtools/dialogs/support/dialogeditwrongformula.h" #include "../vtools/dialogs/support/dialogeditwrongformula.h"
#include "ui_dialogincrements.h"
#include <QCloseEvent> #include <QCloseEvent>
#include <QDir> #include <QDir>
@ -2106,9 +2103,6 @@ DialogIncrements::~DialogIncrements()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::RestoreAfterClose() void DialogIncrements::RestoreAfterClose()
{ {
// Because of bug on Mac OS with Qt 5.11 closing this dialog causes a crash. Instead of closing we will keep
// dialog in memory and reuse it again. This function redo some moves made after close.
connect(this->m_doc, &VPattern::FullUpdateFromFile, this, &DialogIncrements::FullUpdateFromFile); connect(this->m_doc, &VPattern::FullUpdateFromFile, this, &DialogIncrements::FullUpdateFromFile);
ui->tabWidget->setCurrentIndex(0); ui->tabWidget->setCurrentIndex(0);

View File

@ -31,10 +31,6 @@
#include <QDialog> #include <QDialog>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class DialogKnownMaterials; class DialogKnownMaterials;

View File

@ -40,16 +40,7 @@
#include <QtDebug> #include <QtDebug>
#include <chrono> #include <chrono>
#if (defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG)
// DO NOT WORK WITH GCC 4.8
#else
#if __cplusplus >= 201402L
using namespace std::chrono_literals; using namespace std::chrono_literals;
#else
#include "../vmisc/bpstd/chrono.hpp"
using namespace bpstd::literals::chrono_literals;
#endif // __cplusplus >= 201402L
#endif //(defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogLayoutProgress::DialogLayoutProgress(QElapsedTimer timer, qint64 timeout, QWidget *parent) DialogLayoutProgress::DialogLayoutProgress(QElapsedTimer timer, qint64 timeout, QWidget *parent)
@ -96,7 +87,7 @@ DialogLayoutProgress::DialogLayoutProgress(QElapsedTimer timer, qint64 timeout,
m_progressTimer->stop(); m_progressTimer->stop();
} }
}); });
m_progressTimer->start(V_SECONDS(1)); m_progressTimer->start(1s);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -33,10 +33,6 @@
#include <QElapsedTimer> #include <QElapsedTimer>
#include <QTimer> #include <QTimer>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class DialogLayoutProgress; class DialogLayoutProgress;

View File

@ -27,13 +27,10 @@
*************************************************************************/ *************************************************************************/
#include "dialoglayoutsettings.h" #include "dialoglayoutsettings.h"
#include "../vlayout/vlayoutgenerator.h"
#include "../vmisc/vabstractvalapplication.h" #include "../vmisc/vabstractvalapplication.h"
#include "../vmisc/vvalentinasettings.h" #include "../vmisc/vvalentinasettings.h"
#include "ui_dialoglayoutsettings.h" #include "ui_dialoglayoutsettings.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 "../vlayout/vlayoutgenerator.h"
#include <QMessageBox> #include <QMessageBox>
#include <QPrinterInfo> #include <QPrinterInfo>

View File

@ -43,16 +43,13 @@
#include <QUrl> #include <QUrl>
#include "../core/vapplication.h" #include "../core/vapplication.h"
#include "../ifc/xml/utils.h"
#include "../ifc/xml/vpatternimage.h"
#include "../qmuparser/qmudef.h"
#include "../vmisc/vabstractvalapplication.h" #include "../vmisc/vabstractvalapplication.h"
#include "../vmisc/vvalentinasettings.h" #include "../vmisc/vvalentinasettings.h"
#include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vcontainer.h"
#include "../xml/vpattern.h" #include "../xml/vpattern.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 "../ifc/xml/utils.h"
#include "../ifc/xml/vpatternimage.h"
#include "../qmuparser/qmudef.h"
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
#include "../vmisc/compatibility.h" #include "../vmisc/compatibility.h"

View File

@ -33,10 +33,6 @@
#include <QMap> #include <QMap>
#include <QPointer> #include <QPointer>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class VPattern; class VPattern;
class VContainer; class VContainer;
class QCheckBox; class QCheckBox;

View File

@ -31,10 +31,6 @@
#include <QDialog> #include <QDialog>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class DialogPreferences; class DialogPreferences;

View File

@ -33,10 +33,6 @@
#include "../vmisc/vvalentinasettings.h" #include "../vmisc/vvalentinasettings.h"
#include "ui_dialogsavelayout.h" #include "ui_dialogsavelayout.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 <QDir> #include <QDir>
#include <QFileDialog> #include <QFileDialog>
#include <QGlobalStatic> #include <QGlobalStatic>

View File

@ -44,10 +44,6 @@
#include "../vtools/undocommands/image/zvaluemovebackgroundimage.h" #include "../vtools/undocommands/image/zvaluemovebackgroundimage.h"
#include "ui_vwidgetbackgroundimages.h" #include "ui_vwidgetbackgroundimages.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 <QMenu> #include <QMenu>
#include <QPushButton> #include <QPushButton>

View File

@ -30,10 +30,6 @@
#include <QWidget> #include <QWidget>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/def.h" #include "../vmisc/def.h"
class VAbstractPattern; class VAbstractPattern;
@ -44,7 +40,14 @@ namespace Ui
class VWidgetBackgroundImages; class VWidgetBackgroundImages;
} }
enum class ScaleUnit {Percent, Mm, Cm, Inch, Px}; enum class ScaleUnit
{
Percent,
Mm,
Cm,
Inch,
Px
};
class VWidgetBackgroundImages : public QWidget class VWidgetBackgroundImages : public QWidget
{ {

View File

@ -40,16 +40,7 @@
#include <QUndoStack> #include <QUndoStack>
#include <chrono> #include <chrono>
#if (defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG)
// DO NOT WORK WITH GCC 4.8
#else
#if __cplusplus >= 201402L
using namespace std::chrono_literals; using namespace std::chrono_literals;
#else
#include "../vmisc/bpstd/chrono.hpp"
using namespace bpstd::literals::chrono_literals;
#endif // __cplusplus >= 201402L
#endif //(defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG)
namespace namespace
{ {
@ -95,7 +86,7 @@ void VWidgetDetails::UpdateList()
// The filling table is a very expensive operation. This optimization will postpone it. // The filling table is a very expensive operation. This optimization will postpone it.
// Each time a new request happen we will wait 800 ms before calling it. If at this time a new request will arrive // Each time a new request happen we will wait 800 ms before calling it. If at this time a new request will arrive
// we will wait 800 ms more. And so on, until nothing happens within 800ms. // we will wait 800 ms more. And so on, until nothing happens within 800ms.
m_updateListTimer->start(V_MSECONDS(800)); m_updateListTimer->start(800ms);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -31,10 +31,6 @@
#include <QWidget> #include <QWidget>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class VAbstractPattern; class VAbstractPattern;
class VContainer; class VContainer;
class VPiece; class VPiece;

View File

@ -30,10 +30,8 @@
#define VWIDGETGROUPS_H #define VWIDGETGROUPS_H
#include "../vmisc/typedef.h" #include "../vmisc/typedef.h"
#include <QWidget> #include <QWidget>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class QTableWidgetItem; class QTableWidgetItem;
class VAbstractPattern; class VAbstractPattern;

View File

@ -36,12 +36,8 @@
#include <QTimer> #include <QTimer>
#if defined(APPIMAGE) && defined(Q_OS_LINUX) #if defined(APPIMAGE) && defined(Q_OS_LINUX)
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
#include "../vmisc/backport/qscopeguard.h"
#else
#include <QScopeGuard>
#endif
#include "../vmisc/appimage.h" #include "../vmisc/appimage.h"
#include <QScopeGuard>
#endif // defined(APPIMAGE) && defined(Q_OS_LINUX) #endif // defined(APPIMAGE) && defined(Q_OS_LINUX)
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -133,11 +129,9 @@ auto main(int argc, char *argv[]) -> int
VApplication app(argc, argv); VApplication app(argc, argv);
app.InitOptions(); app.InitOptions();
QT_REQUIRE_VERSION(argc, argv, "5.6.0") // clazy:exclude=qstring-arg,qstring-allocations NOLINT QT_REQUIRE_VERSION(argc, argv, "5.15.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")); VApplication::setDesktopFileName(QStringLiteral("ua.com.smart-pattern.valentina.desktop"));
#endif
if (VApplication::IsGUIMode() && VAbstractApplication::VApp()->Settings()->IsAutomaticallyCheckUpdates()) if (VApplication::IsGUIMode() && VAbstractApplication::VApp()->Settings()->IsAutomaticallyCheckUpdates())
{ {

View File

@ -42,6 +42,7 @@
#include <QMessageBox> #include <QMessageBox>
#include <QProcess> #include <QProcess>
#include <QProgressBar> #include <QProgressBar>
#include <QScopeGuard>
#include <QScrollBar> #include <QScrollBar>
#include <QSettings> #include <QSettings>
#include <QShowEvent> #include <QShowEvent>
@ -202,21 +203,11 @@
#include <QTextCodec> #include <QTextCodec>
#endif #endif
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
#include "../vmisc/backport/qscopeguard.h"
#else
#include <QScopeGuard>
#endif
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QSourceLocation> #include <QSourceLocation>
#endif #endif
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QWinTaskbarButton> #include <QWinTaskbarButton>
#include <QWinTaskbarProgress> #include <QWinTaskbarProgress>
#endif #endif
@ -226,16 +217,7 @@
#include <QMimeData> #include <QMimeData>
#endif // defined(Q_OS_MAC) #endif // defined(Q_OS_MAC)
#if (defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG)
// DO NOT WORK WITH GCC 4.8
#else
#if __cplusplus >= 201402L
using namespace std::chrono_literals; using namespace std::chrono_literals;
#else
#include "../vmisc/bpstd/chrono.hpp"
using namespace bpstd::literals::chrono_literals;
#endif // __cplusplus >= 201402L
#endif //(defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG)
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
#include "../vmisc/compatibility.h" #include "../vmisc/compatibility.h"
@ -403,7 +385,7 @@ MainWindow::MainWindow(QWidget *parent)
connect(ui->actionExportFontCorrections, &QAction::triggered, this, &MainWindow::ActionExportFontCorrections); connect(ui->actionExportFontCorrections, &QAction::triggered, this, &MainWindow::ActionExportFontCorrections);
m_progressBar->setVisible(false); m_progressBar->setVisible(false);
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_taskbarProgress->setVisible(false); m_taskbarProgress->setVisible(false);
#endif #endif
m_statusLabel->setText(tr("Create new pattern piece to start working.")); m_statusLabel->setText(tr("Create new pattern piece to start working."));
@ -531,7 +513,7 @@ MainWindow::MainWindow(QWidget *parent)
if (VApplication::IsGUIMode()) if (VApplication::IsGUIMode())
{ {
QTimer::singleShot(V_SECONDS(1), this, &MainWindow::AskDefaultSettings); QTimer::singleShot(1s, this, &MainWindow::AskDefaultSettings);
} }
ui->actionExportFontCorrections->setEnabled(settings->GetSingleStrokeOutlineFont()); ui->actionExportFontCorrections->setEnabled(settings->GetSingleStrokeOutlineFont());
@ -1829,7 +1811,7 @@ void MainWindow::showEvent(QShowEvent *event)
return; return;
} }
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_taskbarButton->setWindow(windowHandle()); m_taskbarButton->setWindow(windowHandle());
#endif #endif
@ -1894,15 +1876,6 @@ void MainWindow::changeEvent(QEvent *event)
*/ */
void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::closeEvent(QCloseEvent *event)
{ {
#if defined(Q_OS_MAC) && QT_VERSION < QT_VERSION_CHECK(5, 11, 1)
// Workaround for Qt bug https://bugreports.qt.io/browse/QTBUG-43344
static int numCalled = 0;
if (numCalled++ >= 1)
{
return;
}
#endif
qCDebug(vMainWindow, "Closing main window"); qCDebug(vMainWindow, "Closing main window");
if (MaybeSave()) if (MaybeSave())
{ {
@ -2235,7 +2208,7 @@ void MainWindow::MeasurementsChanged(const QString &path)
{ {
m_mChanges = true; m_mChanges = true;
m_mChangesAsked = false; m_mChangesAsked = false;
m_measurementsSyncTimer->start(V_MSECONDS(1500)); m_measurementsSyncTimer->start(1500ms);
} }
else else
{ {
@ -2245,7 +2218,7 @@ void MainWindow::MeasurementsChanged(const QString &path)
{ {
m_mChanges = true; m_mChanges = true;
m_mChangesAsked = false; m_mChangesAsked = false;
m_measurementsSyncTimer->start(V_MSECONDS(1500)); m_measurementsSyncTimer->start(1500ms);
break; break;
} }
@ -4498,7 +4471,7 @@ void MainWindow::Clear()
m_toolOptions->ClearPropertyBrowser(); m_toolOptions->ClearPropertyBrowser();
m_toolOptions->itemClicked(nullptr); m_toolOptions->itemClicked(nullptr);
m_progressBar->setVisible(false); m_progressBar->setVisible(false);
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_taskbarProgress->setVisible(false); m_taskbarProgress->setVisible(false);
#endif #endif
m_statusLabel->setVisible(true); m_statusLabel->setVisible(true);
@ -4914,7 +4887,7 @@ void MainWindow::ShowProgress()
{ {
const int newValue = m_progressBar->value() + 1; const int newValue = m_progressBar->value() + 1;
m_progressBar->setValue(newValue); m_progressBar->setValue(newValue);
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_taskbarProgress->setValue(newValue); m_taskbarProgress->setValue(newValue);
#endif #endif
QCoreApplication::processEvents(); QCoreApplication::processEvents();
@ -5393,7 +5366,7 @@ void MainWindow::InitDimensionGradation(int index, const MeasurementDimension_p
int maxWidth = 0; int maxWidth = 0;
for (int i = 0; i < control->count(); ++i) for (int i = 0; i < control->count(); ++i)
{ {
int itemWidth = TextWidth(fontMetrics, control->itemText(i)); int itemWidth = fontMetrics.horizontalAdvance(control->itemText(i));
if (itemWidth > maxWidth) if (itemWidth > maxWidth)
{ {
maxWidth = itemWidth; maxWidth = itemWidth;
@ -6600,7 +6573,7 @@ auto MainWindow::LoadPattern(QString fileName, const QString &customMeasureFile)
m_progressBar->setValue(0); m_progressBar->setValue(0);
const int elements = doc->ElementsToParse(); const int elements = doc->ElementsToParse();
m_progressBar->setMaximum(elements); m_progressBar->setMaximum(elements);
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_taskbarProgress->setVisible(true); m_taskbarProgress->setVisible(true);
m_taskbarProgress->setMaximum(elements); m_taskbarProgress->setMaximum(elements);
#endif #endif
@ -6608,7 +6581,7 @@ auto MainWindow::LoadPattern(QString fileName, const QString &customMeasureFile)
FullParseFile(); FullParseFile();
m_progressBar->setVisible(false); m_progressBar->setVisible(false);
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_taskbarProgress->setVisible(false); m_taskbarProgress->setVisible(false);
#endif #endif
m_statusLabel->setVisible(true); m_statusLabel->setVisible(true);
@ -6619,7 +6592,7 @@ auto MainWindow::LoadPattern(QString fileName, const QString &customMeasureFile)
{ {
/* Collect garbage only after successfully parse. This way wrongly accused items have one more time to /* Collect garbage only after successfully parse. This way wrongly accused items have one more time to
* restore a reference. */ * restore a reference. */
QTimer::singleShot(V_MSECONDS(100), Qt::CoarseTimer, this, [this]() { doc->GarbageCollector(true); }); QTimer::singleShot(100ms, Qt::CoarseTimer, this, [this]() { doc->GarbageCollector(true); });
} }
m_patternReadOnly = doc->IsReadOnly(); m_patternReadOnly = doc->IsReadOnly();

View File

@ -71,7 +71,7 @@
#include <QtSvg> #include <QtSvg>
#include <functional> #include <functional>
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QWinTaskbarButton> #include <QWinTaskbarButton>
#include <QWinTaskbarProgress> #include <QWinTaskbarProgress>
#endif #endif
@ -134,14 +134,14 @@ MainWindowsNoGUI::MainWindowsNoGUI(QWidget *parent)
: VAbstractMainWindow(parent), : VAbstractMainWindow(parent),
pattern(new VContainer(VAbstractApplication::VApp()->TrVars(), VAbstractValApplication::VApp()->patternUnitsP(), pattern(new VContainer(VAbstractApplication::VApp()->TrVars(), VAbstractValApplication::VApp()->patternUnitsP(),
valentinaNamespace)) valentinaNamespace))
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
, ,
m_taskbarButton(new QWinTaskbarButton(this)) m_taskbarButton(new QWinTaskbarButton(this))
#endif #endif
{ {
InitTempLayoutScene(); InitTempLayoutScene();
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_taskbarButton->setWindow(this->windowHandle()); m_taskbarButton->setWindow(this->windowHandle());
m_taskbarProgress = m_taskbarButton->progress(); m_taskbarProgress = m_taskbarButton->progress();
m_taskbarProgress->setMinimum(0); m_taskbarProgress->setMinimum(0);
@ -193,14 +193,14 @@ auto MainWindowsNoGUI::GenerateLayout(VLayoutGenerator &lGenerator) -> bool
QElapsedTimer timer; QElapsedTimer timer;
timer.start(); timer.start();
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QTimer *progressTimer = nullptr; QTimer *progressTimer = nullptr;
#endif #endif
QSharedPointer<DialogLayoutProgress> progress; QSharedPointer<DialogLayoutProgress> progress;
if (VApplication::IsGUIMode()) if (VApplication::IsGUIMode())
{ {
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_taskbarProgress->setVisible(true); m_taskbarProgress->setVisible(true);
m_taskbarProgress->setValue(0); m_taskbarProgress->setValue(0);
m_taskbarProgress->setMaximum(lGenerator.GetNestingTime() * 60); m_taskbarProgress->setMaximum(lGenerator.GetNestingTime() * 60);
@ -419,7 +419,7 @@ auto MainWindowsNoGUI::GenerateLayout(VLayoutGenerator &lGenerator) -> bool
progress->Finished(); progress->Finished();
} }
#if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if defined(Q_OS_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (VApplication::IsGUIMode()) if (VApplication::IsGUIMode())
{ {
progressTimer->stop(); progressTimer->stop();

View File

@ -46,7 +46,7 @@ struct PosterData;
class QGraphicsRectItem; class QGraphicsRectItem;
class VMeasurements; class VMeasurements;
#if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
class QWinTaskbarButton; class QWinTaskbarButton;
class QWinTaskbarProgress; class QWinTaskbarProgress;
#endif #endif
@ -127,7 +127,7 @@ protected:
QSharedPointer<DialogSaveLayout> m_dialogSaveLayout{}; // NOLINT(misc-non-private-member-variables-in-classes) QSharedPointer<DialogSaveLayout> m_dialogSaveLayout{}; // NOLINT(misc-non-private-member-variables-in-classes)
#if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QWinTaskbarButton *m_taskbarButton; // NOLINT(misc-non-private-member-variables-in-classes) QWinTaskbarButton *m_taskbarButton; // NOLINT(misc-non-private-member-variables-in-classes)
QWinTaskbarProgress *m_taskbarProgress{nullptr}; // NOLINT(misc-non-private-member-variables-in-classes) QWinTaskbarProgress *m_taskbarProgress{nullptr}; // NOLINT(misc-non-private-member-variables-in-classes)
#endif #endif

View File

@ -377,8 +377,9 @@ win32:*g++* {
package.files += $$[QT_INSTALL_BINS]/Qt5WinExtras.dll package.files += $$[QT_INSTALL_BINS]/Qt5WinExtras.dll
} }
greaterThan(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 10) { package.files += \
versionAtLeast(QT_VERSION, 5.12.4){ $$PWD/../../../dist/win/msvcr120.dll
# Minimal supported OpenSSL version since Qt 5.12.4 is 1.1.1. # Minimal supported OpenSSL version since Qt 5.12.4 is 1.1.1.
contains(QMAKE_HOST.arch, x86_64) { contains(QMAKE_HOST.arch, x86_64) {
package.files += \ package.files += \
@ -389,34 +390,6 @@ win32:*g++* {
$$PWD/../../../dist/win/openssl/win32/libcrypto-1_1.dll \ $$PWD/../../../dist/win/openssl/win32/libcrypto-1_1.dll \
$$PWD/../../../dist/win/openssl/win32/libssl-1_1.dll $$PWD/../../../dist/win/openssl/win32/libssl-1_1.dll
} }
} else {
package.files += \
$$PWD/../../../dist/win/msvcr120.dll \
contains(QMAKE_HOST.arch, x86_64) {
package.files += \
$$PWD/../../../dist/win/openssl/win64/libeay32.dll \
$$PWD/../../../dist/win/openssl/win64/ssleay32.dll
} else {
package.files += \
$$PWD/../../../dist/win/openssl/win32/libeay32.dll \
$$PWD/../../../dist/win/openssl/win32/ssleay32.dll
}
}
} else {
package.files += \
$$PWD/../../../dist/win/msvcr120.dll \
contains(QMAKE_HOST.arch, x86_64) {
package.files += \
$$PWD/../../../dist/win/openssl/win64/libeay32.dll \
$$PWD/../../../dist/win/openssl/win64/ssleay32.dll
} else {
package.files += \
$$PWD/../../../dist/win/openssl/win32/libeay32.dll \
$$PWD/../../../dist/win/openssl/win32/ssleay32.dll
}
}
package.CONFIG = no_check_exist package.CONFIG = no_check_exist
INSTALLS += package INSTALLS += package

View File

@ -103,16 +103,11 @@
#include "../vtools/tools/vtooluniondetails.h" #include "../vtools/tools/vtooluniondetails.h"
#include "../vwidgets/vabstractmainwindow.h" #include "../vwidgets/vabstractmainwindow.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
#include "../vmisc/backport/qscopeguard.h"
#else
#include <QScopeGuard>
#endif
#include <QDebug> #include <QDebug>
#include <QFileInfo> #include <QFileInfo>
#include <QFuture> #include <QFuture>
#include <QMessageBox> #include <QMessageBox>
#include <QScopeGuard>
#include <QTimer> #include <QTimer>
#include <QUndoStack> #include <QUndoStack>
#include <QtConcurrentMap> #include <QtConcurrentMap>
@ -121,16 +116,7 @@
#include <chrono> #include <chrono>
#include <functional> #include <functional>
#if (defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG)
// DO NOT WORK WITH GCC 4.8
#else
#if __cplusplus >= 201402L
using namespace std::chrono_literals; using namespace std::chrono_literals;
#else
#include "../vmisc/bpstd/chrono.hpp"
using namespace bpstd::literals::chrono_literals;
#endif // __cplusplus >= 201402L
#endif //(defined(Q_CC_GNU) && Q_CC_GNU < 409) && !defined(Q_CC_CLANG)
using namespace Qt::Literals::StringLiterals; using namespace Qt::Literals::StringLiterals;
@ -291,7 +277,7 @@ void VPattern::Parse(const Document &parse)
if (VApplication::IsGUIMode()) if (VApplication::IsGUIMode())
{ {
QTimer::singleShot(V_SECONDS(1), Qt::VeryCoarseTimer, this, &VPattern::RefreshPieceGeometry); QTimer::singleShot(1s, Qt::VeryCoarseTimer, this, &VPattern::RefreshPieceGeometry);
} }
else if (VApplication::CommandLine()->IsTestModeEnabled()) else if (VApplication::CommandLine()->IsTestModeEnabled())
{ {

View File

@ -28,10 +28,6 @@
#include <QUrl> #include <QUrl>
#include <QtGlobal> #include <QtGlobal>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class FvAvailableUpdate final : public QObject class FvAvailableUpdate final : public QObject
{ {
Q_OBJECT // NOLINT Q_OBJECT // NOLINT

View File

@ -28,10 +28,6 @@
#include <QString> #include <QString>
#include <QtGlobal> #include <QtGlobal>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class QGraphicsScene; class QGraphicsScene;
namespace Ui namespace Ui

View File

@ -457,11 +457,7 @@ auto LocaleSign0(const QLocale &locale) -> QChar
const QString sign = locale.toString(0); const QString sign = locale.toString(0);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -477,11 +473,7 @@ auto LocaleSign1(const QLocale &locale) -> QChar
const QString sign = locale.toString(1); const QString sign = locale.toString(1);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -497,11 +489,7 @@ auto LocaleSign2(const QLocale &locale) -> QChar
const QString sign = locale.toString(2); const QString sign = locale.toString(2);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -517,11 +505,7 @@ auto LocaleSign3(const QLocale &locale) -> QChar
const QString sign = locale.toString(3); const QString sign = locale.toString(3);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -537,11 +521,7 @@ auto LocaleSign4(const QLocale &locale) -> QChar
const QString sign = locale.toString(4); const QString sign = locale.toString(4);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -557,11 +537,7 @@ auto LocaleSign5(const QLocale &locale) -> QChar
const QString sign = locale.toString(5); const QString sign = locale.toString(5);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -577,11 +553,7 @@ auto LocaleSign6(const QLocale &locale) -> QChar
const QString sign = locale.toString(6); const QString sign = locale.toString(6);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -597,11 +569,7 @@ auto LocaleSign7(const QLocale &locale) -> QChar
const QString sign = locale.toString(7); const QString sign = locale.toString(7);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -617,11 +585,7 @@ auto LocaleSign8(const QLocale &locale) -> QChar
const QString sign = locale.toString(8); const QString sign = locale.toString(8);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -637,11 +601,7 @@ auto LocaleSign9(const QLocale &locale) -> QChar
const QString sign = locale.toString(9); const QString sign = locale.toString(9);
if (sign.size() == 1) if (sign.size() == 1)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
return sign.front(); return sign.front();
#else
return sign.at(0);
#endif
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)

View File

@ -25,13 +25,6 @@
#include "qmuparser_global.h" #include "qmuparser_global.h"
#include "qmuparserdef.h" #include "qmuparserdef.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#define Q_DISABLE_COPY_MOVE(Class) \
Q_DISABLE_COPY(Class) \
Class(Class &&) = delete; \
Class &operator=(Class &&) = delete;
#endif
#ifndef Q_DISABLE_ASSIGN #ifndef Q_DISABLE_ASSIGN
#define Q_DISABLE_ASSIGN(Class) Class &operator=(const Class &) = delete; #define Q_DISABLE_ASSIGN(Class) Class &operator=(const Class &) = delete;
#endif #endif

View File

@ -23,15 +23,15 @@
#include <QCoreApplication> #include <QCoreApplication>
#include <QLineF> #include <QLineF>
#include <QtDebug>
#include <QtGlobal> #include <QtGlobal>
#include <QtMath>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <QtDebug>
#include <QtMath>
#include "qmuparsererror.h"
#include "../vmisc/defglobal.h" #include "../vmisc/defglobal.h"
#include "qmudef.h" #include "qmudef.h"
#include "qmuparsererror.h"
/** /**
* @file * @file
@ -103,11 +103,7 @@ auto CSR(qreal length, qreal split, qreal arcLength) -> qreal
tmp.setAngle(tmp.angle() + angle * sign); tmp.setAngle(tmp.angle() + angle * sign);
QPointF crosPoint; QPointF crosPoint;
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
const auto type = line.intersects(tmp, &crosPoint); const auto type = line.intersects(tmp, &crosPoint);
#else
const auto type = line.intersect(tmp, &crosPoint);
#endif
if (type == QLineF::NoIntersection) if (type == QLineF::NoIntersection)
{ {
return 0; return 0;
@ -116,12 +112,11 @@ auto CSR(qreal length, qreal split, qreal arcLength) -> qreal
QLineF radius(crosPoint, tmp.p2()); QLineF radius(crosPoint, tmp.p2());
const qreal arcAngle = sign > 0 ? line.angleTo(radius) : radius.angleTo(line); const qreal arcAngle = sign > 0 ? line.angleTo(radius) : radius.angleTo(line);
arcL = (M_PI * radius.length()) / 180.0 * arcAngle; arcL = (M_PI * radius.length()) / 180.0 * arcAngle;
} } while (qAbs(arcL - arcLength) > (0.5 /*mm*/ / 25.4) * PrintDPI);
while(qAbs(arcL - arcLength) > (0.5/*mm*/ / 25.4) * PrintDPI);
return angle; return angle;
} }
} } // namespace
/** /**
* @brief Namespace for mathematical applications. * @brief Namespace for mathematical applications.
@ -303,8 +298,8 @@ auto QmuParser::Sum(const qreal *a_afArg, qmusizetype a_iArgc) -> qreal
{ {
if (a_iArgc == 0) if (a_iArgc == 0)
{ {
throw QmuParserError(QCoreApplication::translate("QmuParser", "too few arguments for function sum.", throw QmuParserError(
"parser error message")); QCoreApplication::translate("QmuParser", "too few arguments for function sum.", "parser error message"));
} }
qreal fRes = 0; qreal fRes = 0;
for (int i = 0; i < a_iArgc; ++i) for (int i = 0; i < a_iArgc; ++i)
@ -324,8 +319,8 @@ auto QmuParser::Avg(const qreal *a_afArg, qmusizetype a_iArgc) -> qreal
{ {
if (a_iArgc == 0) if (a_iArgc == 0)
{ {
throw QmuParserError(QCoreApplication::translate("QmuParser", "too few arguments for function sum.", throw QmuParserError(
"parser error message")); QCoreApplication::translate("QmuParser", "too few arguments for function sum.", "parser error message"));
} }
qreal fRes = 0; qreal fRes = 0;
for (int i = 0; i < a_iArgc; ++i) for (int i = 0; i < a_iArgc; ++i)
@ -345,8 +340,8 @@ auto QmuParser::Min(const qreal *a_afArg, qmusizetype a_iArgc) -> qreal
{ {
if (a_iArgc == 0) if (a_iArgc == 0)
{ {
throw QmuParserError(QCoreApplication::translate("QmuParser", "too few arguments for function min.", throw QmuParserError(
"parser error message")); QCoreApplication::translate("QmuParser", "too few arguments for function min.", "parser error message"));
} }
qreal fRes = a_afArg[0]; qreal fRes = a_afArg[0];
for (int i = 0; i < a_iArgc; ++i) for (int i = 0; i < a_iArgc; ++i)
@ -366,8 +361,8 @@ auto QmuParser::Max(const qreal *a_afArg, qmusizetype a_iArgc) -> qreal
{ {
if (a_iArgc == 0) if (a_iArgc == 0)
{ {
throw QmuParserError(QCoreApplication::translate("QmuParser", "too few arguments for function min.", throw QmuParserError(
"parser error message")); QCoreApplication::translate("QmuParser", "too few arguments for function min.", "parser error message"));
} }
qreal fRes = a_afArg[0]; qreal fRes = a_afArg[0];
for (int i = 0; i < a_iArgc; ++i) for (int i = 0; i < a_iArgc; ++i)
@ -390,8 +385,8 @@ auto QmuParser::IsVal(const QString &a_szExpr, qmusizetype *a_iPos, qreal *a_fVa
{ {
qreal fVal(0); qreal fVal(0);
qmusizetype pos = ReadVal(a_szExpr, fVal, locale != QLocale::c() && cNumbers ? QLocale::c() : locale, decimal, qmusizetype pos =
thousand); ReadVal(a_szExpr, fVal, locale != QLocale::c() && cNumbers ? QLocale::c() : locale, decimal, thousand);
if (pos == -1) if (pos == -1)
{ {
@ -409,7 +404,8 @@ auto QmuParser::IsVal(const QString &a_szExpr, qmusizetype *a_iPos, qreal *a_fVa
* *
* Call QmuParserBase class constructor and trigger Function, Operator and Constant initialization. * Call QmuParserBase class constructor and trigger Function, Operator and Constant initialization.
*/ */
QmuParser::QmuParser():QmuParserBase() QmuParser::QmuParser()
: QmuParserBase()
{ {
AddValIdent(IsVal); AddValIdent(IsVal);
@ -579,10 +575,7 @@ void QmuParser::OnDetectVar(const QString &pExpr, qmusizetype &nStart, qmusizety
// cppcheck-suppress unusedFunction // cppcheck-suppress unusedFunction
auto QmuParser::Diff(qreal *a_Var, qreal a_fPos, qreal a_fEpsilon) const -> qreal auto QmuParser::Diff(qreal *a_Var, qreal a_fPos, qreal a_fEpsilon) const -> qreal
{ {
qreal fRes(0), qreal fRes(0), fBuf(*a_Var), f[4] = {0, 0, 0, 0}, fEpsilon(a_fEpsilon);
fBuf(*a_Var),
f[4] = {0, 0, 0, 0},
fEpsilon(a_fEpsilon);
// Backwards compatible calculation of epsilon inc case the user doesnt provide // Backwards compatible calculation of epsilon inc case the user doesnt provide
// his own epsilon // his own epsilon
@ -591,10 +584,14 @@ auto QmuParser::Diff(qreal *a_Var, qreal a_fPos, qreal a_fEpsilon) const -> qrea
fEpsilon = qFuzzyIsNull(a_fPos) ? static_cast<qreal>(1e-10) : static_cast<qreal>(1e-7) * a_fPos; fEpsilon = qFuzzyIsNull(a_fPos) ? static_cast<qreal>(1e-10) : static_cast<qreal>(1e-7) * a_fPos;
} }
*a_Var = a_fPos+2 * fEpsilon; f[0] = Eval(); *a_Var = a_fPos + 2 * fEpsilon;
*a_Var = a_fPos+1 * fEpsilon; f[1] = Eval(); f[0] = Eval();
*a_Var = a_fPos-1 * fEpsilon; f[2] = Eval(); *a_Var = a_fPos + 1 * fEpsilon;
*a_Var = a_fPos-2 * fEpsilon; f[3] = Eval(); f[1] = Eval();
*a_Var = a_fPos - 1 * fEpsilon;
f[2] = Eval();
*a_Var = a_fPos - 2 * fEpsilon;
f[3] = Eval();
*a_Var = fBuf; // restore variable *a_Var = fBuf; // restore variable
fRes = (-f[0] + 8 * f[1] - 8 * f[2] + f[3]) / (12 * fEpsilon); fRes = (-f[0] + 8 * f[1] - 8 * f[2] + f[3]) / (12 * fEpsilon);

View File

@ -34,5 +34,5 @@ HEADERS += \
$$PWD/qmuformulabase.h \ $$PWD/qmuformulabase.h \
$$PWD/qmutokenparser.h \ $$PWD/qmutokenparser.h \
$$PWD/qmuparsercallback_p.h \ $$PWD/qmuparsercallback_p.h \
$$PWD/make_unique.h \ $$PWD/make_unique.h
$$PWD/text.h

View File

@ -32,7 +32,6 @@ VDynamicLib {
"qmutokenparser.h", "qmutokenparser.h",
"qmuparsercallback_p.h", "qmuparsercallback_p.h",
"make_unique.h", "make_unique.h",
"text.h"
] ]
cpp.defines: ["QMUPARSER_LIBRARY", 'QMUP_VERSION="' + product.version + '"'] cpp.defines: ["QMUPARSER_LIBRARY", 'QMUP_VERSION="' + product.version + '"']

View File

@ -36,10 +36,6 @@
#include "qmudef.h" #include "qmudef.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
#include "text.h"
#endif
/** /**
* @file * @file
* @brief This file contains the basic implementation of the muparser engine. * @brief This file contains the basic implementation of the muparser engine.

View File

@ -64,34 +64,6 @@
#define __has_cpp_attribute(x) 0 #define __has_cpp_attribute(x) 0
#endif #endif
#if QT_VERSION < QT_VERSION_CHECK(5, 8, 0)
#ifndef QT_HAS_CPP_ATTRIBUTE
#ifdef __has_cpp_attribute
#define QT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
#else
#define QT_HAS_CPP_ATTRIBUTE(x) 0
#endif
#endif // QT_HAS_CPP_ATTRIBUTE
#if defined(__cplusplus)
#if QT_HAS_CPP_ATTRIBUTE(clang::fallthrough)
#define Q_FALLTHROUGH() [[clang::fallthrough]]
#elif QT_HAS_CPP_ATTRIBUTE(gnu::fallthrough)
#define Q_FALLTHROUGH() [[gnu::fallthrough]]
#elif QT_HAS_CPP_ATTRIBUTE(fallthrough)
#define Q_FALLTHROUGH() [[fallthrough]]
#endif
#endif
#ifndef Q_FALLTHROUGH
#if (defined(Q_CC_GNU) && Q_CC_GNU >= 700) && !defined(Q_CC_INTEL)
#define Q_FALLTHROUGH() __attribute__((fallthrough))
#else
#define Q_FALLTHROUGH() (void)0
#endif
#endif // defined(__cplusplus)
#endif // QT_VERSION < QT_VERSION_CHECK(5, 8, 0)
/** @brief If this macro is defined mathematical exceptions (div by zero) will be thrown as exceptions. */ /** @brief If this macro is defined mathematical exceptions (div by zero) will be thrown as exceptions. */
// #define QMUP_MATH_EXCEPTIONS // #define QMUP_MATH_EXCEPTIONS

View File

@ -34,10 +34,6 @@
#include "qmuparserdef.h" #include "qmuparserdef.h"
#include "qmutranslation.h" #include "qmutranslation.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
/** @file /** @file
@brief This file defines the error class used by the parser. @brief This file defines the error class used by the parser.
*/ */

View File

@ -22,17 +22,14 @@
#ifndef QMUPARSERTEST_H #ifndef QMUPARSERTEST_H
#define QMUPARSERTEST_H #define QMUPARSERTEST_H
#include <stdlib.h>
#include <QMetaObject> #include <QMetaObject>
#include <QObject> #include <QObject>
#include <QRandomGenerator>
#include <QString> #include <QString>
#include <QVector> #include <QVector>
#include <QtGlobal> #include <QtGlobal>
#include <locale> #include <locale>
#include <stdlib.h>
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
# include <QRandomGenerator>
#endif
#include "qmuparser.h" #include "qmuparser.h"
#include "qmuparser_global.h" #include "qmuparser_global.h"
@ -60,6 +57,7 @@ namespace Test
class QMUPARSERSHARED_EXPORT QmuParserTester : public QObject // final class QMUPARSERSHARED_EXPORT QmuParserTester : public QObject // final
{ {
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
typedef int (QmuParserTester::*testfun_type)(); typedef int (QmuParserTester::*testfun_type)();
@ -168,22 +166,14 @@ private:
static auto Rnd(qreal v) -> qreal static auto Rnd(qreal v) -> qreal
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) return static_cast<qreal>(
return static_cast<qreal>( ( 1 + ( v * QRandomGenerator().bounded(static_cast<qreal>(RAND_MAX)) / (1 + (v * QRandomGenerator().bounded(static_cast<qreal>(RAND_MAX)) / (RAND_MAX + 1.0))));
( RAND_MAX + 1.0 ) ) ) );
#else
return static_cast<qreal>( ( 1 + ( v * qrand() / ( RAND_MAX + 1.0 ) ) ) );
#endif
} }
static auto RndWithString(const char_type *) -> qreal static auto RndWithString(const char_type *) -> qreal
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) return static_cast<qreal>(
return static_cast<qreal>( ( 1 + ( 1000.0f * QRandomGenerator().bounded(static_cast<qreal>(RAND_MAX)) / (1 + (1000.0f * QRandomGenerator().bounded(static_cast<qreal>(RAND_MAX)) / (RAND_MAX + 1.0))));
( RAND_MAX + 1.0 ) ) ) );
#else
return static_cast<qreal>( ( 1 + ( 1000.0f * static_cast<qreal>(qrand()) / ( RAND_MAX + 1.0 ) ) ) );
#endif
} }
static auto Ping() -> qreal { return 10; } static auto Ping() -> qreal { return 10; }

View File

@ -1,52 +0,0 @@
/************************************************************************
**
** @file text.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 21 2, 2023
**
** @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) 2023 Valentina project
** <https://gitlab.com/smart-pattern/valentina> 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 <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef TEXT_H
#define TEXT_H
#include <QtGlobal>
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
#include <QTextStream>
namespace Qt
{
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wunused-variable")
QT_WARNING_DISABLE_CLANG("-Wunused-variable")
// static auto endl Q_DECL_UNUSED = ::endl; // NOLINT
// static auto flush Q_DECL_UNUSED = ::flush; // NOLINT
static auto dec Q_DECL_UNUSED = ::dec; // NOLINT
// static auto SkipEmptyParts Q_DECL_UNUSED = QString::SkipEmptyParts; // NOLINT
QT_WARNING_POP
} // namespace Qt
#endif
#endif // TEXT_H

View File

@ -58,41 +58,6 @@
#define __has_cpp_attribute(x) 0 #define __has_cpp_attribute(x) 0
#endif #endif
#if QT_VERSION < QT_VERSION_CHECK(5, 8, 0)
#ifndef QT_HAS_CPP_ATTRIBUTE
#ifdef __has_cpp_attribute
#define QT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
#else
#define QT_HAS_CPP_ATTRIBUTE(x) 0
#endif
#endif // QT_HAS_CPP_ATTRIBUTE
#if defined(__cplusplus)
#if QT_HAS_CPP_ATTRIBUTE(clang::fallthrough)
#define Q_FALLTHROUGH() [[clang::fallthrough]]
#elif QT_HAS_CPP_ATTRIBUTE(gnu::fallthrough)
#define Q_FALLTHROUGH() [[gnu::fallthrough]]
#elif QT_HAS_CPP_ATTRIBUTE(fallthrough)
#define Q_FALLTHROUGH() [[fallthrough]]
#endif
#endif
#ifndef Q_FALLTHROUGH
#if (defined(Q_CC_GNU) && Q_CC_GNU >= 700) && !defined(Q_CC_INTEL)
#define Q_FALLTHROUGH() __attribute__((fallthrough))
#else
#define Q_FALLTHROUGH() (void)0
#endif
#endif // defined(__cplusplus)
#endif // QT_VERSION < QT_VERSION_CHECK(5, 8, 0)
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#define Q_DISABLE_COPY_MOVE(Class) \
Q_DISABLE_COPY(Class) \
Class(Class &&) = delete; \
Class &operator=(Class &&) = delete;
#endif
#ifndef Q_DISABLE_ASSIGN_MOVE #ifndef Q_DISABLE_ASSIGN_MOVE
#define Q_DISABLE_ASSIGN_MOVE(Class) \ #define Q_DISABLE_ASSIGN_MOVE(Class) \
Q_DISABLE_ASSIGN(Class) \ Q_DISABLE_ASSIGN(Class) \

Some files were not shown because too many files have changed in this diff Show More