From f71b0fd328e48a13a73a606dc3b73a6cdeee35bd Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 13 Nov 2017 12:59:25 +0200 Subject: [PATCH] Fix build on Windows. --HG-- branch : develop --- src/libs/qmuparser/qmuparser.cpp | 2 +- src/libs/vmisc/def.cpp | 2 -- src/libs/vmisc/def.h | 4 +--- src/libs/vmisc/defglobal.cpp | 30 ++++++++++++++++++++++++++ src/libs/vmisc/defglobal.h | 36 ++++++++++++++++++++++++++++++++ src/libs/vmisc/vmisc.pri | 6 ++++-- 6 files changed, 72 insertions(+), 8 deletions(-) create mode 100644 src/libs/vmisc/defglobal.cpp create mode 100644 src/libs/vmisc/defglobal.h diff --git a/src/libs/qmuparser/qmuparser.cpp b/src/libs/qmuparser/qmuparser.cpp index ebe75067b..369dd4e7b 100644 --- a/src/libs/qmuparser/qmuparser.cpp +++ b/src/libs/qmuparser/qmuparser.cpp @@ -33,7 +33,7 @@ #include "qmuparserdef.h" #include "qmuparsererror.h" #include "../vmisc/vmath.h" -#include "../vmisc/def.h" +#include "../vmisc/defglobal.h" /** * @file diff --git a/src/libs/vmisc/def.cpp b/src/libs/vmisc/def.cpp index 7778b1c59..ed0834142 100644 --- a/src/libs/vmisc/def.cpp +++ b/src/libs/vmisc/def.cpp @@ -239,8 +239,6 @@ void SetItemOverrideCursor(QGraphicsItem *item, const QString &pixmapPath, int h #endif } -const qreal PrintDPI = PRINTDPI; - //--------------------------------------------------------------------------------------------------------------------- double ToPixel(double val, const Unit &unit) { diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index b29bfeb89..1dd886c3f 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -41,6 +41,7 @@ #endif /* Q_OS_WIN */ #include "debugbreak.h" +#include "defglobal.h" template class QSharedPointer; @@ -421,9 +422,6 @@ extern const QString unitPX; void SetItemOverrideCursor(QGraphicsItem *item, const QString & pixmapPath, int hotX = -1, int hotY = -1); -#define PRINTDPI 96.0 -extern const qreal PrintDPI; - Q_REQUIRED_RESULT double ToPixel(double val, const Unit &unit); Q_REQUIRED_RESULT double FromPixel(double pix, const Unit &unit); diff --git a/src/libs/vmisc/defglobal.cpp b/src/libs/vmisc/defglobal.cpp new file mode 100644 index 000000000..1d6e37156 --- /dev/null +++ b/src/libs/vmisc/defglobal.cpp @@ -0,0 +1,30 @@ +/************************************************************************ + ** + ** @file global.cpp + ** @author Roman Telezhynskyi + ** @date 13 11, 2017 + ** + ** @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) 2017 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ +#include "defglobal.h" + +const qreal PrintDPI = PRINTDPI; diff --git a/src/libs/vmisc/defglobal.h b/src/libs/vmisc/defglobal.h new file mode 100644 index 000000000..596b5dec9 --- /dev/null +++ b/src/libs/vmisc/defglobal.h @@ -0,0 +1,36 @@ +/************************************************************************ + ** + ** @file defglobal.h + ** @author Roman Telezhynskyi + ** @date 13 11, 2017 + ** + ** @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) 2017 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ +#ifndef DEFGLOBAL_H +#define DEFGLOBAL_H + +#include + +#define PRINTDPI 96.0 +extern const qreal PrintDPI; + +#endif // DEFGLOBAL_H diff --git a/src/libs/vmisc/vmisc.pri b/src/libs/vmisc/vmisc.pri index 032d11211..9a8538157 100644 --- a/src/libs/vmisc/vmisc.pri +++ b/src/libs/vmisc/vmisc.pri @@ -11,7 +11,8 @@ SOURCES += \ $$PWD/commandoptions.cpp \ $$PWD/qxtcsvmodel.cpp \ $$PWD/vtablesearch.cpp \ - $$PWD/dialogs/dialogexporttocsv.cpp + $$PWD/dialogs/dialogexporttocsv.cpp \ + $$PWD/defglobal.cpp *msvc*:SOURCES += $$PWD/stable.cpp @@ -33,7 +34,8 @@ HEADERS += \ $$PWD/vtablesearch.h \ $$PWD/diagnostic.h \ $$PWD/dialogs/dialogexporttocsv.h \ - $$PWD/customevents.h + $$PWD/customevents.h \ + $$PWD/defglobal.h # Qt's versions # 5.2.0, 5.2.1