77 Commits

Author SHA1 Message Date
Denis Rouzaud
54c6291378 script to write include SIP files 2017-06-28 10:45:51 +02:00
Juergen E. Fischer
ad5054bfd9 sip update qgsfeature 2017-05-12 09:53:47 +02:00
Matthias Kuhn
28a21209b9 [sipify] seealso 2017-04-30 16:52:05 +02:00
Denis Rouzaud
1bfa539df1 [sipify] remove extra blank line 2017-04-24 07:39:30 +02:00
Denis Rouzaud
8f2a5c7c00 sipify all 2017-04-20 14:21:36 +02:00
Nyall Dawson
bfd37e1122 [sipify] Add return types for functions in docstrings
and change \return -> :return: in docystrings
2017-04-08 09:48:48 +10:00
Matthias Kuhn
58d2d6d7f9 sipify_all 2017-04-07 12:26:30 +02:00
Nyall Dawson
9b3539ab07 Update sip files 2017-04-03 13:18:36 +10:00
Nyall Dawson
d3daf60020 Convert doxygen notes and version added to sphinx style in sipify 2017-04-02 20:52:50 +10:00
Nyall Dawson
28a57c8f95 Remove ingroup and class from doxygen when creating sip docstrings 2017-04-02 20:30:22 +10:00
Matthias Kuhn
5148b7accb [sipify] Add name of source file to generated headers 2017-04-01 19:10:59 +02:00
Denis Rouzaud
9846b34ec3 add type and default values identifiers 2017-03-30 15:13:01 +02:00
Denis Rouzaud
15e4903890 sipify improvements
* add demo file and start a short doc
* fix some annotations
* do not display hidden line (SIP_SKIP, delete)
* use a defined var for SIP_SKIP
* remove constructor definition in header
* fix comment after method definition in header
* add a test for sipify itself
2017-03-30 15:13:01 +02:00
Denis Rouzaud
a44eb4d7b0 use dedicated header for QgsAttributes 2017-03-30 15:13:01 +02:00
Denis Rouzaud
b0564becfd also comment methods
fix comment starting on first line of block
2017-03-30 15:13:01 +02:00
Denis Rouzaud
7b08608f7f sipify QgsVectorLayer, QgsFeature 2017-03-30 15:13:01 +02:00
Denis Rouzaud
ba6f736c02 remove comments from sipfiles (QgsVectorLayer and QgsFeature) 2017-03-30 15:13:01 +02:00
Matthias Kuhn
bd75aeef49 Put some sip code into qgsfeature.h
Just for reference
2017-03-30 15:13:01 +02:00
Juergen E. Fischer
d2a2b18f95 QgsFeature: add pythonic notes to api doc and add QgsFeature.attribute(fieldIdx) binding 2017-02-15 00:08:27 +01:00
Juergen E. Fischer
6a56cb0dd0 updates and fixes for windows qt5/py3 build 2017-01-24 01:25:59 +01:00
Nyall Dawson
e656c63ab7 Remove duplicate QgsFeature::setFeatureId method
Leave just QgsFeature::setId and document api break
2017-01-11 10:05:31 +01:00
Nyall Dawson
fcb6c2bb9a Fix some incorrect return values from QgsFeature python bindings 2016-11-08 12:54:19 +10:00
Matthias Kuhn
9050cc14d4 Add == and != operator to QgsFeature and add QML bindings 2016-08-19 16:05:41 +02:00
Nyall Dawson
967d37adc7 QgsFeature::fields() returns a value, not a pointer
Also remove all other QgsFields pointers and replace with
references/values, since QgsFields objects are implicitly shared
2016-08-05 06:07:02 +10:00
Nyall Dawson
bd7d913379 Refine QgsFeature geometry getters/setters
All pointer based methods have been removed.

Now we have only:

  void setGeometry( const QgsGeometry& geom )

and

  QgsGeometry geometry() const

Benefits include avoiding a whole lot of tricky pointer lifetime
issues, potential memory leaks, and finally closing #777, which
has survived for over 9 years!...

Impacts on PyQGIS code:
- no more need for the messy
  g = QgsGeometry( feature.geometry() )
  workaround, just use g = feature.geometry() instead
- IMPORTANT: you can no longer test whether a feature has geometry
 using `if f.geometry():`, since QgsFeature::geometry() will
 *always* return an object. Instead, use
 `if not f.geometry().isEmpty():`, or preferably the new method
 `if not f.hasGeometry():`

Fix #777
2016-08-01 16:25:46 +10:00
Nyall Dawson
aceddae65a QgsFeature cleanup, part 1
Deprecate some QgsFeature methods which take or return pointers,
update other classes as required
2016-07-31 21:23:07 +10:00
Nyall Dawson
0fcff9f2a0 Allow direct QVariant creation from some QGIS metatypes 2016-05-20 09:48:18 +10:00
Juergen E. Fischer
71dc339106 more stl to qt ports and size_t => int fixups 2015-12-26 00:59:09 +01:00
Nyall Dawson
9cc9d424ce Add extra check for deprecations to documentation test
This check tests that if a function has been declared deprecated
with either Q_DECL_DEPRECATED or has a @deprecated Doxygen note
then it MUST have both the Q_DECL_DEPRECATD and @deprecated note.

It's important that both are used, as Q_DECL_DEPRECATED allows
throwing a warning if that method is used in code, while the
@deprecated doxygen note gives an indication to devs/PyQGIS users
of why it's deprecated and what should be used instead.

Ideally we'd also test for SIP /Deprecated/ tags, but I can't
find any reliable way to do this.
2015-12-07 21:55:36 +11:00
Matthias Kuhn
56ccb2b858 sipClass_Klass is deprecated for a long time: replace with sipType_Klass 2015-11-11 23:22:51 +01:00
Juergen E. Fischer
b5794b2f2d sip coverage fixes:
* make sip coverage test aware that there are less classes where QSci sip
  headers are not available
* exclude properties from members
* fix QgsFeatureIds typedef (fixes missing signal
  QgsVectorLayer.featuresDeleted and others)
* add missing notes for PyNames
* include some missing new methods in bindings
2015-11-08 19:30:39 +00:00
Nyall Dawson
c49b5b777f Change a lot of arguments to const references in core/gui
Rationale:
- there was a lot of large objects passed by value, so potentially
there's a speed bump from this
- even for implicitly shared classes like QString/QList there's still
a (small) cost for copying the objects when there's no reason to
- it's the right thing to do!
2015-10-07 12:02:04 +11:00
Matthias Kuhn
c6f7873585 Add QgsAttributes::operator== that takes care of NULL variants 2015-07-13 09:48:12 +02:00
Nyall Dawson
b1ffff826d Fix build 2015-05-21 05:49:04 +10:00
Nyall Dawson
267d9528d5 Implicit sharing for QgsFeature 2015-05-21 00:55:57 +10:00
Nyall Dawson
d393d268e1 Fix up non-const getters for attributes and geometry in QgsFeature
(preparation for implicit sharing)
2015-05-20 21:46:15 +10:00
Nyall Dawson
2863f20d67 Add a const geometry getter to QgsFeature 2015-05-11 19:46:32 +10:00
Juergen E. Fischer
9ceb5ceab6 sip sync 2014-11-21 01:17:21 +01:00
Juergen E. Fischer
c4c131ef75 sip sync 2014-05-27 23:32:42 +02:00
Juergen E. Fischer
d647354a52 sip fixes 2014-01-28 00:26:13 +01:00
Juergen E. Fischer
d4e369414b update sip bindings 2014-01-26 18:36:29 +01:00
Matthias Kuhn
52ab06e295 python: represent NULL attributes as QPyNullVariant 2013-08-28 13:15:08 +02:00
Nathan Woodrow
20e274a413 Add __iter__ for QgsFeature 2013-08-03 22:50:49 +10:00
Nathan Woodrow
0bb9543278 Remove __getattr__, __setattr__ for QgsFeature
Not such a good idea after all :)
2013-07-09 21:03:15 +10:00
Matthias Kuhn
c1cd3e84b5 Fix wrong python None type reference counting 2013-06-19 13:03:05 +02:00
Matthias Kuhn
9fc01a6d1f Fix memory leak in QgsFeature sip api 2013-06-15 11:43:15 +02:00
Nathan Woodrow
f8cafe81b4 Fix build error 2013-06-12 09:32:13 +10:00
Nathan Woodrow
052669f5c5 Fix #8040. Build error with sip 2013-06-12 08:10:22 +10:00
Matthias Kuhn
6381d626a1 Use python None object for NULL attributes 2013-06-11 14:48:29 +02:00
Nathan Woodrow
d539739089 Add __getattr__ and __setattr__ to QgsFeature 2013-06-10 09:21:31 +10:00