From 178d260dff4a3f96bae64fc2c22060311986ed58 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 21 Feb 2023 09:52:08 +0200 Subject: [PATCH] Fix conflict with declaration from qmuparser lib. --- src/app/valentina/core/vapplication.cpp | 4 +++ src/libs/qmuparser/qmuparser.pri | 3 +- src/libs/qmuparser/qmuparser.qbs | 1 + src/libs/qmuparser/qmuparserbase.cpp | 4 +++ src/libs/qmuparser/qmuparserdef.h | 11 ------- src/libs/qmuparser/text.h | 44 +++++++++++++++++++++++++ 6 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 src/libs/qmuparser/text.h diff --git a/src/app/valentina/core/vapplication.cpp b/src/app/valentina/core/vapplication.cpp index 6de88b815..8bf2d43fc 100644 --- a/src/app/valentina/core/vapplication.cpp +++ b/src/app/valentina/core/vapplication.cpp @@ -40,6 +40,10 @@ #include "../vmisc/vsysexits.h" #include "../vmisc/vvalentinasettings.h" +#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) +#include "../vmisc/backport/text.h" +#endif + #include #include #include diff --git a/src/libs/qmuparser/qmuparser.pri b/src/libs/qmuparser/qmuparser.pri index 9dae7d639..e052ee11c 100644 --- a/src/libs/qmuparser/qmuparser.pri +++ b/src/libs/qmuparser/qmuparser.pri @@ -34,4 +34,5 @@ HEADERS += \ $$PWD/qmuformulabase.h \ $$PWD/qmutokenparser.h \ $$PWD/qmuparsercallback_p.h \ - $$PWD/make_unique.h + $$PWD/make_unique.h \ + $$PWD/text.h diff --git a/src/libs/qmuparser/qmuparser.qbs b/src/libs/qmuparser/qmuparser.qbs index 18ae99468..b25547abd 100644 --- a/src/libs/qmuparser/qmuparser.qbs +++ b/src/libs/qmuparser/qmuparser.qbs @@ -32,6 +32,7 @@ VDynamicLib { "qmutokenparser.h", "qmuparsercallback_p.h", "make_unique.h", + "text.h" ] cpp.defines: ["QMUPARSER_LIBRARY", 'QMUP_VERSION="' + product.version + '"'] diff --git a/src/libs/qmuparser/qmuparserbase.cpp b/src/libs/qmuparser/qmuparserbase.cpp index 339697714..064c9ebb7 100644 --- a/src/libs/qmuparser/qmuparserbase.cpp +++ b/src/libs/qmuparser/qmuparserbase.cpp @@ -37,6 +37,10 @@ #include "qmudef.h" #include "../vmisc/vmath.h" +#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) +#include "text.h" +#endif + /** * @file * @brief This file contains the basic implementation of the muparser engine. diff --git a/src/libs/qmuparser/qmuparserdef.h b/src/libs/qmuparser/qmuparserdef.h index 94b00afc4..961e70f58 100644 --- a/src/libs/qmuparser/qmuparserdef.h +++ b/src/libs/qmuparser/qmuparserdef.h @@ -108,17 +108,6 @@ using qmusizetype = qsizetype; using qmusizetype = int; #endif -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) -#include -namespace Qt -{ -static auto endl = ::endl; -static auto flush = ::flush; -static auto dec = ::dec; -static auto SkipEmptyParts = QString::SkipEmptyParts; -} -#endif - namespace qmu { //------------------------------------------------------------------------------ diff --git a/src/libs/qmuparser/text.h b/src/libs/qmuparser/text.h new file mode 100644 index 000000000..1afd08e5b --- /dev/null +++ b/src/libs/qmuparser/text.h @@ -0,0 +1,44 @@ +/************************************************************************ + ** + ** @file text.h + ** @author Roman Telezhynskyi + ** @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 + ** 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 TEXT_H +#define TEXT_H + +#include + +#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) +#include +namespace Qt +{ +//static auto endl = ::endl; +//static auto flush = ::flush; +static auto dec = ::dec; +//static auto SkipEmptyParts = QString::SkipEmptyParts; +} +#endif + +#endif // TEXT_H