Skip to content

Commit

Permalink
More deprecation warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dismine committed Jul 7, 2020
1 parent 2c7456c commit 3383df1
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/app/valentina/core/vapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <QDateTime>
#include <QtXmlPatterns>
#include <QIcon>
#include <Qt>

QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes")
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vdxf/vdxfengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/libs/vdxf/vdxfengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class VDxfEngine : public QPaintEngine
QString fileName;
DRW::Version m_version;
bool m_binary;
QMatrix matrix;
QTransform matrix;
QSharedPointer<dx_iface> input;
VarMeasurement varMeasurement;
VarInsunits varInsunits;
Expand Down
9 changes: 9 additions & 0 deletions src/libs/vmisc/qxtcsvmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <QIODevice>
#include <QList>
#include <QTextStream>
#include <Qt>

#include "../vmisc/diagnostic.h"

Expand Down Expand Up @@ -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)
{
Expand All @@ -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();
Expand Down
25 changes: 24 additions & 1 deletion src/libs/vobj/vobjengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <QTextStream>
#include <QVector>
#include <QtDebug>
#include <Qt>

#include "../vmisc/diagnostic.h"
#include "../vmisc/vmath.h"
Expand Down Expand Up @@ -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;
}

Expand All @@ -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
}
}

Expand All @@ -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;

Expand Down Expand Up @@ -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
}

//---------------------------------------------------------------------------------------------------------------------
Expand All @@ -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
}

//---------------------------------------------------------------------------------------------------------------------
Expand All @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vobj/vobjengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class VObjEngine : public QPaintEngine
quint32 planeCount;
QSize size;
int resolution;
QMatrix matrix;
QTransform matrix;

QPolygonF MakePointsUnique(const QPolygonF &polygon)const;
qint64 Square(const QPolygonF &poly)const;
Expand Down
4 changes: 4 additions & 0 deletions src/test/ValentinaTest/tst_dxf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

//---------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 3383df1

Please sign in to comment.