diff --git a/python/core/auto_generated/qgsfeature.sip.in b/python/core/auto_generated/qgsfeature.sip.in index 7038a4e883c..81230ddc068 100644 --- a/python/core/auto_generated/qgsfeature.sip.in +++ b/python/core/auto_generated/qgsfeature.sip.in @@ -14,8 +14,6 @@ - - class QgsFeature { %Docstring @@ -527,9 +525,6 @@ typedef QMap > QgsChangedAttributesMap; typedef QMap QgsGeometryMap; - -typedef QSet QgsFeatureIds; - typedef QList QgsFeatureList; diff --git a/python/core/auto_generated/qgsfeatureid.sip.in b/python/core/auto_generated/qgsfeatureid.sip.in new file mode 100644 index 00000000000..10f6d22580a --- /dev/null +++ b/python/core/auto_generated/qgsfeatureid.sip.in @@ -0,0 +1,21 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/qgsfeatureid.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + + + +typedef QSet QgsFeatureIds; + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/core/qgsfeatureid.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/core/core_auto.sip b/python/core/core_auto.sip index e41dd356f8f..6db6144ae9f 100644 --- a/python/core/core_auto.sip +++ b/python/core/core_auto.sip @@ -44,6 +44,7 @@ %Include auto_generated/qgsexpressioncontextscopegenerator.sip %Include auto_generated/qgsexpressionfieldbuffer.sip %Include auto_generated/qgsfeaturefilterprovider.sip +%Include auto_generated/qgsfeatureid.sip %Include auto_generated/qgsfeatureiterator.sip %Include auto_generated/qgsfeaturerequest.sip %Include auto_generated/qgsfeaturesink.sip diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 326456435c9..994581c0bc2 100755 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -851,6 +851,7 @@ SET(QGIS_CORE_HDRS qgsexpressioncontextscopegenerator.h qgsexpressionfieldbuffer.h qgsfeaturefilterprovider.h + qgsfeatureid.h qgsfeatureiterator.h qgsfeaturerequest.h qgsfeaturesink.h diff --git a/src/core/qgsfeature.h b/src/core/qgsfeature.h index 1717ae7aacd..a949411a2d3 100644 --- a/src/core/qgsfeature.h +++ b/src/core/qgsfeature.h @@ -29,6 +29,7 @@ email : sherman at mrcc.com #include "qgsattributes.h" #include "qgsfields.h" +#include "qgsfeatureid.h" class QgsFeature; class QgsFeaturePrivate; @@ -43,15 +44,6 @@ class QgsRectangle; * See details in QEP #17 ****************************************************************************/ -// feature id class (currently 64 bit) - -// 64 bit feature ids -typedef qint64 QgsFeatureId SIP_SKIP; -#define FID_IS_NEW(fid) (fid<0) -#define FID_TO_NUMBER(fid) static_cast(fid) -#define FID_TO_STRING(fid) QString::number( fid ) -#define STRING_TO_FID(str) (str).toLongLong() - /** * \ingroup core @@ -540,13 +532,6 @@ typedef QMap QgsGeometryMap; typedef QMap QgsGeometryMap; #endif - -#ifndef SIP_RUN -typedef QSet QgsFeatureIds; -#else -typedef QSet QgsFeatureIds; -#endif - typedef QList QgsFeatureList; uint qHash( const QgsFeature &key, uint seed = 0 ) SIP_SKIP; diff --git a/src/core/qgsfeatureid.h b/src/core/qgsfeatureid.h new file mode 100644 index 00000000000..cb2d5a2a4ca --- /dev/null +++ b/src/core/qgsfeatureid.h @@ -0,0 +1,36 @@ +/*************************************************************************** + qgsfeatureid.h + -------------------------------------- +Date : 3.9.2018 +Copyright : (C) 2018 by Matthias Kuhn +email : matthias@opengis.ch + *************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef QGSFEATUREID_H +#define QGSFEATUREID_H + +#include + +// feature id (currently 64 bit) + +// 64 bit feature ids +typedef qint64 QgsFeatureId SIP_SKIP; +#define FID_IS_NEW(fid) (fid<0) +#define FID_TO_NUMBER(fid) static_cast(fid) +#define FID_TO_STRING(fid) QString::number( fid ) +#define STRING_TO_FID(str) (str).toLongLong() + +#ifndef SIP_RUN +typedef QSet QgsFeatureIds; +#else +typedef QSet QgsFeatureIds; +#endif + +#endif