Skip to content

Commit

Permalink
[sipify] insert missing QMetaObject for gadget classes
Browse files Browse the repository at this point in the history
  • 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.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class QgsAbstractGeometry
%TypeHeaderCode %TypeHeaderCode
#include "qgsabstractgeometry.h" #include "qgsabstractgeometry.h"
%End %End
public:
static const QMetaObject staticMetaObject;

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

public: public:


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

public: 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 )]; 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
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ both flavors.
%TypeHeaderCode %TypeHeaderCode
#include "qgscoordinatereferencesystem.h" #include "qgscoordinatereferencesystem.h"
%End %End
public:
static const QMetaObject staticMetaObject;

public: public:


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

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

public: public:


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

public: public:


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

public: public:


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

public: public:


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

public: public:
QgsPointXY(); QgsPointXY();


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

public: public:


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

public: public:


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

public: public:


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

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

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

public: public:


enum Precision enum Precision
Expand Down
12 changes: 10 additions & 2 deletions scripts/sipify.pl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -599,8 +599,16 @@ sub detect_non_method_member{
if ( $LINE =~ m/^\s*friend class \w+/ ){ if ( $LINE =~ m/^\s*friend class \w+/ ){
next; 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; next;
} }


Expand Down

0 comments on commit e8cf8c2

Please sign in to comment.