Skip to content
Permalink
Browse files
Qt5 compilation fix
  • Loading branch information
nyalldawson committed Jul 20, 2021
1 parent 35511ff commit 26ede995ae76d2bb94747667493a1f3f4bf3ee35
Showing with 32 additions and 1 deletion.
  1. +28 −1 src/analysis/interpolation/qgsgridfilewriter.cpp
  2. +4 −0 src/analysis/raster/qgsrelief.cpp
@@ -73,7 +73,11 @@ int QgsGridFileWriter::writeFile( QgsFeedback *feedback )
}
currentXValue += mCellSizeX;
}
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
outStream << endl;
#else
outStream << Qt::endl;
#endif
currentYValue -= mCellSizeY;

if ( feedback )
@@ -101,28 +105,51 @@ int QgsGridFileWriter::writeFile( QgsFeedback *feedback )
}
QTextStream prjStream( &prjFile );
prjStream << crs;
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
prjStream << endl;
#else
prjStream << Qt::endl;
#endif
prjFile.close();

return 0;
}

int QgsGridFileWriter::writeHeader( QTextStream &outStream )
{
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
outStream << "NCOLS " << mNumColumns << endl;
outStream << "NROWS " << mNumRows << endl;
outStream << "XLLCORNER " << mInterpolationExtent.xMinimum() << endl;
outStream << "YLLCORNER " << mInterpolationExtent.yMinimum() << endl;
#else
outStream << "NCOLS " << mNumColumns << Qt::endl;
outStream << "NROWS " << mNumRows << Qt::endl;
outStream << "XLLCORNER " << mInterpolationExtent.xMinimum() << Qt::endl;
outStream << "YLLCORNER " << mInterpolationExtent.yMinimum() << Qt::endl;
#endif
if ( mCellSizeX == mCellSizeY ) //standard way
{
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
outStream << "CELLSIZE " << mCellSizeX << endl;
#else
outStream << "CELLSIZE " << mCellSizeX << Qt::endl;
#endif
}
else //this is supported by GDAL but probably not by other products
{
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
outStream << "DX " << mCellSizeX << endl;
outStream << "DY " << mCellSizeY << endl;
#else
outStream << "DX " << mCellSizeX << Qt::endl;
outStream << "DY " << mCellSizeY << Qt::endl;
#endif
}
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
outStream << "NODATA_VALUE -9999" << endl;
#else
outStream << "NODATA_VALUE -9999" << Qt::endl;

#endif
return 0;
}
@@ -548,7 +548,11 @@ bool QgsRelief::exportFrequencyDistributionToCsv( const QString &file )
#endif
for ( int i = 0; i < 252; ++i )
{
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
outstream << QString::number( i ) + ',' + QString::number( frequency[i] ) << endl;
#else
outstream << QString::number( i ) + ',' + QString::number( frequency[i] ) << Qt::endl;
#endif
}
outFile.close();
return true;

0 comments on commit 26ede99

Please sign in to comment.