Skip to content
Permalink
Browse files

[sipify] insert missing QMetaObject for gadget classes

  • Loading branch information
3nids committed May 15, 2018
1 parent ff35e69 commit e8cf8c2f1c4265e4f16bd9555e1d496a84defe77
@@ -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;
@@ -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
@@ -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 )];
@@ -156,6 +156,9 @@ both flavors.
%TypeHeaderCode
#include "qgscoordinatereferencesystem.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

enum CrsType
@@ -16,6 +16,9 @@ class QgsDataSourceUri
%TypeHeaderCode
#include "qgsdatasourceuri.h"
%End
public:
static const QMetaObject staticMetaObject;

public:
enum SslMode
{
@@ -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 );
@@ -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__();
@@ -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(),
@@ -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
@@ -27,6 +27,9 @@ supports Z and M values.
%TypeHeaderCode
#include "qgspointxy.h"
%End
public:
static const QMetaObject staticMetaObject;

public:
QgsPointXY();

@@ -17,6 +17,9 @@ class QgsRelation
%TypeHeaderCode
#include "qgsrelation.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

enum RelationStrength
@@ -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
@@ -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
@@ -22,6 +22,9 @@ class QgsUnitTypes
%TypeHeaderCode
#include "qgsunittypes.h"
%End
public:
static const QMetaObject staticMetaObject;

public:
enum DistanceUnit
{
@@ -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
@@ -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
@@ -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;
}

0 comments on commit e8cf8c2

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