4853 Commits

Author SHA1 Message Date
Matthias Kuhn
60730abba7 Add missing import 2018-06-30 09:40:13 -05:00
Matthias Kuhn
773138cf57 Add handlesnull parameter to @qgsfunction
Up to date it was not possible to create a function that handles NULL values with the
@qgsfunction decorator. As soon as any parameter was NULL, the return value would also
be NULL.

Example of a function that returns a value now with a NULL paramter and would have returned NULL before

```
@qgsfunction(args=-1, group='Custom', handlesnull=True)
def mean_value(vals, feature, parent):
    valid_vals = [val for val in vals if val != NULL]
    return sum(valid_vals)/len(valid_vals)
```

[FEATURE]
2018-06-30 09:40:13 -05:00
Martin Dobias
569db8e069
Merge pull request #7045 from PeterPetrik/qgs-quick-position_and_transformer
[feature] [qgsquick] Add PositionKit, PositionMarker and CoordinateTransformer
2018-06-29 09:08:35 +02:00
Martin Dobias
97addfc2cc
Merge pull request #7313 from PeterPetrik/mesh_layer_styling_gui
[mesh] [feature] App widgets for styling mesh layers
2018-06-28 15:17:14 +02:00
Martin Dobias
4c8b801791 Make sure that bool(obj) is True for QGIS API objects
bool(obj) in Python has the following semantics:
1. if the object has __bool__() method, return its value
2. if the object has __len__() method, return its value
3. return True

So for objects in QGIS API that implement __len__() method, we were getting
unexpected behavior - for example, "if layer: ..." would evaluate as False
in case the layer was empty, while the usual expectation is that any reference
to an object that is not None should evaluate to True.
2018-06-28 11:04:50 +02:00
Peter Petrik
7bfcaf4db9 remove need for factory for system of measurement 2018-06-28 10:41:13 +02:00
Nyall Dawson
73eb7628d8 Style 2018-06-28 11:26:53 +10:00
Juergen E. Fischer
d0e94728d8 fix build with sip 4.18.1 (eg. ubuntu artful) 2018-06-27 23:30:04 +02:00
Matthias Kuhn
d7b85c69f8
Merge pull request #7016 from m-kuhn/featureSourceEmpty
QgsFeatureSource::empty() method
2018-06-26 13:01:08 +02:00
Peter Petrik
aeea184890 [mesh] [feature] App widgets for styling mesh layers
- Adding datasets to mesh layer from properties panel
- Information and source panel in properties panel
- Selection of active dataset (properties or styling panel)
- Styling of contours/scalars (properties or styling panel)
- Styling of mesh frame (properties or styling panel)
- Styling of vector arrows (properties or styling panel)
2018-06-26 08:50:19 +02:00
Peter Petrik
caed3a91d9 choose system of measurement for scalebar or position 2018-06-25 13:47:58 +02:00
Matthias Kuhn
1b15e68f64
Add minimal smartness for QgsProcessingFeatureSource::hasFeatures 2018-06-22 14:41:42 +02:00
Matthias Kuhn
2718317e85
Merge pull request #7298 from nyalldawson/layout
[layouts] Save last used export folder in project
2018-06-22 14:35:37 +02:00
Matthias Kuhn
c780d607cc
Merge pull request #7105 from PeterPetrik/quick-3-identity
[qgsquick] [feature] Identify and highlight
2018-06-22 14:34:08 +02:00
Matthias Kuhn
638fc0ceff
Merge pull request #7245 from rouault/gpkg_transactions
[OGR provider] [FEATURE] Add support for transactions on GPKG databases
2018-06-22 14:33:01 +02:00
Nyall Dawson
635f8ad7ca Add QgsFileUtils::findClosestExistingPath to find the closest
existing folder match for a path

E.g. if \a path is "/home/user/projects/2018/P4343"
and "/home/user/projects" exists but no "2018" subfolder
exists, then the function will return "/home/user/projects".

(Suprisingly no existing Qt method for this!)
2018-06-22 10:45:00 +10:00
Etienne Trimaille
6eeaca5570 return the default style first in the list 2018-06-22 09:23:47 +10:00
Martin Dobias
4c84cfa29a Fix a memory leak in classify() + add missing annotations/docstrings
A pseudo color renderer was getting created in classify() but never deleted.

Spotted by @PeterPetrik

As a bonus switched a for loop from mixed constBegin()/end() usage to range for.
2018-06-22 05:48:46 +10:00
Denis Rouzaud
ad00020366 QgsSettings.enumValue cast to enum 2018-06-21 05:29:16 -08:00
Denis Rouzaud
01681aba89 fix missing import 2018-06-21 05:29:16 -08:00
Denis Rouzaud
7dfec1fde0 [pyqgis] add misssing QgsSettings.setEnumValue
also fix sections in enumValue and flagValue
2018-06-21 05:29:16 -08:00
Nyall Dawson
981c6686c0 Dox++ 2018-06-21 18:22:55 +10:00
Nyall Dawson
2ed547219a Add globs to information returned by QgsVectorFileWriter.supportedFiltersAndFormats 2018-06-21 18:22:55 +10:00
Denis Rouzaud
f749c521a9 use Q_ENUM for QgsLocator::Priority 2018-06-20 11:21:25 -08:00
Nyall Dawson
77d22849d9 Fix calculation of relation aggregate in virtual field with same name as related field 2018-06-20 15:23:55 +10:00
Denis Rouzaud
ff1988f11d Python __repr__ test output 2018-06-19 13:55:53 -04:00
Denis Rouzaud
763dfd2998 use SIP to define Python __repr__ rather than injections
because it's a bit more clever!
2018-06-19 07:58:26 -04:00
Denis Rouzaud
cc3e29bcc2 add __repr__ for more geometry classes and add test 2018-06-19 07:02:17 -04:00
Denis Rouzaud
ac4f508c13 create Python __repr__ methods for QgsPoint and QgsPointXY 2018-06-19 07:02:17 -04:00
Nyall Dawson
4059c9b71d Move some more common geometry methods to headers to allow compiler inlining 2018-06-19 13:16:02 +10:00
Nyall Dawson
077ecedfc5 Unit tests for QgsMessageLog 2018-06-19 06:23:58 +10:00
Nyall Dawson
949853a0e0 Add API for temporarily suppressing user notifications for
message log critical/warning messages

These messages are still logged, but the log indicator is not
modified to flag their appearance.

This allows certain error messages to be logged (e.g. on startup)
which cannot be fixed by users/developers (e.g. those caused
by upstream Qt issues, 3rd party Python libraries, etc) but
without flagging them.

Currently, we get so many of these warnings on startup that the
log indicator loses all impact, and newly introduced, VALID
errors go unnoticed/ignored.
2018-06-19 06:23:58 +10:00
Nyall Dawson
00f0583325 Fix doc test 2018-06-18 23:14:45 +10:00
Nyall Dawson
68b38b2daf Add a signal when a project is cleared 2018-06-18 23:14:45 +10:00
Nyall Dawson
4fb9091e6e QgsRectangle::intersect should use a reference, not a pointer
We never call this method using nullptrs, so there's no need
for this to be a pointer argument in the first place. And
having it a pointer encourages leaky code, such as the
leak this commit fixes in server.
2018-06-18 07:55:17 +10:00
Nyall Dawson
b643465b12 Fix build, dox++ 2018-06-17 15:09:07 +10:00
Denis Rouzaud
8503896674
[locator] add clearPreviousResults virtual method (#7256)
* [locator] add clearPreviousResults virtual method

* also clear previous results when triggering result
2018-06-16 19:04:59 -08:00
Nyall Dawson
7a9b2980ea Fix doxygen warning 2018-06-17 11:15:10 +10:00
Marco Hugentobler
e76ca64eae Consider PR feedback 2018-06-17 11:11:39 +10:00
Marco Hugentobler
49cce29268 \param instead of @param 2018-06-17 11:11:39 +10:00
Marco Hugentobler
18f0af8c23 Port dxf export improvements to QGIS 3 2018-06-17 11:11:39 +10:00
Nyall Dawson
a4c8386e88 [sipify] Replace std::numeric_limits with old style DBL_MAX/etc 2018-06-17 09:24:37 +10:00
Nyall Dawson
47e7a100d9 DBL_EPSILON -> numeric_limits 2018-06-17 09:24:37 +10:00
Nyall Dawson
ac17d300ca DBL_MAX -> std::numeric_limits 2018-06-17 09:24:37 +10:00
Even Rouault
6a987f913b
[OGR provider] [FEATURE] Add support for transactions on GPKG databases
For complete support, it requires two GDAL fixes:
- One to avoid feature count to be invalid when using ROLLBACK TO SAVEPOINT
  f73ec8cd1d

- Another one to avoid nasty issues, at least on Linux, with the POSIX
  advisory locks used by libsqlite that could be invalidated due to how GDAL
  could open files behind the back of libsqlite. The consequence of this
  could be the deletion of -wal and -shm files, which caused issues in QGIS
  (non working iterators when the edit is finished, and later edits in the
  same session not working). Those issues could appear for example if doing
  ogrinfo on the .gpkg opened by QGIS, or if opening two QGIS session on the
  .gpkg

Both fixes are queued for GDAL 2.3.1
2018-06-15 12:56:59 +02:00
Matthias Kuhn
66ad9d99dd
Merge pull request #7055 from m-kuhn/wfsNoMainThreadEventLoopb
Avoid running QEventLoop on main thread (in WFS provider)
2018-06-15 08:57:50 +02:00
Nyall Dawson
f99d51175f Fix seealso links 2018-06-15 06:39:48 +10:00
Nyall Dawson
76eb29daf3 Unit tests and dox for QgsRasterIterator 2018-06-15 06:39:48 +10:00
Matthias Kuhn
402f3ffdd5
Regenerate sip with latest sipify 2018-06-14 09:54:00 +02:00
Matthias Kuhn
44e8f60a63
Add documentation 2018-06-14 09:52:28 +02:00