mirror of
https://gitlab.com/smart-pattern/valentina.git
synced 2024-09-08 01:54:37 +02:00
Compare commits
3 commits
5855af6bc9
...
8c3de72a51
Author | SHA1 | Date | |
---|---|---|---|
|
8c3de72a51 | ||
|
b43592e3e9 | ||
|
003c9bf33f |
|
@ -29,6 +29,9 @@
|
|||
#include "puzzlepreferencesconfigurationpage.h"
|
||||
#include "ui_puzzlepreferencesconfigurationpage.h"
|
||||
#include "../../vpapplication.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
#include "../vmisc/backport/qoverload.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
PuzzlePreferencesConfigurationPage::PuzzlePreferencesConfigurationPage(QWidget *parent) :
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
#include "puzzlepreferenceslayoutpage.h"
|
||||
#include "ui_puzzlepreferenceslayoutpage.h"
|
||||
#include "vpapplication.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
#include "../vmisc/backport/qoverload.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
PuzzlePreferencesLayoutPage::PuzzlePreferencesLayoutPage(QWidget *parent) :
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
#include "../vpapplication.h"
|
||||
#include "../ifc/exception/vexception.h"
|
||||
#include "../vlayout/vlayoutexporter.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 <QShowEvent>
|
||||
|
|
|
@ -27,6 +27,10 @@
|
|||
*************************************************************************/
|
||||
#include "vpundocommand.h"
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes")
|
||||
QT_WARNING_DISABLE_INTEL(1418)
|
||||
|
|
|
@ -64,6 +64,9 @@
|
|||
#include "../vdxf/libdxfrw/drw_base.h"
|
||||
#include "../vmisc/dialogs/dialogselectlanguage.h"
|
||||
#include "../vmisc/lambdaconstants.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 "vptilefactory.h"
|
||||
#include "layout/vppiece.h"
|
||||
|
||||
|
@ -85,7 +88,9 @@ Q_LOGGING_CATEGORY(pWindow, "p.window") // NOLINT
|
|||
|
||||
QT_WARNING_POP
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
using namespace std::chrono_literals;
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -383,7 +388,11 @@ VPMainWindow::VPMainWindow(const VPCommandLinePtr &cmd, QWidget *parent) :
|
|||
|
||||
if (m_cmd->IsGuiEnabled())
|
||||
{
|
||||
#if __cplusplus >= 201402L
|
||||
QTimer::singleShot(1s, this, &VPMainWindow::SetDefaultGUILanguage);
|
||||
#else
|
||||
QTimer::singleShot(1000, this, &VPMainWindow::SetDefaultGUILanguage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2623,7 +2632,11 @@ void VPMainWindow::GeneratePdfTiledFile(const VPSheetPtr &sheet, bool showTilesS
|
|||
|
||||
if (showTilesScheme)
|
||||
{
|
||||
DrawTilesScheme(printer.data(), painter, sheet, firstPage);
|
||||
if (not DrawTilesScheme(printer.data(), painter, sheet, firstPage))
|
||||
{
|
||||
return;
|
||||
}
|
||||
firstPage = false;
|
||||
}
|
||||
|
||||
for(int row=0; row < m_layout->TileFactory()->RowNb(sheet); row++) // for each row of the tiling grid
|
||||
|
@ -3090,7 +3103,12 @@ auto VPMainWindow::PrintLayoutTiledSheetPage(QPrinter *printer, QPainter &painte
|
|||
|
||||
if (page.tilesScheme)
|
||||
{
|
||||
return DrawTilesScheme(printer, &painter, page.sheet, firstPage);
|
||||
if (not DrawTilesScheme(printer, &painter, page.sheet, firstPage))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
firstPage = false;
|
||||
}
|
||||
|
||||
if(not firstPage)
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
#include "../../mapplication.h"
|
||||
#include "../../vtapesettings.h"
|
||||
#include "../vpatterndb/pmsystems.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
#include "../vmisc/backport/qoverload.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
TapePreferencesConfigurationPage::TapePreferencesConfigurationPage(QWidget *parent)
|
||||
|
|
|
@ -27,6 +27,9 @@
|
|||
*************************************************************************/
|
||||
#include "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,
|
||||
|
|
|
@ -29,6 +29,9 @@
|
|||
#include "ui_dialogmeasurementscsvcolumns.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 <QPushButton>
|
||||
|
|
|
@ -33,7 +33,9 @@
|
|||
|
||||
#include "../vpatterndb/variables/vmeasurement.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)
|
||||
|
||||
namespace
|
||||
{
|
||||
|
|
|
@ -49,6 +49,9 @@
|
|||
#include "../vmisc/qxtcsvmodel.h"
|
||||
#include "../vmisc/dialogs/dialogexporttocsv.h"
|
||||
#include "../vmisc/compatibility.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 "vlitepattern.h"
|
||||
#include "../qmuparser/qmudef.h"
|
||||
#include "../vtools/dialogs/support/dialogeditwrongformula.h"
|
||||
|
@ -71,7 +74,9 @@
|
|||
#include <QTimer>
|
||||
#include <chrono>
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
using namespace std::chrono_literals;
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
#include <QMimeData>
|
||||
|
@ -160,7 +165,7 @@ void InitDimensionYWZItems(const QVector<qreal> &bases, const DimesionLabels &la
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto ConverToDouble(QString text, const QString &error)
|
||||
auto ConverToDouble(QString text, const QString &error) -> qreal
|
||||
{
|
||||
text.replace(QStringLiteral(" "), QString());
|
||||
text = VTranslateVars::TryFormulaFromUser(text, VAbstractApplication::VApp()->Settings()->GetOsSeparator());
|
||||
|
@ -237,7 +242,11 @@ TMainWindow::TMainWindow(QWidget *parent)
|
|||
|
||||
if (MApplication::VApp()->IsAppInGUIMode())
|
||||
{
|
||||
#if __cplusplus >= 201402L
|
||||
QTimer::singleShot(1s, this, &TMainWindow::SetDefaultGUILanguage);
|
||||
#else
|
||||
QTimer::singleShot(1000, this, &TMainWindow::SetDefaultGUILanguage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
#include "../vpatterndb/pmsystems.h"
|
||||
#include "../vmisc/vvalentinasettings.h"
|
||||
#include "../vmisc/literals.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 <QDirIterator>
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
#include "../dialogknownmaterials.h"
|
||||
#include "../vmisc/vvalentinasettings.h"
|
||||
#include "../vmisc/vabstractvalapplication.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 "../vwidgets/vmaingraphicsview.h"
|
||||
#include "../ifc/xml/vabstractpattern.h"
|
||||
|
||||
|
|
|
@ -29,6 +29,9 @@
|
|||
#include "dialogincrements.h"
|
||||
#include "ui_dialogincrements.h"
|
||||
#include "../vmisc/vvalentinasettings.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/qmutokenparser.h"
|
||||
#include "../vpatterndb/vtranslatevars.h"
|
||||
|
|
|
@ -39,7 +39,9 @@
|
|||
#include <QShowEvent>
|
||||
#include <chrono>
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
using namespace std::chrono_literals;
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogLayoutProgress::DialogLayoutProgress(QElapsedTimer timer, qint64 timeout, QWidget *parent)
|
||||
|
@ -83,7 +85,11 @@ DialogLayoutProgress::DialogLayoutProgress(QElapsedTimer timer, qint64 timeout,
|
|||
m_progressTimer->stop();
|
||||
}
|
||||
});
|
||||
#if __cplusplus >= 201402L
|
||||
m_progressTimer->start(1s);
|
||||
#else
|
||||
m_progressTimer->start(1000);
|
||||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
#include "ui_dialoglayoutsettings.h"
|
||||
#include "../vmisc/vvalentinasettings.h"
|
||||
#include "../vmisc/vabstractvalapplication.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>
|
||||
|
|
|
@ -46,6 +46,9 @@
|
|||
#include "../vpatterndb/vcontainer.h"
|
||||
#include "../core/vapplication.h"
|
||||
#include "../vmisc/vvalentinasettings.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 "../ifc/xml/vpatternimage.h"
|
||||
#include "../ifc/xml/utils.h"
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
#include "ui_dialogsavelayout.h"
|
||||
#include "../core/vapplication.h"
|
||||
#include "../vmisc/vvalentinasettings.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/exception/vexception.h"
|
||||
#include "../vlayout/vlayoutexporter.h"
|
||||
|
||||
|
|
|
@ -43,6 +43,9 @@
|
|||
#include "../vtools/undocommands/image/resetbackgroundimage.h"
|
||||
#include "../vmisc/vabstractapplication.h"
|
||||
#include "../vmisc/lambdaconstants.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 <QPushButton>
|
||||
|
|
|
@ -39,7 +39,9 @@
|
|||
#include <QUndoStack>
|
||||
#include <chrono>
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
using namespace std::chrono_literals;
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -91,7 +93,11 @@ void VWidgetDetails::UpdateList()
|
|||
// 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
|
||||
// we will wait 800 ms more. And so on, until nothing happens within 800ms.
|
||||
#if __cplusplus >= 201402L
|
||||
m_updateListTimer->start(800ms);
|
||||
#else
|
||||
m_updateListTimer->start(800);
|
||||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -214,7 +214,9 @@
|
|||
#include <QDrag>
|
||||
#endif //defined(Q_OS_MAC)
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
using namespace std::chrono_literals;
|
||||
#endif
|
||||
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes")
|
||||
|
@ -469,7 +471,11 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
|
||||
if (VApplication::IsGUIMode())
|
||||
{
|
||||
#if __cplusplus >= 201402L
|
||||
QTimer::singleShot(1s, this, &MainWindow::SetDefaultGUILanguage);
|
||||
#else
|
||||
QTimer::singleShot(1000, this, &MainWindow::SetDefaultGUILanguage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2134,7 +2140,11 @@ void MainWindow::MeasurementsChanged(const QString &path)
|
|||
{
|
||||
m_mChanges = true;
|
||||
m_mChangesAsked = false;
|
||||
#if __cplusplus >= 201402L
|
||||
m_measurementsSyncTimer->start(1500ms);
|
||||
#else
|
||||
m_measurementsSyncTimer->start(1500);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2144,7 +2154,11 @@ void MainWindow::MeasurementsChanged(const QString &path)
|
|||
{
|
||||
m_mChanges = true;
|
||||
m_mChangesAsked = false;
|
||||
#if __cplusplus >= 201402L
|
||||
m_measurementsSyncTimer->start(1500ms);
|
||||
#else
|
||||
m_measurementsSyncTimer->start(1500);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -247,7 +247,7 @@ QString PrepareGroupTags(QStringList tags)
|
|||
tag = tag.simplified();
|
||||
}
|
||||
|
||||
return ConvertToList(ConvertToSet<QString>(tags)).join(',');
|
||||
return ConvertToStringList(ConvertToSet<QString>(tags)).join(',');
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
141
src/libs/qmuparser/make_unique.h
Normal file
141
src/libs/qmuparser/make_unique.h
Normal file
|
@ -0,0 +1,141 @@
|
|||
// Implementation of C++14's make_unique for C++11 compilers.
|
||||
//
|
||||
// This has been tested with:
|
||||
// - MSVC 11.0 (Visual Studio 2012)
|
||||
// - gcc 4.6.3
|
||||
// - Xcode 4.4 (with clang "4.0")
|
||||
//
|
||||
// It is based off an implementation proposed by Stephan T. Lavavej for
|
||||
// inclusion in the C++14 standard:
|
||||
// http://isocpp.org/files/papers/N3656.txt
|
||||
// Where appropriate, it borrows the use of MSVC's _VARIADIC_EXPAND_0X macro
|
||||
// machinery to compensate for lack of variadic templates.
|
||||
//
|
||||
// This file injects make_unique into the std namespace, which I acknowledge is
|
||||
// technically forbidden ([C++11: 17.6.4.2.2.1/1]), but is necessary in order
|
||||
// to have syntax compatibility with C++14.
|
||||
//
|
||||
// I perform compiler version checking for MSVC, gcc, and clang to ensure that
|
||||
// we don't add make_unique if it is already there (instead, we include
|
||||
// <memory> to get the compiler-provided one). You can override the compiler
|
||||
// version checking by defining the symbol COMPILER_SUPPORTS_MAKE_UNIQUE.
|
||||
//
|
||||
//
|
||||
// ===============================================================================
|
||||
// This file is released into the public domain. See LICENCE for more information.
|
||||
// ===============================================================================
|
||||
|
||||
#pragma once
|
||||
|
||||
// If user hasn't specified COMPILER_SUPPORTS_MAKE_UNIQUE then try to figure out
|
||||
// based on compiler version if std::make_unique is provided.
|
||||
#if !defined(COMPILER_SUPPORTS_MAKE_UNIQUE)
|
||||
#if defined(_MSC_VER)
|
||||
// std::make_unique was added in MSVC 12.0
|
||||
#if _MSC_VER >= 1800 // MSVC 12.0 (Visual Studio 2013)
|
||||
#define COMPILER_SUPPORTS_MAKE_UNIQUE
|
||||
#endif
|
||||
#elif defined(__clang__)
|
||||
// std::make_unique was added in clang 3.4, but not until Xcode 6.
|
||||
// Annoyingly, Apple makes the clang version defines match the version
|
||||
// of Xcode, not the version of clang.
|
||||
#define CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
|
||||
#if defined(__APPLE__) && CLANG_VERSION >= 60000
|
||||
#define COMPILER_SUPPORTS_MAKE_UNIQUE
|
||||
#elif !defined(__APPLE__) && CLANG_VERSION >= 30400
|
||||
#define COMPILER_SUPPORTS_MAKE_UNIQUE
|
||||
#endif
|
||||
#elif defined(__GNUC__)
|
||||
// std::make_unique was added in gcc 4.9, for standards versions greater
|
||||
// than -std=c++11.
|
||||
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
|
||||
#if GCC_VERSION >= 40900 && __cplusplus > 201103L
|
||||
#define COMPILER_SUPPORTS_MAKE_UNIQUE
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(COMPILER_SUPPORTS_MAKE_UNIQUE)
|
||||
|
||||
// If the compiler supports std::make_unique, then pull in <memory> to get it.
|
||||
#include <memory>
|
||||
|
||||
#else
|
||||
|
||||
// Otherwise, the compiler doesn't provide it, so implement it ourselves.
|
||||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
namespace std {
|
||||
|
||||
template<class _Ty> struct _Unique_if {
|
||||
typedef unique_ptr<_Ty> _Single_object;
|
||||
};
|
||||
|
||||
template<class _Ty> struct _Unique_if<_Ty[]> {
|
||||
typedef unique_ptr<_Ty[]> _Unknown_bound;
|
||||
};
|
||||
|
||||
template<class _Ty, size_t N> struct _Unique_if<_Ty[N]> {
|
||||
typedef void _Known_bound;
|
||||
};
|
||||
|
||||
//
|
||||
// template< class T, class... Args >
|
||||
// unique_ptr<T> make_unique( Args&&... args);
|
||||
//
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1800)
|
||||
|
||||
// Macro machinery because MSVC 11.0 doesn't support variadic templates.
|
||||
// The _VARIADIC_EXPAND_0X stuff is defined in <xstddef>
|
||||
#define _MAKE_UNIQUE( \
|
||||
TEMPLATE_LIST, PADDING_LIST, LIST, COMMA, X1, X2, X3, X4) \
|
||||
template<class _Ty COMMA LIST(_CLASS_TYPE)> inline \
|
||||
typename _Unique_if<_Ty>::_Single_object make_unique(LIST(_TYPE_REFREF_ARG)) \
|
||||
{ \
|
||||
return unique_ptr<_Ty>(new _Ty(LIST(_FORWARD_ARG))); \
|
||||
} \
|
||||
|
||||
_VARIADIC_EXPAND_0X(_MAKE_UNIQUE, , , , )
|
||||
#undef _MAKE_UNIQUE
|
||||
|
||||
#else // not MSVC 11.0 or earlier
|
||||
|
||||
template<class _Ty, class... Args>
|
||||
typename _Unique_if<_Ty>::_Single_object
|
||||
make_unique(Args&&... args) {
|
||||
return unique_ptr<_Ty>(new _Ty(std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// template< class T >
|
||||
// unique_ptr<T> make_unique( std::size_t size );
|
||||
|
||||
template<class _Ty>
|
||||
typename _Unique_if<_Ty>::_Unknown_bound
|
||||
make_unique(size_t n) {
|
||||
typedef typename remove_extent<_Ty>::type U;
|
||||
return unique_ptr<_Ty>(new U[n]());
|
||||
}
|
||||
|
||||
// template< class T, class... Args >
|
||||
// /* unspecified */ make_unique( Args&&... args ) = delete;
|
||||
|
||||
// MSVC 11.0 doesn't support deleted functions, so the best we can do
|
||||
// is simply not define the function.
|
||||
#if !(defined(_MSC_VER) && (_MSC_VER < 1800))
|
||||
|
||||
template<class T, class... Args>
|
||||
typename _Unique_if<T>::_Known_bound
|
||||
make_unique(Args&&...) = delete;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace std
|
||||
|
||||
#endif // !COMPILER_SUPPORTS_MAKE_UNIQUE
|
|
@ -33,4 +33,5 @@ HEADERS += \
|
|||
$$PWD/qmudef.h \
|
||||
$$PWD/qmuformulabase.h \
|
||||
$$PWD/qmutokenparser.h \
|
||||
$$PWD/qmuparsercallback_p.h
|
||||
$$PWD/qmuparsercallback_p.h \
|
||||
$$PWD/make_unique.h
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include "qmuparsererror.h"
|
||||
#include "qmuparsercallback.h"
|
||||
#include "make_unique.h"
|
||||
|
||||
/** @file
|
||||
@brief This file contains the parser token definition.
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
#include "drw_objects.h"
|
||||
#include "drw_header.h"
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "../vmisc/diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_GCC("-Wsuggest-final-types")
|
||||
QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods")
|
||||
|
|
|
@ -157,7 +157,11 @@ QVector<QGraphicsItem *> VPoster::Tile(QGraphicsItem *parent, const PosterData &
|
|||
const VWatermarkData &watermarkData, const QString &watermarkPath) const
|
||||
{
|
||||
QVector<QGraphicsItem *> data;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
|
||||
data.append(Borders(parent, img, sheets));
|
||||
#else
|
||||
data += Borders(parent, img, sheets);
|
||||
#endif
|
||||
|
||||
if (watermarkData.opacity > 0)
|
||||
{
|
||||
|
|
|
@ -34,6 +34,10 @@
|
|||
#include <QVector>
|
||||
#include <QFontMetrics>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
||||
class QPointF;
|
||||
|
||||
// Contains helpful methods to hide version dependent code. It can be deprecation of method or change in API
|
||||
|
@ -104,6 +108,13 @@ inline auto ConvertToList(const C<T> &container) -> QList<T>
|
|||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename T, template <typename> class C>
|
||||
inline auto ConvertToStringList(const C<T> &container) -> QStringList
|
||||
{
|
||||
return {ConvertToList(container)};
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename T, template <typename> class C>
|
||||
inline auto ConvertToSet(const C<T> &container) -> QSet<T>
|
||||
|
|
|
@ -45,6 +45,9 @@
|
|||
|
||||
#include "debugbreak.h"
|
||||
#include "defglobal.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
||||
template <class T> class QSharedPointer;
|
||||
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
#include <QSharedData>
|
||||
|
||||
#include "../vmisc/defglobal.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "../vmisc/diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_GCC("-Weffc++")
|
||||
|
|
|
@ -34,6 +34,9 @@
|
|||
|
||||
#include "../vmisc/defglobal.h"
|
||||
#include "../vmisc/typedef.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "../vmisc/diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "floatitemdef.h"
|
||||
|
||||
QT_WARNING_PUSH
|
||||
|
|
|
@ -31,9 +31,13 @@
|
|||
|
||||
#include <QPointF>
|
||||
#include <QSharedData>
|
||||
#include <QString>
|
||||
|
||||
#include "../vmisc/typedef.h"
|
||||
#include "../vmisc/defglobal.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "../vmisc/diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_GCC("-Weffc++")
|
||||
|
|
|
@ -1102,7 +1102,11 @@ VPassmark VPiece::CreatePassmark(const QVector<VPieceNode> &path, int previousIn
|
|||
const QString infoMsg = tr("Notch for point '%1' in piece '%2' will be disabled. Manual length is less than "
|
||||
"allowed value.")
|
||||
.arg(VPiecePath::NodeName(path, passmarkIndex, data), GetName());
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
|
||||
qInfo() << VAbstractValApplication::warningMessageSignature + infoMsg;
|
||||
#else
|
||||
qWarning() << VAbstractValApplication::warningMessageSignature + infoMsg;
|
||||
#endif
|
||||
return VPassmark();
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,10 @@
|
|||
|
||||
#include "../vpropertyexplorer_global.h"
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "../vmisc/diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
||||
namespace VPE
|
||||
{
|
||||
|
||||
|
|
|
@ -29,6 +29,9 @@
|
|||
#include "dialogeditlabel.h"
|
||||
#include "ui_dialogeditlabel.h"
|
||||
#include "../vmisc/vabstractapplication.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 "../vformat/vlabeltemplate.h"
|
||||
#include "../ifc/xml/vlabeltemplateconverter.h"
|
||||
#include "../ifc/xml/vabstractpattern.h"
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#include "../ifc/ifcdef.h"
|
||||
#include "../vmisc/vabstractapplication.h"
|
||||
#include "../vmisc/vmath.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 "../vpatterndb/vcontainer.h"
|
||||
#include "../vwidgets/vabstractmainwindow.h"
|
||||
#include "dialogtool.h"
|
||||
|
|
|
@ -54,6 +54,9 @@
|
|||
#include "../vmisc/vabstractapplication.h"
|
||||
#include "../vmisc/vcommonsettings.h"
|
||||
#include "../vmisc/compatibility.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 "../vpatterndb/vcontainer.h"
|
||||
#include "../vwidgets/vabstractmainwindow.h"
|
||||
#include "../vwidgets/vmaingraphicsscene.h"
|
||||
|
|
|
@ -54,6 +54,9 @@
|
|||
#include "../vmisc/vabstractapplication.h"
|
||||
#include "../vmisc/vcommonsettings.h"
|
||||
#include "../vmisc/compatibility.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 "../vpatterndb/vcontainer.h"
|
||||
#include "../vwidgets/vabstractmainwindow.h"
|
||||
#include "../vwidgets/vmaingraphicsscene.h"
|
||||
|
|
|
@ -45,8 +45,10 @@
|
|||
#include "../../visualization/line/vistoollineintersect.h"
|
||||
#include "../ifc/xml/vabstractpattern.h"
|
||||
#include "../vgeometry/vpointf.h"
|
||||
#include "../vmisc/vabstractapplication.h"
|
||||
#include "../vmisc/compatibility.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 "../vpatterndb/vcontainer.h"
|
||||
#include "dialogtool.h"
|
||||
#include "ui_dialoglineintersect.h"
|
||||
|
|
|
@ -58,6 +58,9 @@
|
|||
#include "../vmisc/vabstractapplication.h"
|
||||
#include "../vmisc/vcommonsettings.h"
|
||||
#include "../vmisc/compatibility.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 "../vpatterndb/vcontainer.h"
|
||||
#include "../vpatterndb/vtranslatevars.h"
|
||||
#include "../vwidgets/vabstractmainwindow.h"
|
||||
|
|
|
@ -58,6 +58,9 @@
|
|||
#include "../vmisc/vabstractapplication.h"
|
||||
#include "../vmisc/vcommonsettings.h"
|
||||
#include "../vmisc/compatibility.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 "../vpatterndb/vcontainer.h"
|
||||
#include "../vpatterndb/vtranslatevars.h"
|
||||
#include "../vwidgets/vabstractmainwindow.h"
|
||||
|
|
|
@ -58,6 +58,9 @@
|
|||
#include "../vgeometry/vsplinepoint.h"
|
||||
#include "../vmisc/vabstractapplication.h"
|
||||
#include "../vmisc/vcommonsettings.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
#include "../vmisc/backport/qoverload.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
#include "../vpatterndb/vcontainer.h"
|
||||
#include "../vwidgets/vabstractmainwindow.h"
|
||||
#include "../vwidgets/vmaingraphicsscene.h"
|
||||
|
|
|
@ -29,6 +29,9 @@
|
|||
#include "dialoginsertnode.h"
|
||||
#include "ui_dialoginsertnode.h"
|
||||
#include "../vpatterndb/vcontainer.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>
|
||||
|
||||
|
|
|
@ -34,6 +34,9 @@
|
|||
#include "../../../tools/vtoolseamallowance.h"
|
||||
#include "../../support/dialogeditwrongformula.h"
|
||||
#include "../vmisc/vmodifierkey.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 <QTimer>
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
#include "ui_dialogpin.h"
|
||||
#include "visualization/line/vistoolspecialpoint.h"
|
||||
#include "../../../tools/vabstracttool.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
#include "../vmisc/backport/qoverload.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogPin::DialogPin(const VContainer *data, quint32 toolId, QWidget *parent)
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
#include "../../../tools/vtoolseamallowance.h"
|
||||
#include "../../support/dialogeditwrongformula.h"
|
||||
#include "../vgeometry/vplacelabelitem.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 <QTimer>
|
||||
|
||||
|
|
|
@ -53,6 +53,9 @@
|
|||
#include "dialogpatternmaterials.h"
|
||||
#include "../vmisc/vabstractvalapplication.h"
|
||||
#include "../vmisc/vvalentinasettings.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 <QMessageBox>
|
||||
|
|
|
@ -56,6 +56,9 @@
|
|||
#include "../qmuparser/qmutokenparser.h"
|
||||
#include "../vlayout/vlayoutdef.h"
|
||||
#include "toolsdef.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 <QFuture>
|
||||
#include <QtConcurrent/QtConcurrentRun>
|
||||
|
|
|
@ -36,6 +36,9 @@
|
|||
#include <QString>
|
||||
|
||||
#include "../vmisc/defglobal.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
#include "../vmisc/diagnostic.h"
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
|
||||
struct VFinalMeasurement;
|
||||
|
||||
|
|
|
@ -102,13 +102,13 @@ void TST_BuitInRegExp::TestCheckIsNamesUnique_data()
|
|||
}
|
||||
|
||||
QTest::addColumn<QString>("translatedName");
|
||||
QTest::addColumn<QList<QString>>("originalNames");
|
||||
QTest::addColumn<QStringList>("originalNames");
|
||||
|
||||
QList<QString> keys = names.uniqueKeys();
|
||||
for (const auto &key : keys)
|
||||
{
|
||||
const QString tag = QString("Locale: '%1'. Name '%2'").arg(m_locale, key);
|
||||
QTest::newRow(qUtf8Printable(tag)) << key << names.values(key);
|
||||
QTest::newRow(qUtf8Printable(tag)) << key << QStringList(names.values(key));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ void TST_BuitInRegExp::TestCheckIsNamesUnique_data()
|
|||
void TST_BuitInRegExp::TestCheckIsNamesUnique()
|
||||
{
|
||||
QFETCH(QString, translatedName);
|
||||
QFETCH(QList<QString>, originalNames);
|
||||
QFETCH(QStringList, originalNames);
|
||||
|
||||
if (originalNames.size() > 1)
|
||||
{
|
||||
|
|
|
@ -131,13 +131,13 @@ void TST_MeasurementRegExp::TestCheckIsNamesUnique_data()
|
|||
}
|
||||
|
||||
QTest::addColumn<QString>("translatedName");
|
||||
QTest::addColumn<QList<QString>>("originalNames");
|
||||
QTest::addColumn<QStringList>("originalNames");
|
||||
|
||||
QList<QString> keys = names.uniqueKeys();
|
||||
for (const auto &key : keys)
|
||||
{
|
||||
const QString tag = QString("System: '%1', locale: '%2'. Name '%3'").arg(m_system, m_locale, key);
|
||||
QTest::newRow(qUtf8Printable(tag)) << key << names.values(key);
|
||||
QTest::newRow(qUtf8Printable(tag)) << key << QStringList(names.values(key));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ void TST_MeasurementRegExp::TestCheckIsNamesUnique_data()
|
|||
void TST_MeasurementRegExp::TestCheckIsNamesUnique()
|
||||
{
|
||||
QFETCH(QString, translatedName);
|
||||
QFETCH(QList<QString>, originalNames);
|
||||
QFETCH(QStringList, originalNames);
|
||||
|
||||
if (QLocale() == QLocale(QStringLiteral("zh_CN")) || QLocale() == QLocale(QStringLiteral("he_IL")))
|
||||
{
|
||||
|
|
|
@ -30,6 +30,10 @@
|
|||
|
||||
#include <QtTest>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
Q_DECLARE_METATYPE(Qt::LayoutDirection)
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
TST_TSLocaleTranslation::TST_TSLocaleTranslation(const QString &locale, QObject *parent)
|
||||
: TST_AbstractTranslation(parent),
|
||||
|
|
Loading…
Reference in a new issue