diff --git a/.travis.yml b/.travis.yml index 002229d15..dda0880d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -105,7 +105,11 @@ before_script: qmake ../Valentina.pro -r -spec linux-clang CONFIG+=noDebugSymbols CONFIG+=checkWarnings CONFIG+=noTests; fi else - qmake ../Valentina.pro -r CONFIG+=noDebugSymbols CONFIG+=no_ccache CONFIG+=checkWarnings CONFIG+=noTests; + if [[ "$LEGACY" = false ]]; then + qmake ../Valentina.pro -r CONFIG+=noDebugSymbols CONFIG+=no_ccache CONFIG+=checkWarnings CONFIG+=noTests; + else + qmake ../Valentina.pro -r CONFIG+=noDebugSymbols CONFIG+=no_ccache CONFIG+=noTests; + fi fi script: - "$CXX --version" diff --git a/common.pri b/common.pri index 9cf33735d..6662944ef 100644 --- a/common.pri +++ b/common.pri @@ -329,44 +329,30 @@ defineReplace(FindLatestTagDistance){ # In debug mode on Unix system we use all usefull for us compilers keys for checking errors. # Also trying make all possible for speed up build time. unix { +LIBS_USED_FOR_QT = \ + QtCore \ + QtSvg \ + QtXml \ + QtPrintSupport \ + QtXmlPatterns \ + QtWidgets \ + QtGui \ + QtNetwork \ + QtTest \ + QtConcurrent -!macx{ -# Key -isystem disable checking errors in system headers. Mark ignore warnings Qt headers. -ISYSTEM += \ - -isystem "$$[QT_INSTALL_HEADERS]" \ - -isystem "$$[QT_INSTALL_HEADERS]/QtWidgets" \ - -isystem "$$[QT_INSTALL_HEADERS]/QtXml" \ - -isystem "$$[QT_INSTALL_HEADERS]/QtGui" \ - -isystem "$$[QT_INSTALL_HEADERS]/QtXmlPatterns" \ - -isystem "$$[QT_INSTALL_HEADERS]/QtCore" \ - -isystem "$$[QT_INSTALL_HEADERS]/QtPrintSupport" \ - -isystem "$$[QT_INSTALL_HEADERS]/QtSvg" \ - -isystem "$$[QT_INSTALL_HEADERS]/QtNetwork" \ - -isystem "$$[QT_INSTALL_HEADERS]/QtTest" \ - -isystem "$$[QT_INSTALL_HEADERS]/QtConcurrent" +# Key -isystem disable checking errors in system headers. Marking ignore for warnings in Qt headers. +!macx{ +ISYSTEM += -isystem "$$[QT_INSTALL_HEADERS]" +for(somelib, $$list($$LIBS_USED_FOR_QT)) { + ISYSTEM += -isystem "$$[QT_INSTALL_HEADERS]/$${somelib}" +} } else { -ISYSTEM += \ - -isystem "$$[QT_INSTALL_LIBS]/QtWidgets.framework/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtWidgets.framework/Versions/5/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtXml.framework/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtXml.framework/Versions/5/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtGui.framework/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtGui.framework/Versions/5/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtXmlPatterns.framework/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtXmlPatterns.framework/Versions/5/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtCore.framework/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtCore.framework/Versions/5/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtPrintSupport.framework/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtPrintSupport.framework/Versions/5/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtSvg.framework/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtSvg.framework/Versions/5/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtNetwork.framework/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtNetwork.framework/Versions/5/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtTest.framework/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtTest.framework/Versions/5/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtConcurrent.framework/Headers/" \ - -isystem "$$[QT_INSTALL_LIBS]/QtConcurrent.framework/Versions/5/Headers/" +for(somelib, $$list($$LIBS_USED_FOR_QT)) { + ISYSTEM += -isystem "$$[QT_INSTALL_LIBS]/$${somelib}.framework/Versions/5/Headers" + ISYSTEM += -isystem "$$[QT_INSTALL_LIBS]/$${somelib}.framework/Headers" +} } # Usefull GCC warnings keys. diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index 30e3c599b..b3a9fd1b4 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -128,22 +128,10 @@ void InsertGlobalContours(const QList &scenes, const QListTrVars(), qApp->patternUnitsP(), valentinaNamespace)), - doc(nullptr), - undoAction(nullptr), - redoAction(nullptr), - actionDockWidgetToolOptions(nullptr), - actionDockWidgetGroups(nullptr), - isNoScaling(false), - isNeedAutosave(false), + pattern(new VContainer(qApp->TrVars(), qApp->patternUnitsP(), valentinaNamespace)) #if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) - m_taskbarButton(new QWinTaskbarButton(this)), - m_taskbarProgress(nullptr), + ,m_taskbarButton(new QWinTaskbarButton(this)) #endif - m_dialogSaveLayout() { InitTempLayoutScene(); diff --git a/src/app/valentina/mainwindowsnogui.h b/src/app/valentina/mainwindowsnogui.h index 247d1f5e4..0e43a8ba0 100644 --- a/src/app/valentina/mainwindowsnogui.h +++ b/src/app/valentina/mainwindowsnogui.h @@ -86,41 +86,41 @@ public slots: protected slots: void ExportFMeasurementsToCSV(); protected: - QVector listDetails; + QVector listDetails{}; /** @brief currentScene pointer to current scene. */ - QGraphicsScene *currentScene; + QGraphicsScene *currentScene{nullptr}; - QGraphicsScene *tempSceneLayout; + QGraphicsScene *tempSceneLayout{nullptr}; /** @brief pattern container with data (points, arcs, splines, spline paths, variables) */ VContainer *pattern; /** @brief doc dom document container */ - VPattern *doc; + VPattern *doc{nullptr}; QList gcontours{}; QVector > detailsOnLayout{}; - QAction *undoAction; - QAction *redoAction; - QAction *actionDockWidgetToolOptions; - QAction *actionDockWidgetGroups; + QAction *undoAction{nullptr}; + QAction *redoAction{nullptr}; + QAction *actionDockWidgetToolOptions{nullptr}; + QAction *actionDockWidgetGroups{nullptr}; - bool isNoScaling; - bool isNeedAutosave; + bool isNoScaling{false}; + bool isNeedAutosave{false}; VPrintLayout *m_layoutSettings{new VPrintLayout(this)}; - QSharedPointer m_dialogSaveLayout; - /** @brief mouseCoordinate pointer to label who show mouse coordinate. */ QPointer m_mouseCoordinate{nullptr}; QPointer m_unreadPatternMessage{nullptr}; + QSharedPointer m_dialogSaveLayout{}; + #if defined(Q_OS_WIN) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) QWinTaskbarButton *m_taskbarButton; - QWinTaskbarProgress *m_taskbarProgress; + QWinTaskbarProgress *m_taskbarProgress{nullptr}; #endif static QVector PrepareDetailsForLayout(const QVector &details); diff --git a/src/libs/vdxf/vdxf.pro b/src/libs/vdxf/vdxf.pro index 15b0941ee..f3f26b65e 100644 --- a/src/libs/vdxf/vdxf.pro +++ b/src/libs/vdxf/vdxf.pro @@ -62,7 +62,7 @@ include(warnings.pri) CONFIG(release, debug|release){ # Release mode - CONFIG += silent + !macx:CONFIG += silent !unix:*g++*{ QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll diff --git a/src/libs/vlayout/vlayout.pro b/src/libs/vlayout/vlayout.pro index 18f5ddf14..9a8c4044a 100644 --- a/src/libs/vlayout/vlayout.pro +++ b/src/libs/vlayout/vlayout.pro @@ -7,7 +7,7 @@ # File with common stuff for whole project include(../../../common.pri) -QT += core gui widgets printsupport xml concurrent +QT += core gui widgets printsupport xml concurrent svg # Name of library TARGET = vlayout diff --git a/src/libs/vlayout/vlayoutexporter.cpp b/src/libs/vlayout/vlayoutexporter.cpp index ac967ffb0..48a066911 100644 --- a/src/libs/vlayout/vlayoutexporter.cpp +++ b/src/libs/vlayout/vlayoutexporter.cpp @@ -182,7 +182,7 @@ void VLayoutExporter::ExportToPDF(QGraphicsScene *scene) const printer.setOutputFileName(m_fileName); printer.setDocName(QFileInfo(m_fileName).fileName()); printer.setResolution(static_cast(PrintDPI)); - printer.setOrientation(QPrinter::Portrait); + printer.setPageOrientation(QPageLayout::Portrait); printer.setFullPage(m_ignorePrinterMargins); qreal width = FromPixel(m_imageRect.width() * m_xScale + m_margins.left() + m_margins.right(), Unit::Mm); diff --git a/src/libs/vlayout/vprintlayout.h b/src/libs/vlayout/vprintlayout.h index 46e1033f2..f4cc8e12c 100644 --- a/src/libs/vlayout/vprintlayout.h +++ b/src/libs/vlayout/vprintlayout.h @@ -44,8 +44,8 @@ class VPrintLayout : public QObject { Q_OBJECT public: - VPrintLayout(QObject *parent = nullptr); - ~VPrintLayout(); + explicit VPrintLayout(QObject *parent = nullptr); + virtual ~VPrintLayout(); auto FileName() const -> QString; void SetFileName(const QString &fileName); diff --git a/src/libs/vmisc/testvapplication.h b/src/libs/vmisc/testvapplication.h index b9dde2e25..aaeecb969 100644 --- a/src/libs/vmisc/testvapplication.h +++ b/src/libs/vmisc/testvapplication.h @@ -29,7 +29,7 @@ #ifndef TESTVAPPLICATION_H #define TESTVAPPLICATION_H -#include "vabstractapplication.h" +#include "vabstractvalapplication.h" #include "projectversion.h" #include "../vmisc/vcommonsettings.h" @@ -50,12 +50,12 @@ public: } }; -class TestVApplication : public VAbstractApplication +class TestVApplication : public VAbstractValApplication { Q_OBJECT public: TestVApplication(int &argc, char ** argv) - : VAbstractApplication(argc, argv), + : VAbstractValApplication(argc, argv), m_trVars(nullptr) { setApplicationName("ValentinaTest");