Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[sipify] insert missing QMetaObject for gadget classes
  • Loading branch information
3nids committed May 15, 2018
1 parent ff35e69 commit e8cf8c2
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 2 deletions.
Expand Up @@ -25,6 +25,9 @@ class QgsAbstractGeometry
%TypeHeaderCode
#include "qgsabstractgeometry.h"
%End
public:
static const QMetaObject staticMetaObject;

%ConvertToSubClassCode
if ( qgsgeometry_cast<QgsPoint *>( sipCpp ) != nullptr )
sipType = sipType_QgsPoint;
Expand Down
3 changes: 3 additions & 0 deletions python/core/auto_generated/geometry/qgsgeometry.sip.in
Expand Up @@ -43,6 +43,9 @@ can be accessed via the geometry() method or set using the setGeometry() method.
%TypeHeaderCode
#include "qgsgeometry.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

enum OperationResult
Expand Down
3 changes: 3 additions & 0 deletions python/core/auto_generated/geometry/qgspoint.sip.in
Expand Up @@ -21,6 +21,9 @@ class QgsPoint: QgsAbstractGeometry
%TypeHeaderCode
#include "qgspoint.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

QgsPoint( double x = 0.0, double y = 0.0, SIP_PYOBJECT z = Py_None, SIP_PYOBJECT m = Py_None, QgsWkbTypes::Type wkbType = QgsWkbTypes::Unknown ) [( double x = 0.0, double y = 0.0, double z = 0.0, double m = 0.0, QgsWkbTypes::Type wkbType = QgsWkbTypes::Unknown )];
Expand Down
Expand Up @@ -156,6 +156,9 @@ both flavors.
%TypeHeaderCode
#include "qgscoordinatereferencesystem.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

enum CrsType
Expand Down
3 changes: 3 additions & 0 deletions python/core/auto_generated/qgsdatasourceuri.sip.in
Expand Up @@ -16,6 +16,9 @@ class QgsDataSourceUri
%TypeHeaderCode
#include "qgsdatasourceuri.h"
%End
public:
static const QMetaObject staticMetaObject;

public:
enum SslMode
{
Expand Down
3 changes: 3 additions & 0 deletions python/core/auto_generated/qgsdefaultvalue.sip.in
Expand Up @@ -36,6 +36,9 @@ not set, the default value will only be used when a feature is created.
%TypeHeaderCode
#include "qgsdefaultvalue.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

explicit QgsDefaultValue( const QString &expression = QString(), bool applyOnUpdate = false );
Expand Down
3 changes: 3 additions & 0 deletions python/core/auto_generated/qgsfeature.sip.in
Expand Up @@ -33,6 +33,9 @@ geometry and a list of field/values attributes.
#define sipType_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
#endif
%End
public:
static const QMetaObject staticMetaObject;

public:

SIP_PYOBJECT __iter__();
Expand Down
3 changes: 3 additions & 0 deletions python/core/auto_generated/qgsfield.sip.in
Expand Up @@ -27,6 +27,9 @@ length, and if applicable, precision.
%TypeHeaderCode
#include "qgsfield.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

QgsField( const QString &name = QString(),
Expand Down
3 changes: 3 additions & 0 deletions python/core/auto_generated/qgsfieldconstraints.sip.in
Expand Up @@ -21,6 +21,9 @@ Stores information about constraints which may be present on a field.
%TypeHeaderCode
#include "qgsfieldconstraints.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

enum Constraint
Expand Down
3 changes: 3 additions & 0 deletions python/core/auto_generated/qgspointxy.sip.in
Expand Up @@ -27,6 +27,9 @@ supports Z and M values.
%TypeHeaderCode
#include "qgspointxy.h"
%End
public:
static const QMetaObject staticMetaObject;

public:
QgsPointXY();

Expand Down
3 changes: 3 additions & 0 deletions python/core/auto_generated/qgsrelation.sip.in
Expand Up @@ -17,6 +17,9 @@ class QgsRelation
%TypeHeaderCode
#include "qgsrelation.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

enum RelationStrength
Expand Down
3 changes: 3 additions & 0 deletions python/core/auto_generated/qgssnappingconfig.sip.in
Expand Up @@ -21,6 +21,9 @@ This is a container for configuration of the snapping of the project
%TypeHeaderCode
#include "qgssnappingconfig.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

enum SnappingMode
Expand Down
3 changes: 3 additions & 0 deletions python/core/auto_generated/qgstolerance.sip.in
Expand Up @@ -19,6 +19,9 @@ This is the class is providing tolerance value in map unit values.
%TypeHeaderCode
#include "qgstolerance.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

enum UnitType
Expand Down
3 changes: 3 additions & 0 deletions python/core/auto_generated/qgsunittypes.sip.in
Expand Up @@ -22,6 +22,9 @@ class QgsUnitTypes
%TypeHeaderCode
#include "qgsunittypes.h"
%End
public:
static const QMetaObject staticMetaObject;

public:
enum DistanceUnit
{
Expand Down
3 changes: 3 additions & 0 deletions python/core/auto_generated/qgsvectorsimplifymethod.sip.in
Expand Up @@ -20,6 +20,9 @@ This class contains information how to simplify geometries fetched from a vector
%TypeHeaderCode
#include "qgsvectorsimplifymethod.h"
%End
public:
static const QMetaObject staticMetaObject;

public:
QgsVectorSimplifyMethod();
%Docstring
Expand Down
3 changes: 3 additions & 0 deletions python/core/auto_generated/raster/qgsrasterprojector.sip.in
Expand Up @@ -24,6 +24,9 @@ which are used to calculate affine transformation matrices.
%TypeHeaderCode
#include "qgsrasterprojector.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

enum Precision
Expand Down
12 changes: 10 additions & 2 deletions scripts/sipify.pl
Expand Up @@ -599,8 +599,16 @@ sub detect_non_method_member{
if ( $LINE =~ m/^\s*friend class \w+/ ){
next;
}
# Skip Q_OBJECT, Q_PROPERTY, Q_ENUM, Q_GADGET etc.
if ($LINE =~ m/^\s*Q_(OBJECT|ENUMS|ENUM|FLAG|PROPERTY|GADGET|DECLARE_METATYPE|DECLARE_TYPEINFO|NOWARN_DEPRECATED_(PUSH|POP))\b.*?$/){

# insert metaoject for Q_GADGET
if ($LINE =~ m/^\s*Q_GADGET\b.*?$/){
write_output("HCE", " public:\n");
write_output("HCE", " static const QMetaObject staticMetaObject;\n\n");
next;
}

# Skip Q_OBJECT, Q_PROPERTY, Q_ENUM etc.
if ($LINE =~ m/^\s*Q_(OBJECT|ENUMS|ENUM|FLAG|PROPERTY|DECLARE_METATYPE|DECLARE_TYPEINFO|NOWARN_DEPRECATED_(PUSH|POP))\b.*?$/){
next;
}

Expand Down

0 comments on commit e8cf8c2

Please sign in to comment.