Skip to content
Permalink
Browse files

Remove leftover QObject inheritance

  • Loading branch information
nyalldawson committed Jan 10, 2019
1 parent 93bfbd0 commit b80829ce593b42f4b576bd288991bf698bef6ca7
@@ -41,8 +41,7 @@ result will be communicated to users, but not prevent them from proceeding.

};


class QgsAbstractValidityCheck : QObject
class QgsAbstractValidityCheck
{
%Docstring
Abstract base class for individual validity checks.
@@ -77,6 +76,8 @@ Checks must be registered in the application's :py:class:`QgsValidityCheckRegist
TypeUserCheck,
};

virtual ~QgsAbstractValidityCheck();

virtual QgsAbstractValidityCheck *create() const = 0 /Factory/;
%Docstring
Creates a new instance of the check and returns it.
@@ -126,9 +127,6 @@ The ``context`` argument gives the wider in which the check is being run.

};




/************************************************************************
* This file has been generated automatically from *
* *
@@ -51,9 +51,9 @@ bool QgsLayoutScaleBarValidityCheck::prepareCheck( const QgsValidityCheckContext
{
QgsValidityCheckResult res;
res.type = QgsValidityCheckResult::Warning;
res.title = tr( "Scalebar is not linked to a map" );
res.title = QObject::tr( "Scalebar is not linked to a map" );
const QString name = bar->displayName().toHtmlEscaped();
res.detailedDescription = tr( "The scalebar “%1” is not linked to a map item. This scale will be misleading." ).arg( name );
res.detailedDescription = QObject::tr( "The scalebar “%1” is not linked to a map item. This scale will be misleading." ).arg( name );
mResults.append( res );
}
}
@@ -66,9 +66,6 @@ class CORE_EXPORT QgsValidityCheckResult

};

// note -- this is a QObject so that we can store just weak pointers to it -- avoiding crashes
// if a Python plugin doesn't correctly remove checks on plugin unload

/**
* \class QgsAbstractValidityCheck
* \ingroup core
@@ -92,7 +89,7 @@ class CORE_EXPORT QgsValidityCheckResult
*
* \since QGIS 3.6
*/
class CORE_EXPORT QgsAbstractValidityCheck : public QObject
class CORE_EXPORT QgsAbstractValidityCheck
{

public:
@@ -104,6 +101,8 @@ class CORE_EXPORT QgsAbstractValidityCheck : public QObject
TypeUserCheck = 10000, //!< Starting point for custom user types
};

virtual ~QgsAbstractValidityCheck() = default;

/**
* Creates a new instance of the check and returns it.
*/
@@ -158,7 +157,4 @@ class CORE_EXPORT QgsAbstractValidityCheck : public QObject

};




#endif // QGSABSTRACTVALIDITYCHECK_H
@@ -28,21 +28,21 @@ QgsValidityCheckRegistry::~QgsValidityCheckRegistry()
QList<const QgsAbstractValidityCheck *> QgsValidityCheckRegistry::checks() const
{
QList<const QgsAbstractValidityCheck *> results;
for ( const QPointer< QgsAbstractValidityCheck > &check : mChecks )
for ( const QgsAbstractValidityCheck *check : mChecks )
{
if ( check )
results.append( check.data() );
results.append( check );
}
return results;
}

QList<const QgsAbstractValidityCheck *> QgsValidityCheckRegistry::checks( int type ) const
{
QList< const QgsAbstractValidityCheck * > results;
for ( const QPointer< QgsAbstractValidityCheck > &check : mChecks )
for ( const QgsAbstractValidityCheck *check : mChecks )
{
if ( check && check->checkType() == type )
results << check.data();
results << check;
}
return results;
}
@@ -19,7 +19,6 @@
#include "qgis_sip.h"
#include "qgsabstractvaliditycheck.h"
#include <QList>
#include <QPointer>
#include <memory>
#include <vector>

0 comments on commit b80829c

Please sign in to comment.
You can’t perform that action at this time.