Skip to content

Commit 74fb0fa

Browse files
committed
Move QgsFeatureId to own header
1 parent a6e0e39 commit 74fb0fa

File tree

6 files changed

+60
-21
lines changed

6 files changed

+60
-21
lines changed

python/core/auto_generated/qgsfeature.sip.in

-5
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515

1616

17-
18-
1917
class QgsFeature
2018
{
2119
%Docstring
@@ -527,9 +525,6 @@ typedef QMap<qint64, QMap<int, QVariant> > QgsChangedAttributesMap;
527525

528526
typedef QMap<qint64, QgsGeometry> QgsGeometryMap;
529527

530-
531-
typedef QSet<qint64> QgsFeatureIds;
532-
533528
typedef QList<QgsFeature> QgsFeatureList;
534529

535530

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/qgsfeatureid.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
typedef QSet<qint64> QgsFeatureIds;
14+
15+
/************************************************************************
16+
* This file has been generated automatically from *
17+
* *
18+
* src/core/qgsfeatureid.h *
19+
* *
20+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
21+
************************************************************************/

python/core/core_auto.sip

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
%Include auto_generated/qgsexpressioncontextscopegenerator.sip
4545
%Include auto_generated/qgsexpressionfieldbuffer.sip
4646
%Include auto_generated/qgsfeaturefilterprovider.sip
47+
%Include auto_generated/qgsfeatureid.sip
4748
%Include auto_generated/qgsfeatureiterator.sip
4849
%Include auto_generated/qgsfeaturerequest.sip
4950
%Include auto_generated/qgsfeaturesink.sip

src/core/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ SET(QGIS_CORE_HDRS
851851
qgsexpressioncontextscopegenerator.h
852852
qgsexpressionfieldbuffer.h
853853
qgsfeaturefilterprovider.h
854+
qgsfeatureid.h
854855
qgsfeatureiterator.h
855856
qgsfeaturerequest.h
856857
qgsfeaturesink.h

src/core/qgsfeature.h

+1-16
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ email : sherman at mrcc.com
2929

3030
#include "qgsattributes.h"
3131
#include "qgsfields.h"
32+
#include "qgsfeatureid.h"
3233

3334
class QgsFeature;
3435
class QgsFeaturePrivate;
@@ -43,15 +44,6 @@ class QgsRectangle;
4344
* See details in QEP #17
4445
****************************************************************************/
4546

46-
// feature id class (currently 64 bit)
47-
48-
// 64 bit feature ids
49-
typedef qint64 QgsFeatureId SIP_SKIP;
50-
#define FID_IS_NEW(fid) (fid<0)
51-
#define FID_TO_NUMBER(fid) static_cast<qint64>(fid)
52-
#define FID_TO_STRING(fid) QString::number( fid )
53-
#define STRING_TO_FID(str) (str).toLongLong()
54-
5547

5648
/**
5749
* \ingroup core
@@ -540,13 +532,6 @@ typedef QMap<QgsFeatureId, QgsGeometry> QgsGeometryMap;
540532
typedef QMap<qint64, QgsGeometry> QgsGeometryMap;
541533
#endif
542534

543-
544-
#ifndef SIP_RUN
545-
typedef QSet<QgsFeatureId> QgsFeatureIds;
546-
#else
547-
typedef QSet<qint64> QgsFeatureIds;
548-
#endif
549-
550535
typedef QList<QgsFeature> QgsFeatureList;
551536

552537
uint qHash( const QgsFeature &key, uint seed = 0 ) SIP_SKIP;

src/core/qgsfeatureid.h

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/***************************************************************************
2+
qgsfeatureid.h
3+
--------------------------------------
4+
Date : 3.9.2018
5+
Copyright : (C) 2018 by Matthias Kuhn
6+
email : matthias@opengis.ch
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
16+
#ifndef QGSFEATUREID_H
17+
#define QGSFEATUREID_H
18+
19+
#include <QSet>
20+
21+
// feature id (currently 64 bit)
22+
23+
// 64 bit feature ids
24+
typedef qint64 QgsFeatureId SIP_SKIP;
25+
#define FID_IS_NEW(fid) (fid<0)
26+
#define FID_TO_NUMBER(fid) static_cast<qint64>(fid)
27+
#define FID_TO_STRING(fid) QString::number( fid )
28+
#define STRING_TO_FID(str) (str).toLongLong()
29+
30+
#ifndef SIP_RUN
31+
typedef QSet<QgsFeatureId> QgsFeatureIds;
32+
#else
33+
typedef QSet<qint64> QgsFeatureIds;
34+
#endif
35+
36+
#endif

0 commit comments

Comments
 (0)