Fix conflict with declaration from qmuparser lib.

This commit is contained in:
Roman Telezhynskyi 2023-02-21 09:52:08 +02:00
parent fb08b0a317
commit 178d260dff
6 changed files with 55 additions and 12 deletions

View File

@ -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 <QtDebug>
#include <QDir>
#include <QProcess>

View File

@ -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

View File

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

View File

@ -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.

View File

@ -108,17 +108,6 @@ using qmusizetype = qsizetype;
using qmusizetype = int;
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
#include <QTextStream>
namespace Qt
{
static auto endl = ::endl;
static auto flush = ::flush;
static auto dec = ::dec;
static auto SkipEmptyParts = QString::SkipEmptyParts;
}
#endif
namespace qmu
{
//------------------------------------------------------------------------------

44
src/libs/qmuparser/text.h Normal file
View File

@ -0,0 +1,44 @@
/************************************************************************
**
** @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
{
//static auto endl = ::endl;
//static auto flush = ::flush;
static auto dec = ::dec;
//static auto SkipEmptyParts = QString::SkipEmptyParts;
}
#endif
#endif // TEXT_H