Skip to content

Commit

Permalink
make QgsWkbTypes a Q_GADGET and declare GeometryType as Q_ENUM (#8024)
Browse files Browse the repository at this point in the history
* make QgsWkbTypes a Q_GADGET and declare GeometryType as Q_ENUM

* include QObject

* remove extra include

* move QgsWkbTypes to moc headers

* run sip_include
  • Loading branch information
3nids committed Oct 5, 2018
1 parent 8f4d3ba commit 9fa8c35
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions python/core/auto_additions/qgswkbtypes.py
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/geometry/qgswkbtypes.h
QgsWkbTypes.GeometryType.baseClass = QgsWkbTypes
3 changes: 3 additions & 0 deletions python/core/auto_generated/geometry/qgswkbtypes.sip.in
Expand Up @@ -23,6 +23,9 @@ Handles storage of information regarding WKB types and their properties.
%TypeHeaderCode
#include "qgswkbtypes.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

enum Type
Expand Down
1 change: 0 additions & 1 deletion python/core/auto_generated/qgsdataitem.sip.in
Expand Up @@ -11,7 +11,6 @@




class QgsDataItem : QObject
{
%Docstring
Expand Down
2 changes: 1 addition & 1 deletion python/core/core_auto.sip
Expand Up @@ -295,7 +295,6 @@
%Include auto_generated/geometry/qgstriangle.sip
%Include auto_generated/geometry/qgssurface.sip
%Include auto_generated/geometry/qgswkbptr.sip
%Include auto_generated/geometry/qgswkbtypes.sip
%Include auto_generated/./3d/qgs3drendererregistry.sip
%Include auto_generated/./3d/qgsabstract3drenderer.sip
%Include auto_generated/fieldformatter/qgsrangefieldformatter.sip
Expand Down Expand Up @@ -396,6 +395,7 @@
%Include auto_generated/geometry/qgsabstractgeometry.sip
%Include auto_generated/geometry/qgsgeometry.sip
%Include auto_generated/geometry/qgspoint.sip
%Include auto_generated/geometry/qgswkbtypes.sip
%Include auto_generated/geocms/geonode/qgsgeonoderequest.sip
%Include auto_generated/gps/qgsgpsconnection.sip
%Include auto_generated/gps/qgsgpsdetector.sip
Expand Down
2 changes: 1 addition & 1 deletion src/core/CMakeLists.txt
Expand Up @@ -700,6 +700,7 @@ SET(QGIS_CORE_MOC_HDRS
geometry/qgsabstractgeometry.h
geometry/qgsgeometry.h
geometry/qgspoint.h
geometry/qgswkbtypes.h

geocms/geonode/qgsgeonoderequest.h

Expand Down Expand Up @@ -1160,7 +1161,6 @@ SET(QGIS_CORE_HDRS
geometry/qgstriangle.h
geometry/qgssurface.h
geometry/qgswkbptr.h
geometry/qgswkbtypes.h

3d/qgs3drendererregistry.h
3d/qgsabstract3drenderer.h
Expand Down
4 changes: 3 additions & 1 deletion src/core/geometry/qgswkbtypes.h
Expand Up @@ -18,11 +18,11 @@
#ifndef QGSWKBTYPES_H
#define QGSWKBTYPES_H

#include <QObject>
#include <QMap>
#include <QString>

#include "qgis_core.h"
#include "qgis.h"

/***************************************************************************
* This class is considered CRITICAL and any change MUST be accompanied with
Expand All @@ -39,6 +39,7 @@

class CORE_EXPORT QgsWkbTypes
{
Q_GADGET
public:

/**
Expand Down Expand Up @@ -142,6 +143,7 @@ class CORE_EXPORT QgsWkbTypes
UnknownGeometry,
NullGeometry
};
Q_ENUM( GeometryType )

/**
* Returns the single type for a WKB type. For example, for MultiPolygon WKB types the single type would be Polygon.
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsdataitem.h
Expand Up @@ -33,7 +33,7 @@
#include "qgsmaplayer.h"
#include "qgscoordinatereferencesystem.h"
#include "qgsmimedatautils.h"

#include "qgswkbtypes.h"

class QgsDataProvider;
class QgsDataItem;
Expand Down
2 changes: 1 addition & 1 deletion src/providers/arcgisrest/qgsafsdataitems.h
Expand Up @@ -17,7 +17,7 @@

#include "qgsdataitem.h"
#include "qgsdatasourceuri.h"

#include "qgswkbtypes.h"

class QgsAfsRootItem : public QgsDataCollectionItem
{
Expand Down
1 change: 1 addition & 0 deletions src/providers/arcgisrest/qgsamsdataitems.h
Expand Up @@ -19,6 +19,7 @@

#include "qgsdataitem.h"
#include "qgsdatasourceuri.h"
#include "qgswkbtypes.h"


class QgsAmsRootItem : public QgsDataCollectionItem
Expand Down
2 changes: 2 additions & 0 deletions src/providers/ows/qgsowsdataitems.h
Expand Up @@ -17,6 +17,8 @@

#include "qgsdataitem.h"
#include "qgsdatasourceuri.h"
#include "qgswkbtypes.h"

class QgsOWSConnectionItem : public QgsDataCollectionItem
{
Q_OBJECT
Expand Down
1 change: 1 addition & 0 deletions src/providers/postgres/qgspostgresdataitems.h
Expand Up @@ -22,6 +22,7 @@
#include "qgspostgresconn.h"
#include "qgsmimedatautils.h"
#include "qgsvectorlayerexporter.h"
#include "qgswkbtypes.h"

class QgsPGRootItem;
class QgsPGConnectionItem;
Expand Down

0 comments on commit 9fa8c35

Please sign in to comment.