41 Commits

Author SHA1 Message Date
Nyall Dawson
d72c4d001f [processing] Allow parameter metadata to set the number of decimal places
to show in numeric/distance widgets

E.g. to only show 2 decimal places:

  # only show two decimal places in parameter's widgets, not 6:
  param.setMetadata( {'widget_wrapper':
    { 'decimals': 2 }
  })
2018-11-30 05:02:59 +10:00
Matthias Kuhn
c55b4eb4c8
Make sip a bit happier 2018-10-31 12:15:43 +01:00
Matthias Kuhn
87c126323c
Regenerate fids for "multipart to singlepart algorithm" 2018-10-31 10:27:56 +01:00
Matthias Kuhn
a4d4c55c82
Parameter name harmonization 2018-10-31 10:27:55 +01:00
Matthias Kuhn
50cf8b9e4e
Unify parameter names 2018-10-31 10:27:54 +01:00
Matthias Kuhn
229c617785
Ignore FID field when merging vector layers to geopackage 2018-10-31 10:27:54 +01:00
Harrissou Sant-anna
0816a29962 Fix typo in generated file 2018-10-13 12:30:52 +10:00
Nyall Dawson
d26f25cf94 Deprecate unused QgsProcessingAlgorithm::helpString method 2018-09-26 04:26:49 +10:00
Nyall Dawson
95d68e9172 [processing] Default to hiding help button for algorithms
And require that showing help is opt-in. Apart from a handful
of built-in providers, most providers will not have help pages
available within the QGIS documentation (including model and
script algorithms). Accordingly, we should hide the help button
by default and only show it for these selected providers.

Note that 3rd party algorithms can still specify custom helpUrl
urls, in which case the button WILL be shown.
2018-09-26 04:26:49 +10:00
Nyall Dawson
e2082a0935 [processing] Fix modeler help/description generation, allow setting
of model short description text

Fixes #18767
2018-09-26 04:26:49 +10:00
Nyall Dawson
4b24552097 Change QgsProcessingAlgorithm::supportInPlaceEdit to use QgsMapLayer, not QgsVectorLayer
Because at some stage in the future we may allow in-place edits to raster layers,
and we don't want to have to break API for this.
2018-09-21 18:15:46 +10:00
Nyall Dawson
17326541cd [processing] Add method to attempt to reattach model children to linked algorithms
Refs #19857
2018-09-19 05:04:09 +10:00
Alessandro Pasotti
0380c06003 Add prepareSource method 2018-09-14 18:23:03 +10:00
Alessandro Pasotti
4549ee5fff In-place moved check logic into QgsAlgorithm
+ new tests
+ fixed fixer function
+ drop z/m
2018-09-14 18:23:03 +10:00
Alessandro Pasotti
f35e37613b Expose processFeature to public API 2018-09-14 18:23:03 +10:00
Nyall Dawson
681d44f11f Messy mockup of feature 2018-09-14 18:23:03 +10:00
Denis Rouzaud
4b7da692d6 run sipify all 2018-09-10 11:41:57 -04:00
Nyall Dawson
a717b85e2e [FEATURE][processing] New modeler parameter widget
A new widget which handles parameter values for child algorithms
within a model. Instead of the previous approach of requiring
individual widget wrappers to handle creation of a suitable
model widget, we do all this automatically for them.

This widget uses a stacked widget with a toolbutton to select
the parameter's source, instead of the previous combo box approach
(which didn't scale well for large models). I.e. users select
first whether the value is taken from a static value, a
model input, or an output from a different child algorithm. The
widget then changes appearance and behavior based on this
choice.

Additionally, a new option is present for all parameters
of using a "precalculated expression". This expression is
evaluated once before the child algorithm is executed
and used during the execution of that algorithm.
2018-09-04 19:06:07 +10:00
nirvn
48b18d4c6c [processing] add parameterAsInts function 2018-09-04 10:07:07 +07:00
nirvn
13ecaa4190 [needs-docs][processing] Add a multiple selection mode to the band parameter 2018-09-04 10:07:07 +07:00
Nyall Dawson
4930061b21 [processing] Fix incorrect OGR warnings when loading raster layer results
Fixes #19597
2018-08-16 06:37:18 +10:00
Nyall Dawson
bef88f30df Minor processing parameter evaluation refactoring 2018-08-14 18:56:14 +10:00
Nyall Dawson
1fea03fec7 [processing] Make model to/from variant methods public 2018-08-01 07:32:52 +10:00
Matthias Kuhn
d7b85c69f8
Merge pull request #7016 from m-kuhn/featureSourceEmpty
QgsFeatureSource::empty() method
2018-06-26 13:01:08 +02:00
Matthias Kuhn
1b15e68f64
Add minimal smartness for QgsProcessingFeatureSource::hasFeatures 2018-06-22 14:41:42 +02: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
ac17d300ca DBL_MAX -> std::numeric_limits 2018-06-17 09:24:37 +10:00
Nyall Dawson
e91aed6617 [processing] Force model outputs to respect constraints set by
their underlying algorithm's provider

E.g. for model outputs generated by a saga algorithm, only
sdat and shp files are valid outputs. So only give users choices
of these instead of all formats.

Also fixes temporary file names generated as part of model
execution may use formats which are not compatible with the
algorithm's provider.

Fixes #18908
2018-06-05 10:05:32 +10:00
Nyall Dawson
f6416a1990 [processing] Fix missing vector inputs when run in batch mode
Fix incorrect definition of compatibleVectorLayers, which was
using layer WKB type values instead of processing source types.
2018-06-01 15:55:11 +10:00
Nyall Dawson
59d425c5b0 [processing] Fix some incorrect formatting of algorithm titles 2018-05-31 15:27:51 +10:00
Nyall Dawson
0bbaa3b01e [processing] Add method to retrieve list of accepted Python data types for a parameter type 2018-05-31 15:27:34 +10:00
Denis Rouzaud
65bb60e96c run sipify 2018-05-28 10:39:34 -08:00
Nyall Dawson
4b1b752633 Fix bad regex 2018-05-27 18:54:09 +10:00
Nyall Dawson
38850bdb94 [pyqgis] Ensure that multiline param tags are indented for additional lines 2018-05-27 18:54:09 +10:00
Nyall Dawson
c864d22d1f Add "get ..." to doxygen compliance blacklist
Should be "gets ..." for consistent tense, or better yet
"returns ..." for consistency.
2018-05-27 14:05:06 +10:00
Nyall Dawson
94cf3fc788 Use "customize" instead of "customise"
Since we default to US spelling, we should always be using "customize"
2018-05-26 15:44:04 +10:00
Nyall Dawson
1c615c15cc More documentation compliance
Use Qt style "returns .." tense instead of "return ..", and lock
this in with a documentation compliance unit test
2018-05-25 15:09:00 +10:00
Nyall Dawson
2cb8a33884 Fix broken see also links 2018-05-25 11:16:18 +10:00
Nyall Dawson
5edcc64f72 [processing] Allow algorithms to return a translated short description
This is used in the algorithm's tooltip in the toolbox, and is intended
for single sentence description of the algorithm, e.g.
"Converts 2D features to 3D by sampling a DEM raster."

Convert grass algorithms to use short description for the
descriptive parts of their names, to cleanup the toolbox
and make it more uniform.
2018-05-17 08:50:39 +10:00
Nyall Dawson
c9e5a36558 [processing] Avoid generic exceptions
Makes the full Python exception available when running algorithm,
which provides much more useful error messages
2018-05-16 04:35:17 +10:00
Denis Rouzaud
7df2593caf move auto generated sip file in dedicated folder 2018-05-14 10:23:37 -04:00