Commit c5014a92 authored by Stefan Gerlach's avatar Stefan Gerlach

Fix a few Qt 5.15 deprecation warnings

parent dfb5bc83
......@@ -41,7 +41,11 @@ public:
if (!m_inputs.value(0)) return 0;
QDateTime inputDate = m_inputs.value(0)->dateTimeAt(row);
if (!inputDate.isValid()) return 0;
#if QT_VERSION >= 0x051400
QDateTime start(QDate(1900, 1, 1).startOfDay());
#else
QDateTime start(QDate(1900, 1, 1));
#endif
return qint64(start.daysTo(inputDate));
}
......
......@@ -42,7 +42,11 @@ public:
if (!m_inputs.value(0)) return NAN;
QDateTime inputDate = m_inputs.value(0)->dateTimeAt(row);
if (!inputDate.isValid()) return NAN;
#if QT_VERSION >= 0x051400
QDateTime start(QDate(1900, 1, 1).startOfDay());
#else
QDateTime start(QDate(1900, 1, 1));
#endif
return double(start.daysTo(inputDate)) +
double( -inputDate.time().msecsTo(QTime(0,0,0,0)) ) / 86400000.0;
}
......
......@@ -41,7 +41,11 @@ public:
if (!m_inputs.value(0)) return 0;
QDateTime inputDate = m_inputs.value(0)->dateTimeAt(row);
if (!inputDate.isValid()) return 0;
#if QT_VERSION >= 0x051400
QDateTime start(QDate(1900, 1, 1).startOfDay());
#else
QDateTime start(QDate(1900, 1, 1));
#endif
return int(start.daysTo(inputDate));
}
......
......@@ -215,7 +215,7 @@ CartesianScale* CartesianScale::createLogScale(const Interval<double> &interval,
//######################### logical to scene mappers ###########################
//##############################################################################
QVector<QPointF> CartesianCoordinateSystem::mapLogicalToScene(const QVector<QPointF>& points, MappingFlags flags) const {
//DEBUG("CartesianCoordinateSystem::mapLogicalToScene() 1 (points)")
//DEBUG(Q_FUNC_INFO << ", (points with flags)")
const QRectF pageRect = d->plot->dataRect();
bool noPageClipping = pageRect.isNull() || (flags & MappingFlag::SuppressPageClipping);
const bool noPageClippingY = flags & MappingFlag::SuppressPageClippingY;
......@@ -268,7 +268,7 @@ QVector<QPointF> CartesianCoordinateSystem::mapLogicalToScene(const QVector<QPoi
*/
void CartesianCoordinateSystem::mapLogicalToScene(const QVector<QPointF>& logicalPoints,
QVector<QPointF>& scenePoints, std::vector<bool>& visiblePoints, MappingFlags flags) const {
DEBUG("CartesianCoordinateSystem::mapLogicalToScene() 2 (curve with all points)")
DEBUG(Q_FUNC_INFO << ", (curve with all points)")
const QRectF pageRect = d->plot->dataRect();
const bool noPageClipping = pageRect.isNull() || (flags & MappingFlag::SuppressPageClipping);
const bool noPageClippingY = flags & MappingFlag::SuppressPageClippingY;
......@@ -320,7 +320,7 @@ void CartesianCoordinateSystem::mapLogicalToScene(const QVector<QPointF>& logica
*/
void CartesianCoordinateSystem::mapLogicalToScene(int startIndex, int endIndex, const QVector<QPointF>& logicalPoints, QVector<QPointF>& scenePoints,
QVector<bool>& visiblePoints, QVector<QVector<bool>>& scenePointsUsed, double minLogicalDiffX, double minLogicalDiffY, MappingFlags flags) const {
DEBUG("CartesianCoordinateSystem::mapLogicalToScene() 3 (curve points)")
DEBUG(Q_FUNC_INFO << ", (curve points)")
const QRectF pageRect = d->plot->dataRect();
const bool noPageClipping = pageRect.isNull() || (flags & MappingFlag::SuppressPageClipping);
const bool noPageClippingY = flags & MappingFlag::SuppressPageClippingY;
......@@ -376,7 +376,7 @@ void CartesianCoordinateSystem::mapLogicalToScene(int startIndex, int endIndex,
* Map a single point
* */
QPointF CartesianCoordinateSystem::mapLogicalToScene(QPointF logicalPoint, MappingFlags flags) const {
//DEBUG("CartesianCoordinateSystem::mapLogicalToScene() 4 (single point)")
//DEBUG(Q_FUNC_INFO << ", (single point)")
const QRectF pageRect = d->plot->dataRect();
const bool noPageClipping = pageRect.isNull() || (flags & MappingFlag::SuppressPageClipping);
const bool noPageClippingY = flags & MappingFlag::SuppressPageClippingY;
......
......@@ -1328,7 +1328,6 @@ void CartesianPlot::addSmoothCurve() {
}
void CartesianPlot::addFitCurve() {
DEBUG("CartesianPlot::addFitCurve()");
XYFitCurve* curve = new XYFitCurve("fit");
const XYCurve* curCurve = currentCurve();
if (curCurve) {
......@@ -2000,7 +1999,6 @@ void CartesianPlot::scaleAutoTriggered() {
}
bool CartesianPlot::scaleAuto() {
DEBUG("CartesianPlot::scaleAuto()");
Q_D(CartesianPlot);
if (d->curvesXMinMaxIsDirty) {
......@@ -2090,7 +2088,7 @@ bool CartesianPlot::scaleAuto() {
d->yMax = d->curvesYMax;
updateY = true;
}
DEBUG(" xmin/xmax = " << d->xMin << '/' << d->xMax << ", ymin/ymax = " << d->yMin << '/' << d->yMax);
DEBUG(Q_FUNC_INFO << ", xmin/xmax = " << d->xMin << '/' << d->xMax << ", ymin/ymax = " << d->yMin << '/' << d->yMax);
if (updateX || updateY) {
if (updateX) {
......@@ -2655,8 +2653,7 @@ void CartesianPlotPrivate::retransform() {
}
void CartesianPlotPrivate::retransformScales() {
DEBUG("CartesianPlotPrivate::retransformScales()");
DEBUG(" xmin/xmax = " << xMin << '/'<< xMax << ", ymin/ymax = " << yMin << '/' << yMax);
DEBUG(Q_FUNC_INFO << ", xmin/xmax = " << xMin << '/'<< xMax << ", ymin/ymax = " << yMin << '/' << yMax);
PERFTRACE("CartesianPlotPrivate::retransformScales()");
QVector<CartesianScale*> scales;
......@@ -2939,7 +2936,7 @@ void CartesianPlotPrivate::checkYRange() {
}
CartesianScale* CartesianPlotPrivate::createScale(CartesianPlot::Scale type, double sceneStart, double sceneEnd, double logicalStart, double logicalEnd) {
DEBUG("CartesianPlotPrivate::createScale() scene start/end = " << sceneStart << '/' << sceneEnd << ", logical start/end = " << logicalStart << '/' << logicalEnd);
DEBUG(Q_FUNC_INFO << ", scene start/end = " << sceneStart << '/' << sceneEnd << ", logical start/end = " << logicalStart << '/' << logicalEnd);
// Interval<double> interval (logicalStart-0.01, logicalEnd+0.01); //TODO: move this to CartesianScale
Interval<double> interval (std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max());
// Interval<double> interval (logicalStart, logicalEnd);
......@@ -4074,7 +4071,7 @@ void CartesianPlot::loadThemeConfig(const KConfig& config) {
// theme path is saved with UNIX dir separator
theme = theme.right(theme.length() - theme.lastIndexOf(QLatin1Char('/')) - 1);
DEBUG(" set theme to " << STDSTRING(theme));
DEBUG(Q_FUNC_INFO << ", set theme to " << STDSTRING(theme));
}
//loadThemeConfig() can be called from
......
......@@ -72,7 +72,7 @@ CartesianPlotLegendDock::CartesianPlotLegendDock(QWidget* parent) : BaseDock(par
if (!layout)
continue;
layout->setContentsMargins(2,2,2,2);
layout->setContentsMargins(2, 2, 2, 2);
layout->setHorizontalSpacing(2);
layout->setVerticalSpacing(2);
}
......@@ -726,7 +726,7 @@ void CartesianPlotLegendDock::borderOpacityChanged(int value) {
if (m_initializing)
return;
float opacity = (float)value/100.;
double opacity = (double)value/100.;
for (auto* legend : m_legendList)
legend->setBorderOpacity(opacity);
}
......
......@@ -66,7 +66,11 @@ void MQTTUnitTest::testContainFalse() {
while(!in.atEnd()) {
QString line = in.readLine();
QStringList topics = line.split(' ', QString::SkipEmptyParts);
#if QT_VERSION >= 0x051400
QStringList topics = line.split(QLatin1Char(' '), Qt::SkipEmptyParts);
#else
QStringList topics = line.split(QLatin1Char(' '), QString::SkipEmptyParts);
#endif
QCOMPARE(client->checkTopicContains(topics[0], topics[1]), false);
}
......@@ -85,7 +89,11 @@ void MQTTUnitTest::testContainTrue() {
while(!in.atEnd()) {
QString line = in.readLine();
#if QT_VERSION >= 0x051400
QStringList topics = line.split(QLatin1Char(' '), Qt::SkipEmptyParts);
#else
QStringList topics = line.split(QLatin1Char(' '), QString::SkipEmptyParts);
#endif
QCOMPARE(client->checkTopicContains(topics[0], topics[1]), true);
}
......@@ -107,7 +115,11 @@ void MQTTUnitTest::testCommonTrue(){
while(!in.atEnd()) {
QString line = in.readLine();
#if QT_VERSION >= 0x051400
QStringList topics = line.split(QLatin1Char(' '), Qt::SkipEmptyParts);
#else
QStringList topics = line.split(QLatin1Char(' '), QString::SkipEmptyParts);
#endif
QCOMPARE(client->checkCommonLevel(topics[0], topics[1]), topics[2]);
}
......@@ -126,7 +138,11 @@ void MQTTUnitTest::testCommonFalse(){
while(!in.atEnd()) {
QString line = in.readLine();
#if QT_VERSION >= 0x051400
QStringList topics = line.split(QLatin1Char(' '), Qt::SkipEmptyParts);
#else
QStringList topics = line.split(QLatin1Char(' '), QString::SkipEmptyParts);
#endif
QCOMPARE(client->checkCommonLevel(topics[0], topics[1]), "");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment