88 Commits

Author SHA1 Message Date
Nyall Dawson
04a9cd9211 Add more consistency to doxygen formatting 2017-10-06 08:19:00 +10:00
Denis Rouzaud
54c6291378 script to write include SIP files 2017-06-28 10:45:51 +02:00
Juergen E. Fischer
9ddd28dd81 Fix windows build
undefined error C2079: 'QMapNode<Key,T>::value' uses undefined class 'QgsGeometry'
2017-05-12 08:14:36 +02:00
Denis Rouzaud
4cc4a27068 [sipify] operators, remove argument
* skip some operators
 * allow to remove an argument with SIP_PYARGREMOVE
2017-04-26 15:06:16 +02:00
Nyall Dawson
266f182a26 Use auto doxygen links where possible instead of explicit \link
Will make things nicer in Python documentation
2017-04-03 13:18:36 +10:00
Nyall Dawson
fa6ec3a993 @(end)link -> \(end)link 2017-04-03 13:18:36 +10:00
Nyall Dawson
57eb237d20 Remove @author credits from doxygen
Because
- not widely used, seems strange that some authors get credit
while others don't
- already included in copyright header
2017-04-03 13:18:35 +10:00
Nyall Dawson
dfb5f56f80 @see -> \see 2017-04-03 13:18:35 +10:00
Nyall Dawson
e47073b1e1 \return -> \returns (for consistency) 2017-04-03 13:18:35 +10:00
Nyall Dawson
e4daf8ea62 @return(s) -> \return(s) 2017-04-03 13:18:13 +10:00
Nyall Dawson
11dcfd935c @param -> \param 2017-04-03 13:17:27 +10:00
Nyall Dawson
0326f7142d Change doxygen @note to \note 2017-04-03 13:16:03 +10:00
Matthias Kuhn
fb91ed7395 Use "\since" instead of "@note added in" 2017-04-03 01:06:33 +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
85894ed4c8 pre-process headers (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
Matthias Kuhn
255eb98be6 Make features valid on setAttribute and setGeometry
Implements https://github.com/qgis/qgis3.0_api/issues/75
2017-03-18 12:11:52 +01:00
Denis Rouzaud
40c056cae0 run astyle on src/core 2017-03-03 09:09:37 +01: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
Nyall Dawson
e656c63ab7 Remove duplicate QgsFeature::setFeatureId method
Leave just QgsFeature::setId and document api break
2017-01-11 10:05:31 +01:00
Matthias Kuhn
b1e226c069 Add missing #include "qgis_core.h" 2017-01-05 16:49:00 +01:00
Nyall Dawson
9021bb479c Remove "//! Destructor" doxygen comments
This documentation doesn't add any value
2016-12-30 13:52:57 +10:00
Nyall Dawson
6f3b0caa81 Add method to QgsAttributes to convert to QgsAttributeMap 2016-11-08 11:25:48 +10:00
Nyall Dawson
32b1603c81 Update indentation 2016-11-08 08:57:51 +10:00
Matthias Kuhn
f80a33be65 [FEATURE] Expose @parent variable in aggregate functions
This makes it possible to access attributes and geometry from the parent
feature when in the filter of the "aggregate" expression function.

With this in place aggregates can be calculated per feature.

E.g. max "measurement" for each point_station per polygon_research_area.

Or a default attribute value when digitizing features:

    aggregate(layer:='countries', aggregate:='max', expression:=\"code\",
filter:=intersects( $geometry, geometry(@parent) ) )
2016-10-27 23:11:50 +02:00
Nyall Dawson
1367fd09fc Prepare commit converts single line doxygen block format
Flips single line doxygen comments to use the proper single line
format:

/*!< comment */   to   //!< Comment

and

/** comment */    to   //! Comment
2016-10-25 09:17:39 +10:00
Matthias Kuhn
b6779f63ff Rename QgsFields::fieldNameIndex() to lookupField()
To have two clearly different names for tolerant/intolerant index lookup
2016-10-01 15:39:03 +02:00
Matthias Kuhn
9050cc14d4 Add == and != operator to QgsFeature and add QML bindings 2016-08-19 16:05:41 +02:00
Matthias Kuhn
5c20f0782a Cleanup QgsEditFormConfig
* It's now implicitly shared, meaning that changes to the config
   can be supervised and a signal is sent from QgsVectorLayer and
   there is no risk of elements suddenly being deleted.
 * Remove a bunch of methods that were in QgsVectorLayer for legacy
   reasons.
2016-08-19 09:03:07 +02:00
Denis Rouzaud
7233d263a2 remove extra includes 2016-08-11 15:19:31 +02:00
Denis Rouzaud
0af7cd3206 remove old code in comment (old QgsFeatureId class and 32bit IDs) 2016-08-11 14:41:08 +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
c628c0f434 Rework includes to forward declare as much as possible
Should speed up recompilation when headers change
2016-07-18 19:10:19 +10:00
Nyall Dawson
0a056f8a1f Add doxygen test to force use of \ingroup for classes
Using the group tag helps keep the API docs organized
2016-07-04 19:57:13 +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
Nyall Dawson
ee44bc8925 Implement QEP 17 - add "requires tests" comments to some classes 2015-11-14 20:17:54 +11: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
72608b0a6f Doxymentation 2015-09-11 23:56:34 +02:00
Matthias Kuhn
c6f7873585 Add QgsAttributes::operator== that takes care of NULL variants 2015-07-13 09:48:12 +02:00
Denis Rouzaud
9e3183c63f Revert "sort includes"
This reverts commit 2b7d3d3c73b50ba6dc74abec6dd652ff1b87c0ec.
2015-06-10 14:54:47 +02:00
Denis Rouzaud
2b7d3d3c73 sort includes 2015-06-10 13:59:08 +02: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
Radim Blazek
6e3cbe3a3d QgsFeature and QgsGeometry serialization 2015-05-18 16:35:43 +02:00