More deprecation warnings.

This commit is contained in:
Roman Telezhynskyi 2020-07-07 10:51:00 +03:00
parent 2c7456ccd3
commit 3383df193b
7 changed files with 45 additions and 4 deletions

View File

@ -51,6 +51,7 @@
#include <QDateTime> #include <QDateTime>
#include <QtXmlPatterns> #include <QtXmlPatterns>
#include <QIcon> #include <QIcon>
#include <Qt>
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes") QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes")
@ -202,7 +203,11 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
vStdOut().flush(); vStdOut().flush();
vStdErr().flush(); vStdErr().flush();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
(*qApp->LogFile()) << debugdate << endl; (*qApp->LogFile()) << debugdate << endl;
#else
(*qApp->LogFile()) << debugdate << Qt::endl;
#endif
} }
if (isGuiThread) if (isGuiThread)

View File

@ -154,7 +154,7 @@ void VDxfEngine::updateState(const QPaintEngineState &state)
if (flags & QPaintEngine::DirtyTransform) if (flags & QPaintEngine::DirtyTransform)
{ {
matrix = state.matrix(); // Save new matrix for moving paths matrix = state.transform(); // Save new matrix for moving paths
} }
} }

View File

@ -105,7 +105,7 @@ private:
QString fileName; QString fileName;
DRW::Version m_version; DRW::Version m_version;
bool m_binary; bool m_binary;
QMatrix matrix; QTransform matrix;
QSharedPointer<dx_iface> input; QSharedPointer<dx_iface> input;
VarMeasurement varMeasurement; VarMeasurement varMeasurement;
VarInsunits varInsunits; VarInsunits varInsunits;

View File

@ -39,6 +39,7 @@
#include <QIODevice> #include <QIODevice>
#include <QList> #include <QList>
#include <QTextStream> #include <QTextStream>
#include <Qt>
#include "../vmisc/diagnostic.h" #include "../vmisc/diagnostic.h"
@ -615,7 +616,11 @@ bool QxtCsvModel::toCSV(QIODevice* dest, QString &error, bool withHeader, QChar
} }
data += qxt_addCsvQuotes(d_ptr.quoteMode, d_ptr.header.at(col)); data += qxt_addCsvQuotes(d_ptr.quoteMode, d_ptr.header.at(col));
} }
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
stream << data << endl; stream << data << endl;
#else
stream << data << Qt::endl;
#endif
} }
for (row = 0; row < rows; ++row) for (row = 0; row < rows; ++row)
{ {
@ -636,7 +641,11 @@ bool QxtCsvModel::toCSV(QIODevice* dest, QString &error, bool withHeader, QChar
data += qxt_addCsvQuotes(d_ptr.quoteMode, QString()); data += qxt_addCsvQuotes(d_ptr.quoteMode, QString());
} }
} }
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
stream << data << endl; stream << data << endl;
#else
stream << data << Qt::endl;
#endif
} }
stream << flush; stream << flush;
dest->close(); dest->close();

View File

@ -41,6 +41,7 @@
#include <QTextStream> #include <QTextStream>
#include <QVector> #include <QVector>
#include <QtDebug> #include <QtDebug>
#include <Qt>
#include "../vmisc/diagnostic.h" #include "../vmisc/diagnostic.h"
#include "../vmisc/vmath.h" #include "../vmisc/vmath.h"
@ -125,8 +126,13 @@ bool VObjEngine::begin(QPaintDevice *pdev)
} }
stream = QSharedPointer<QTextStream>(new QTextStream(outputDevice.data())); stream = QSharedPointer<QTextStream>(new QTextStream(outputDevice.data()));
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
*stream << "# Valentina OBJ File" << endl; *stream << "# Valentina OBJ File" << endl;
*stream << "# valentinaproject.bitbucket.io/" << endl; *stream << "# valentinaproject.bitbucket.io/" << endl;
#else
*stream << "# Valentina OBJ File" << Qt::endl;
*stream << "# valentinaproject.bitbucket.io/" << Qt::endl;
#endif
return true; return true;
} }
@ -149,7 +155,7 @@ void VObjEngine::updateState(const QPaintEngineState &state)
if (flags & QPaintEngine::DirtyTransform) if (flags & QPaintEngine::DirtyTransform)
{ {
matrix = state.matrix(); // Save new matrix for moving paths matrix = state.transform(); // Save new matrix for moving paths
} }
} }
@ -166,7 +172,11 @@ void VObjEngine::drawPath(const QPainterPath &path)
qint64 sq = Square(polygon); qint64 sq = Square(polygon);
++planeCount; ++planeCount;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
*stream << "o Plane." << QString("%1").arg(planeCount, 3, 10, QLatin1Char('0')) << endl; *stream << "o Plane." << QString("%1").arg(planeCount, 3, 10, QLatin1Char('0')) << endl;
#else
*stream << "o Plane." << QString("%1").arg(planeCount, 3, 10, QLatin1Char('0')) << Qt::endl;
#endif
quint32 num_points = 0; quint32 num_points = 0;
@ -221,7 +231,11 @@ void VObjEngine::drawPath(const QPainterPath &path)
} }
delaunay2d_release(res);//Don't forget release data delaunay2d_release(res);//Don't forget release data
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
*stream << "s off" << endl; *stream << "s off" << endl;
#else
*stream << "s off" << Qt::endl;
#endif
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -236,7 +250,11 @@ void VObjEngine::drawPolygon(const QPointF *points, int pointCount, PolygonDrawM
{ {
*stream << QString(" %1").arg(static_cast<int>(globalPointsCount) - pointCount + i + 1); *stream << QString(" %1").arg(static_cast<int>(globalPointsCount) - pointCount + i + 1);
} }
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
*stream << endl; *stream << endl;
#else
*stream << Qt::endl;
#endif
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -259,8 +277,13 @@ void VObjEngine::drawPoints(const QPointF *points, int pointCount)
qreal x = ((points[i].x() - 0)/qFloor(size.width()/2.0)) - 1.0; qreal x = ((points[i].x() - 0)/qFloor(size.width()/2.0)) - 1.0;
qreal y = (((points[i].y() - 0)/qFloor(size.width()/2.0)) - 1.0)*-1; qreal y = (((points[i].y() - 0)/qFloor(size.width()/2.0)) - 1.0)*-1;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
*stream << "v" << " " << QString::number(x, 'f', 6 ) << " " << QString::number(y, 'f', 6 ) << " " *stream << "v" << " " << QString::number(x, 'f', 6 ) << " " << QString::number(y, 'f', 6 ) << " "
<< "0.000000" << endl; << "0.000000" << endl;
#else
*stream << "v" << " " << QString::number(x, 'f', 6 ) << " " << QString::number(y, 'f', 6 ) << " "
<< "0.000000" << Qt::endl;
#endif
++globalPointsCount; ++globalPointsCount;
} }
} }

View File

@ -79,7 +79,7 @@ private:
quint32 planeCount; quint32 planeCount;
QSize size; QSize size;
int resolution; int resolution;
QMatrix matrix; QTransform matrix;
QPolygonF MakePointsUnique(const QPolygonF &polygon)const; QPolygonF MakePointsUnique(const QPolygonF &polygon)const;
qint64 Square(const QPolygonF &poly)const; qint64 Square(const QPolygonF &poly)const;

View File

@ -59,7 +59,11 @@ TST_DXF::TST_DXF(QObject *parent)
void TST_DXF::initTestCase() void TST_DXF::initTestCase()
{ {
QTextStream ts(stdout); QTextStream ts(stdout);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
ts << QStringLiteral("Available codecs:\n%2.").arg(AvailableCodecs().join(", "))<< endl; ts << QStringLiteral("Available codecs:\n%2.").arg(AvailableCodecs().join(", "))<< endl;
#else
ts << QStringLiteral("Available codecs:\n%2.").arg(AvailableCodecs().join(", "))<< Qt::endl;
#endif
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------