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

View File

@ -154,7 +154,7 @@ void VDxfEngine::updateState(const QPaintEngineState &state)
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;
DRW::Version m_version;
bool m_binary;
QMatrix matrix;
QTransform matrix;
QSharedPointer<dx_iface> input;
VarMeasurement varMeasurement;
VarInsunits varInsunits;

View File

@ -39,6 +39,7 @@
#include <QIODevice>
#include <QList>
#include <QTextStream>
#include <Qt>
#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));
}
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
stream << data << endl;
#else
stream << data << Qt::endl;
#endif
}
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());
}
}
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
stream << data << endl;
#else
stream << data << Qt::endl;
#endif
}
stream << flush;
dest->close();

View File

@ -41,6 +41,7 @@
#include <QTextStream>
#include <QVector>
#include <QtDebug>
#include <Qt>
#include "../vmisc/diagnostic.h"
#include "../vmisc/vmath.h"
@ -125,8 +126,13 @@ bool VObjEngine::begin(QPaintDevice *pdev)
}
stream = QSharedPointer<QTextStream>(new QTextStream(outputDevice.data()));
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
*stream << "# Valentina OBJ File" << endl;
*stream << "# valentinaproject.bitbucket.io/" << endl;
#else
*stream << "# Valentina OBJ File" << Qt::endl;
*stream << "# valentinaproject.bitbucket.io/" << Qt::endl;
#endif
return true;
}
@ -149,7 +155,7 @@ void VObjEngine::updateState(const QPaintEngineState &state)
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);
++planeCount;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
*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;
@ -221,7 +231,11 @@ void VObjEngine::drawPath(const QPainterPath &path)
}
delaunay2d_release(res);//Don't forget release data
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
*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);
}
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
*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 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 ) << " "
<< "0.000000" << endl;
#else
*stream << "v" << " " << QString::number(x, 'f', 6 ) << " " << QString::number(y, 'f', 6 ) << " "
<< "0.000000" << Qt::endl;
#endif
++globalPointsCount;
}
}

View File

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

View File

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