Followup 320c696 use clang-modernize to replace 0/NULL use with nullptr

This commit is contained in:
Nyall Dawson 2015-12-14 11:21:07 +11:00
parent fb2b930db8
commit 576875e998
1071 changed files with 5127 additions and 5127 deletions

View File

@ -20,7 +20,7 @@
#include <qmath.h>
CloughTocherInterpolator::CloughTocherInterpolator()
: mTIN( 0 )
: mTIN( nullptr )
, mEdgeTolerance( 0.00001 )
, der1X( 0.0 )
, der1Y( 0.0 )

View File

@ -930,7 +930,7 @@ QList<int>* DualEdgeTriangulation::getSurroundingTriangles( int pointno )
if ( firstedge == -1 )//an error occured
{
return 0;
return nullptr;
}
QList<int>* vlist = new QList<int>();//create the value list on the heap
@ -3070,13 +3070,13 @@ QList<int>* DualEdgeTriangulation::getPointsAroundEdge( double x, double y )
else
{
QgsDebugMsg( "warning: null pointer" );
return 0;
return nullptr;
}
}
else
{
QgsDebugMsg( "Edge number negative" );
return 0;
return nullptr;
}
}
@ -3102,7 +3102,7 @@ bool DualEdgeTriangulation::saveAsShapefile( const QString& fileName ) const
}
}
QgsVectorFileWriter writer( shapeFileName, "Utf-8", fields, QGis::WKBLineString, 0 );
QgsVectorFileWriter writer( shapeFileName, "Utf-8", fields, QGis::WKBLineString, nullptr );
if ( writer.hasError() != QgsVectorFileWriter::NoError )
{
return false;

View File

@ -181,7 +181,7 @@ inline DualEdgeTriangulation::DualEdgeTriangulation()
, xMin( 0 )
, yMax( 0 )
, yMin( 0 )
, mTriangleInterpolator( 0 )
, mTriangleInterpolator( nullptr )
, mForcedCrossBehaviour( Triangulation::DELETE_FIRST )
, mEdgeColor( 0, 255, 0 )
, mForcedEdgeColor( 0, 0, 255 )
@ -202,7 +202,7 @@ inline DualEdgeTriangulation::DualEdgeTriangulation( int nop, Triangulation* dec
, xMin( 0 )
, yMax( 0 )
, yMin( 0 )
, mTriangleInterpolator( 0 )
, mTriangleInterpolator( nullptr )
, mForcedCrossBehaviour( Triangulation::DELETE_FIRST )
, mEdgeColor( 0, 255, 0 )
, mForcedEdgeColor( 0, 0, 255 )

View File

@ -49,7 +49,7 @@ class ANALYSIS_EXPORT LinTriangleInterpolator : public TriangleInterpolator
};
inline LinTriangleInterpolator::LinTriangleInterpolator()
: mTIN( 0 )
: mTIN( nullptr )
{
}

View File

@ -25,7 +25,7 @@ Node::Node( const Node& n )
}
else
{
mPoint = 0;
mPoint = nullptr;
}
mNext = n.getNext();
@ -39,7 +39,7 @@ Node& Node::operator=( const Node & n )
if ( n.getPoint() )//mPoint of n is not a null pointer
{
mPoint = new Point3D( n.getPoint()->getX(), n.getPoint()->getY(), n.getPoint()->getZ() );
if ( mPoint == 0 )//no memory
if ( mPoint == nullptr )//no memory
{
mPoint = tmp;
mNext = n.getNext();
@ -49,7 +49,7 @@ Node& Node::operator=( const Node & n )
}
else//mPoint of n is a null pointer
{
mPoint = 0;
mPoint = nullptr;
}
if ( tmp )

View File

@ -42,7 +42,7 @@ class ANALYSIS_EXPORT Node
void setPoint( Point3D* p );
};
inline Node::Node() : mPoint( 0 ), mNext( 0 )
inline Node::Node() : mPoint( nullptr ), mNext( nullptr )
{
}

View File

@ -518,7 +518,7 @@ bool NormVecDecorator::estimateFirstDerivatives( QProgressDialog* d )
{
d->setMinimum( 0 );
d->setMaximum( getNumberOfPoints() );
d->setCancelButton( 0 ); //we cannot cancel derivative estimation
d->setCancelButton( nullptr ); //we cannot cancel derivative estimation
d->show();
}

View File

@ -45,7 +45,7 @@ class ANALYSIS_EXPORT NormVecDecorator: public TriDecorator
/** Estimates the first derivative a point. Return true in case of succes and false otherwise*/
bool estimateFirstDerivative( int pointno );
/** This method adds the functionality of estimating normals at the data points. Return true in the case of success and false otherwise*/
bool estimateFirstDerivatives( QProgressDialog* d = 0 );
bool estimateFirstDerivatives( QProgressDialog* d = nullptr );
/** Returns a pointer to the normal vector for the point with the number n*/
Vector3D* getNormal( int n ) const;
/** Finds out, in which triangle a point with coordinates x and y is and assigns the triangle points to p1, p2, p3 and the estimated normals to v1, v2, v3. The vectors are normaly taken from 'mNormVec', exept if p1, p2 or p3 is a point on a breakline. In this case, the normal is calculated on-the-fly. Returns false, if something went wrong and true otherwise*/
@ -78,12 +78,12 @@ class ANALYSIS_EXPORT NormVecDecorator: public TriDecorator
void setState( int pointno, pointState s );
};
inline NormVecDecorator::NormVecDecorator(): TriDecorator(), mInterpolator( 0 ), mNormVec( new QVector<Vector3D*>( mDefaultStorageForNormals ) ), mPointState( new QVector<pointState>( mDefaultStorageForNormals ) )
inline NormVecDecorator::NormVecDecorator(): TriDecorator(), mInterpolator( nullptr ), mNormVec( new QVector<Vector3D*>( mDefaultStorageForNormals ) ), mPointState( new QVector<pointState>( mDefaultStorageForNormals ) )
{
alreadyestimated = false;
}
inline NormVecDecorator::NormVecDecorator( Triangulation* tin ): TriDecorator( tin ), mInterpolator( 0 ), mNormVec( new QVector<Vector3D*>( mDefaultStorageForNormals ) ), mPointState( new QVector<pointState>( mDefaultStorageForNormals ) )
inline NormVecDecorator::NormVecDecorator( Triangulation* tin ): TriDecorator( tin ), mInterpolator( nullptr ), mNormVec( new QVector<Vector3D*>( mDefaultStorageForNormals ) ), mPointState( new QVector<pointState>( mDefaultStorageForNormals ) )
{
alreadyestimated = false;
}
@ -102,7 +102,7 @@ inline Vector3D* NormVecDecorator::getNormal( int n ) const
else
{
QgsDebugMsg( "warning, null pointer" );
return 0;
return nullptr;
}
}

View File

@ -47,7 +47,7 @@ void ParametricLine::calcPoint( float t, Point3D *p )
ParametricLine* ParametricLine::getParent() const
{
QgsDebugMsg( "warning, derive a class from ParametricLine" );
return 0;
return nullptr;
}
void ParametricLine::remove( int i )
@ -78,11 +78,11 @@ const Point3D* ParametricLine::getControlPoint( int number ) const
{
Q_UNUSED( number );
QgsDebugMsg( "warning, derive a class from ParametricLine" );
return 0;
return nullptr;
}
const QVector<Point3D*>* ParametricLine::getControlPoly() const
{
QgsDebugMsg( "warning, derive a class from ParametricLine" );
return 0;
return nullptr;
}

View File

@ -58,7 +58,7 @@ class ANALYSIS_EXPORT ParametricLine
//-----------------------------------------constructors and destructor----------------------
inline ParametricLine::ParametricLine() : mDegree( 0 ), mParent( 0 ), mControlPoly( 0 )
inline ParametricLine::ParametricLine() : mDegree( 0 ), mParent( nullptr ), mControlPoly( nullptr )
{
}

View File

@ -93,7 +93,7 @@ Point3D* TriDecorator::getPoint( unsigned int i ) const
else
{
QgsDebugMsg( "warning, null pointer" );
return 0;
return nullptr;
}
}
@ -162,7 +162,7 @@ QList<int>* TriDecorator::getSurroundingTriangles( int pointno )
else
{
QgsDebugMsg( "warning, null pointer" );
return 0;
return nullptr;
}
}
@ -342,6 +342,6 @@ QList<int>* TriDecorator::getPointsAroundEdge( double x, double y )
else
{
QgsDebugMsg( "warning, null pointer" );
return 0;
return nullptr;
}
}

View File

@ -59,7 +59,7 @@ class ANALYSIS_EXPORT TriDecorator : public Triangulation
Triangulation* mTIN;
};
inline TriDecorator::TriDecorator(): mTIN( 0 )
inline TriDecorator::TriDecorator(): mTIN( nullptr )
{
}

View File

@ -35,7 +35,7 @@ QgsGridFileWriter::QgsGridFileWriter( QgsInterpolator* i, const QString& outputP
}
QgsGridFileWriter::QgsGridFileWriter()
: mInterpolator( 0 )
: mInterpolator( nullptr )
, mNumColumns( 0 )
, mNumRows( 0 )
, mCellSizeX( 0 )
@ -72,10 +72,10 @@ int QgsGridFileWriter::writeFile( bool showProgressDialog )
double currentXValue;
double interpolatedValue;
QProgressDialog* progressDialog = 0;
QProgressDialog* progressDialog = nullptr;
if ( showProgressDialog )
{
progressDialog = new QProgressDialog( QObject::tr( "Interpolating..." ), QObject::tr( "Abort" ), 0, mNumRows, 0 );
progressDialog = new QProgressDialog( QObject::tr( "Interpolating..." ), QObject::tr( "Abort" ), 0, mNumRows, nullptr );
progressDialog->setWindowModality( Qt::WindowModal );
}

View File

@ -54,7 +54,7 @@ int QgsInterpolator::cacheBaseData()
for ( ; v_it != mLayerData.end(); ++v_it )
{
if ( v_it->vectorLayer == 0 )
if ( v_it->vectorLayer == nullptr )
{
continue;
}

View File

@ -29,8 +29,8 @@
QgsTINInterpolator::QgsTINInterpolator( const QList<LayerData>& inputData, TIN_INTERPOLATION interpolation, bool showProgressDialog )
: QgsInterpolator( inputData )
, mTriangulation( 0 )
, mTriangleInterpolator( 0 )
, mTriangulation( nullptr )
, mTriangleInterpolator( nullptr )
, mIsInitialized( false )
, mShowProgressDialog( showProgressDialog )
, mExportTriangulationToFile( false )
@ -67,7 +67,7 @@ int QgsTINInterpolator::interpolatePoint( double x, double y, double& result )
void QgsTINInterpolator::initialize()
{
DualEdgeTriangulation* theDualEdgeTriangulation = new DualEdgeTriangulation( 100000, 0 );
DualEdgeTriangulation* theDualEdgeTriangulation = new DualEdgeTriangulation( 100000, nullptr );
if ( mInterpolation == CloughTocher )
{
NormVecDecorator* dec = new NormVecDecorator();
@ -94,10 +94,10 @@ void QgsTINInterpolator::initialize()
}
}
QProgressDialog* theProgressDialog = 0;
QProgressDialog* theProgressDialog = nullptr;
if ( mShowProgressDialog )
{
theProgressDialog = new QProgressDialog( QObject::tr( "Building triangulation..." ), QObject::tr( "Abort" ), 0, nFeatures, 0 );
theProgressDialog = new QProgressDialog( QObject::tr( "Building triangulation..." ), QObject::tr( "Abort" ), 0, nFeatures, nullptr );
theProgressDialog->setWindowModality( Qt::WindowModal );
}
@ -140,7 +140,7 @@ void QgsTINInterpolator::initialize()
NormVecDecorator* dec = dynamic_cast<NormVecDecorator*>( mTriangulation );
if ( dec )
{
QProgressDialog* progressDialog = 0;
QProgressDialog* progressDialog = nullptr;
if ( mShowProgressDialog ) //show a progress dialog because it can take a long time...
{
progressDialog = new QProgressDialog();
@ -203,7 +203,7 @@ int QgsTINInterpolator::insertData( QgsFeature* f, bool zCoord, int attr, InputT
double x, y, z;
QgsConstWkbPtr currentWkbPtr( g->asWkb() + 1 + sizeof( int ) );
//maybe a structure or break line
Line3D* line = 0;
Line3D* line = nullptr;
QGis::WkbType wkbType = g->wkbType();
switch ( wkbType )

View File

@ -28,8 +28,8 @@
void QgsGraphAnalyzer::dijkstra( const QgsGraph* source, int startPointIdx, int criterionNum, QVector<int>* resultTree, QVector<double>* resultCost )
{
QVector< double > * result = NULL;
if ( resultCost != NULL )
QVector< double > * result = nullptr;
if ( resultCost != nullptr )
{
result = resultCost;
}
@ -42,7 +42,7 @@ void QgsGraphAnalyzer::dijkstra( const QgsGraph* source, int startPointIdx, int
result->insert( result->begin(), source->vertexCount(), std::numeric_limits<double>::infinity() );
( *result )[ startPointIdx ] = 0.0;
if ( resultTree != NULL )
if ( resultTree != nullptr )
{
resultTree->clear();
resultTree->insert( resultTree->begin(), source->vertexCount(), -1 );
@ -73,7 +73,7 @@ void QgsGraphAnalyzer::dijkstra( const QgsGraph* source, int startPointIdx, int
if ( cost < ( *result )[ arc.inVertex()] )
{
( *result )[ arc.inVertex()] = cost;
if ( resultTree != NULL )
if ( resultTree != nullptr )
{
( *resultTree )[ arc.inVertex()] = *arcIt;
}
@ -81,7 +81,7 @@ void QgsGraphAnalyzer::dijkstra( const QgsGraph* source, int startPointIdx, int
}
}
}
if ( resultCost == NULL )
if ( resultCost == nullptr )
{
delete result;
}

View File

@ -39,7 +39,7 @@ class ANALYSIS_EXPORT QgsGraphAnalyzer
* @param resultTree array represents the shortest path tree. resultTree[ vertexIndex ] == inboundingArcIndex if vertex reacheble and resultTree[ vertexIndex ] == -1 others.
* @param resultCost array of cost paths
*/
static void dijkstra( const QgsGraph* source, int startVertexIdx, int criterionNum, QVector<int>* resultTree = NULL, QVector<double>* resultCost = NULL );
static void dijkstra( const QgsGraph* source, int startVertexIdx, int criterionNum, QVector<int>* resultTree = nullptr, QVector<double>* resultCost = nullptr );
/**
* return shortest path tree with root-node in startVertexIdx

View File

@ -29,7 +29,7 @@ QgsGraphBuilder::QgsGraphBuilder( const QgsCoordinateReferenceSystem& crs, bool
QgsGraphBuilder::~QgsGraphBuilder()
{
if ( mGraph != NULL )
if ( mGraph != nullptr )
delete mGraph;
}
@ -46,6 +46,6 @@ void QgsGraphBuilder::addArc( int pt1id, const QgsPoint&, int pt2id, const QgsPo
QgsGraph* QgsGraphBuilder::graph()
{
QgsGraph* res = mGraph;
mGraph = NULL;
mGraph = nullptr;
return res;
}

View File

@ -130,7 +130,7 @@ void QgsLineVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, c
{
QgsVectorLayer *vl = mVectorLayer;
if ( vl == NULL )
if ( vl == nullptr )
return;
int featureCount = ( int ) vl->featureCount() * 2;

View File

@ -21,13 +21,13 @@
QgsOSMDatabase::QgsOSMDatabase( const QString& dbFileName )
: mDbFileName( dbFileName )
, mDatabase( 0 )
, mStmtNode( 0 )
, mStmtNodeTags( 0 )
, mStmtWay( 0 )
, mStmtWayNode( 0 )
, mStmtWayNodePoints( 0 )
, mStmtWayTags( 0 )
, mDatabase( nullptr )
, mStmtNode( nullptr )
, mStmtNodeTags( nullptr )
, mStmtWay( nullptr )
, mStmtWayNode( nullptr )
, mStmtWayNodePoints( nullptr )
, mStmtWayTags( nullptr )
{
}
@ -39,14 +39,14 @@ QgsOSMDatabase::~QgsOSMDatabase()
bool QgsOSMDatabase::isOpen() const
{
return mDatabase != 0;
return mDatabase != nullptr;
}
bool QgsOSMDatabase::open()
{
// open database
int res = QgsSLConnect::sqlite3_open_v2( mDbFileName.toUtf8().data(), &mDatabase, SQLITE_OPEN_READWRITE, 0 );
int res = QgsSLConnect::sqlite3_open_v2( mDbFileName.toUtf8().data(), &mDatabase, SQLITE_OPEN_READWRITE, nullptr );
if ( res != SQLITE_OK )
{
mError = QString( "Failed to open database [%1]: %2" ).arg( res ).arg( mDbFileName );
@ -69,7 +69,7 @@ void QgsOSMDatabase::deleteStatement( sqlite3_stmt*& stmt )
if ( stmt )
{
sqlite3_finalize( stmt );
stmt = 0;
stmt = nullptr;
}
}
@ -83,7 +83,7 @@ bool QgsOSMDatabase::close()
deleteStatement( mStmtWayNodePoints );
deleteStatement( mStmtWayTags );
Q_ASSERT( mStmtNode == 0 );
Q_ASSERT( mStmtNode == nullptr );
// close database
if ( QgsSLConnect::sqlite3_close( mDatabase ) != SQLITE_OK )
@ -91,7 +91,7 @@ bool QgsOSMDatabase::close()
//mError = ( char * ) "Closing SQLite3 database failed.";
//return false;
}
mDatabase = 0;
mDatabase = nullptr;
return true;
}
@ -99,7 +99,7 @@ bool QgsOSMDatabase::close()
int QgsOSMDatabase::runCountStatement( const char* sql ) const
{
sqlite3_stmt* stmt;
int res = sqlite3_prepare_v2( mDatabase, sql, -1, &stmt, 0 );
int res = sqlite3_prepare_v2( mDatabase, sql, -1, &stmt, nullptr );
if ( res != SQLITE_OK )
return -1;
@ -183,7 +183,7 @@ QList<QgsOSMTagCountPair> QgsOSMDatabase::usedTags( bool ways ) const
QString sql = QString( "SELECT k, count(k) FROM %1_tags GROUP BY k" ).arg( ways ? "ways" : "nodes" );
sqlite3_stmt* stmt;
if ( sqlite3_prepare_v2( mDatabase, sql.toUtf8().data(), -1, &stmt, 0 ) != SQLITE_OK )
if ( sqlite3_prepare_v2( mDatabase, sql.toUtf8().data(), -1, &stmt, nullptr ) != SQLITE_OK )
return pairs;
while ( sqlite3_step( stmt ) == SQLITE_ROW )
@ -278,7 +278,7 @@ bool QgsOSMDatabase::prepareStatements()
for ( int i = 0; i < count; ++i )
{
if ( sqlite3_prepare_v2( mDatabase, sql[i], -1, sqlite[i], 0 ) != SQLITE_OK )
if ( sqlite3_prepare_v2( mDatabase, sql[i], -1, sqlite[i], nullptr ) != SQLITE_OK )
{
const char* errMsg = sqlite3_errmsg( mDatabase ); // does not require free
mError = QString( "Error preparing SQL command:\n%1\nSQL:\n%2" )
@ -309,7 +309,7 @@ bool QgsOSMDatabase::exportSpatiaLite( ExportType type, const QString& tableName
// import data
int retX = sqlite3_exec( mDatabase, "BEGIN", NULL, NULL, 0 );
int retX = sqlite3_exec( mDatabase, "BEGIN", nullptr, nullptr, nullptr );
Q_ASSERT( retX == SQLITE_OK );
Q_UNUSED( retX );
@ -320,7 +320,7 @@ bool QgsOSMDatabase::exportSpatiaLite( ExportType type, const QString& tableName
else
Q_ASSERT( false && "Unknown export type" );
int retY = sqlite3_exec( mDatabase, "COMMIT", NULL, NULL, 0 );
int retY = sqlite3_exec( mDatabase, "COMMIT", nullptr, nullptr, nullptr );
Q_ASSERT( retY == SQLITE_OK );
Q_UNUSED( retY );
@ -338,8 +338,8 @@ bool QgsOSMDatabase::createSpatialTable( const QString& tableName, const QString
sqlCreateTable += QString( ", %1 TEXT" ).arg( quotedIdentifier( tagKeys[i] ) );
sqlCreateTable += ')';
char *errMsg = NULL;
int ret = sqlite3_exec( mDatabase, sqlCreateTable.toUtf8().constData(), NULL, NULL, &errMsg );
char *errMsg = nullptr;
int ret = sqlite3_exec( mDatabase, sqlCreateTable.toUtf8().constData(), nullptr, nullptr, &errMsg );
if ( ret != SQLITE_OK )
{
mError = "Unable to create table:\n" + QString::fromUtf8( errMsg );
@ -350,7 +350,7 @@ bool QgsOSMDatabase::createSpatialTable( const QString& tableName, const QString
QString sqlAddGeomColumn = QString( "SELECT AddGeometryColumn(%1, 'geometry', 4326, %2, 'XY')" )
.arg( quotedValue( tableName ),
quotedValue( geometryType ) );
ret = sqlite3_exec( mDatabase, sqlAddGeomColumn.toUtf8().constData(), NULL, NULL, &errMsg );
ret = sqlite3_exec( mDatabase, sqlAddGeomColumn.toUtf8().constData(), nullptr, nullptr, &errMsg );
if ( ret != SQLITE_OK )
{
mError = "Unable to add geometry column:\n" + QString::fromUtf8( errMsg );
@ -365,8 +365,8 @@ bool QgsOSMDatabase::createSpatialTable( const QString& tableName, const QString
bool QgsOSMDatabase::createSpatialIndex( const QString& tableName )
{
QString sqlSpatialIndex = QString( "SELECT CreateSpatialIndex(%1, 'geometry')" ).arg( quotedValue( tableName ) );
char *errMsg = NULL;
int ret = sqlite3_exec( mDatabase, sqlSpatialIndex.toUtf8().constData(), NULL, NULL, &errMsg );
char *errMsg = nullptr;
int ret = sqlite3_exec( mDatabase, sqlSpatialIndex.toUtf8().constData(), nullptr, nullptr, &errMsg );
if ( ret != SQLITE_OK )
{
mError = "Unable to create spatial index:\n" + QString::fromUtf8( errMsg );
@ -385,7 +385,7 @@ void QgsOSMDatabase::exportSpatiaLiteNodes( const QString& tableName, const QStr
sqlInsertPoint += QString( ",?" );
sqlInsertPoint += ", GeomFromWKB(?, 4326))";
sqlite3_stmt* stmtInsert;
if ( sqlite3_prepare_v2( mDatabase, sqlInsertPoint.toUtf8().constData(), -1, &stmtInsert, 0 ) != SQLITE_OK )
if ( sqlite3_prepare_v2( mDatabase, sqlInsertPoint.toUtf8().constData(), -1, &stmtInsert, nullptr ) != SQLITE_OK )
{
mError = "Prepare SELECT FROM nodes failed.";
return;
@ -453,7 +453,7 @@ void QgsOSMDatabase::exportSpatiaLiteWays( bool closed, const QString& tableName
sqlInsertLine += QString( ",?" );
sqlInsertLine += ", GeomFromWKB(?, 4326))";
sqlite3_stmt* stmtInsert;
if ( sqlite3_prepare_v2( mDatabase, sqlInsertLine.toUtf8().constData(), -1, &stmtInsert, 0 ) != SQLITE_OK )
if ( sqlite3_prepare_v2( mDatabase, sqlInsertLine.toUtf8().constData(), -1, &stmtInsert, nullptr ) != SQLITE_OK )
{
mError = "Prepare SELECT FROM ways failed.";
return;
@ -547,10 +547,10 @@ QString QgsOSMDatabase::quotedValue( QString value )
QgsOSMNodeIterator::QgsOSMNodeIterator( sqlite3* handle )
: mStmt( 0 )
: mStmt( nullptr )
{
const char* sql = "SELECT id,lon,lat FROM nodes";
if ( sqlite3_prepare_v2( handle, sql, -1, &mStmt, 0 ) != SQLITE_OK )
if ( sqlite3_prepare_v2( handle, sql, -1, &mStmt, nullptr ) != SQLITE_OK )
{
qDebug( "OSMNodeIterator: error prepare" );
}
@ -585,7 +585,7 @@ void QgsOSMNodeIterator::close()
if ( mStmt )
{
sqlite3_finalize( mStmt );
mStmt = 0;
mStmt = nullptr;
}
}
@ -593,10 +593,10 @@ void QgsOSMNodeIterator::close()
QgsOSMWayIterator::QgsOSMWayIterator( sqlite3* handle )
: mStmt( 0 )
: mStmt( nullptr )
{
const char* sql = "SELECT id FROM ways";
if ( sqlite3_prepare_v2( handle, sql, -1, &mStmt, 0 ) != SQLITE_OK )
if ( sqlite3_prepare_v2( handle, sql, -1, &mStmt, nullptr ) != SQLITE_OK )
{
qDebug( "OSMWayIterator: error prepare" );
}
@ -629,6 +629,6 @@ void QgsOSMWayIterator::close()
if ( mStmt )
{
sqlite3_finalize( mStmt );
mStmt = 0;
mStmt = nullptr;
}
}

View File

@ -22,7 +22,7 @@ QString QgsOSMDownload::queryFromRect( const QgsRectangle& rect )
QgsOSMDownload::QgsOSMDownload()
: mServiceUrl( defaultServiceUrl() ), mReply( 0 )
: mServiceUrl( defaultServiceUrl() ), mReply( nullptr )
{
}
@ -32,7 +32,7 @@ QgsOSMDownload::~QgsOSMDownload()
{
mReply->abort();
mReply->deleteLater();
mReply = 0;
mReply = nullptr;
}
}
@ -103,7 +103,7 @@ void QgsOSMDownload::onFinished()
Q_ASSERT( mReply );
mReply->deleteLater();
mReply = 0;
mReply = nullptr;
mFile.close();

View File

@ -23,12 +23,12 @@
QgsOSMXmlImport::QgsOSMXmlImport( const QString& xmlFilename, const QString& dbFilename )
: mXmlFileName( xmlFilename )
, mDbFileName( dbFilename )
, mDatabase( 0 )
, mStmtInsertNode( 0 )
, mStmtInsertNodeTag( 0 )
, mStmtInsertWay( 0 )
, mStmtInsertWayNode( 0 )
, mStmtInsertWayTag( 0 )
, mDatabase( nullptr )
, mStmtInsertNode( nullptr )
, mStmtInsertNodeTag( nullptr )
, mStmtInsertWay( nullptr )
, mStmtInsertWayNode( nullptr )
, mStmtInsertWayTag( nullptr )
{
}
@ -64,7 +64,7 @@ bool QgsOSMXmlImport::import()
qDebug( "starting import" );
int retX = sqlite3_exec( mDatabase, "BEGIN", NULL, NULL, 0 );
int retX = sqlite3_exec( mDatabase, "BEGIN", nullptr, nullptr, nullptr );
Q_ASSERT( retX == SQLITE_OK );
Q_UNUSED( retX );
@ -88,7 +88,7 @@ bool QgsOSMXmlImport::import()
}
}
int retY = sqlite3_exec( mDatabase, "COMMIT", NULL, NULL, 0 );
int retY = sqlite3_exec( mDatabase, "COMMIT", nullptr, nullptr, nullptr );
Q_ASSERT( retY == SQLITE_OK );
Q_UNUSED( retY );
@ -117,7 +117,7 @@ bool QgsOSMXmlImport::createIndexes()
int count = sizeof( sqlIndexes ) / sizeof( const char* );
for ( int i = 0; i < count; ++i )
{
int ret = sqlite3_exec( mDatabase, sqlIndexes[i], 0, 0, 0 );
int ret = sqlite3_exec( mDatabase, sqlIndexes[i], nullptr, nullptr, nullptr );
if ( ret != SQLITE_OK )
{
mError = "Error creating indexes!";
@ -133,11 +133,11 @@ bool QgsOSMXmlImport::createDatabase()
{
char **results;
int rows, columns;
if ( QgsSLConnect::sqlite3_open_v2( mDbFileName.toUtf8().data(), &mDatabase, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0 ) != SQLITE_OK )
if ( QgsSLConnect::sqlite3_open_v2( mDbFileName.toUtf8().data(), &mDatabase, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, nullptr ) != SQLITE_OK )
return false;
bool above41 = false;
int ret = sqlite3_get_table( mDatabase, "select spatialite_version()", &results, &rows, &columns, NULL );
int ret = sqlite3_get_table( mDatabase, "select spatialite_version()", &results, &rows, &columns, nullptr );
if ( ret == SQLITE_OK && rows == 1 && columns == 1 )
{
QString version = QString::fromUtf8( results[1] );
@ -166,7 +166,7 @@ bool QgsOSMXmlImport::createDatabase()
for ( int i = 0; i < initCount; ++i )
{
char* errMsg;
if ( sqlite3_exec( mDatabase, sqlInitStatements[i], 0, 0, &errMsg ) != SQLITE_OK )
if ( sqlite3_exec( mDatabase, sqlInitStatements[i], nullptr, nullptr, &errMsg ) != SQLITE_OK )
{
mError = QString( "Error executing SQL command:\n%1\nSQL:\n%2" )
.arg( QString::fromUtf8( errMsg ), QString::fromUtf8( sqlInitStatements[i] ) );
@ -197,7 +197,7 @@ bool QgsOSMXmlImport::createDatabase()
for ( int i = 0; i < insertCount; ++i )
{
if ( sqlite3_prepare_v2( mDatabase, sqlInsertStatements[i], -1, sqliteInsertStatements[i], 0 ) != SQLITE_OK )
if ( sqlite3_prepare_v2( mDatabase, sqlInsertStatements[i], -1, sqliteInsertStatements[i], nullptr ) != SQLITE_OK )
{
const char* errMsg = sqlite3_errmsg( mDatabase ); // does not require free
mError = QString( "Error preparing SQL command:\n%1\nSQL:\n%2" )
@ -216,7 +216,7 @@ void QgsOSMXmlImport::deleteStatement( sqlite3_stmt*& stmt )
if ( stmt )
{
sqlite3_finalize( stmt );
stmt = 0;
stmt = nullptr;
}
}
@ -232,10 +232,10 @@ bool QgsOSMXmlImport::closeDatabase()
deleteStatement( mStmtInsertWayNode );
deleteStatement( mStmtInsertWayTag );
Q_ASSERT( mStmtInsertNode == 0 );
Q_ASSERT( mStmtInsertNode == nullptr );
QgsSLConnect::sqlite3_close( mDatabase );
mDatabase = 0;
mDatabase = nullptr;
return true;
}

View File

@ -117,7 +117,7 @@ static CPLErr rescalePostWarpChunkProcessor( void* pKern, void* pArg )
QgsAlignRaster::QgsAlignRaster()
: mProgressHandler( 0 )
: mProgressHandler( nullptr )
{
// parameters
mCellSizeX = mCellSizeY = 0;
@ -267,7 +267,7 @@ bool QgsAlignRaster::checkInputParameters()
QSizeF cs;
QgsRectangle extent;
if ( !suggestedWarpOutput( info, mCrsWkt, &cs, 0, &extent ) )
if ( !suggestedWarpOutput( info, mCrsWkt, &cs, nullptr, &extent ) )
{
mErrorMessage = QString( "Failed to get suggested warp output.\n\n"
"File:\n%1\n\n"
@ -444,7 +444,7 @@ bool QgsAlignRaster::createAndWarp( const Item& raster )
// Create the output file.
GDALDatasetH hDstDS;
hDstDS = GDALCreate( hDriver, raster.outputFilename.toLocal8Bit().constData(), mXSize, mYSize,
bandCount, eDT, NULL );
bandCount, eDT, nullptr );
if ( !hDstDS )
{
GDALClose( hSrcDS );
@ -458,7 +458,7 @@ bool QgsAlignRaster::createAndWarp( const Item& raster )
// Copy the color table, if required.
GDALColorTableH hCT = GDALGetRasterColorTable( GDALGetRasterBand( hSrcDS, 1 ) );
if ( hCT != NULL )
if ( hCT != nullptr )
GDALSetRasterColorTable( GDALGetRasterBand( hDstDS, 1 ), hCT );
// -----------------------------------------------------------------------
@ -522,7 +522,7 @@ bool QgsAlignRaster::suggestedWarpOutput( const QgsAlignRaster::RasterInfo& info
// to destination georeferenced coordinates (not destination
// pixel line). We do that by omitting the destination dataset
// handle (setting it to NULL).
void* hTransformArg = GDALCreateGenImgProjTransformer( info.mDataset, info.mCrsWkt.toAscii().constData(), NULL, destWkt.toAscii().constData(), FALSE, 0, 1 );
void* hTransformArg = GDALCreateGenImgProjTransformer( info.mDataset, info.mCrsWkt.toAscii().constData(), nullptr, destWkt.toAscii().constData(), FALSE, 0, 1 );
if ( !hTransformArg )
return false;

View File

@ -49,7 +49,7 @@ class ANALYSIS_EXPORT QgsAlignRaster
~RasterInfo();
//! Check whether the given path is a valid raster
bool isValid() const { return mDataset != 0; }
bool isValid() const { return mDataset != nullptr; }
//! Return CRS in WKT format
QString crs() const { return mCrsWkt; }
@ -218,7 +218,7 @@ class ANALYSIS_EXPORT QgsAlignRaster
bool createAndWarp( const Item& raster );
//! Determine suggested output of raster warp to a different CRS. Returns true on success
static bool suggestedWarpOutput( const RasterInfo& info, const QString& destWkt, QSizeF* cellSize = 0, QPointF* gridOffset = 0, QgsRectangle* rect = 0 );
static bool suggestedWarpOutput( const RasterInfo& info, const QString& destWkt, QSizeF* cellSize = nullptr, QPointF* gridOffset = nullptr, QgsRectangle* rect = nullptr );
protected:

View File

@ -60,36 +60,36 @@ int QgsNineCellFilter::processRaster( QProgressDialog* p )
//open input file
int xSize, ySize;
GDALDatasetH inputDataset = openInputFile( xSize, ySize );
if ( inputDataset == NULL )
if ( inputDataset == nullptr )
{
return 1; //opening of input file failed
}
//output driver
GDALDriverH outputDriver = openOutputDriver();
if ( outputDriver == 0 )
if ( outputDriver == nullptr )
{
return 2;
}
GDALDatasetH outputDataset = openOutputFile( inputDataset, outputDriver );
if ( outputDataset == NULL )
if ( outputDataset == nullptr )
{
return 3; //create operation on output file failed
}
//open first raster band for reading (operation is only for single band raster)
GDALRasterBandH rasterBand = GDALGetRasterBand( inputDataset, 1 );
if ( rasterBand == NULL )
if ( rasterBand == nullptr )
{
GDALClose( inputDataset );
GDALClose( outputDataset );
return 4;
}
mInputNodataValue = GDALGetRasterNoDataValue( rasterBand, NULL );
mInputNodataValue = GDALGetRasterNoDataValue( rasterBand, nullptr );
GDALRasterBandH outputRasterBand = GDALGetRasterBand( outputDataset, 1 );
if ( outputRasterBand == NULL )
if ( outputRasterBand == nullptr )
{
GDALClose( inputDataset );
GDALClose( outputDataset );
@ -97,7 +97,7 @@ int QgsNineCellFilter::processRaster( QProgressDialog* p )
}
//try to set -9999 as nodata value
GDALSetRasterNoDataValue( outputRasterBand, -9999 );
mOutputNodataValue = GDALGetRasterNoDataValue( outputRasterBand, NULL );
mOutputNodataValue = GDALGetRasterNoDataValue( outputRasterBand, nullptr );
if ( ySize < 3 ) //we require at least three rows (should be true for most datasets)
{
@ -209,7 +209,7 @@ int QgsNineCellFilter::processRaster( QProgressDialog* p )
GDALDatasetH QgsNineCellFilter::openInputFile( int& nCellsX, int& nCellsY )
{
GDALDatasetH inputDataset = GDALOpen( TO8F( mInputFile ), GA_ReadOnly );
if ( inputDataset != NULL )
if ( inputDataset != nullptr )
{
nCellsX = GDALGetRasterXSize( inputDataset );
nCellsY = GDALGetRasterYSize( inputDataset );
@ -218,7 +218,7 @@ GDALDatasetH QgsNineCellFilter::openInputFile( int& nCellsX, int& nCellsY )
if ( GDALGetRasterCount( inputDataset ) < 1 )
{
GDALClose( inputDataset );
return NULL;
return nullptr;
}
}
return inputDataset;
@ -231,15 +231,15 @@ GDALDriverH QgsNineCellFilter::openOutputDriver()
//open driver
GDALDriverH outputDriver = GDALGetDriverByName( mOutputFormat.toLocal8Bit().data() );
if ( outputDriver == NULL )
if ( outputDriver == nullptr )
{
return outputDriver; //return NULL, driver does not exist
}
driverMetadata = GDALGetMetadata( outputDriver, NULL );
driverMetadata = GDALGetMetadata( outputDriver, nullptr );
if ( !CSLFetchBoolean( driverMetadata, GDAL_DCAP_CREATE, false ) )
{
return NULL; //driver exist, but it does not support the create operation
return nullptr; //driver exist, but it does not support the create operation
}
return outputDriver;
@ -247,18 +247,18 @@ GDALDriverH QgsNineCellFilter::openOutputDriver()
GDALDatasetH QgsNineCellFilter::openOutputFile( GDALDatasetH inputDataset, GDALDriverH outputDriver )
{
if ( inputDataset == NULL )
if ( inputDataset == nullptr )
{
return NULL;
return nullptr;
}
int xSize = GDALGetRasterXSize( inputDataset );
int ySize = GDALGetRasterYSize( inputDataset );
//open output file
char **papszOptions = NULL;
char **papszOptions = nullptr;
GDALDatasetH outputDataset = GDALCreate( outputDriver, TO8F( mOutputFile ), xSize, ySize, 1, GDT_Float32, papszOptions );
if ( outputDataset == NULL )
if ( outputDataset == nullptr )
{
return outputDataset;
}
@ -268,7 +268,7 @@ GDALDatasetH QgsNineCellFilter::openOutputFile( GDALDatasetH inputDataset, GDALD
if ( GDALGetGeoTransform( inputDataset, geotransform ) != CE_None )
{
GDALClose( outputDataset );
return NULL;
return nullptr;
}
GDALSetGeoTransform( outputDataset, geotransform );

View File

@ -18,28 +18,28 @@
QgsRasterCalcNode::QgsRasterCalcNode()
: mType( tNumber )
, mLeft( 0 )
, mRight( 0 )
, mLeft( nullptr )
, mRight( nullptr )
, mNumber( 0 )
, mMatrix( 0 )
, mMatrix( nullptr )
, mOperator( opNONE )
{
}
QgsRasterCalcNode::QgsRasterCalcNode( double number )
: mType( tNumber )
, mLeft( 0 )
, mRight( 0 )
, mLeft( nullptr )
, mRight( nullptr )
, mNumber( number )
, mMatrix( 0 )
, mMatrix( nullptr )
, mOperator( opNONE )
{
}
QgsRasterCalcNode::QgsRasterCalcNode( QgsRasterMatrix* matrix )
: mType( tMatrix )
, mLeft( 0 )
, mRight( 0 )
, mLeft( nullptr )
, mRight( nullptr )
, mNumber( 0 )
, mMatrix( matrix )
, mOperator( opNONE )
@ -52,18 +52,18 @@ QgsRasterCalcNode::QgsRasterCalcNode( Operator op, QgsRasterCalcNode* left, QgsR
, mLeft( left )
, mRight( right )
, mNumber( 0 )
, mMatrix( 0 )
, mMatrix( nullptr )
, mOperator( op )
{
}
QgsRasterCalcNode::QgsRasterCalcNode( const QString& rasterName )
: mType( tRasterRef )
, mLeft( 0 )
, mRight( 0 )
, mLeft( nullptr )
, mRight( nullptr )
, mNumber( 0 )
, mRasterName( rasterName )
, mMatrix( 0 )
, mMatrix( nullptr )
, mOperator( opNONE )
{
if ( mRasterName.startsWith( '"' ) && mRasterName.endsWith( '"' ) )

View File

@ -86,7 +86,7 @@ int QgsRasterCalculator::processCalculation( QProgressDialog* p )
return 2;
}
QgsRasterBlock* block = 0;
QgsRasterBlock* block = nullptr;
// if crs transform needed
if ( it->raster->crs() != mOutputCrs )
{
@ -106,7 +106,7 @@ int QgsRasterCalculator::processCalculation( QProgressDialog* p )
//open output dataset for writing
GDALDriverH outputDriver = openOutputDriver();
if ( outputDriver == NULL )
if ( outputDriver == nullptr )
{
return 1;
}
@ -194,15 +194,15 @@ GDALDriverH QgsRasterCalculator::openOutputDriver()
//open driver
GDALDriverH outputDriver = GDALGetDriverByName( mOutputFormat.toLocal8Bit().data() );
if ( outputDriver == NULL )
if ( outputDriver == nullptr )
{
return outputDriver; //return NULL, driver does not exist
}
driverMetadata = GDALGetMetadata( outputDriver, NULL );
driverMetadata = GDALGetMetadata( outputDriver, nullptr );
if ( !CSLFetchBoolean( driverMetadata, GDAL_DCAP_CREATE, false ) )
{
return NULL; //driver exist, but it does not support the create operation
return nullptr; //driver exist, but it does not support the create operation
}
return outputDriver;
@ -211,9 +211,9 @@ GDALDriverH QgsRasterCalculator::openOutputDriver()
GDALDatasetH QgsRasterCalculator::openOutputFile( GDALDriverH outputDriver )
{
//open output file
char **papszOptions = NULL;
char **papszOptions = nullptr;
GDALDatasetH outputDataset = GDALCreate( outputDriver, TO8F( mOutputFile ), mNumOutputColumns, mNumOutputRows, 1, GDT_Float32, papszOptions );
if ( outputDataset == NULL )
if ( outputDataset == nullptr )
{
return outputDataset;
}

View File

@ -72,7 +72,7 @@ class ANALYSIS_EXPORT QgsRasterCalculator
/** Starts the calculation and writes new raster
@param p progress bar (or 0 if called from non-gui code)
@return 0 in case of success*/
int processCalculation( QProgressDialog* p = 0 );
int processCalculation( QProgressDialog* p = nullptr );
private:
//default constructor forbidden. We need formula, output file, output format and output raster resolution obligatory

View File

@ -22,7 +22,7 @@
QgsRasterMatrix::QgsRasterMatrix()
: mColumns( 0 )
, mRows( 0 )
, mData( 0 )
, mData( nullptr )
, mNodataValue( -1 )
{
}
@ -38,7 +38,7 @@ QgsRasterMatrix::QgsRasterMatrix( int nCols, int nRows, double* data, double nod
QgsRasterMatrix::QgsRasterMatrix( const QgsRasterMatrix& m )
: mColumns( 0 )
, mRows( 0 )
, mData( 0 )
, mData( nullptr )
{
operator=( m );
}
@ -72,7 +72,7 @@ void QgsRasterMatrix::setData( int cols, int rows, double* data, double nodataVa
double* QgsRasterMatrix::takeData()
{
double* data = mData;
mData = 0; mColumns = 0; mRows = 0;
mData = nullptr; mColumns = 0; mRows = 0;
return data;
}

View File

@ -88,20 +88,20 @@ int QgsRelief::processRaster( QProgressDialog* p )
//open input file
int xSize, ySize;
GDALDatasetH inputDataset = openInputFile( xSize, ySize );
if ( inputDataset == NULL )
if ( inputDataset == nullptr )
{
return 1; //opening of input file failed
}
//output driver
GDALDriverH outputDriver = openOutputDriver();
if ( outputDriver == 0 )
if ( outputDriver == nullptr )
{
return 2;
}
GDALDatasetH outputDataset = openOutputFile( inputDataset, outputDriver );
if ( outputDataset == NULL )
if ( outputDataset == nullptr )
{
return 3; //create operation on output file failed
}
@ -125,13 +125,13 @@ int QgsRelief::processRaster( QProgressDialog* p )
//open first raster band for reading (operation is only for single band raster)
GDALRasterBandH rasterBand = GDALGetRasterBand( inputDataset, 1 );
if ( rasterBand == NULL )
if ( rasterBand == nullptr )
{
GDALClose( inputDataset );
GDALClose( outputDataset );
return 4;
}
mInputNodataValue = GDALGetRasterNoDataValue( rasterBand, NULL );
mInputNodataValue = GDALGetRasterNoDataValue( rasterBand, nullptr );
mSlopeFilter->setInputNodataValue( mInputNodataValue );
mAspectFilter->setInputNodataValue( mInputNodataValue );
mHillshadeFilter285->setInputNodataValue( mInputNodataValue );
@ -142,7 +142,7 @@ int QgsRelief::processRaster( QProgressDialog* p )
GDALRasterBandH outputGreenBand = GDALGetRasterBand( outputDataset, 2 );
GDALRasterBandH outputBlueBand = GDALGetRasterBand( outputDataset, 3 );
if ( outputRedBand == NULL || outputGreenBand == NULL || outputBlueBand == NULL )
if ( outputRedBand == nullptr || outputGreenBand == nullptr || outputBlueBand == nullptr )
{
GDALClose( inputDataset );
GDALClose( outputDataset );
@ -152,7 +152,7 @@ int QgsRelief::processRaster( QProgressDialog* p )
GDALSetRasterNoDataValue( outputRedBand, -9999 );
GDALSetRasterNoDataValue( outputGreenBand, -9999 );
GDALSetRasterNoDataValue( outputBlueBand, -9999 );
mOutputNodataValue = GDALGetRasterNoDataValue( outputRedBand, NULL );
mOutputNodataValue = GDALGetRasterNoDataValue( outputRedBand, nullptr );
mSlopeFilter->setOutputNodataValue( mOutputNodataValue );
mAspectFilter->setOutputNodataValue( mOutputNodataValue );
mHillshadeFilter285->setOutputNodataValue( mOutputNodataValue );
@ -398,7 +398,7 @@ bool QgsRelief::setElevationColor( double elevation, int* red, int* green, int*
GDALDatasetH QgsRelief::openInputFile( int& nCellsX, int& nCellsY )
{
GDALDatasetH inputDataset = GDALOpen( TO8F( mInputFile ), GA_ReadOnly );
if ( inputDataset != NULL )
if ( inputDataset != nullptr )
{
nCellsX = GDALGetRasterXSize( inputDataset );
nCellsY = GDALGetRasterYSize( inputDataset );
@ -407,7 +407,7 @@ GDALDatasetH QgsRelief::openInputFile( int& nCellsX, int& nCellsY )
if ( GDALGetRasterCount( inputDataset ) < 1 )
{
GDALClose( inputDataset );
return NULL;
return nullptr;
}
}
return inputDataset;
@ -420,15 +420,15 @@ GDALDriverH QgsRelief::openOutputDriver()
//open driver
GDALDriverH outputDriver = GDALGetDriverByName( mOutputFormat.toLocal8Bit().data() );
if ( outputDriver == NULL )
if ( outputDriver == nullptr )
{
return outputDriver; //return NULL, driver does not exist
}
driverMetadata = GDALGetMetadata( outputDriver, NULL );
driverMetadata = GDALGetMetadata( outputDriver, nullptr );
if ( !CSLFetchBoolean( driverMetadata, GDAL_DCAP_CREATE, false ) )
{
return NULL; //driver exist, but it does not support the create operation
return nullptr; //driver exist, but it does not support the create operation
}
return outputDriver;
@ -436,23 +436,23 @@ GDALDriverH QgsRelief::openOutputDriver()
GDALDatasetH QgsRelief::openOutputFile( GDALDatasetH inputDataset, GDALDriverH outputDriver )
{
if ( inputDataset == NULL )
if ( inputDataset == nullptr )
{
return NULL;
return nullptr;
}
int xSize = GDALGetRasterXSize( inputDataset );
int ySize = GDALGetRasterYSize( inputDataset );
//open output file
char **papszOptions = NULL;
char **papszOptions = nullptr;
//use PACKBITS compression for tiffs by default
papszOptions = CSLSetNameValue( papszOptions, "COMPRESS", "PACKBITS" );
//create three band raster (reg, green, blue)
GDALDatasetH outputDataset = GDALCreate( outputDriver, TO8F( mOutputFile ), xSize, ySize, 3, GDT_Byte, papszOptions );
if ( outputDataset == NULL )
if ( outputDataset == nullptr )
{
return outputDataset;
}
@ -462,7 +462,7 @@ GDALDatasetH QgsRelief::openOutputFile( GDALDatasetH inputDataset, GDALDriverH o
if ( GDALGetGeoTransform( inputDataset, geotransform ) != CE_None )
{
GDALClose( outputDataset );
return NULL;
return nullptr;
}
GDALSetGeoTransform( outputDataset, geotransform );
@ -489,14 +489,14 @@ bool QgsRelief::exportFrequencyDistributionToCsv( const QString& file )
{
int nCellsX, nCellsY;
GDALDatasetH inputDataset = openInputFile( nCellsX, nCellsY );
if ( inputDataset == NULL )
if ( inputDataset == nullptr )
{
return false;
}
//open first raster band for reading (elevation raster is always single band)
GDALRasterBandH elevationBand = GDALGetRasterBand( inputDataset, 1 );
if ( elevationBand == NULL )
if ( elevationBand == nullptr )
{
GDALClose( inputDataset );
return false;
@ -572,14 +572,14 @@ QList< QgsRelief::ReliefColor > QgsRelief::calculateOptimizedReliefClasses()
int nCellsX, nCellsY;
GDALDatasetH inputDataset = openInputFile( nCellsX, nCellsY );
if ( inputDataset == NULL )
if ( inputDataset == nullptr )
{
return resultList;
}
//open first raster band for reading (elevation raster is always single band)
GDALRasterBandH elevationBand = GDALGetRasterBand( inputDataset, 1 );
if ( elevationBand == NULL )
if ( elevationBand == nullptr )
{
GDALClose( inputDataset );
return resultList;

View File

@ -128,7 +128,7 @@ void QgsGeometryAnalyzer::simplifyFeature( QgsFeature& f, QgsVectorFileWriter* v
}
const QgsGeometry* featureGeometry = f.constGeometry();
QgsGeometry* tmpGeometry = 0;
QgsGeometry* tmpGeometry = nullptr;
// simplify feature
tmpGeometry = featureGeometry->simplify( tolerance );
@ -245,7 +245,7 @@ void QgsGeometryAnalyzer::centroidFeature( QgsFeature& f, QgsVectorFileWriter* v
}
const QgsGeometry* featureGeometry = f.constGeometry();
QgsGeometry* tmpGeometry = 0;
QgsGeometry* tmpGeometry = nullptr;
tmpGeometry = featureGeometry->centroid();
@ -391,7 +391,7 @@ bool QgsGeometryAnalyzer::convexHull( QgsVectorLayer* layer, const QString& shap
QgsVectorFileWriter vWriter( shapefileName, dp->encoding(), fields, outputType, &crs );
QgsFeature currentFeature;
QgsGeometry* dissolveGeometry = 0; //dissolve geometry
QgsGeometry* dissolveGeometry = nullptr; //dissolve geometry
QMultiMap<QString, QgsFeatureId> map;
if ( onlySelectedFeatures )
@ -552,8 +552,8 @@ void QgsGeometryAnalyzer::convexFeature( QgsFeature& f, int nProcessedFeatures,
}
const QgsGeometry* featureGeometry = f.constGeometry();
QgsGeometry* tmpGeometry = 0;
QgsGeometry* convexGeometry = 0;
QgsGeometry* tmpGeometry = nullptr;
QgsGeometry* convexGeometry = nullptr;
convexGeometry = featureGeometry->convexHull();
@ -622,7 +622,7 @@ bool QgsGeometryAnalyzer::dissolve( QgsVectorLayer* layer, const QString& shapef
}
}
QgsGeometry *dissolveGeometry = 0; //dissolve geometry
QgsGeometry *dissolveGeometry = nullptr; //dissolve geometry
QMultiMap<QString, QgsFeatureId>::const_iterator jt = map.constBegin();
QgsFeature outputFeature;
while ( jt != map.constEnd() )
@ -750,7 +750,7 @@ bool QgsGeometryAnalyzer::buffer( QgsVectorLayer* layer, const QString& shapefil
QgsVectorFileWriter vWriter( shapefileName, dp->encoding(), layer->fields(), outputType, &crs );
QgsFeature currentFeature;
QgsGeometry *dissolveGeometry = 0; //dissolve geometry (if dissolve enabled)
QgsGeometry *dissolveGeometry = nullptr; //dissolve geometry (if dissolve enabled)
//take only selection
if ( onlySelectedFeatures )
@ -843,8 +843,8 @@ void QgsGeometryAnalyzer::bufferFeature( QgsFeature& f, int nProcessedFeatures,
double currentBufferDistance;
const QgsGeometry* featureGeometry = f.constGeometry();
QgsGeometry* tmpGeometry = 0;
QgsGeometry* bufferGeometry = 0;
QgsGeometry* tmpGeometry = nullptr;
QgsGeometry* bufferGeometry = nullptr;
//create buffer
if ( bufferDistanceField == -1 )
@ -904,7 +904,7 @@ bool QgsGeometryAnalyzer::eventLayer( QgsVectorLayer* lineLayer, QgsVectorLayer*
}
//create output datasource or attributes in memory provider
QgsVectorFileWriter* fileWriter = 0;
QgsVectorFileWriter* fileWriter = nullptr;
QgsFeatureList memoryProviderFeatures;
if ( !memoryProvider )
{
@ -931,7 +931,7 @@ bool QgsGeometryAnalyzer::eventLayer( QgsVectorLayer* lineLayer, QgsVectorLayer*
//iterate over eventLayer and write new features to output file or layer
fit = eventLayer->getFeatures( QgsFeatureRequest().setFlags( QgsFeatureRequest::NoGeometry ) );
QgsGeometry* lrsGeom = 0;
QgsGeometry* lrsGeom = nullptr;
double measure1, measure2 = 0.0;
int nEventFeatures = eventLayer->featureCount();
@ -1128,7 +1128,7 @@ bool QgsGeometryAnalyzer::createOffsetGeometry( QgsGeometry* geom, QgsGeometry*
{
geomArray[i] = outputGeomList.at( i );
}
GEOSGeometry* collection = 0;
GEOSGeometry* collection = nullptr;
if ( geom->type() == QGis::Point )
{
collection = GEOSGeom_createCollection_r( geosctxt, GEOS_MULTIPOINT, geomArray, outputGeomList.size() );
@ -1172,7 +1172,7 @@ QgsGeometry* QgsGeometryAnalyzer::locateBetweenMeasures( double fromMeasure, dou
{
if ( !lineGeom )
{
return 0;
return nullptr;
}
QgsMultiPolyline resultGeom;
@ -1187,7 +1187,7 @@ QgsGeometry* QgsGeometryAnalyzer::locateBetweenMeasures( double fromMeasure, dou
if ( wkbType != QGis::WKBLineString25D && wkbType != QGis::WKBMultiLineString25D )
{
return 0;
return nullptr;
}
if ( wkbType == QGis::WKBLineString25D )
@ -1207,7 +1207,7 @@ QgsGeometry* QgsGeometryAnalyzer::locateBetweenMeasures( double fromMeasure, dou
if ( resultGeom.size() < 1 )
{
return 0;
return nullptr;
}
return QgsGeometry::fromMultiPolyline( resultGeom );
}
@ -1216,7 +1216,7 @@ QgsGeometry* QgsGeometryAnalyzer::locateAlongMeasure( double measure, const QgsG
{
if ( !lineGeom )
{
return 0;
return nullptr;
}
QgsMultiPoint resultGeom;
@ -1231,7 +1231,7 @@ QgsGeometry* QgsGeometryAnalyzer::locateAlongMeasure( double measure, const QgsG
if ( wkbType != QGis::WKBLineString25D && wkbType != QGis::WKBMultiLineString25D )
{
return 0;
return nullptr;
}
if ( wkbType == QGis::WKBLineString25D )
@ -1251,7 +1251,7 @@ QgsGeometry* QgsGeometryAnalyzer::locateAlongMeasure( double measure, const QgsG
if ( resultGeom.size() < 1 )
{
return 0;
return nullptr;
}
return QgsGeometry::fromMultiPoint( resultGeom );
}

View File

@ -45,7 +45,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
@param p progress dialog (or 0 if no progress dialog is to be shown)
*/
bool simplify( QgsVectorLayer* layer, const QString& shapefileName, double tolerance,
bool onlySelectedFeatures = false, QProgressDialog* p = 0 );
bool onlySelectedFeatures = false, QProgressDialog* p = nullptr );
/** Calculate the true centroids, or 'center of mass' for a vector layer and
write it to a new shape file
@ -55,7 +55,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
@param p progress dialog (or 0 if no progress dialog is to be shown)
*/
bool centroids( QgsVectorLayer* layer, const QString& shapefileName,
bool onlySelectedFeatures = false, QProgressDialog* p = 0 );
bool onlySelectedFeatures = false, QProgressDialog* p = nullptr );
/** Create a polygon based on the extent of all (selected) features and write it to a new shape file
@param layer input vector layer
@ -63,7 +63,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
@param onlySelectedFeatures if true, only selected features are considered, else all the features
@param p progress dialog (or 0 if no progress dialog is to be shown)
*/
bool extent( QgsVectorLayer* layer, const QString& shapefileName, bool onlySelectedFeatures = false, QProgressDialog* p = 0 );
bool extent( QgsVectorLayer* layer, const QString& shapefileName, bool onlySelectedFeatures = false, QProgressDialog* p = nullptr );
/** Create buffers for a vector layer and write it to a new shape file
@param layer input vector layer
@ -75,7 +75,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
@param p progress dialog (or 0 if no progress dialog is to be shown)
*/
bool buffer( QgsVectorLayer* layer, const QString& shapefileName, double bufferDistance,
bool onlySelectedFeatures = false, bool dissolve = false, int bufferDistanceField = -1, QProgressDialog* p = 0 );
bool onlySelectedFeatures = false, bool dissolve = false, int bufferDistanceField = -1, QProgressDialog* p = nullptr );
/** Create convex hull(s) of a vector layer and write it to a new shape file
@param layer input vector layer
@ -86,7 +86,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
@param p progress dialog (or 0 if no progress dialog is to be shown)
*/
bool convexHull( QgsVectorLayer* layer, const QString& shapefileName, bool onlySelectedFeatures = false,
int uniqueIdField = -1, QProgressDialog* p = 0 );
int uniqueIdField = -1, QProgressDialog* p = nullptr );
/** Dissolve a vector layer and write it to a new shape file
@param layer input vector layer
@ -97,7 +97,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
@param p progress dialog (or 0 if no progress dialog is to be shown)
*/
bool dissolve( QgsVectorLayer* layer, const QString& shapefileName, bool onlySelectedFeatures = false,
int uniqueIdField = -1, QProgressDialog* p = 0 );
int uniqueIdField = -1, QProgressDialog* p = nullptr );
/** Creates an event layer (multipoint or multiline) by locating features from a (non-spatial) event table along the features of a line layer.
Note that currently (until QgsGeometry supports m-values) the z-coordinate of the line layer is used for linear referencing
@ -118,7 +118,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
*/
bool eventLayer( QgsVectorLayer* lineLayer, QgsVectorLayer* eventLayer, int lineField, int eventField, QgsFeatureIds &unlocatedFeatureIds, const QString& outputLayer,
const QString& outputFormat, int locationField1, int locationField2 = -1, int offsetField = -1, double offsetScale = 1.0,
bool forceSingleGeometry = false, QgsVectorDataProvider* memoryProvider = 0, QProgressDialog* p = 0 );
bool forceSingleGeometry = false, QgsVectorDataProvider* memoryProvider = nullptr, QProgressDialog* p = nullptr );
/** Returns linear reference geometry as a multiline (or 0 if no match). Currently, the z-coordinates are considered to be the measures (no support for m-values in QGIS)*/
QgsGeometry* locateBetweenMeasures( double fromMeasure, double toMeasure, const QgsGeometry *lineGeom );

View File

@ -148,7 +148,7 @@ void QgsOverlayAnalyzer::intersectFeature( QgsFeature& f, QgsVectorFileWriter* v
}
const QgsGeometry* featureGeometry = f.constGeometry();
QgsGeometry* intersectGeometry = 0;
QgsGeometry* intersectGeometry = nullptr;
QgsFeature overlayFeature;
QList<QgsFeatureId> intersects;

View File

@ -46,7 +46,7 @@ class ANALYSIS_EXPORT QgsOverlayAnalyzer
*/
bool intersection( QgsVectorLayer* layerA, QgsVectorLayer* layerB,
const QString& shapefileName, bool onlySelectedFeatures = false,
QProgressDialog* p = 0 );
QProgressDialog* p = nullptr );
private:

View File

@ -13,7 +13,7 @@ QgsPointSample::QgsPointSample( QgsVectorLayer* inputLayer, const QString& outpu
}
QgsPointSample::QgsPointSample()
: mInputLayer( NULL )
: mInputLayer( nullptr )
, mNCreatedPoints( 0 )
{
}

View File

@ -23,8 +23,8 @@ QgsTransectSample::QgsTransectSample( QgsVectorLayer* strataLayer, const QString
}
QgsTransectSample::QgsTransectSample()
: mStrataLayer( NULL )
, mBaselineLayer( NULL )
: mStrataLayer( nullptr )
, mBaselineLayer( nullptr )
, mShareBaseline( false )
, mMinDistanceUnits( Meters )
, mMinTransectLength( 0.0 )
@ -330,7 +330,7 @@ QgsGeometry* QgsTransectSample::findBaselineGeometry( const QVariant& strataId )
{
if ( !mBaselineLayer )
{
return 0;
return nullptr;
}
QgsFeatureIterator baseLineIt = mBaselineLayer->getFeatures( QgsFeatureRequest().setSubsetOfAttributes( QStringList( mBaselineStrataId ), mBaselineLayer->fields() ) );
@ -345,7 +345,7 @@ QgsGeometry* QgsTransectSample::findBaselineGeometry( const QVariant& strataId )
Q_NOWARN_DEPRECATED_POP
}
}
return 0;
return nullptr;
}
bool QgsTransectSample::otherTransectWithinDistance( QgsGeometry* geom, double minDistLayerUnit, double minDistance, QgsSpatialIndex& sIndex,
@ -514,12 +514,12 @@ QgsGeometry* QgsTransectSample::closestMultilineElement( const QgsPoint& pt, Qgs
if ( !multiLine || ( multiLine->wkbType() != QGis::WKBMultiLineString
&& multiLine->wkbType() != QGis::WKBMultiLineString25D ) )
{
return 0;
return nullptr;
}
double minDist = DBL_MAX;
double currentDist = 0;
QgsGeometry* currentLine = 0;
QgsGeometry* currentLine = nullptr;
QScopedPointer<QgsGeometry> closestLine;
QgsGeometry* pointGeom = QgsGeometry::fromPoint( pt );
@ -548,7 +548,7 @@ QgsGeometry* QgsTransectSample::clipBufferLine( const QgsGeometry* stratumGeom,
{
if ( !stratumGeom || !clippedBaseline || clippedBaseline->wkbType() == QGis::WKBUnknown )
{
return 0;
return nullptr;
}
QgsGeometry* usedBaseline = clippedBaseline;
@ -558,7 +558,7 @@ QgsGeometry* QgsTransectSample::clipBufferLine( const QgsGeometry* stratumGeom,
usedBaseline = clippedBaseline->simplify( mBaselineSimplificationTolerance );
if ( !usedBaseline )
{
return 0;
return nullptr;
}
//int verticesAfter = usedBaseline->asMultiPolyline().count();
@ -582,8 +582,8 @@ QgsGeometry* QgsTransectSample::clipBufferLine( const QgsGeometry* stratumGeom,
}
//it is also possible that clipBaselineBuffer is a multipolygon
QgsGeometry* bufferLine = 0; //buffer line or multiline
QgsGeometry* bufferLineClipped = 0;
QgsGeometry* bufferLine = nullptr; //buffer line or multiline
QgsGeometry* bufferLineClipped = nullptr;
QgsMultiPolyline mpl;
if ( clipBaselineBuffer->isMultipart() )
{
@ -665,7 +665,7 @@ QgsGeometry* QgsTransectSample::clipBufferLine( const QgsGeometry* stratumGeom,
{
delete usedBaseline;
}
return 0; //no solution found even with reduced tolerances
return nullptr; //no solution found even with reduced tolerances
}
double QgsTransectSample::bufferDistance( double minDistanceFromAttribute ) const

View File

@ -44,7 +44,7 @@ QgsZonalStatistics::QgsZonalStatistics( QgsVectorLayer* polygonLayer, const QStr
QgsZonalStatistics::QgsZonalStatistics()
: mRasterBand( 0 )
, mPolygonLayer( 0 )
, mPolygonLayer( nullptr )
, mInputNodataValue( -1 )
, mStatistics( QgsZonalStatistics::All )
{
@ -72,7 +72,7 @@ int QgsZonalStatistics::calculateStatistics( QProgressDialog* p )
//open the raster layer and the raster band
GDALAllRegister();
GDALDatasetH inputDataset = GDALOpen( TO8F( mRasterFilePath ), GA_ReadOnly );
if ( inputDataset == NULL )
if ( inputDataset == nullptr )
{
return 3;
}
@ -84,12 +84,12 @@ int QgsZonalStatistics::calculateStatistics( QProgressDialog* p )
}
GDALRasterBandH rasterBand = GDALGetRasterBand( inputDataset, mRasterBand );
if ( rasterBand == NULL )
if ( rasterBand == nullptr )
{
GDALClose( inputDataset );
return 5;
}
mInputNodataValue = GDALGetRasterNoDataValue( rasterBand, NULL );
mInputNodataValue = GDALGetRasterNoDataValue( rasterBand, nullptr );
//get geometry info about raster layer
int nCellsXGDAL = GDALGetRasterXSize( inputDataset );
@ -431,8 +431,8 @@ void QgsZonalStatistics::statisticsFromMiddlePointTest( void* band, const QgsGeo
return;
}
GEOSCoordSequence* cellCenterCoords = 0;
GEOSGeometry* currentCellCenter = 0;
GEOSCoordSequence* cellCenterCoords = nullptr;
GEOSGeometry* currentCellCenter = nullptr;
for ( int i = 0; i < nCellsY; ++i )
{
@ -472,7 +472,7 @@ void QgsZonalStatistics::statisticsFromPreciseIntersection( void* band, const Qg
double currentY = rasterBBox.yMaximum() - pixelOffsetY * cellSizeY - cellSizeY / 2;
float* pixelData = ( float * ) CPLMalloc( sizeof( float ) );
QgsGeometry* pixelRectGeometry = 0;
QgsGeometry* pixelRectGeometry = nullptr;
double hCellSizeX = cellSizeX / 2.0;
double hCellSizeY = cellSizeY / 2.0;
@ -504,7 +504,7 @@ void QgsZonalStatistics::statisticsFromPreciseIntersection( void* band, const Qg
delete intersectGeometry;
}
delete pixelRectGeometry;
pixelRectGeometry = 0;
pixelRectGeometry = nullptr;
}
currentX += cellSizeX;
}

View File

@ -95,7 +95,7 @@ void QgsAtlasCompositionWidget::changeCoverageLayer( QgsMapLayer *layer )
if ( !vl )
{
atlasMap->setCoverageLayer( 0 );
atlasMap->setCoverageLayer( nullptr );
}
else
{
@ -227,7 +227,7 @@ void QgsAtlasCompositionWidget::updateAtlasFeatures()
bool updated = atlasMap->updateFeatures();
if ( !updated )
{
QMessageBox::warning( 0, tr( "Atlas preview" ),
QMessageBox::warning( nullptr, tr( "Atlas preview" ),
tr( "No matching atlas features found!" ),
QMessageBox::Ok,
QMessageBox::Ok );

View File

@ -273,18 +273,18 @@ QgsAttributeSelectionDialog::QgsAttributeSelectionDialog( QgsComposerAttributeTa
QWidget* parent, Qt::WindowFlags f )
: QDialog( parent, f )
, mComposerTable( table )
, mComposerTableV1( NULL )
, mComposerTableV1( nullptr )
, mVectorLayer( vLayer )
, mColumnModel( NULL )
, mColumnModelV1( NULL )
, mSortedProxyModel( NULL )
, mSortedProxyModelV1( NULL )
, mAvailableSortProxyModel( NULL )
, mAvailableSortProxyModelV1( NULL )
, mColumnAlignmentDelegate( NULL )
, mColumnSourceDelegate( NULL )
, mColumnSortOrderDelegate( NULL )
, mColumnWidthDelegate( NULL )
, mColumnModel( nullptr )
, mColumnModelV1( nullptr )
, mSortedProxyModel( nullptr )
, mSortedProxyModelV1( nullptr )
, mAvailableSortProxyModel( nullptr )
, mAvailableSortProxyModelV1( nullptr )
, mColumnAlignmentDelegate( nullptr )
, mColumnSourceDelegate( nullptr )
, mColumnSortOrderDelegate( nullptr )
, mColumnWidthDelegate( nullptr )
{
setupUi( this );
@ -327,19 +327,19 @@ QgsAttributeSelectionDialog::QgsAttributeSelectionDialog( QgsComposerAttributeTa
QgsAttributeSelectionDialog::QgsAttributeSelectionDialog( QgsComposerAttributeTable *table, QgsVectorLayer *vLayer, QWidget *parent, Qt::WindowFlags f )
: QDialog( parent, f )
, mComposerTable( NULL )
, mComposerTable( nullptr )
, mComposerTableV1( table )
, mVectorLayer( vLayer )
, mColumnModel( NULL )
, mColumnModelV1( NULL )
, mSortedProxyModel( NULL )
, mSortedProxyModelV1( NULL )
, mAvailableSortProxyModel( NULL )
, mAvailableSortProxyModelV1( NULL )
, mColumnAlignmentDelegate( NULL )
, mColumnSourceDelegate( NULL )
, mColumnSortOrderDelegate( NULL )
, mColumnWidthDelegate( NULL )
, mColumnModel( nullptr )
, mColumnModelV1( nullptr )
, mSortedProxyModel( nullptr )
, mSortedProxyModelV1( nullptr )
, mAvailableSortProxyModel( nullptr )
, mAvailableSortProxyModelV1( nullptr )
, mColumnAlignmentDelegate( nullptr )
, mColumnSourceDelegate( nullptr )
, mColumnSortOrderDelegate( nullptr )
, mColumnWidthDelegate( nullptr )
{
setupUi( this );
@ -532,7 +532,7 @@ void QgsAttributeSelectionDialog::on_mRemoveSortColumnPushButton_clicked()
int rowToRemove = selectedIndex.row();
//find corresponding column
QgsComposerTableColumn * column = 0;
QgsComposerTableColumn * column = nullptr;
if ( mComposerTable )
{
column = mSortedProxyModel->columnFromIndex( selectedIndex );

View File

@ -44,7 +44,7 @@ class QgsComposerColumnAlignmentDelegate : public QItemDelegate
Q_OBJECT
public:
explicit QgsComposerColumnAlignmentDelegate( QObject *parent = 0 );
explicit QgsComposerColumnAlignmentDelegate( QObject *parent = nullptr );
QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
@ -61,7 +61,7 @@ class QgsComposerColumnSourceDelegate : public QItemDelegate
Q_OBJECT
public:
QgsComposerColumnSourceDelegate( QgsVectorLayer* vlayer, QObject *parent = 0, const QgsComposerObject* composerObject = 0 );
QgsComposerColumnSourceDelegate( QgsVectorLayer* vlayer, QObject *parent = nullptr, const QgsComposerObject* composerObject = nullptr );
QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
@ -81,7 +81,7 @@ class QgsComposerColumnWidthDelegate : public QItemDelegate
Q_OBJECT
public:
explicit QgsComposerColumnWidthDelegate( QObject *parent = 0 );
explicit QgsComposerColumnWidthDelegate( QObject *parent = nullptr );
QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
@ -98,7 +98,7 @@ class QgsComposerColumnSortOrderDelegate : public QItemDelegate
Q_OBJECT
public:
explicit QgsComposerColumnSortOrderDelegate( QObject *parent = 0 );
explicit QgsComposerColumnSortOrderDelegate( QObject *parent = nullptr );
QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
@ -114,10 +114,10 @@ class QgsAttributeSelectionDialog: public QDialog, private Ui::QgsAttributeSelec
{
Q_OBJECT
public:
QgsAttributeSelectionDialog( QgsComposerAttributeTableV2* table, QgsVectorLayer* vLayer, QWidget * parent = 0, Qt::WindowFlags f = 0 );
QgsAttributeSelectionDialog( QgsComposerAttributeTableV2* table, QgsVectorLayer* vLayer, QWidget * parent = nullptr, Qt::WindowFlags f = nullptr );
//todo - remove for QGIS 3.0
QgsAttributeSelectionDialog( QgsComposerAttributeTable* table, QgsVectorLayer* vLayer, QWidget * parent = 0, Qt::WindowFlags f = 0 );
QgsAttributeSelectionDialog( QgsComposerAttributeTable* table, QgsVectorLayer* vLayer, QWidget * parent = nullptr, Qt::WindowFlags f = nullptr );
~QgsAttributeSelectionDialog();

View File

@ -107,10 +107,10 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
: QMainWindow()
, mTitle( title )
, mQgis( qgis )
, mPrinter( 0 )
, mPrinter( nullptr )
, mSetPageOrientation( false )
, mUndoView( 0 )
, mAtlasFeatureAction( 0 )
, mUndoView( nullptr )
, mAtlasFeatureAction( nullptr )
{
setupUi( this );
setWindowTitle( mTitle );
@ -455,7 +455,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
mStatusZoomCombo = new QComboBox( mStatusBar );
mStatusZoomCombo->setEditable( true );
mStatusZoomCombo->setInsertPolicy( QComboBox::NoInsert );
mStatusZoomCombo->setCompleter( 0 );
mStatusZoomCombo->setCompleter( nullptr );
mStatusZoomCombo->setMinimumWidth( 100 );
//zoom combo box accepts decimals in the range 1-9999, with an optional decimal point and "%" sign
QRegExp zoomRx( "\\s*\\d{1,4}(\\.\\d?)?\\s*%?" );
@ -494,7 +494,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
mStatusBar->addWidget( mStatusAtlasLabel );
//create composer view and layout with rulers
mView = 0;
mView = nullptr;
mViewLayout = new QGridLayout();
mViewLayout->setSpacing( 0 );
mViewLayout->setMargin( 0 );
@ -951,7 +951,7 @@ void QgsComposer::showItemOptions( QgsComposerItem* item )
if ( !item )
{
mItemDock->setWidget( 0 );
mItemDock->setWidget( nullptr );
return;
}
@ -1052,7 +1052,7 @@ void QgsComposer::on_mActionAtlasPreview_triggered( bool checked )
if ( checked && !atlasMap->enabled() )
{
//no atlas current enabled
QMessageBox::warning( 0, tr( "Enable atlas preview" ),
QMessageBox::warning( nullptr, tr( "Enable atlas preview" ),
tr( "Atlas in not currently enabled for this composition!" ),
QMessageBox::Ok,
QMessageBox::Ok );
@ -1079,7 +1079,7 @@ void QgsComposer::on_mActionAtlasPreview_triggered( bool checked )
if ( !previewEnabled )
{
//something went wrong, eg, no matching features
QMessageBox::warning( 0, tr( "Enable atlas preview" ),
QMessageBox::warning( nullptr, tr( "Enable atlas preview" ),
tr( "No matching atlas features found!" ),
QMessageBox::Ok,
QMessageBox::Ok );
@ -1643,7 +1643,7 @@ void QgsComposer::exportCompositionAsPDF( QgsComposer::OutputMode mode )
{
if ( atlasMap->filenamePattern().isEmpty() )
{
int res = QMessageBox::warning( 0, tr( "Empty filename pattern" ),
int res = QMessageBox::warning( nullptr, tr( "Empty filename pattern" ),
tr( "The filename pattern is empty. A default one will be used." ),
QMessageBox::Ok | QMessageBox::Cancel,
QMessageBox::Ok );
@ -1667,7 +1667,7 @@ void QgsComposer::exportCompositionAsPDF( QgsComposer::OutputMode mode )
// test directory (if it exists and is writable)
if ( !QDir( outputDir ).exists() || !QFileInfo( outputDir ).isWritable() )
{
QMessageBox::warning( 0, tr( "Unable to write into the directory" ),
QMessageBox::warning( nullptr, tr( "Unable to write into the directory" ),
tr( "The given output directory is not writable. Cancelling." ),
QMessageBox::Ok,
QMessageBox::Ok );
@ -1845,7 +1845,7 @@ void QgsComposer::printComposition( QgsComposer::OutputMode mode )
//set printer page orientation
setPrinterPageOrientation();
QPrintDialog printDialog( printer(), 0 );
QPrintDialog printDialog( printer(), nullptr );
if ( printDialog.exec() != QDialog::Accepted )
{
return;
@ -1965,7 +1965,7 @@ void QgsComposer::exportCompositionAsImage( QgsComposer::OutputMode mode )
if ( memuse > 200 ) // about 4500x4500
{
int answer = QMessageBox::warning( 0, tr( "Big image" ),
int answer = QMessageBox::warning( nullptr, tr( "Big image" ),
tr( "To create image %1x%2 requires about %3 MB of memory. Proceed?" )
.arg( width ).arg( height ).arg( memuse ),
QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok );
@ -2070,7 +2070,7 @@ void QgsComposer::exportCompositionAsImage( QgsComposer::OutputMode mode )
if ( image.isNull() )
{
QMessageBox::warning( 0, tr( "Memory Allocation Error" ),
QMessageBox::warning( nullptr, tr( "Memory Allocation Error" ),
tr( "Trying to create image #%1( %2x%3 @ %4dpi ) "
"may result in a memory overflow.\n"
"Please try a lower resolution or a smaller papersize" )
@ -2129,7 +2129,7 @@ void QgsComposer::exportCompositionAsImage( QgsComposer::OutputMode mode )
// else, it has an atlas to render, so a directory must first be selected
if ( atlasMap->filenamePattern().isEmpty() )
{
int res = QMessageBox::warning( 0, tr( "Empty filename pattern" ),
int res = QMessageBox::warning( nullptr, tr( "Empty filename pattern" ),
tr( "The filename pattern is empty. A default one will be used." ),
QMessageBox::Ok | QMessageBox::Cancel,
QMessageBox::Ok );
@ -2194,7 +2194,7 @@ void QgsComposer::exportCompositionAsImage( QgsComposer::OutputMode mode )
// test directory (if it exists and is writable)
if ( !QDir( dir ).exists() || !QFileInfo( dir ).isWritable() )
{
QMessageBox::warning( 0, tr( "Unable to write into the directory" ),
QMessageBox::warning( nullptr, tr( "Unable to write into the directory" ),
tr( "The given output directory is not writable. Cancelling." ),
QMessageBox::Ok,
QMessageBox::Ok );
@ -2486,7 +2486,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
// If we have an Atlas
if ( atlasMap->filenamePattern().isEmpty() )
{
int res = QMessageBox::warning( 0, tr( "Empty filename pattern" ),
int res = QMessageBox::warning( nullptr, tr( "Empty filename pattern" ),
tr( "The filename pattern is empty. A default one will be used." ),
QMessageBox::Ok | QMessageBox::Cancel,
QMessageBox::Ok );
@ -2513,7 +2513,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
// test directory (if it exists and is writable)
if ( !QDir( outputDir ).exists() || !QFileInfo( outputDir ).isWritable() )
{
QMessageBox::warning( 0, tr( "Unable to write into the directory" ),
QMessageBox::warning( nullptr, tr( "Unable to write into the directory" ),
tr( "The given output directory is not writable. Cancelling." ),
QMessageBox::Ok,
QMessageBox::Ok );
@ -2787,7 +2787,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
QString errorMsg;
int errorLine;
if ( ! doc.setContent( &svgBuffer, false, &errorMsg, &errorLine ) )
QMessageBox::warning( 0, tr( "SVG error" ), tr( "There was an error in SVG output for SVG layer " ) + layerName + tr( " on page " ) + QString::number( i + 1 ) + '(' + errorMsg + ')' );
QMessageBox::warning( nullptr, tr( "SVG error" ), tr( "There was an error in SVG output for SVG layer " ) + layerName + tr( " on page " ) + QString::number( i + 1 ) + '(' + errorMsg + ')' );
if ( 1 == svgLayerId )
{
svg = QDomDocument( doc.doctype() );
@ -2977,7 +2977,7 @@ void QgsComposer::on_mActionDuplicateComposer_triggered()
dlg->close();
delete dlg;
dlg = 0;
dlg = nullptr;
if ( !newComposer )
{
@ -3031,7 +3031,7 @@ void QgsComposer::on_mActionSaveAsTemplate_triggered()
if ( templateFile.write( saveDocument.toByteArray() ) == -1 )
{
QMessageBox::warning( 0, tr( "Save error" ), tr( "Error, could not save file" ) );
QMessageBox::warning( nullptr, tr( "Save error" ), tr( "Error, could not save file" ) );
}
}
@ -3044,7 +3044,7 @@ void QgsComposer::loadTemplate( const bool newComposer )
{
QSettings settings;
QString openFileDir = settings.value( "UI/lastComposerTemplateDir", QDir::homePath() ).toString();
QString openFileString = QFileDialog::getOpenFileName( 0, tr( "Load template" ), openFileDir, "*.qpt" );
QString openFileString = QFileDialog::getOpenFileName( nullptr, tr( "Load template" ), openFileDir, "*.qpt" );
if ( openFileString.isEmpty() )
{
@ -3061,8 +3061,8 @@ void QgsComposer::loadTemplate( const bool newComposer )
return;
}
QgsComposer* c = 0;
QgsComposition* comp = 0;
QgsComposer* c = nullptr;
QgsComposition* comp = nullptr;
if ( newComposer )
{
@ -3096,12 +3096,12 @@ void QgsComposer::loadTemplate( const bool newComposer )
dlg->show();
c->setUpdatesEnabled( false );
comp->loadFromTemplate( templateDoc, 0, false, newComposer );
comp->loadFromTemplate( templateDoc, nullptr, false, newComposer );
c->setUpdatesEnabled( true );
dlg->close();
delete dlg;
dlg = 0;
dlg = nullptr;
}
}
}
@ -3538,7 +3538,7 @@ void QgsComposer::readXML( const QDomElement& composerElem, const QDomDocument&
if ( mComposition->generateWorldFile() )
{
QDomElement compositionElem = compositionNodeList.at( 0 ).toElement();
QgsComposerMap* worldFileMap = 0;
QgsComposerMap* worldFileMap = nullptr;
QList<const QgsComposerMap*> maps = mComposition->composerMapItems();
for ( QList<const QgsComposerMap*>::const_iterator it = maps.begin(); it != maps.end(); ++it )
{
@ -3776,8 +3776,8 @@ void QgsComposer::setSelectionTool()
bool QgsComposer::containsWMSLayer() const
{
QMap<QgsComposerItem*, QWidget*>::const_iterator item_it = mItemWidgetMap.constBegin();
QgsComposerItem* currentItem = 0;
QgsComposerMap* currentMap = 0;
QgsComposerItem* currentItem = nullptr;
QgsComposerMap* currentMap = nullptr;
for ( ; item_it != mItemWidgetMap.constEnd(); ++item_it )
{
@ -3798,8 +3798,8 @@ bool QgsComposer::containsAdvancedEffects() const
{
// Check if composer contains any blend modes or flattened layers for transparency
QMap<QgsComposerItem*, QWidget*>::const_iterator item_it = mItemWidgetMap.constBegin();
QgsComposerItem* currentItem = 0;
QgsComposerMap* currentMap = 0;
QgsComposerItem* currentItem = nullptr;
QgsComposerMap* currentMap = nullptr;
for ( ; item_it != mItemWidgetMap.constEnd(); ++item_it )
{
@ -4085,7 +4085,7 @@ void QgsComposer::updateAtlasMapLayerAction( QgsVectorLayer *coverageLayer )
if ( mAtlasFeatureAction )
{
delete mAtlasFeatureAction;
mAtlasFeatureAction = 0;
mAtlasFeatureAction = nullptr;
}
if ( coverageLayer )
@ -4129,7 +4129,7 @@ void QgsComposer::updateAtlasMapLayerAction( bool atlasEnabled )
if ( mAtlasFeatureAction )
{
delete mAtlasFeatureAction;
mAtlasFeatureAction = 0;
mAtlasFeatureAction = nullptr;
}
if ( atlasEnabled )

View File

@ -25,7 +25,7 @@
#include <QFileDialog>
#include <QFileInfo>
QgsComposerArrowWidget::QgsComposerArrowWidget( QgsComposerArrow* arrow ): QgsComposerItemBaseWidget( 0, arrow ), mArrow( arrow )
QgsComposerArrowWidget::QgsComposerArrowWidget( QgsComposerArrow* arrow ): QgsComposerItemBaseWidget( nullptr, arrow ), mArrow( arrow )
{
setupUi( this );
mRadioButtonGroup = new QButtonGroup( this );
@ -310,7 +310,7 @@ void QgsComposerArrowWidget::on_mLineStyleButton_clicked()
}
QgsLineSymbolV2* newSymbol = mArrow->lineSymbol()->clone();
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), 0, this );
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), nullptr, this );
d.setExpressionContext( mArrow->createExpressionContext() );
if ( d.exec() == QDialog::Accepted )

View File

@ -32,7 +32,7 @@
#include "qgscomposertablebackgroundcolorsdialog.h"
QgsComposerAttributeTableWidget::QgsComposerAttributeTableWidget( QgsComposerAttributeTableV2* table, QgsComposerFrame* frame )
: QgsComposerItemBaseWidget( 0, table )
: QgsComposerItemBaseWidget( nullptr, table )
, mComposerTable( table )
, mFrame( frame )
{

View File

@ -26,7 +26,7 @@
QgsComposerHtmlWidget::QgsComposerHtmlWidget( QgsComposerHtml* html, QgsComposerFrame* frame )
: QgsComposerItemBaseWidget( 0, html )
: QgsComposerItemBaseWidget( nullptr, html )
, mHtml( html )
, mFrame( frame )
{
@ -80,11 +80,11 @@ QgsComposerHtmlWidget::QgsComposerHtmlWidget( QgsComposerHtml* html, QgsComposer
}
QgsComposerHtmlWidget::QgsComposerHtmlWidget()
: QgsComposerItemBaseWidget( 0, 0 )
, mHtml( NULL )
, mFrame( NULL )
, mHtmlEditor( NULL )
, mStylesheetEditor( NULL )
: QgsComposerItemBaseWidget( nullptr, nullptr )
, mHtml( nullptr )
, mFrame( nullptr )
, mHtmlEditor( nullptr )
, mStylesheetEditor( nullptr )
{
}

View File

@ -36,7 +36,7 @@ class QgsComposerImageExportOptionsDialog: public QDialog, private Ui::QgsCompos
* @param parent parent widget
* @param flags window flags
*/
QgsComposerImageExportOptionsDialog( QWidget* parent = 0, Qt::WindowFlags flags = 0 );
QgsComposerImageExportOptionsDialog( QWidget* parent = nullptr, Qt::WindowFlags flags = nullptr );
~QgsComposerImageExportOptionsDialog();

View File

@ -81,14 +81,14 @@ QgsAtlasComposition* QgsComposerItemBaseWidget::atlasComposition() const
{
if ( !mComposerObject )
{
return 0;
return nullptr;
}
QgsComposition* composition = mComposerObject->composition();
if ( !composition )
{
return 0;
return nullptr;
}
return &composition->atlasComposition();
@ -103,7 +103,7 @@ QgsVectorLayer* QgsComposerItemBaseWidget::atlasCoverageLayer() const
return atlasMap->coverageLayer();
}
return 0;
return nullptr;
}
@ -185,8 +185,8 @@ QgsComposerItemWidget::QgsComposerItemWidget( QWidget* parent, QgsComposerItem*
}
QgsComposerItemWidget::QgsComposerItemWidget()
: QgsComposerItemBaseWidget( 0, 0 )
, mItem( NULL )
: QgsComposerItemBaseWidget( nullptr, nullptr )
, mItem( nullptr )
, mFreezeXPosSpin( false )
, mFreezeYPosSpin( false )
, mFreezeWidthSpin( false )

View File

@ -25,7 +25,7 @@
#include <QFontDialog>
#include <QWidget>
QgsComposerLabelWidget::QgsComposerLabelWidget( QgsComposerLabel* label ): QgsComposerItemBaseWidget( 0, label ), mComposerLabel( label )
QgsComposerLabelWidget::QgsComposerLabelWidget( QgsComposerLabel* label ): QgsComposerItemBaseWidget( nullptr, label ), mComposerLabel( label )
{
setupUi( this );

View File

@ -28,7 +28,7 @@ QgsComposerLegendItemDialog::QgsComposerLegendItemDialog( const QStandardItem* i
}
}
QgsComposerLegendItemDialog::QgsComposerLegendItemDialog(): QDialog( 0 )
QgsComposerLegendItemDialog::QgsComposerLegendItemDialog(): QDialog( nullptr )
{
}

View File

@ -31,7 +31,7 @@ class QgsComposerLegendItemDialog: public QDialog, private Ui::QgsComposerLegend
Q_OBJECT
public:
QgsComposerLegendItemDialog( const QStandardItem* item, QWidget* parent = 0 );
QgsComposerLegendItemDialog( const QStandardItem* item, QWidget* parent = nullptr );
~QgsComposerLegendItemDialog();
/** Returns the item text inserted by user*/

View File

@ -28,7 +28,7 @@ QgsComposerLegendLayersDialog::QgsComposerLegendLayersDialog( QList<QgsMapLayer*
}
}
QgsComposerLegendLayersDialog::QgsComposerLegendLayersDialog(): QDialog( 0 )
QgsComposerLegendLayersDialog::QgsComposerLegendLayersDialog(): QDialog( nullptr )
{
}
@ -43,11 +43,11 @@ QgsMapLayer* QgsComposerLegendLayersDialog::selectedLayer()
QListWidgetItem* item = listMapLayers->currentItem();
if ( !item )
{
return 0;
return nullptr;
}
QMap<QListWidgetItem*, QgsMapLayer*>::iterator it = mItemLayerMap.find( item );
QgsMapLayer* c = 0;
QgsMapLayer* c = nullptr;
c = it.value();
return c;
}

View File

@ -26,7 +26,7 @@ class QgsComposerLegendLayersDialog: public QDialog, private Ui::QgsComposerLege
Q_OBJECT
public:
QgsComposerLegendLayersDialog( QList<QgsMapLayer*> layers, QWidget* parent = 0 );
QgsComposerLegendLayersDialog( QList<QgsMapLayer*> layers, QWidget* parent = nullptr );
~QgsComposerLegendLayersDialog();
QgsMapLayer* selectedLayer();

View File

@ -44,7 +44,7 @@
QgsComposerLegendWidget::QgsComposerLegendWidget( QgsComposerLegend* legend )
: QgsComposerItemBaseWidget( 0, legend )
: QgsComposerItemBaseWidget( nullptr, legend )
, mLegend( legend )
{
setupUi( this );
@ -88,7 +88,7 @@ QgsComposerLegendWidget::QgsComposerLegendWidget( QgsComposerLegend* legend )
this, SLOT( selectedChanged( const QModelIndex &, const QModelIndex & ) ) );
}
QgsComposerLegendWidget::QgsComposerLegendWidget(): QgsComposerItemBaseWidget( 0, 0 ), mLegend( 0 )
QgsComposerLegendWidget::QgsComposerLegendWidget(): QgsComposerItemBaseWidget( nullptr, nullptr ), mLegend( nullptr )
{
setupUi( this );
}
@ -575,7 +575,7 @@ void QgsComposerLegendWidget::on_mMapComboBox_currentIndexChanged( int index )
int mapNr = itemData.toInt();
if ( mapNr < 0 )
{
mLegend->setComposerMap( 0 );
mLegend->setComposerMap( nullptr );
}
else
{
@ -797,7 +797,7 @@ void QgsComposerLegendWidget::resetLayerNodeToDefaults()
return;
}
QgsLayerTreeLayer* nodeLayer = 0;
QgsLayerTreeLayer* nodeLayer = nullptr;
if ( QgsLayerTreeNode* node = mItemTreeView->layerTreeModel()->index2node( currentIndex ) )
{
if ( QgsLayerTree::isLayer( node ) )
@ -1066,10 +1066,10 @@ QgsComposerLegendMenuProvider::QgsComposerLegendMenuProvider( QgsLayerTreeView*
QMenu*QgsComposerLegendMenuProvider::createContextMenu()
{
if ( !mView->currentNode() )
return 0;
return nullptr;
if ( mWidget->legend()->autoUpdateModel() )
return 0; // no editing allowed
return nullptr; // no editing allowed
QMenu* menu = new QMenu();

View File

@ -264,7 +264,7 @@ void QgsComposerManager::on_mAddButton_clicked()
}
}
QgsComposer* newComposer = 0;
QgsComposer* newComposer = nullptr;
bool loadedOK = false;
QString title;
@ -296,12 +296,12 @@ void QgsComposerManager::on_mAddButton_clicked()
dlg->show();
newComposer->hide();
loadedOK = newComposer->composition()->loadFromTemplate( templateDoc, 0, false );
loadedOK = newComposer->composition()->loadFromTemplate( templateDoc, nullptr, false );
newComposer->activate();
dlg->close();
delete dlg;
dlg = 0;
dlg = nullptr;
}
}
@ -309,7 +309,7 @@ void QgsComposerManager::on_mAddButton_clicked()
{
newComposer->close();
QgisApp::instance()->deleteComposer( newComposer );
newComposer = 0;
newComposer = nullptr;
QMessageBox::warning( this, tr( "Template error" ), tr( "Error, could not load template file" ) );
}
}
@ -435,7 +435,7 @@ void QgsComposerManager::show_clicked()
QMap<QListWidgetItem*, QgsComposer*>::const_iterator it = mItemComposerMap.find( item );
if ( it != mItemComposerMap.constEnd() )
{
QgsComposer* c = 0;
QgsComposer* c = nullptr;
if ( it.value() ) //a normal composer
{
c = it.value();
@ -464,7 +464,7 @@ void QgsComposerManager::duplicate_clicked()
return;
}
QgsComposer* currentComposer = 0;
QgsComposer* currentComposer = nullptr;
QString currentTitle;
QListWidgetItem* item = mComposerListWidget->selectedItems().at( 0 );
@ -494,7 +494,7 @@ void QgsComposerManager::duplicate_clicked()
dlg->close();
delete dlg;
dlg = 0;
dlg = nullptr;
if ( newComposer )
{
@ -516,7 +516,7 @@ void QgsComposerManager::rename_clicked()
}
QString currentTitle;
QgsComposer* currentComposer = 0;
QgsComposer* currentComposer = nullptr;
QListWidgetItem* item = mComposerListWidget->selectedItems().at( 0 );
QMap<QListWidgetItem*, QgsComposer*>::iterator it = mItemComposerMap.find( item );
@ -596,7 +596,7 @@ void QgsComposerNameDelegate::setModelData( QWidget *editor, QAbstractItemModel
if ( changed && cNames.contains( value ) )
{
//name exists!
QMessageBox::warning( 0, tr( "Rename composer" ), tr( "There is already a composer named \"%1\"" ).arg( value ) );
QMessageBox::warning( nullptr, tr( "Rename composer" ), tr( "There is already a composer named \"%1\"" ).arg( value ) );
return;
}

View File

@ -30,7 +30,7 @@ class QgsComposerNameDelegate : public QItemDelegate
Q_OBJECT
public:
explicit QgsComposerNameDelegate( QObject *parent = 0 );
explicit QgsComposerNameDelegate( QObject *parent = nullptr );
QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option,
const QModelIndex &index ) const override;
@ -49,7 +49,7 @@ class QgsComposerManager: public QDialog, private Ui::QgsComposerManagerBase
{
Q_OBJECT
public:
QgsComposerManager( QWidget * parent = 0, Qt::WindowFlags f = 0 );
QgsComposerManager( QWidget * parent = nullptr, Qt::WindowFlags f = nullptr );
~QgsComposerManager();
void addTemplates( const QMap<QString, QString>& templates );

View File

@ -44,7 +44,7 @@
#include <QMessageBox>
QgsComposerMapWidget::QgsComposerMapWidget( QgsComposerMap* composerMap )
: QgsComposerItemBaseWidget( 0, composerMap )
: QgsComposerItemBaseWidget( nullptr, composerMap )
, mComposerMap( composerMap )
{
setupUi( this );
@ -1194,7 +1194,7 @@ void QgsComposerMapWidget::on_mAddGridPushButton_clicked()
addGridListItem( grid->id(), grid->name() );
mGridListWidget->setCurrentRow( 0 );
on_mGridListWidget_currentItemChanged( mGridListWidget->currentItem(), 0 );
on_mGridListWidget_currentItemChanged( mGridListWidget->currentItem(), nullptr );
}
void QgsComposerMapWidget::on_mRemoveGridPushButton_clicked()
@ -1256,13 +1256,13 @@ QgsComposerMapGrid* QgsComposerMapWidget::currentGrid()
{
if ( !mComposerMap )
{
return 0;
return nullptr;
}
QListWidgetItem* item = mGridListWidget->currentItem();
if ( !item )
{
return 0;
return nullptr;
}
return mComposerMap->grids()->grid( item->data( Qt::UserRole ).toString() );
@ -1566,7 +1566,7 @@ void QgsComposerMapWidget::on_mGridLineStyleButton_clicked()
}
QgsLineSymbolV2* newSymbol = static_cast<QgsLineSymbolV2*>( grid->lineSymbol()->clone() );
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), 0, this );
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), nullptr, this );
if ( d.exec() == QDialog::Accepted )
{
@ -1591,7 +1591,7 @@ void QgsComposerMapWidget::on_mGridMarkerStyleButton_clicked()
}
QgsMarkerSymbolV2* newSymbol = static_cast<QgsMarkerSymbolV2*>( grid->markerSymbol()->clone() );
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), 0, this );
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), nullptr, this );
if ( d.exec() == QDialog::Accepted )
{
@ -2029,7 +2029,7 @@ void QgsComposerMapWidget::on_mAnnotationFormatButton_clicked()
QScopedPointer< QgsExpressionContext> expressionContext( grid->createExpressionContext() );
QgsExpressionBuilderDialog exprDlg( 0, grid->annotationExpression(), this, "generic", *expressionContext );
QgsExpressionBuilderDialog exprDlg( nullptr, grid->annotationExpression(), this, "generic", *expressionContext );
exprDlg.setWindowTitle( tr( "Expression based annotation" ) );
if ( exprDlg.exec() == QDialog::Accepted )
@ -2186,7 +2186,7 @@ void QgsComposerMapWidget::on_mCoordinatePrecisionSpinBox_valueChanged( int valu
QListWidgetItem* QgsComposerMapWidget::addGridListItem( const QString& id, const QString& name )
{
QListWidgetItem* item = new QListWidgetItem( name, 0 );
QListWidgetItem* item = new QListWidgetItem( name, nullptr );
item->setData( Qt::UserRole, id );
item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable );
mGridListWidget->insertItem( 0, item );
@ -2225,11 +2225,11 @@ void QgsComposerMapWidget::loadGridEntries()
if ( mGridListWidget->currentItem() )
{
on_mGridListWidget_currentItemChanged( mGridListWidget->currentItem(), 0 );
on_mGridListWidget_currentItemChanged( mGridListWidget->currentItem(), nullptr );
}
else
{
on_mGridListWidget_currentItemChanged( 0, 0 );
on_mGridListWidget_currentItemChanged( nullptr, nullptr );
}
}
@ -2331,13 +2331,13 @@ QgsComposerMapOverview* QgsComposerMapWidget::currentOverview()
{
if ( !mComposerMap )
{
return 0;
return nullptr;
}
QListWidgetItem* item = mOverviewListWidget->currentItem();
if ( !item )
{
return 0;
return nullptr;
}
return mComposerMap->overviews()->overview( item->data( Qt::UserRole ).toString() );
@ -2440,7 +2440,7 @@ void QgsComposerMapWidget::updateOverviewFrameSymbolMarker( const QgsComposerMap
QListWidgetItem* QgsComposerMapWidget::addOverviewListItem( const QString& id, const QString& name )
{
QListWidgetItem* item = new QListWidgetItem( name, 0 );
QListWidgetItem* item = new QListWidgetItem( name, nullptr );
item->setData( Qt::UserRole, id );
item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable );
mOverviewListWidget->insertItem( 0, item );
@ -2479,11 +2479,11 @@ void QgsComposerMapWidget::loadOverviewEntries()
if ( mOverviewListWidget->currentItem() )
{
on_mOverviewListWidget_currentItemChanged( mOverviewListWidget->currentItem(), 0 );
on_mOverviewListWidget_currentItemChanged( mOverviewListWidget->currentItem(), nullptr );
}
else
{
on_mOverviewListWidget_currentItemChanged( 0, 0 );
on_mOverviewListWidget_currentItemChanged( nullptr, nullptr );
}
}
@ -2570,7 +2570,7 @@ void QgsComposerMapWidget::on_mOverviewFrameStyleButton_clicked()
}
QgsFillSymbolV2* newSymbol = static_cast<QgsFillSymbolV2*>( overview->frameSymbol()->clone() );
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), 0, this );
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), nullptr, this );
if ( d.exec() == QDialog::Accepted )
{

View File

@ -32,7 +32,7 @@
#include <QSettings>
#include <QSvgRenderer>
QgsComposerPictureWidget::QgsComposerPictureWidget( QgsComposerPicture* picture ): QgsComposerItemBaseWidget( 0, picture ), mPicture( picture ), mPreviewsLoaded( false )
QgsComposerPictureWidget::QgsComposerPictureWidget( QgsComposerPicture* picture ): QgsComposerItemBaseWidget( nullptr, picture ), mPicture( picture ), mPreviewsLoaded( false )
{
setupUi( this );
@ -100,7 +100,7 @@ void QgsComposerPictureWidget::on_mPictureBrowseButton_clicked()
QFileInfo fileInfo( filePath );
if ( !fileInfo.exists() || !fileInfo.isReadable() )
{
QMessageBox::critical( 0, "Invalid file", "Error, file does not exist or is not readable" );
QMessageBox::critical( nullptr, "Invalid file", "Error, file does not exist or is not readable" );
return;
}

View File

@ -23,7 +23,7 @@
#include <QFontDialog>
#include <QWidget>
QgsComposerScaleBarWidget::QgsComposerScaleBarWidget( QgsComposerScaleBar* scaleBar ): QgsComposerItemBaseWidget( 0, scaleBar ), mComposerScaleBar( scaleBar )
QgsComposerScaleBarWidget::QgsComposerScaleBarWidget( QgsComposerScaleBar* scaleBar ): QgsComposerItemBaseWidget( nullptr, scaleBar ), mComposerScaleBar( scaleBar )
{
setupUi( this );
connectUpdateSignal();

View File

@ -24,7 +24,7 @@
#include "qgssymbollayerv2utils.h"
#include <QColorDialog>
QgsComposerShapeWidget::QgsComposerShapeWidget( QgsComposerShape* composerShape ): QgsComposerItemBaseWidget( 0, composerShape ), mComposerShape( composerShape )
QgsComposerShapeWidget::QgsComposerShapeWidget( QgsComposerShape* composerShape ): QgsComposerItemBaseWidget( nullptr, composerShape ), mComposerShape( composerShape )
{
setupUi( this );

View File

@ -38,7 +38,7 @@ class QgsComposerTableBackgroundColorsDialog: public QDialog, private Ui::QgsCom
* @param parent parent widget
* @param flags window flags
*/
QgsComposerTableBackgroundColorsDialog( QgsComposerTableV2* table, QWidget* parent = 0, Qt::WindowFlags flags = 0 );
QgsComposerTableBackgroundColorsDialog( QgsComposerTableV2* table, QWidget* parent = nullptr, Qt::WindowFlags flags = nullptr );
~QgsComposerTableBackgroundColorsDialog();

View File

@ -26,7 +26,7 @@
#include "qgsexpressionbuilderdialog.h"
#include "qgisgui.h"
QgsComposerTableWidget::QgsComposerTableWidget( QgsComposerAttributeTable* table ): QgsComposerItemBaseWidget( 0, table ), mComposerTable( table )
QgsComposerTableWidget::QgsComposerTableWidget( QgsComposerAttributeTable* table ): QgsComposerItemBaseWidget( nullptr, table ), mComposerTable( table )
{
setupUi( this );
//add widget for general composer item properties

View File

@ -142,7 +142,7 @@ QgsCompositionWidget::QgsCompositionWidget( QWidget* parent, QgsComposition* c )
blockSignals( false );
}
QgsCompositionWidget::QgsCompositionWidget(): QWidget( 0 ), mComposition( 0 )
QgsCompositionWidget::QgsCompositionWidget(): QWidget( nullptr ), mComposition( nullptr )
{
setupUi( this );
}
@ -171,7 +171,7 @@ void QgsCompositionWidget::populateDataDefinedButtons()
return;
}
QgsVectorLayer* vl = 0;
QgsVectorLayer* vl = nullptr;
QgsAtlasComposition* atlas = &mComposition->atlasComposition();
if ( atlas && atlas->enabled() )
@ -570,7 +570,7 @@ void QgsCompositionWidget::on_mPageStyleButton_clicked()
return;
}
QgsVectorLayer* coverageLayer = 0;
QgsVectorLayer* coverageLayer = nullptr;
// use the atlas coverage layer, if any
if ( mComposition->atlasComposition().enabled() )
{
@ -704,7 +704,7 @@ void QgsCompositionWidget::onItemRemoved( QgsComposerItem* item )
}
if ( mWorldFileMapComboBox->count() == 0 )
{
mComposition->setWorldFileMap( 0 );
mComposition->setWorldFileMap( nullptr );
}
}
@ -716,7 +716,7 @@ void QgsCompositionWidget::on_mWorldFileMapComboBox_currentIndexChanged( int ind
}
if ( index == -1 )
{
mComposition->setWorldFileMap( 0 );
mComposition->setWorldFileMap( nullptr );
}
else
{

View File

@ -66,17 +66,17 @@
QgsGPSInformationWidget::QgsGPSInformationWidget( QgsMapCanvas * thepCanvas, QWidget * parent, Qt::WindowFlags f )
: QWidget( parent, f )
, mNmea( 0 )
, mNmea( nullptr )
, mpCanvas( thepCanvas )
{
setupUi( this );
mpLastLayer = 0;
mpLastLayer = nullptr;
mLastGpsPosition = QgsPoint( 0.0, 0.0 );
mpMapMarker = 0;
mpRubberBand = 0;
mpMapMarker = nullptr;
mpRubberBand = nullptr;
populateDevices();
QWidget * mpHistogramWidget = mStackedWidget->widget( 1 );
#if (!WITH_QWTPOLAR)
@ -237,7 +237,7 @@ QgsGPSInformationWidget::QgsGPSInformationWidget( QgsMapCanvas * thepCanvas, QWi
setStatusIndicator( NoData );
//SLM - added functionality
mLogFile = 0;
mLogFile = nullptr;
connect( QgisApp::instance()->layerTreeView(), SIGNAL( currentLayerChanged( QgsMapLayer* ) ),
this, SLOT( updateCloseFeatureButton( QgsMapLayer* ) ) );
@ -429,7 +429,7 @@ void QgsGPSInformationWidget::connectGps()
void QgsGPSInformationWidget::timedout()
{
mConnectButton->setChecked( false );
mNmea = NULL;
mNmea = nullptr;
mGPSPlainTextEdit->appendPlainText( tr( "Timed out!" ) );
showStatusBarMessage( tr( "Failed to connect to GPS device." ) );
}
@ -464,7 +464,7 @@ void QgsGPSInformationWidget::connected( QgsGPSConnection *conn )
else // error opening file
{
delete mLogFile;
mLogFile = 0;
mLogFile = nullptr;
// need to indicate why - this just reports that an error occurred
showStatusBarMessage( tr( "Error opening log file." ) );
@ -479,16 +479,16 @@ void QgsGPSInformationWidget::disconnectGps()
disconnect( mNmea, SIGNAL( nmeaSentenceReceived( const QString& ) ), this, SLOT( logNmeaSentence( const QString& ) ) );
mLogFile->close();
delete mLogFile;
mLogFile = 0;
mLogFile = nullptr;
}
QgsGPSConnectionRegistry::instance()->unregisterConnection( mNmea );
delete mNmea;
mNmea = NULL;
mNmea = nullptr;
if ( mpMapMarker ) // marker should not be shown on GPS disconnected - not current position
{
delete mpMapMarker;
mpMapMarker = NULL;
mpMapMarker = nullptr;
}
mGPSPlainTextEdit->appendPlainText( tr( "Disconnected..." ) );
mConnectButton->setChecked( false );
@ -736,7 +736,7 @@ void QgsGPSInformationWidget::displayGPSInformation( const QgsGPSInformation& in
if ( mpMapMarker )
{
delete mpMapMarker;
mpMapMarker = 0;
mpMapMarker = nullptr;
}
} // show marker
}
@ -795,7 +795,7 @@ void QgsGPSInformationWidget::on_mBtnCloseFeature_clicked()
//lines: bail out if there are not at least two vertices
if ( layerWKBType == QGis::WKBLineString && mCaptureList.size() < 2 )
{
QMessageBox::information( 0, tr( "Not enough vertices" ),
QMessageBox::information( nullptr, tr( "Not enough vertices" ),
tr( "Cannot close a line feature until it has at least two vertices." ) );
return;
}
@ -803,7 +803,7 @@ void QgsGPSInformationWidget::on_mBtnCloseFeature_clicked()
//polygons: bail out if there are not at least three vertices
if ( layerWKBType == QGis::WKBPolygon && mCaptureList.size() < 3 )
{
QMessageBox::information( 0, tr( "Not enough vertices" ),
QMessageBox::information( nullptr, tr( "Not enough vertices" ),
tr( "Cannot close a polygon feature until it has at least three vertices." ) );
return;
}
@ -818,7 +818,7 @@ void QgsGPSInformationWidget::on_mBtnCloseFeature_clicked()
int size = 0;
char end = QgsApplication::endian();
unsigned char *wkb = NULL;
unsigned char *wkb = nullptr;
int wkbtype = 0;
QgsCoordinateTransform t( mWgs84CRS, vlayer->crs() );
@ -952,14 +952,14 @@ void QgsGPSInformationWidget::on_mBtnCloseFeature_clicked()
else if ( avoidIntersectionsReturn == 2 )
{
//bail out...
QMessageBox::critical( 0, tr( "Error" ), tr( "The feature could not be added because removing the polygon intersections would change the geometry type" ) );
QMessageBox::critical( nullptr, tr( "Error" ), tr( "The feature could not be added because removing the polygon intersections would change the geometry type" ) );
delete f;
connectGpsSlot();
return;
}
else if ( avoidIntersectionsReturn == 3 )
{
QMessageBox::critical( 0, tr( "Error" ), tr( "An error was reported during intersection removal" ) );
QMessageBox::critical( nullptr, tr( "Error" ), tr( "An error was reported during intersection removal" ) );
delete f;
connectGpsSlot();
return;
@ -968,7 +968,7 @@ void QgsGPSInformationWidget::on_mBtnCloseFeature_clicked()
// Should never get here, as preconditions should have removed any that aren't handled
else // layerWKBType == QGis::WKBPolygon - unknown type
{
QMessageBox::critical( 0, tr( "Error" ), tr( "Cannot add feature. "
QMessageBox::critical( nullptr, tr( "Error" ), tr( "Cannot add feature. "
"Unknown WKB type. Choose a different layer and try again." ) );
connectGpsSlot();
delete f;
@ -992,7 +992,7 @@ void QgsGPSInformationWidget::on_mBtnCloseFeature_clicked()
vlayer->startEditing();
}
delete mpRubberBand;
mpRubberBand = NULL;
mpRubberBand = nullptr;
// delete the elements of mCaptureList
mCaptureList.clear();

View File

@ -44,7 +44,7 @@ class QgsGPSInformationWidget: public QWidget, private Ui::QgsGPSInformationWidg
{
Q_OBJECT
public:
QgsGPSInformationWidget( QgsMapCanvas * thepCanvas, QWidget * parent = 0, Qt::WindowFlags f = 0 );
QgsGPSInformationWidget( QgsMapCanvas * thepCanvas, QWidget * parent = nullptr, Qt::WindowFlags f = nullptr );
~QgsGPSInformationWidget();
private slots:

View File

@ -122,7 +122,7 @@ static QgsLayerTreeGroup* _groupIndexToNode( int groupIndex, QgsLayerTreeGroup*
}
}
return 0;
return nullptr;
}
QgsLayerTreeGroup* QgsAppLegendInterface::groupIndexToNode( int itemIndex )
@ -237,7 +237,7 @@ QList< GroupLayerInfo > QgsAppLegendInterface::groupLayerRelationship()
bool QgsAppLegendInterface::groupExists( int groupIndex )
{
return groupIndexToNode( groupIndex ) != 0;
return groupIndexToNode( groupIndex ) != nullptr;
}
bool QgsAppLegendInterface::isGroupExpanded( int groupIndex )

View File

@ -81,7 +81,7 @@ class QgsAppLegendInterface : public QgsLegendInterface
public slots:
//! Add a new group
int addGroup( const QString& name, bool expand = true, QTreeWidgetItem* parent = 0 ) override;
int addGroup( const QString& name, bool expand = true, QTreeWidgetItem* parent = nullptr ) override;
//! Add a new group at a specified index
int addGroup( const QString& name, bool expand, int groupIndex ) override;

View File

@ -211,7 +211,7 @@ static void dumpBacktrace( unsigned int depth )
}
close( fd[1] ); // close writing end
execl( "/usr/bin/c++filt", "c++filt", ( char * ) 0 );
execl( "/usr/bin/c++filt", "c++filt", ( char * ) nullptr );
perror( "could not start c++filt" );
exit( 1 );
}
@ -456,7 +456,7 @@ int main( int argc, char *argv[] )
#endif
// initialize random number seed
qsrand( time( NULL ) );
qsrand( time( nullptr ) );
/////////////////////////////////////////////////////////////////
// Command line options 'behaviour' flag setup
@ -720,7 +720,7 @@ int main( int argc, char *argv[] )
/////////////////////////////////////////////////////////////////////
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(ANDROID)
bool myUseGuiFlag = getenv( "DISPLAY" ) != 0;
bool myUseGuiFlag = getenv( "DISPLAY" ) != nullptr;
#else
bool myUseGuiFlag = true;
#endif
@ -934,8 +934,8 @@ int main( int argc, char *argv[] )
}
}
QTranslator qgistor( 0 );
QTranslator qttor( 0 );
QTranslator qgistor( nullptr );
QTranslator qttor( nullptr );
if ( myTranslationCode != "C" )
{
if ( qgistor.load( QString( "qgis_" ) + myTranslationCode, i18nPath ) )

View File

@ -33,14 +33,14 @@
QgsMapToolNodeTool::QgsMapToolNodeTool( QgsMapCanvas* canvas )
: QgsMapToolEdit( canvas )
, mSelectRubberBand( 0 )
, mSelectedFeature( 0 )
, mNodeEditor( 0 )
, mSelectRubberBand( nullptr )
, mSelectedFeature( nullptr )
, mNodeEditor( nullptr )
, mMoving( true )
, mSelectAnother( false )
, mAnother( 0 )
, mSelectionRubberBand( 0 )
, mRect( 0 )
, mSelectionRubberBand( nullptr )
, mRect( nullptr )
, mIsPoint( false )
, mDeselectOnRelease( -1 )
{
@ -403,9 +403,9 @@ void QgsMapToolNodeTool::canvasReleaseEvent( QgsMapMouseEvent* e )
if ( mRect )
{
delete mSelectionRubberBand;
mSelectionRubberBand = 0;
mSelectionRubberBand = nullptr;
delete mRect;
mRect = 0;
mRect = nullptr;
}
if ( mPressCoordinates == e->pos() )
@ -495,7 +495,7 @@ void QgsMapToolNodeTool::deactivate()
{
cleanTool();
mSelectionRubberBand = 0;
mSelectionRubberBand = nullptr;
mSelectAnother = false;
mMoving = true;
@ -516,7 +516,7 @@ void QgsMapToolNodeTool::cleanTool( bool deleteSelectedFeature )
if ( mSelectRubberBand )
{
delete mSelectRubberBand;
mSelectRubberBand = 0;
mSelectRubberBand = nullptr;
}
if ( mSelectedFeature )
@ -531,13 +531,13 @@ void QgsMapToolNodeTool::cleanTool( bool deleteSelectedFeature )
if ( deleteSelectedFeature )
delete mSelectedFeature;
mSelectedFeature = 0;
mSelectedFeature = nullptr;
}
if ( mNodeEditor )
{
delete mNodeEditor;
mNodeEditor = 0;
mNodeEditor = nullptr;
}
}

View File

@ -37,7 +37,7 @@ class QgsNodeEditorModel : public QAbstractTableModel
QgsNodeEditorModel( QgsVectorLayer* layer,
QgsSelectedFeature* selectedFeature,
QgsMapCanvas* canvas, QObject* parent = 0 );
QgsMapCanvas* canvas, QObject* parent = nullptr );
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const override;
int columnCount( const QModelIndex &parent = QModelIndex() ) const override;

View File

@ -31,9 +31,9 @@ QgsSelectedFeature::QgsSelectedFeature( QgsFeatureId featureId,
QgsVectorLayer *vlayer,
QgsMapCanvas *canvas )
: mFeatureId( featureId )
, mGeometry( 0 )
, mGeometry( nullptr )
, mChangingGeometry( false )
, mValidator( 0 )
, mValidator( nullptr )
{
QgsDebugCall;
setSelectedFeature( featureId, vlayer, canvas );
@ -55,7 +55,7 @@ QgsSelectedFeature::~QgsSelectedFeature()
mValidator->stop();
mValidator->wait();
mValidator->deleteLater();
mValidator = 0;
mValidator = nullptr;
}
delete mGeometry;
@ -93,7 +93,7 @@ void QgsSelectedFeature::setSelectedFeature( QgsFeatureId featureId, QgsVectorLa
mCanvas = canvas;
delete mGeometry;
mGeometry = 0;
mGeometry = nullptr;
// signal changing of current layer
connect( QgisApp::instance()->layerTreeView(), SIGNAL( currentLayerChanged( QgsMapLayer* ) ), this, SLOT( currentLayerChanged( QgsMapLayer* ) ) );
@ -177,7 +177,7 @@ void QgsSelectedFeature::validateGeometry( QgsGeometry *g )
mValidator->stop();
mValidator->wait();
mValidator->deleteLater();
mValidator = 0;
mValidator = nullptr;
}
mGeomErrors.clear();
@ -319,7 +319,7 @@ void QgsSelectedFeature::moveSelectedVertexes( const QgsVector &v )
QMultiMap<double, QgsSnappingResult> currentResultList;
for ( int i = mVertexMap.size() - 1; i > -1 && nUpdates > 0; i-- )
{
QgsVertexEntry *entry = mVertexMap.value( i, 0 );
QgsVertexEntry *entry = mVertexMap.value( i, nullptr );
if ( !entry || !entry->isSelected() )
continue;
@ -400,7 +400,7 @@ void QgsSelectedFeature::createVertexMap()
if ( !mGeometry )
{
QgsDebugMsg( "Loading feature" );
updateGeometry( 0 );
updateGeometry( nullptr );
}
if ( !mGeometry )

View File

@ -194,7 +194,7 @@ class QgsSelectedFeature: public QObject
/**
* Validates the geometry
*/
void validateGeometry( QgsGeometry *g = 0 );
void validateGeometry( QgsGeometry *g = nullptr );
QgsFeatureId mFeatureId;
QgsGeometry *mGeometry;

View File

@ -23,7 +23,7 @@ QgsVertexEntry::QgsVertexEntry( QgsMapCanvas *canvas, QgsMapLayer *layer, const
, mPenWidth( penWidth )
, mToolTip( tooltip )
, mType( type )
, mMarker( 0 )
, mMarker( nullptr )
, mCanvas( canvas )
, mLayer( layer )
{
@ -64,7 +64,7 @@ void QgsVertexEntry::placeMarker()
else if ( mMarker )
{
delete mMarker;
mMarker = 0;
mMarker = nullptr;
}
}

View File

@ -89,7 +89,7 @@ void QgsNewOgrConnection::testConnection()
OGRSFDriverH pahDriver;
CPLErrorReset();
poDS = OGROpen( TO8F( uri ), false, &pahDriver );
if ( poDS == NULL )
if ( poDS == nullptr )
{
QMessageBox::information( this, tr( "Test connection" ), tr( "Connection failed - Check settings and try again.\n\nExtended error information:\n%1" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
}

View File

@ -31,7 +31,7 @@ class QgsNewOgrConnection : public QDialog, private Ui::QgsNewOgrConnectionBase
public:
//! Constructor
QgsNewOgrConnection( QWidget *parent = 0, const QString& connType = QString::null, const QString& connName = QString::null, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
QgsNewOgrConnection( QWidget *parent = nullptr, const QString& connType = QString::null, const QString& connName = QString::null, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
//! Destructor
~QgsNewOgrConnection();
//! Tests the connection using the parameters supplied

View File

@ -32,7 +32,7 @@ class QgsOpenVectorLayerDialog : public QDialog, private Ui::QgsOpenVectorLayerD
Q_OBJECT
public:
QgsOpenVectorLayerDialog( QWidget* parent = 0, Qt::WindowFlags fl = 0 );
QgsOpenVectorLayerDialog( QWidget* parent = nullptr, Qt::WindowFlags fl = nullptr );
~QgsOpenVectorLayerDialog();
//! Opens a dialog to select a file datasource*/
QStringList openFile();

View File

@ -119,7 +119,7 @@ QList<QPair<QLabel*, QWidget*> > QgsVectorLayerSaveAsDialog::createControls( con
{
QgsVectorFileWriter::Option *option = it.value();
QLabel *label = new QLabel( it.key() );
QWidget *control = 0;
QWidget *control = nullptr;
switch ( option->type )
{
case QgsVectorFileWriter::Int:
@ -170,7 +170,7 @@ QList<QPair<QLabel*, QWidget*> > QgsVectorLayerSaveAsDialog::createControls( con
}
case QgsVectorFileWriter::Hidden:
control = 0;
control = nullptr;
break;
}
@ -293,7 +293,7 @@ void QgsVectorLayerSaveAsDialog::on_browseFilename_clicked()
QSettings settings;
QString dirName = leFilename->text().isEmpty() ? settings.value( "/UI/lastVectorFileFilterDir", QDir::homePath() ).toString() : leFilename->text();
QString filterString = QgsVectorFileWriter::filterForDriver( format() );
QString outputFile = QFileDialog::getSaveFileName( 0, tr( "Save layer as..." ), dirName, filterString );
QString outputFile = QFileDialog::getSaveFileName( nullptr, tr( "Save layer as..." ), dirName, filterString );
if ( !outputFile.isNull() )
{
leFilename->setText( outputFile );

View File

@ -38,8 +38,8 @@ class QgsVectorLayerSaveAsDialog : public QDialog, private Ui::QgsVectorLayerSav
AllOptions = ~0
};
QgsVectorLayerSaveAsDialog( long srsid, QWidget* parent = 0, Qt::WindowFlags fl = 0 );
QgsVectorLayerSaveAsDialog( long srsid, const QgsRectangle& layerExtent, bool layerHasSelectedFeatures, int options = AllOptions, QWidget* parent = 0, Qt::WindowFlags fl = 0 );
QgsVectorLayerSaveAsDialog( long srsid, QWidget* parent = nullptr, Qt::WindowFlags fl = nullptr );
QgsVectorLayerSaveAsDialog( long srsid, const QgsRectangle& layerExtent, bool layerHasSelectedFeatures, int options = AllOptions, QWidget* parent = nullptr, Qt::WindowFlags fl = nullptr );
~QgsVectorLayerSaveAsDialog();
QString format() const;

View File

@ -28,7 +28,7 @@ class QgsOSMDownloadDialog : public QDialog, private Ui::QgsOSMDownloadDialog
{
Q_OBJECT
public:
explicit QgsOSMDownloadDialog( QWidget* parent = 0 );
explicit QgsOSMDownloadDialog( QWidget* parent = nullptr );
~QgsOSMDownloadDialog();
void setRect( const QgsRectangle& rect );

View File

@ -28,7 +28,7 @@ class QgsOSMExportDialog : public QDialog, private Ui::QgsOSMExportDialog
{
Q_OBJECT
public:
explicit QgsOSMExportDialog( QWidget *parent = 0 );
explicit QgsOSMExportDialog( QWidget *parent = nullptr );
~QgsOSMExportDialog();
protected:

View File

@ -26,7 +26,7 @@ class QgsOSMImportDialog : public QDialog, private Ui::QgsOSMImportDialog
{
Q_OBJECT
public:
explicit QgsOSMImportDialog( QWidget* parent = 0 );
explicit QgsOSMImportDialog( QWidget* parent = nullptr );
~QgsOSMImportDialog();
private slots:

View File

@ -45,7 +45,7 @@ void QgsPluginItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem
int pixelsHigh = QApplication::fontMetrics().height();
// Draw the background
style->drawPrimitive( QStyle::PE_PanelItemViewItem, &option, painter, NULL );
style->drawPrimitive( QStyle::PE_PanelItemViewItem, &option, painter, nullptr );
// Draw the checkbox
if ( index.flags() & Qt::ItemIsUserCheckable )

View File

@ -26,7 +26,7 @@ class QgsPluginItemDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
explicit QgsPluginItemDelegate( QObject * parent = 0 );
explicit QgsPluginItemDelegate( QObject * parent = nullptr );
QSize sizeHint( const QStyleOptionViewItem & theOption, const QModelIndex & theIndex ) const override;
void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
};

View File

@ -60,7 +60,7 @@ QgsPluginManager::QgsPluginManager( QWidget * parent, bool pluginsAreEnabled, Qt
: QgsOptionsDialogBase( "PluginManager", parent, fl )
{
// initialize pointer
mPythonUtils = NULL;
mPythonUtils = nullptr;
setupUi( this );
@ -912,7 +912,7 @@ const QMap<QString, QString> * QgsPluginManager::pluginMetadata( const QString&
{
return &it.value();
}
return NULL;
return nullptr;
}

View File

@ -47,7 +47,7 @@ class QgsPluginManager : public QgsOptionsDialogBase, private Ui::QgsPluginManag
Q_OBJECT
public:
//! Constructor; set pluginsAreEnabled to false in --noplugins mode
QgsPluginManager( QWidget *parent = 0, bool pluginsAreEnabled = true, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
QgsPluginManager( QWidget *parent = nullptr, bool pluginsAreEnabled = true, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
//! Destructor
~QgsPluginManager();

View File

@ -42,7 +42,7 @@ class QgsPluginSortFilterProxyModel : public QSortFilterProxyModel
Q_OBJECT
public:
explicit QgsPluginSortFilterProxyModel( QObject *parent = 0 );
explicit QgsPluginSortFilterProxyModel( QObject *parent = nullptr );
//! (Re)configire the status filter
void setAcceptedStatuses( const QStringList& statuses );

View File

@ -521,42 +521,42 @@ static bool cmpByText_( QAction* a, QAction* b )
}
QgisApp *QgisApp::smInstance = 0;
QgisApp *QgisApp::smInstance = nullptr;
// constructor starts here
QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent, Qt::WindowFlags fl )
: QMainWindow( parent, fl )
, mNonEditMapTool( 0 )
, mScaleLabel( 0 )
, mScaleEdit( 0 )
, mScaleEditValidator( 0 )
, mCoordsEdit( 0 )
, mRotationLabel( 0 )
, mRotationEdit( 0 )
, mRotationEditValidator( 0 )
, mProgressBar( 0 )
, mRenderSuppressionCBox( 0 )
, mOnTheFlyProjectionStatusLabel( 0 )
, mOnTheFlyProjectionStatusButton( 0 )
, mMessageButton( 0 )
, mFeatureActionMenu( 0 )
, mPopupMenu( 0 )
, mDatabaseMenu( 0 )
, mWebMenu( 0 )
, mToolPopupOverviews( 0 )
, mToolPopupDisplay( 0 )
, mLayerTreeCanvasBridge( 0 )
, mNonEditMapTool( nullptr )
, mScaleLabel( nullptr )
, mScaleEdit( nullptr )
, mScaleEditValidator( nullptr )
, mCoordsEdit( nullptr )
, mRotationLabel( nullptr )
, mRotationEdit( nullptr )
, mRotationEditValidator( nullptr )
, mProgressBar( nullptr )
, mRenderSuppressionCBox( nullptr )
, mOnTheFlyProjectionStatusLabel( nullptr )
, mOnTheFlyProjectionStatusButton( nullptr )
, mMessageButton( nullptr )
, mFeatureActionMenu( nullptr )
, mPopupMenu( nullptr )
, mDatabaseMenu( nullptr )
, mWebMenu( nullptr )
, mToolPopupOverviews( nullptr )
, mToolPopupDisplay( nullptr )
, mLayerTreeCanvasBridge( nullptr )
, mSplash( splash )
, mInternalClipboard( 0 )
, mInternalClipboard( nullptr )
, mShowProjectionTab( false )
, mPythonUtils( 0 )
, mComposerManager( 0 )
, mpTileScaleWidget( 0 )
, mpGpsWidget( 0 )
, mSnappingUtils( 0 )
, mPythonUtils( nullptr )
, mComposerManager( nullptr )
, mpTileScaleWidget( nullptr )
, mpGpsWidget( nullptr )
, mSnappingUtils( nullptr )
, mProjectLastModified()
, mWelcomePage( 0 )
, mCentralContainer( 0 )
, mWelcomePage( nullptr )
, mCentralContainer( nullptr )
{
if ( smInstance )
{
@ -657,7 +657,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
mLayerTreeView->setObjectName( "theLayerTreeView" ); // "theLayerTreeView" used to find this canonical instance later
// create undo widget
mUndoWidget = new QgsUndoWidget( NULL, mMapCanvas );
mUndoWidget = new QgsUndoWidget( nullptr, mMapCanvas );
mUndoWidget->setObjectName( "Undo" );
// Advanced Digitizing dock
@ -743,7 +743,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
mpGpsDock->setWidget( mpGpsWidget );
mpGpsDock->hide();
mLastMapToolMessage = 0;
mLastMapToolMessage = nullptr;
mLogViewer = new QgsMessageLogViewer( statusBar(), this );
@ -775,7 +775,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
addWindow( mWindowAction );
#endif
activateDeactivateLayerRelatedActions( NULL ); // after members were created
activateDeactivateLayerRelatedActions( nullptr ); // after members were created
connect( QgsMapLayerActionRegistry::instance(), SIGNAL( changed() ), this, SLOT( refreshActionFeatureAction() ) );
@ -839,7 +839,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
{
// python is disabled so get rid of the action for python console
delete mActionShowPythonDialog;
mActionShowPythonDialog = 0;
mActionShowPythonDialog = nullptr;
}
// Set icon size of toolbars
@ -921,7 +921,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
#else
//remove mActionTouch button
delete mActionTouch;
mActionTouch = 0;
mActionTouch = nullptr;
#endif
// supposedly all actions have been added, now register them to the shortcut manager
@ -948,83 +948,83 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
} // QgisApp ctor
QgisApp::QgisApp()
: QMainWindow( 0, 0 )
, mStyleSheetBuilder( 0 )
, mActionPluginSeparator1( 0 )
, mActionPluginSeparator2( 0 )
, mActionRasterSeparator( 0 )
, mMapToolGroup( 0 )
, mPreviewGroup( 0 )
: QMainWindow( nullptr, nullptr )
, mStyleSheetBuilder( nullptr )
, mActionPluginSeparator1( nullptr )
, mActionPluginSeparator2( nullptr )
, mActionRasterSeparator( nullptr )
, mMapToolGroup( nullptr )
, mPreviewGroup( nullptr )
#ifdef Q_OS_MAC
, mWindowMenu( 0 )
#endif
, mPanelMenu( 0 )
, mToolbarMenu( 0 )
, mLayerTreeDock( 0 )
, mLayerOrderDock( 0 )
, mOverviewDock( 0 )
, mpGpsDock( 0 )
, mLogDock( 0 )
, mNonEditMapTool( 0 )
, mScaleLabel( 0 )
, mScaleEdit( 0 )
, mScaleEditValidator( 0 )
, mCoordsEdit( 0 )
, mRotationLabel( 0 )
, mRotationEdit( 0 )
, mRotationEditValidator( 0 )
, mProgressBar( 0 )
, mRenderSuppressionCBox( 0 )
, mOnTheFlyProjectionStatusLabel( 0 )
, mOnTheFlyProjectionStatusButton( 0 )
, mMessageButton( 0 )
, mFeatureActionMenu( 0 )
, mPopupMenu( 0 )
, mDatabaseMenu( 0 )
, mWebMenu( 0 )
, mToolPopupOverviews( 0 )
, mToolPopupDisplay( 0 )
, mMapCanvas( 0 )
, mOverviewCanvas( 0 )
, mLayerTreeView( 0 )
, mLayerTreeCanvasBridge( 0 )
, mMapLayerOrder( 0 )
, mOverviewMapCursor( 0 )
, mMapWindow( 0 )
, mQgisInterface( 0 )
, mSplash( 0 )
, mInternalClipboard( 0 )
, mPanelMenu( nullptr )
, mToolbarMenu( nullptr )
, mLayerTreeDock( nullptr )
, mLayerOrderDock( nullptr )
, mOverviewDock( nullptr )
, mpGpsDock( nullptr )
, mLogDock( nullptr )
, mNonEditMapTool( nullptr )
, mScaleLabel( nullptr )
, mScaleEdit( nullptr )
, mScaleEditValidator( nullptr )
, mCoordsEdit( nullptr )
, mRotationLabel( nullptr )
, mRotationEdit( nullptr )
, mRotationEditValidator( nullptr )
, mProgressBar( nullptr )
, mRenderSuppressionCBox( nullptr )
, mOnTheFlyProjectionStatusLabel( nullptr )
, mOnTheFlyProjectionStatusButton( nullptr )
, mMessageButton( nullptr )
, mFeatureActionMenu( nullptr )
, mPopupMenu( nullptr )
, mDatabaseMenu( nullptr )
, mWebMenu( nullptr )
, mToolPopupOverviews( nullptr )
, mToolPopupDisplay( nullptr )
, mMapCanvas( nullptr )
, mOverviewCanvas( nullptr )
, mLayerTreeView( nullptr )
, mLayerTreeCanvasBridge( nullptr )
, mMapLayerOrder( nullptr )
, mOverviewMapCursor( nullptr )
, mMapWindow( nullptr )
, mQgisInterface( nullptr )
, mSplash( nullptr )
, mInternalClipboard( nullptr )
, mShowProjectionTab( false )
, mpMapTipsTimer( 0 )
, mpMaptip( 0 )
, mpMapTipsTimer( nullptr )
, mpMaptip( nullptr )
, mMapTipsVisible( false )
, mFullScreenMode( false )
, mPrevScreenModeMaximized( false )
, mSaveRollbackInProgress( false )
, mPythonUtils( 0 )
, mBrowserWidget( 0 )
, mBrowserWidget2( 0 )
, mAdvancedDigitizingDockWidget( 0 )
, mStatisticalSummaryDockWidget( 0 )
, mBookMarksDockWidget( 0 )
, mSnappingDialog( 0 )
, mPluginManager( 0 )
, mComposerManager( 0 )
, mpTileScaleWidget( 0 )
, mPythonUtils( nullptr )
, mBrowserWidget( nullptr )
, mBrowserWidget2( nullptr )
, mAdvancedDigitizingDockWidget( nullptr )
, mStatisticalSummaryDockWidget( nullptr )
, mBookMarksDockWidget( nullptr )
, mSnappingDialog( nullptr )
, mPluginManager( nullptr )
, mComposerManager( nullptr )
, mpTileScaleWidget( nullptr )
, mLastComposerId( 0 )
, mpGpsWidget( 0 )
, mLastMapToolMessage( 0 )
, mLogViewer( 0 )
, mpGpsWidget( nullptr )
, mLastMapToolMessage( nullptr )
, mLogViewer( nullptr )
, mTrustedMacros( false )
, mMacrosWarn( 0 )
, mUserInputDockWidget( 0 )
, mVectorLayerTools( 0 )
, mActionFilterLegend( 0 )
, mLegendExpressionFilterButton( 0 )
, mSnappingUtils( 0 )
, mMacrosWarn( nullptr )
, mUserInputDockWidget( nullptr )
, mVectorLayerTools( nullptr )
, mActionFilterLegend( nullptr )
, mLegendExpressionFilterButton( nullptr )
, mSnappingUtils( nullptr )
, mProjectLastModified()
, mWelcomePage( 0 )
, mCentralContainer( 0 )
, mWelcomePage( nullptr )
, mCentralContainer( nullptr )
, mProjOpen( 0 )
{
smInstance = this;
@ -1033,7 +1033,7 @@ QgisApp::QgisApp()
mMapCanvas = new QgsMapCanvas();
mMapCanvas->freeze();
mLayerTreeView = new QgsLayerTreeView( this );
mUndoWidget = new QgsUndoWidget( NULL, mMapCanvas );
mUndoWidget = new QgsUndoWidget( nullptr, mMapCanvas );
mInfoBar = new QgsMessageBar( centralWidget() );
// More tests may need more members to be initialized
}
@ -1104,7 +1104,7 @@ QgisApp::~QgisApp()
removeAnnotationItems();
// cancel request for FileOpen events
QgsApplication::setFileOpenEventReceiver( 0 );
QgsApplication::setFileOpenEventReceiver( nullptr );
QgsApplication::exitQgis();
@ -1306,9 +1306,9 @@ void QgisApp::readSettings()
void QgisApp::createActions()
{
mActionPluginSeparator1 = NULL; // plugin list separator will be created when the first plugin is loaded
mActionPluginSeparator2 = NULL; // python separator will be created only if python is found
mActionRasterSeparator = NULL; // raster plugins list separator will be created when the first plugin is loaded
mActionPluginSeparator1 = nullptr; // plugin list separator will be created when the first plugin is loaded
mActionPluginSeparator2 = nullptr; // python separator will be created only if python is found
mActionRasterSeparator = nullptr; // raster plugins list separator will be created when the first plugin is loaded
// Project Menu Items
@ -1540,7 +1540,7 @@ void QgisApp::createActions()
#ifndef HAVE_ORACLE
delete mActionAddOracleLayer;
mActionAddOracleLayer = 0;
mActionAddOracleLayer = nullptr;
#endif
}
@ -1699,7 +1699,7 @@ void QgisApp::createMenus()
// Get platform for menu layout customization (Gnome, Kde, Mac, Win)
QDialogButtonBox::ButtonLayout layout =
QDialogButtonBox::ButtonLayout( style()->styleHint( QStyle::SH_DialogButtonLayout, 0, this ) );
QDialogButtonBox::ButtonLayout( style()->styleHint( QStyle::SH_DialogButtonLayout, nullptr, this ) );
// Project Menu
@ -2498,7 +2498,7 @@ void QgisApp::createCanvasTools()
void QgisApp::createOverview()
{
// overview canvas
mOverviewCanvas = new QgsMapOverviewCanvas( NULL, mMapCanvas );
mOverviewCanvas = new QgsMapOverviewCanvas( nullptr, mMapCanvas );
//set canvas color to default
QSettings settings;
@ -3005,7 +3005,7 @@ void QgisApp::sponsors()
void QgisApp::about()
{
static QgsAbout *abt = NULL;
static QgsAbout *abt = nullptr;
if ( !abt )
{
QApplication::setOverrideCursor( Qt::WaitCursor );
@ -3271,7 +3271,7 @@ bool QgisApp::askUserForZipItemLayers( QString path )
{
bool ok = false;
QVector<QgsDataItem*> childItems;
QgsZipItem *zipItem = 0;
QgsZipItem *zipItem = nullptr;
QSettings settings;
int promptLayers = settings.value( "/qgis/promptForRasterSublayers", 1 ).toInt();
@ -3283,7 +3283,7 @@ bool QgisApp::askUserForZipItemLayers( QString path )
return false;
}
zipItem = new QgsZipItem( 0, path, path );
zipItem = new QgsZipItem( nullptr, path, path );
if ( ! zipItem )
return false;
@ -3469,7 +3469,7 @@ bool QgisApp::shouldAskUserForGDALSublayers( QgsRasterLayer *layer )
void QgisApp::loadGDALSublayers( const QString& uri, const QStringList& list )
{
QString path, name;
QgsRasterLayer *subLayer = NULL;
QgsRasterLayer *subLayer = nullptr;
//add layers in reverse order so they appear in the right order in the layer dock
for ( int i = list.size() - 1; i >= 0 ; i-- )
@ -4560,7 +4560,7 @@ void QgisApp::openProject( QAction *action )
{
// possibly save any pending work before opening a different project
QString debugme;
assert( action != NULL );
assert( action != nullptr );
debugme = action->data().toString();
@ -4710,7 +4710,7 @@ void QgisApp::showComposerManager()
{
if ( !mComposerManager )
{
mComposerManager = new QgsComposerManager( 0, Qt::Window );
mComposerManager = new QgsComposerManager( nullptr, Qt::Window );
connect( mComposerManager, SIGNAL( finished( int ) ), this, SLOT( deleteComposerManager() ) );
}
mComposerManager->show();
@ -4720,7 +4720,7 @@ void QgisApp::showComposerManager()
void QgisApp::deleteComposerManager()
{
mComposerManager->deleteLater();
mComposerManager = 0;
mComposerManager = nullptr;
}
void QgisApp::disablePreviewMode()
@ -4779,7 +4779,7 @@ void QgisApp::updateFilterLegend()
}
else
{
layerTreeView()->layerTreeModel()->setLegendFilterByMap( 0 );
layerTreeView()->layerTreeModel()->setLegendFilterByMap( nullptr );
}
}
@ -4789,7 +4789,7 @@ void QgisApp::saveMapAsImage()
if ( myFileNameAndFilter.first != "" )
{
//save the mapview to the selected file
mMapCanvas->saveAsImage( myFileNameAndFilter.first, NULL, myFileNameAndFilter.second );
mMapCanvas->saveAsImage( myFileNameAndFilter.first, nullptr, myFileNameAndFilter.second );
statusBar()->showMessage( tr( "Saved map image to %1" ).arg( myFileNameAndFilter.first ) );
}
@ -5066,7 +5066,7 @@ void QgisApp::updateDefaultFeatureAction( QAction *action )
if ( vlayer->actions()->size() > 0 && index < vlayer->actions()->size() )
{
vlayer->actions()->setDefaultAction( index );
QgsMapLayerActionRegistry::instance()->setDefaultActionForLayer( vlayer, 0 );
QgsMapLayerActionRegistry::instance()->setDefaultActionForLayer( vlayer, nullptr );
}
else
{
@ -5080,7 +5080,7 @@ void QgisApp::updateDefaultFeatureAction( QAction *action )
}
else
{
QgsMapLayerActionRegistry::instance()->setDefaultActionForLayer( vlayer, 0 );
QgsMapLayerActionRegistry::instance()->setDefaultActionForLayer( vlayer, nullptr );
}
}
@ -5367,7 +5367,7 @@ void QgisApp::saveAsRasterFile()
fileWriter.setMaxTileHeight( d.maximumTileSizeY() );
}
QProgressDialog pd( 0, tr( "Abort..." ), 0, 0 );
QProgressDialog pd( nullptr, tr( "Abort..." ), 0, 0 );
// Show the dialo immediately because cloning pipe can take some time (WCS)
pd.setLabelText( tr( "Reading raster" ) );
pd.setWindowTitle( tr( "Saving raster" ) );
@ -5377,7 +5377,7 @@ void QgisApp::saveAsRasterFile()
// TODO: show error dialogs
// TODO: this code should go somewhere else, but probably not into QgsRasterFileWriter
// clone pipe/provider is not really necessary, ready for threads
QScopedPointer<QgsRasterPipe> pipe( 0 );
QScopedPointer<QgsRasterPipe> pipe( nullptr );
if ( d.mode() == QgsRasterLayerSaveAsDialog::RawDataMode )
{
@ -5526,7 +5526,7 @@ void QgisApp::saveAsVectorFileGeneral( QgsVectorLayer* vlayer, bool symbologyOpt
bool autoGeometryType = dialog->automaticGeometryType();
QgsWKBTypes::Type forcedGeometryType = dialog->geometryType();
QgsCoordinateTransform* ct = 0;
QgsCoordinateTransform* ct = nullptr;
destCRS = QgsCoordinateReferenceSystem( dialog->crs(), QgsCoordinateReferenceSystem::InternalCrsId );
if ( destCRS.isValid() && destCRS != vlayer->crs() )
@ -5571,7 +5571,7 @@ void QgisApp::saveAsVectorFileGeneral( QgsVectorLayer* vlayer, bool symbologyOpt
&newFilename,
( QgsVectorFileWriter::SymbologyExport )( dialog->symbologyExport() ),
dialog->scaleDenominator(),
dialog->hasFilterExtent() ? &filterExtent : 0,
dialog->hasFilterExtent() ? &filterExtent : nullptr,
autoGeometryType ? QgsWKBTypes::Unknown : forcedGeometryType,
dialog->forceMulti(),
dialog->includeZ()
@ -5594,7 +5594,7 @@ void QgisApp::saveAsVectorFileGeneral( QgsVectorLayer* vlayer, bool symbologyOpt
}
else
{
QgsMessageViewer *m = new QgsMessageViewer( 0 );
QgsMessageViewer *m = new QgsMessageViewer( nullptr );
m->setWindowTitle( tr( "Save error" ) );
m->setMessageAsPlainText( tr( "Export to vector file failed.\nError: %1" ).arg( errorMessage ) );
m->exec();
@ -5751,14 +5751,14 @@ QgsGeometry* QgisApp::unionGeometries( const QgsVectorLayer* vl, QgsFeatureList&
canceled = false;
if ( !vl || featureList.size() < 2 )
{
return 0;
return nullptr;
}
QgsGeometry* unionGeom = featureList[0].geometry();
QgsGeometry* backupPtr = 0; //pointer to delete intermediate results
QgsGeometry* backupPtr = nullptr; //pointer to delete intermediate results
if ( !unionGeom )
{
return 0;
return nullptr;
}
QProgressDialog progress( tr( "Merging features..." ), tr( "Abort" ), 0, featureList.size(), this );
@ -5773,7 +5773,7 @@ QgsGeometry* QgisApp::unionGeometries( const QgsVectorLayer* vl, QgsFeatureList&
delete unionGeom;
QApplication::restoreOverrideCursor();
canceled = true;
return 0;
return nullptr;
}
progress.setValue( i );
QgsGeometry* currentGeom = featureList[i].geometry();
@ -5784,12 +5784,12 @@ QgsGeometry* QgisApp::unionGeometries( const QgsVectorLayer* vl, QgsFeatureList&
if ( i > 1 ) //delete previous intermediate results
{
delete backupPtr;
backupPtr = 0;
backupPtr = nullptr;
}
if ( !unionGeom )
{
QApplication::restoreOverrideCursor();
return 0;
return nullptr;
}
}
}
@ -5917,7 +5917,7 @@ void QgisApp::deleteComposer( QgsComposer* c )
QgsComposer* QgisApp::duplicateComposer( QgsComposer* currentComposer, QString title )
{
QgsComposer* newComposer = 0;
QgsComposer* newComposer = nullptr;
// test that current composer template write is valid
QDomDocument currentDoc;
@ -5945,10 +5945,10 @@ QgsComposer* QgisApp::duplicateComposer( QgsComposer* currentComposer, QString t
// hiding composer until template is loaded is much faster, provide feedback to user
newComposer->hide();
QApplication::setOverrideCursor( Qt::BusyCursor );
if ( !newComposer->composition()->loadFromTemplate( currentDoc, 0, false ) )
if ( !newComposer->composition()->loadFromTemplate( currentDoc, nullptr, false ) )
{
deleteComposer( newComposer );
newComposer = 0;
newComposer = nullptr;
QgsDebugMsg( "Error, composer could not be duplicated" );
return newComposer;
}
@ -6180,13 +6180,13 @@ void QgisApp::mergeAttributesOfSelectedFeatures()
QgsVectorLayer* vl = qobject_cast<QgsVectorLayer *>( activeMapLayer );
if ( !vl )
{
QMessageBox::information( 0, tr( "Active layer is not vector" ), tr( "The merge features tool only works on vector layers. Please select a vector layer from the layer list" ) );
QMessageBox::information( nullptr, tr( "Active layer is not vector" ), tr( "The merge features tool only works on vector layers. Please select a vector layer from the layer list" ) );
return;
}
if ( !vl->isEditable() )
{
QMessageBox::information( 0, tr( "Layer not editable" ), tr( "Merging features can only be done for layers in editing mode. To use the merge tool, go to Layer->Toggle editing" ) );
QMessageBox::information( nullptr, tr( "Layer not editable" ), tr( "Merging features can only be done for layers in editing mode. To use the merge tool, go to Layer->Toggle editing" ) );
return;
}
@ -6194,7 +6194,7 @@ void QgisApp::mergeAttributesOfSelectedFeatures()
const QgsFeatureIds& featureIdSet = vl->selectedFeaturesIds();
if ( featureIdSet.size() < 2 )
{
QMessageBox::information( 0, tr( "Not enough features selected" ), tr( "The merge tool requires at least two selected features" ) );
QMessageBox::information( nullptr, tr( "Not enough features selected" ), tr( "The merge tool requires at least two selected features" ) );
return;
}
@ -6263,18 +6263,18 @@ void QgisApp::mergeSelectedFeatures()
QgsMapLayer* activeMapLayer = activeLayer();
if ( !activeMapLayer )
{
QMessageBox::information( 0, tr( "No active layer" ), tr( "No active layer found. Please select a layer in the layer list" ) );
QMessageBox::information( nullptr, tr( "No active layer" ), tr( "No active layer found. Please select a layer in the layer list" ) );
return;
}
QgsVectorLayer* vl = qobject_cast<QgsVectorLayer *>( activeMapLayer );
if ( !vl )
{
QMessageBox::information( 0, tr( "Active layer is not vector" ), tr( "The merge features tool only works on vector layers. Please select a vector layer from the layer list" ) );
QMessageBox::information( nullptr, tr( "Active layer is not vector" ), tr( "The merge features tool only works on vector layers. Please select a vector layer from the layer list" ) );
return;
}
if ( !vl->isEditable() )
{
QMessageBox::information( 0, tr( "Layer not editable" ), tr( "Merging features can only be done for layers in editing mode. To use the merge tool, go to Layer->Toggle editing" ) );
QMessageBox::information( nullptr, tr( "Layer not editable" ), tr( "Merging features can only be done for layers in editing mode. To use the merge tool, go to Layer->Toggle editing" ) );
return;
}
@ -6289,7 +6289,7 @@ void QgisApp::mergeSelectedFeatures()
const QgsFeatureIds& featureIdSet = vl->selectedFeaturesIds();
if ( featureIdSet.size() < 2 )
{
QMessageBox::information( 0, tr( "Not enough features selected" ), tr( "The merge tool requires at least two selected features" ) );
QMessageBox::information( nullptr, tr( "Not enough features selected" ), tr( "The merge tool requires at least two selected features" ) );
return;
}
@ -6302,7 +6302,7 @@ void QgisApp::mergeSelectedFeatures()
{
if ( !canceled )
{
QMessageBox::critical( 0, tr( "Merge failed" ), tr( "An error occured during the merge operation" ) );
QMessageBox::critical( nullptr, tr( "Merge failed" ), tr( "An error occured during the merge operation" ) );
}
return;
}
@ -6310,7 +6310,7 @@ void QgisApp::mergeSelectedFeatures()
//make a first geometry union and notify the user straight away if the union geometry type does not match the layer one
if ( providerChecksTypeStrictly && unionGeom->wkbType() != vl->wkbType() )
{
QMessageBox::critical( 0, tr( "Union operation canceled" ), tr( "The union operation would result in a geometry type that is not compatible with the current layer and therefore is canceled" ) );
QMessageBox::critical( nullptr, tr( "Union operation canceled" ), tr( "The union operation would result in a geometry type that is not compatible with the current layer and therefore is canceled" ) );
delete unionGeom;
return;
}
@ -6327,7 +6327,7 @@ void QgisApp::mergeSelectedFeatures()
if ( featureIdsAfter.size() < 2 )
{
QMessageBox::information( 0, tr( "Not enough features selected" ), tr( "The merge tool requires at least two selected features" ) );
QMessageBox::information( nullptr, tr( "Not enough features selected" ), tr( "The merge tool requires at least two selected features" ) );
delete unionGeom;
return;
}
@ -6343,14 +6343,14 @@ void QgisApp::mergeSelectedFeatures()
{
if ( !canceled )
{
QMessageBox::critical( 0, tr( "Merge failed" ), tr( "An error occured during the merge operation" ) );
QMessageBox::critical( nullptr, tr( "Merge failed" ), tr( "An error occured during the merge operation" ) );
}
return;
}
if ( providerChecksTypeStrictly && unionGeom->wkbType() != vl->wkbType() )
{
QMessageBox::critical( 0, "Union operation canceled", tr( "The union operation would result in a geometry type that is not compatible with the current layer and therefore is canceled" ) );
QMessageBox::critical( nullptr, "Union operation canceled", tr( "The union operation would result in a geometry type that is not compatible with the current layer and therefore is canceled" ) );
delete unionGeom;
return;
}
@ -6689,7 +6689,7 @@ QgsVectorLayer *QgisApp::pasteAsNewMemoryVector( const QString & theLayerName )
tr( "Layer name" ), QLineEdit::Normal,
defaultName, &ok );
if ( !ok )
return 0;
return nullptr;
if ( layerName.isEmpty() )
{
@ -6699,7 +6699,7 @@ QgsVectorLayer *QgisApp::pasteAsNewMemoryVector( const QString & theLayerName )
QgsVectorLayer *layer = pasteToNewMemoryVector();
if ( !layer )
return 0;
return nullptr;
layer->setLayerName( layerName );
@ -6778,7 +6778,7 @@ QgsVectorLayer *QgisApp::pasteToNewMemoryVector()
if ( !message.isEmpty() )
{
QMessageBox::warning( this, tr( "Warning" ), message, QMessageBox::Ok );
return 0;
return nullptr;
}
QgsVectorLayer *layer = new QgsVectorLayer( typeName, "pasted_features", "memory" );
@ -6787,7 +6787,7 @@ QgsVectorLayer *QgisApp::pasteToNewMemoryVector()
{
delete layer;
QMessageBox::warning( this, tr( "Warning" ), tr( "Cannot create new layer" ), QMessageBox::Ok );
return 0;
return nullptr;
}
layer->startEditing();
@ -6802,7 +6802,7 @@ QgsVectorLayer *QgisApp::pasteToNewMemoryVector()
tr( "Cannot create field %1 (%2,%3)" ).arg( f.name(), f.typeName(), QVariant::typeToName( f.type() ) ),
QMessageBox::Ok );
delete layer;
return 0;
return nullptr;
}
}
@ -6819,7 +6819,7 @@ QgsVectorLayer *QgisApp::pasteToNewMemoryVector()
if ( QGis::singleType( wkbType ) != QGis::singleType( type ) )
{
feature.setGeometry( 0 );
feature.setGeometry( nullptr );
}
if ( QGis::isMultiType( wkbType ) && QGis::isSingleType( type ) )
@ -6831,7 +6831,7 @@ QgsVectorLayer *QgisApp::pasteToNewMemoryVector()
{
QgsDebugMsg( "Cannot add features or commit changes" );
delete layer;
return 0;
return nullptr;
}
layer->removeSelection();
@ -7038,7 +7038,7 @@ bool QgisApp::toggleEditing( QgsMapLayer *layer, bool allowCancel )
if ( allowCancel )
buttons |= QMessageBox::Cancel;
switch ( QMessageBox::information( 0,
switch ( QMessageBox::information( nullptr,
tr( "Stop editing" ),
tr( "Do you want to save the changes to layer %1?" ).arg( vlayer->name() ),
buttons ) )
@ -7149,7 +7149,7 @@ void QgisApp::cancelEdits( QgsMapLayer *layer, bool leaveEditable, bool triggerR
if ( !vlayer->rollBack( !leaveEditable ) )
{
mSaveRollbackInProgress = false;
QMessageBox::information( 0,
QMessageBox::information( nullptr,
tr( "Error" ),
tr( "Could not %1 changes to layer %2\n\nErrors: %3\n" )
.arg( leaveEditable ? tr( "rollback" ) : tr( "cancel" ),
@ -7249,7 +7249,7 @@ void QgisApp::cancelAllEdits( bool verifyAction )
bool QgisApp::verifyEditsActionDialog( const QString& act, const QString& upon )
{
bool res = false;
switch ( QMessageBox::information( 0,
switch ( QMessageBox::information( nullptr,
tr( "Current edits" ),
tr( "%1 current changes for %2 layer(s)?" )
.arg( act,
@ -7480,7 +7480,7 @@ void QgisApp::duplicateLayers( const QList<QgsMapLayer *>& lyrList )
Q_FOREACH ( QgsMapLayer * selectedLyr, selectedLyrs )
{
dupLayer = 0;
dupLayer = nullptr;
unSppType.clear();
layerDupName = selectedLyr->name() + ' ' + tr( "copy" );
@ -7576,7 +7576,7 @@ void QgisApp::duplicateLayers( const QList<QgsMapLayer *>& lyrList )
}
}
dupLayer = 0;
dupLayer = nullptr;
mMapCanvas->freeze( false );
@ -8234,7 +8234,7 @@ void QgisApp::openURL( QString url, bool useQgisDocDirectory )
/** Get a pointer to the currently selected map layer */
QgsMapLayer *QgisApp::activeLayer()
{
return mLayerTreeView ? mLayerTreeView->currentLayer() : 0;
return mLayerTreeView ? mLayerTreeView->currentLayer() : nullptr;
}
/** Set the current layer */
@ -8303,7 +8303,7 @@ QgsVectorLayer* QgisApp::addVectorLayer( const QString& vectorLayerPath, const Q
// The first layer loaded is not useful in that case. The user can select it in
// the list if he wants to load it.
delete layer;
layer = 0;
layer = nullptr;
}
else
{
@ -8322,7 +8322,7 @@ QgsVectorLayer* QgisApp::addVectorLayer( const QString& vectorLayerPath, const Q
delete layer;
mMapCanvas->freeze( false );
return NULL;
return nullptr;
}
// Only update the map if we frozen in this method
@ -8633,7 +8633,7 @@ void QgisApp::removePluginMenu( const QString& name, QAction* action )
if ( actions.indexOf( mActionPluginSeparator1 ) + 1 == end )
{
mPluginMenu->removeAction( mActionPluginSeparator1 );
mActionPluginSeparator1 = NULL;
mActionPluginSeparator1 = nullptr;
}
}
@ -8647,7 +8647,7 @@ QMenu* QgisApp::getDatabaseMenu( const QString& menuName )
QString dst = cleanedMenuName;
dst.remove( QChar( '&' ) );
QAction *before = NULL;
QAction *before = nullptr;
QList<QAction*> actions = mDatabaseMenu->actions();
for ( int i = 0; i < actions.count(); i++ )
{
@ -8686,7 +8686,7 @@ QMenu* QgisApp::getRasterMenu( const QString& menuName )
cleanedMenuName.remove( QChar( '&' ) );
#endif
QAction *before = NULL;
QAction *before = nullptr;
if ( !mActionRasterSeparator )
{
// First plugin - create plugin list separator
@ -8739,7 +8739,7 @@ QMenu* QgisApp::getVectorMenu( const QString& menuName )
QString dst = cleanedMenuName;
dst.remove( QChar( '&' ) );
QAction *before = NULL;
QAction *before = nullptr;
QList<QAction*> actions = mVectorMenu->actions();
for ( int i = 0; i < actions.count(); i++ )
{
@ -8780,7 +8780,7 @@ QMenu* QgisApp::getWebMenu( const QString& menuName )
QString dst = cleanedMenuName;
dst.remove( QChar( '&' ) );
QAction *before = NULL;
QAction *before = nullptr;
QList<QAction*> actions = mWebMenu->actions();
for ( int i = 0; i < actions.count(); i++ )
{
@ -8830,7 +8830,7 @@ void QgisApp::addPluginToDatabaseMenu( const QString& name, QAction* action )
if ( mDatabaseMenu->actions().count() != 1 )
return;
QAction* before = NULL;
QAction* before = nullptr;
QList<QAction*> actions = menuBar()->actions();
for ( int i = 0; i < actions.count(); i++ )
{
@ -8884,7 +8884,7 @@ void QgisApp::addPluginToWebMenu( const QString& name, QAction* action )
if ( mWebMenu->actions().count() != 1 )
return;
QAction* before = NULL;
QAction* before = nullptr;
QList<QAction*> actions = menuBar()->actions();
for ( int i = 0; i < actions.count(); i++ )
{
@ -8956,7 +8956,7 @@ void QgisApp::removePluginRasterMenu( const QString& name, QAction* action )
if ( actions.indexOf( mActionRasterSeparator ) + 1 == actions.count() )
{
mRasterMenu->removeAction( mActionRasterSeparator );
mActionRasterSeparator = NULL;
mActionRasterSeparator = nullptr;
}
}
@ -9202,7 +9202,7 @@ void QgisApp::layersWereAdded( const QList<QgsMapLayer *>& theLayers )
for ( int i = 0; i < theLayers.size(); ++i )
{
QgsMapLayer * layer = theLayers.at( i );
QgsDataProvider *provider = 0;
QgsDataProvider *provider = nullptr;
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
if ( vlayer )
@ -9420,7 +9420,7 @@ void QgisApp::legendLayerSelectionChanged( void )
mActionCancelEdits->setEnabled( QgsLayerTreeUtils::layersEditable( selectedLayers ) );
mLegendExpressionFilterButton->setEnabled( false );
mLegendExpressionFilterButton->setVectorLayer( 0 );
mLegendExpressionFilterButton->setVectorLayer( nullptr );
if ( selectedLayers.size() == 1 )
{
QgsLayerTreeLayer* l = selectedLayers.front();
@ -9840,7 +9840,7 @@ void QgisApp::refreshActionFeatureAction()
{
QgsMapLayer* layer = activeLayer();
if ( layer == 0 || layer->type() != QgsMapLayer::VectorLayer )
if ( layer == nullptr || layer->type() != QgsMapLayer::VectorLayer )
{
return;
}
@ -9934,7 +9934,7 @@ QgsRasterLayer* QgisApp::addRasterLayerPrivate(
QgsDebugMsg( "Creating new raster layer using " + uri
+ " with baseName of " + baseName );
QgsRasterLayer *layer = 0;
QgsRasterLayer *layer = nullptr;
// XXX ya know QgsRasterLayer can snip out the basename on its own;
// XXX why do we have to pass it in for it?
// ET : we may not be getting "normal" files here, so we still need the baseName argument
@ -9968,7 +9968,7 @@ QgsRasterLayer* QgisApp::addRasterLayerPrivate(
// The first layer loaded is not useful in that case. The user can select it in
// the list if he wants to load it.
delete layer;
layer = NULL;
layer = nullptr;
}
}
else
@ -9996,7 +9996,7 @@ QgsRasterLayer* QgisApp::addRasterLayerPrivate(
if ( layer )
{
delete layer;
layer = NULL;
layer = nullptr;
}
}
@ -10149,7 +10149,7 @@ QgsPluginLayer* QgisApp::addPluginLayer( const QString& uri, const QString& base
{
QgsPluginLayer* layer = QgsPluginLayerRegistry::instance()->createLayer( providerKey, uri );
if ( !layer )
return 0;
return nullptr;
layer->setLayerName( baseName );

View File

@ -132,7 +132,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
Q_OBJECT
public:
//! Constructor
QgisApp( QSplashScreen *splash, bool restorePlugins = true, QWidget *parent = 0, Qt::WindowFlags fl = Qt::Window );
QgisApp( QSplashScreen *splash, bool restorePlugins = true, QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::Window );
//! Constructor for unit tests
QgisApp();
//! Destructor
@ -428,7 +428,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QMenu *windowMenu() { return mWindowMenu; }
#else
QMenu *firstRightStandardMenu() { return mHelpMenu; }
QMenu *windowMenu() { return NULL; }
QMenu *windowMenu() { return nullptr; }
#endif
QMenu *printComposersMenu() {return mPrintComposersMenu;}
QMenu *helpMenu() { return mHelpMenu; }
@ -576,19 +576,19 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
\param layerContainingSelection The layer that the selection will be taken from
(defaults to the active layer on the legend)
*/
void editCut( QgsMapLayer *layerContainingSelection = 0 );
void editCut( QgsMapLayer *layerContainingSelection = nullptr );
//! copies selected features on the active layer to the clipboard
/**
\param layerContainingSelection The layer that the selection will be taken from
(defaults to the active layer on the legend)
*/
void editCopy( QgsMapLayer *layerContainingSelection = 0 );
void editCopy( QgsMapLayer *layerContainingSelection = nullptr );
//! copies features on the clipboard to the active layer
/**
\param destinationLayer The layer that the clipboard will be pasted to
(defaults to the active layer on the legend)
*/
void editPaste( QgsMapLayer *destinationLayer = 0 );
void editPaste( QgsMapLayer *destinationLayer = nullptr );
//! copies features on the clipboard to a new vector layer
void pasteAsNewVector();
//! copies features on the clipboard to a new memory vector layer
@ -598,13 +598,13 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
\param sourceLayer The layer where the style will be taken from
(defaults to the active layer on the legend)
*/
void copyStyle( QgsMapLayer *sourceLayer = 0 );
void copyStyle( QgsMapLayer *sourceLayer = nullptr );
//! pastes style on the clipboard to the active layer
/**
\param destinationLayer The layer that the clipboard will be pasted to
(defaults to the active layer on the legend)
*/
void pasteStyle( QgsMapLayer *destinationLayer = 0 );
void pasteStyle( QgsMapLayer *destinationLayer = nullptr );
//! copies features to internal clipboard
void copyFeatures( QgsFeatureStore & featureStore );
@ -612,7 +612,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void loadGDALSublayers( const QString& uri, const QStringList& list );
/** Deletes the selected attributes for the currently selected vector layer*/
void deleteSelected( QgsMapLayer *layer = 0, QWidget *parent = 0, bool promptConfirmation = false );
void deleteSelected( QgsMapLayer *layer = nullptr, QWidget *parent = nullptr, bool promptConfirmation = false );
//! project was written
void writeProject( QDomDocument & );
@ -662,7 +662,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void updateProjectFromTemplates();
//! Opens the options dialog
void showOptionsDialog( QWidget *parent = 0, const QString& currentPage = QString() );
void showOptionsDialog( QWidget *parent = nullptr, const QString& currentPage = QString() );
/** Refreshes the state of the layer actions toolbar action
* @note added in 2.1 */
@ -1354,7 +1354,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
/** Deletes all the composer objects and clears mPrintComposers*/
void deletePrintComposers();
void saveAsVectorFileGeneral( QgsVectorLayer* vlayer = 0, bool symbologyOption = true );
void saveAsVectorFileGeneral( QgsVectorLayer* vlayer = nullptr, bool symbologyOption = true );
/** Paste features from clipboard into a new memory layer.
* If no features are in clipboard an empty layer is returned.
@ -1442,52 +1442,52 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
public:
Tools()
: mZoomIn( 0 )
, mZoomOut( 0 )
, mPan( 0 )
: mZoomIn( nullptr )
, mZoomOut( nullptr )
, mPan( nullptr )
#ifdef HAVE_TOUCH
, mTouch( 0 )
#endif
, mIdentify( 0 )
, mFeatureAction( 0 )
, mMeasureDist( 0 )
, mMeasureArea( 0 )
, mMeasureAngle( 0 )
, mAddFeature( 0 )
, mCircularStringCurvePoint( 0 )
, mCircularStringRadius( 0 )
, mMoveFeature( 0 )
, mOffsetCurve( 0 )
, mReshapeFeatures( 0 )
, mSplitFeatures( 0 )
, mSplitParts( 0 )
, mSelect( 0 )
, mSelectFeatures( 0 )
, mSelectPolygon( 0 )
, mSelectFreehand( 0 )
, mSelectRadius( 0 )
, mVertexAdd( 0 )
, mVertexMove( 0 )
, mVertexDelete( 0 )
, mAddRing( 0 )
, mFillRing( 0 )
, mAddPart( 0 )
, mSimplifyFeature( 0 )
, mDeleteRing( 0 )
, mDeletePart( 0 )
, mNodeTool( 0 )
, mRotatePointSymbolsTool( 0 )
, mAnnotation( 0 )
, mFormAnnotation( 0 )
, mHtmlAnnotation( 0 )
, mSvgAnnotation( 0 )
, mTextAnnotation( 0 )
, mPinLabels( 0 )
, mShowHideLabels( 0 )
, mMoveLabel( 0 )
, mRotateFeature( 0 )
, mRotateLabel( 0 )
, mChangeLabelProperties( 0 )
, mIdentify( nullptr )
, mFeatureAction( nullptr )
, mMeasureDist( nullptr )
, mMeasureArea( nullptr )
, mMeasureAngle( nullptr )
, mAddFeature( nullptr )
, mCircularStringCurvePoint( nullptr )
, mCircularStringRadius( nullptr )
, mMoveFeature( nullptr )
, mOffsetCurve( nullptr )
, mReshapeFeatures( nullptr )
, mSplitFeatures( nullptr )
, mSplitParts( nullptr )
, mSelect( nullptr )
, mSelectFeatures( nullptr )
, mSelectPolygon( nullptr )
, mSelectFreehand( nullptr )
, mSelectRadius( nullptr )
, mVertexAdd( nullptr )
, mVertexMove( nullptr )
, mVertexDelete( nullptr )
, mAddRing( nullptr )
, mFillRing( nullptr )
, mAddPart( nullptr )
, mSimplifyFeature( nullptr )
, mDeleteRing( nullptr )
, mDeletePart( nullptr )
, mNodeTool( nullptr )
, mRotatePointSymbolsTool( nullptr )
, mAnnotation( nullptr )
, mFormAnnotation( nullptr )
, mHtmlAnnotation( nullptr )
, mSvgAnnotation( nullptr )
, mTextAnnotation( nullptr )
, mPinLabels( nullptr )
, mShowHideLabels( nullptr )
, mMoveLabel( nullptr )
, mRotateFeature( nullptr )
, mRotateLabel( nullptr )
, mChangeLabelProperties( nullptr )
{}
QgsMapTool *mZoomIn;

View File

@ -47,7 +47,7 @@
QgisAppInterface::QgisAppInterface( QgisApp * _qgis )
: qgis( _qgis )
, mTimer( NULL )
, mTimer( nullptr )
, legendIface( _qgis->layerTreeView() )
, pluginManagerIface( _qgis->pluginManager() )
{
@ -363,18 +363,18 @@ QList<QgsComposerView*> QgisAppInterface::activeComposers()
QgsComposerView* QgisAppInterface::createNewComposer( const QString& title )
{
QgsComposer* composerObj = 0;
QgsComposer* composerObj = nullptr;
composerObj = qgis->createNewComposer( title );
if ( composerObj )
{
return composerObj->view();
}
return 0;
return nullptr;
}
QgsComposerView* QgisAppInterface::duplicateComposer( QgsComposerView* composerView, const QString& title )
{
QgsComposer* composerObj = 0;
QgsComposer* composerObj = nullptr;
composerObj = qobject_cast<QgsComposer *>( composerView->composerWindow() );
if ( composerObj )
{
@ -384,14 +384,14 @@ QgsComposerView* QgisAppInterface::duplicateComposer( QgsComposerView* composerV
return dupComposer->view();
}
}
return 0;
return nullptr;
}
void QgisAppInterface::deleteComposer( QgsComposerView* composerView )
{
composerView->composerWindow()->close();
QgsComposer* composerObj = 0;
QgsComposer* composerObj = nullptr;
composerObj = qobject_cast<QgsComposer *>( composerView->composerWindow() );
if ( composerObj )
{
@ -452,7 +452,7 @@ QDialog* QgisAppInterface::showAttributeTable( QgsVectorLayer *l, const QString&
dialog->show();
return dialog;
}
return 0;
return nullptr;
}
void QgisAppInterface::addWindow( QAction *action )
@ -580,7 +580,7 @@ QAction *QgisAppInterface::actionRollbackAllEdits() { return qgis->actionRollbac
QAction *QgisAppInterface::actionCancelEdits() { return qgis->actionCancelEdits(); }
QAction *QgisAppInterface::actionCancelAllEdits() { return qgis->actionCancelAllEdits(); }
QAction *QgisAppInterface::actionLayerSaveAs() { return qgis->actionLayerSaveAs(); }
QAction *QgisAppInterface::actionLayerSelectionSaveAs() { return 0; }
QAction *QgisAppInterface::actionLayerSelectionSaveAs() { return nullptr; }
QAction *QgisAppInterface::actionRemoveLayer() { return qgis->actionRemoveLayer(); }
QAction *QgisAppInterface::actionDuplicateLayer() { return qgis->actionDuplicateLayer(); }
QAction *QgisAppInterface::actionLayerProperties() { return qgis->actionLayerProperties(); }
@ -667,7 +667,7 @@ QgsAttributeDialog* QgisAppInterface::getFeatureForm( QgsVectorLayer *l, QgsFeat
QgsAttributeEditorContext context;
context.setDistanceArea( myDa );
context.setVectorLayerTools( qgis->vectorLayerTools() );
QgsAttributeDialog *dialog = new QgsAttributeDialog( l, &feature, false, NULL, true, context );
QgsAttributeDialog *dialog = new QgsAttributeDialog( l, &feature, false, nullptr, true, context );
if ( !feature.isValid() )
{
dialog->setIsAddDialog( true );

View File

@ -30,7 +30,7 @@ class APP_EXPORT QgisAppStyleSheet: public QObject
Q_OBJECT
public:
QgisAppStyleSheet( QObject * parent = 0 );
QgisAppStyleSheet( QObject * parent = nullptr );
~QgisAppStyleSheet();
/** Return changeable options built from settings and/or defaults */

View File

@ -29,9 +29,9 @@ class APP_EXPORT QgsAddAttrDialog: public QDialog, private Ui::QgsAddAttrDialogB
Q_OBJECT
public:
QgsAddAttrDialog( QgsVectorLayer *vlayer,
QWidget *parent = 0, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
QWidget *parent = nullptr, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
QgsAddAttrDialog( const std::list<QString>& typelist,
QWidget *parent = 0, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
QWidget *parent = nullptr, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
QgsField field() const;

View File

@ -33,7 +33,7 @@ class APP_EXPORT QgsAddTabOrGroup : public QDialog, private Ui::QgsAddTabOrGroup
typedef QPair<QString, QTreeWidgetItem*> TabPair;
public:
QgsAddTabOrGroup( QgsVectorLayer *lyr, const QList<TabPair>& tabList, QWidget *parent = 0 );
QgsAddTabOrGroup( QgsVectorLayer *lyr, const QList<TabPair>& tabList, QWidget *parent = nullptr );
~QgsAddTabOrGroup();
QString name();

View File

@ -27,7 +27,7 @@ static QgsMapLayer* _rasterLayer( const QString& filename )
if ( layer->type() == QgsMapLayer::RasterLayer && layer->source() == filename )
return layer;
}
return 0;
return nullptr;
}
static QString _rasterLayerName( const QString& filename )

View File

@ -12,7 +12,7 @@ class QgsAlignRasterDialog : public QDialog, private Ui::QgsAlignRasterDialog
{
Q_OBJECT
public:
explicit QgsAlignRasterDialog( QWidget *parent = 0 );
explicit QgsAlignRasterDialog( QWidget *parent = nullptr );
~QgsAlignRasterDialog();
signals:

View File

@ -24,7 +24,7 @@
#include <QColorDialog>
QgsAnnotationWidget::QgsAnnotationWidget( QgsAnnotationItem* item, QWidget * parent, Qt::WindowFlags f ): QWidget( parent, f ), mItem( item ), mMarkerSymbol( 0 )
QgsAnnotationWidget::QgsAnnotationWidget( QgsAnnotationItem* item, QWidget * parent, Qt::WindowFlags f ): QWidget( parent, f ), mItem( item ), mMarkerSymbol( nullptr )
{
setupUi( this );
@ -79,7 +79,7 @@ void QgsAnnotationWidget::apply()
mItem->setFrameColor( mFrameColorButton->color() );
mItem->setFrameBackgroundColor( mBackgroundColorButton->color() );
mItem->setMarkerSymbol( mMarkerSymbol );
mMarkerSymbol = 0; //item takes ownership
mMarkerSymbol = nullptr; //item takes ownership
mItem->update();
}
}
@ -99,7 +99,7 @@ void QgsAnnotationWidget::on_mMapMarkerButton_clicked()
return;
}
QgsMarkerSymbolV2* markerSymbol = mMarkerSymbol->clone();
QgsSymbolV2SelectorDialog dlg( markerSymbol, QgsStyleV2::defaultStyle(), 0, this );
QgsSymbolV2SelectorDialog dlg( markerSymbol, QgsStyleV2::defaultStyle(), nullptr, this );
if ( dlg.exec() == QDialog::Rejected )
{
delete markerSymbol;

View File

@ -29,7 +29,7 @@ class APP_EXPORT QgsAnnotationWidget: public QWidget, private Ui::QgsAnnotationW
{
Q_OBJECT
public:
QgsAnnotationWidget( QgsAnnotationItem* item, QWidget * parent = 0, Qt::WindowFlags f = 0 );
QgsAnnotationWidget( QgsAnnotationItem* item, QWidget * parent = nullptr, Qt::WindowFlags f = nullptr );
~QgsAnnotationWidget();
void apply();

View File

@ -357,8 +357,8 @@ void QgsAppLayerTreeViewMenuProvider::addCustomLayerActions( QMenu* menu, QgsMap
// Mac doesn't have '&' keyboard shortcuts.
menuName.remove( QChar( '&' ) );
#endif
QAction* before = 0;
QMenu* newMenu = 0;
QAction* before = nullptr;
QMenu* newMenu = nullptr;
QString dst = menuName;
dst.remove( QChar( '&' ) );
Q_FOREACH ( QMenu* menu, theMenus )

View File

@ -37,7 +37,7 @@ class APP_EXPORT QgsAttributeActionDialog: public QWidget, private Ui::QgsAttrib
public:
QgsAttributeActionDialog( QgsAttributeAction* actions,
const QgsFields& fields,
QWidget* parent = 0 );
QWidget* parent = nullptr );
~QgsAttributeActionDialog() {}

View File

@ -64,10 +64,10 @@ static QgsExpressionContext _getExpressionContext( const void* context )
QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWidget *parent, Qt::WindowFlags flags )
: QDialog( parent, flags )
, mDock( 0 )
, mDock( nullptr )
, mLayer( theLayer )
, mRubberBand( 0 )
, mCurrentSearchWidgetWrapper( 0 )
, mRubberBand( nullptr )
, mCurrentSearchWidgetWrapper( nullptr )
{
setupUi( this );
@ -275,7 +275,7 @@ void QgsAttributeTableDialog::closeEvent( QCloseEvent* event )
{
QDialog::closeEvent( event );
if ( mDock == NULL )
if ( mDock == nullptr )
{
QSettings settings;
settings.setValue( "/Windows/BetterAttributeTable/geometry", saveGeometry() );
@ -412,7 +412,7 @@ void QgsAttributeTableDialog::runFieldCalculation( QgsVectorLayer* layer, const
if ( !calculationSuccess )
{
QMessageBox::critical( 0, tr( "Error" ), tr( "An error occured while evaluating the calculation string:\n%1" ).arg( error ) );
QMessageBox::critical( nullptr, tr( "Error" ), tr( "An error occured while evaluating the calculation string:\n%1" ).arg( error ) );
mLayer->destroyEditCommand();
return;
}
@ -424,7 +424,7 @@ void QgsAttributeTableDialog::replaceSearchWidget( QWidget* oldw, QWidget* neww
{
mFilterLayout->removeWidget( oldw );
oldw->setVisible( false );
mFilterLayout->addWidget( neww, 0, 0, 0 );
mFilterLayout->addWidget( neww, 0, 0, nullptr );
neww->setVisible( true );
}
@ -434,7 +434,7 @@ void QgsAttributeTableDialog::filterColumnChanged( QObject* filterAction )
mFilterButton->setPopupMode( QToolButton::InstantPopup );
// replace the search line edit with a search widget that is suited to the selected field
// delete previous widget
if ( mCurrentSearchWidgetWrapper != 0 )
if ( mCurrentSearchWidgetWrapper != nullptr )
{
mCurrentSearchWidgetWrapper->widget()->setVisible( false );
delete mCurrentSearchWidgetWrapper;
@ -491,7 +491,7 @@ void QgsAttributeTableDialog::filterShowAll()
mFilterButton->setDefaultAction( mActionShowAllFilter );
mFilterButton->setPopupMode( QToolButton::InstantPopup );
mFilterQuery->setVisible( false );
if ( mCurrentSearchWidgetWrapper != 0 )
if ( mCurrentSearchWidgetWrapper != nullptr )
{
mCurrentSearchWidgetWrapper->widget()->setVisible( false );
}
@ -747,7 +747,7 @@ void QgsAttributeTableDialog::filterQueryChanged( const QString& query )
void QgsAttributeTableDialog::filterQueryAccepted()
{
if (( mFilterQuery->isVisible() && mFilterQuery->text().isEmpty() ) ||
( mCurrentSearchWidgetWrapper != 0 && mCurrentSearchWidgetWrapper->widget()->isVisible()
( mCurrentSearchWidgetWrapper != nullptr && mCurrentSearchWidgetWrapper->widget()->isVisible()
&& mCurrentSearchWidgetWrapper->expression().isEmpty() ) )
{
filterShowAll();
@ -763,14 +763,14 @@ void QgsAttributeTableDialog::openConditionalStyles()
void QgsAttributeTableDialog::setFilterExpression( const QString& filterString )
{
if ( mCurrentSearchWidgetWrapper == 0 || !mCurrentSearchWidgetWrapper->applyDirectly() )
if ( mCurrentSearchWidgetWrapper == nullptr || !mCurrentSearchWidgetWrapper->applyDirectly() )
{
mFilterQuery->setText( filterString );
mFilterButton->setDefaultAction( mActionAdvancedFilter );
mFilterButton->setPopupMode( QToolButton::MenuButtonPopup );
mFilterQuery->setVisible( true );
mApplyFilterButton->setVisible( true );
if ( mCurrentSearchWidgetWrapper != 0 )
if ( mCurrentSearchWidgetWrapper != nullptr )
{
// replace search widget widget with the normal filter query line edit
replaceSearchWidget( mCurrentSearchWidgetWrapper->widget(), mFilterQuery );

View File

@ -53,7 +53,7 @@ class APP_EXPORT QgsAttributeTableDialog : public QDialog, private Ui::QgsAttrib
* @param parent parent object
* @param flags window flags
*/
QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWidget *parent = 0, Qt::WindowFlags flags = Qt::Window );
QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::Window );
~QgsAttributeTableDialog();
/**
@ -227,7 +227,7 @@ class QgsAttributeTableDock : public QDockWidget
Q_OBJECT
public:
QgsAttributeTableDock( const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 );
QgsAttributeTableDock( const QString & title, QWidget * parent = nullptr, Qt::WindowFlags flags = nullptr );
virtual void closeEvent( QCloseEvent * ev ) override;
};

View File

@ -27,7 +27,7 @@ class APP_EXPORT QgsBookmarks : public QDockWidget, private Ui::QgsBookmarksBase
Q_OBJECT
public:
QgsBookmarks( QWidget *parent = 0 );
QgsBookmarks( QWidget *parent = nullptr );
~QgsBookmarks();
public slots:

View File

@ -76,7 +76,7 @@ void QgsBrowserPropertiesWidget::setWidget( QWidget* paramWidget )
QgsBrowserPropertiesWidget* QgsBrowserPropertiesWidget::createWidget( QgsDataItem* item, QWidget* parent )
{
QgsBrowserPropertiesWidget* propertiesWidget = 0;
QgsBrowserPropertiesWidget* propertiesWidget = nullptr;
// In general, we would like to show all items' paramWidget, but top level items like
// WMS etc. have currently too large widgets which do not fit well to browser properties widget
if ( item->type() == QgsDataItem::Directory )
@ -141,7 +141,7 @@ void QgsBrowserLayerProperties::setItem( QgsDataItem* item )
QgsDebugMsg( "creating raster layer" );
// should copy code from addLayer() to split uri ?
QgsRasterLayer* layer = new QgsRasterLayer( layerItem->uri(), layerItem->uri(), layerItem->providerKey() );
if ( layer != NULL )
if ( layer != nullptr )
{
if ( layer->isValid() )
{
@ -155,7 +155,7 @@ void QgsBrowserLayerProperties::setItem( QgsDataItem* item )
{
QgsDebugMsg( "creating vector layer" );
QgsVectorLayer* layer = new QgsVectorLayer( layerItem->uri(), layerItem->name(), layerItem->providerKey() );
if ( layer != NULL )
if ( layer != nullptr )
{
if ( layer->isValid() )
{
@ -217,7 +217,7 @@ void QgsBrowserLayerProperties::setCondensedMode( bool condensedMode )
QgsBrowserDirectoryProperties::QgsBrowserDirectoryProperties( QWidget* parent ) :
QgsBrowserPropertiesWidget( parent )
, mDirectoryWidget( 0 )
, mDirectoryWidget( nullptr )
{
setupUi( this );
@ -238,7 +238,7 @@ void QgsBrowserDirectoryProperties::setItem( QgsDataItem* item )
QgsBrowserPropertiesDialog::QgsBrowserPropertiesDialog( const QString& settingsSection, QWidget* parent ) :
QDialog( parent )
, mPropertiesWidget( 0 )
, mPropertiesWidget( nullptr )
, mSettingsSection( settingsSection )
{
setupUi( this );
@ -264,8 +264,8 @@ void QgsBrowserPropertiesDialog::setItem( QgsDataItem* item )
QgsBrowserDockWidget::QgsBrowserDockWidget( const QString& name, QWidget * parent ) :
QDockWidget( parent )
, mModel( 0 )
, mProxyModel( 0 )
, mModel( nullptr )
, mProxyModel( nullptr )
, mPropertiesWidgetEnabled( false )
, mPropertiesWidgetHeight( 0 )
{
@ -511,7 +511,7 @@ void QgsBrowserDockWidget::refreshModel( const QModelIndex& index )
void QgsBrowserDockWidget::addLayer( QgsLayerItem *layerItem )
{
if ( layerItem == NULL )
if ( layerItem == nullptr )
return;
QString uri = QgisApp::instance()->crsAndFormatAdjustedLayerUri( layerItem->uri(), layerItem->supportedCRS(), layerItem->supportedFormats() );
@ -541,20 +541,20 @@ void QgsBrowserDockWidget::addLayerAtIndex( const QModelIndex& index )
QgsDebugMsg( QString( "rowCount() = %1" ).arg( mModel->rowCount( mProxyModel->mapToSource( index ) ) ) );
QgsDataItem *item = mModel->dataItem( mProxyModel->mapToSource( index ) );
if ( item != NULL && item->type() == QgsDataItem::Project )
if ( item != nullptr && item->type() == QgsDataItem::Project )
{
QgsProjectItem *projectItem = qobject_cast<QgsProjectItem*>( item );
if ( projectItem != NULL )
if ( projectItem != nullptr )
{
QApplication::setOverrideCursor( Qt::WaitCursor );
QgisApp::instance()->openFile( projectItem->path() );
QApplication::restoreOverrideCursor();
}
}
if ( item != NULL && item->type() == QgsDataItem::Layer )
if ( item != nullptr && item->type() == QgsDataItem::Layer )
{
QgsLayerItem *layerItem = qobject_cast<QgsLayerItem*>( item );
if ( layerItem != NULL )
if ( layerItem != nullptr )
{
QApplication::setOverrideCursor( Qt::WaitCursor );
addLayer( layerItem );
@ -808,7 +808,7 @@ void QgsDockBrowserTreeView::dragMoveEvent( QDragMoveEvent* e )
//
QgsBrowserTreeFilterProxyModel::QgsBrowserTreeFilterProxyModel( QObject* parent )
: QSortFilterProxyModel( parent ), mModel( 0 )
: QSortFilterProxyModel( parent ), mModel( nullptr )
, mFilter( "" ), mPatternSyntax( "normal" ), mCaseSensitivity( Qt::CaseInsensitive )
{
setDynamicSortFilter( true );

Some files were not shown because too many files have changed in this diff Show More