33 Commits

Author SHA1 Message Date
Alexander Bruy
5709f84b2f [processing] add createByDefault argument to directory output
constructor
2019-07-15 08:51:01 +10:00
Nyall Dawson
e65acadc3a [processing][API] Add methods to retrieve lists of files from
QgsProcessingParameterMultipleInput

These need to be handled differently to map layers, and none of
the existing API works for this use case.
2019-07-09 11:22:36 +10:00
Nyall Dawson
e9a1eab694 [processsing][API] Add api to allow QgsProcessingParameterFile parameters
to have a file filter string defined

Previously only an extension was settable, which prevented use when
multiple extension types are possible. A file filter string allows
for flexible file selection instead.
2019-07-08 15:07:42 +10:00
Nyall Dawson
d96c7386b1 Allow creation of color parameters with no opacity control 2019-07-01 06:32:21 +10:00
Nyall Dawson
38bb5fb260 [FEATURE][processing] New parameter type for colors
Allows for algorithms which require a color value as an input
2019-07-01 06:32:21 +10:00
Matthias Kuhn
4771f802fc
Add QgsProcessingParameters::parameterAsBoolean for consistency 2019-04-15 14:08:41 +02:00
Nyall Dawson
d3016d73d4 [processing] Add method to specify additional expression context variables
which will be available to a parameter when it is evaluated.

Specifying variables via this method is for metadata purposes only.
It is the algorithm's responsibility to correctly set the value of
these additional variables in all expression context used when evaluating
the parameter, in whichever way is appropriate for that particular variable.
2019-04-08 07:07:12 +10:00
Harrissou Sant-anna
f998ec9bb4 Remove duplicate word 2019-03-22 12:44:27 +10:00
Nyall Dawson
719a225bca [processing] Port point widget wrapper to new API
And switch to a snapping canvas tool when selecting points from canvas
2019-03-17 16:19:40 +10:00
Nyall Dawson
32fbf0a92b [processing][FEATURE] New parameter type for map scales
This adds a new parameter type specifically for map scales,
QgsProcessingParameterScale. The values are evaluated using
self.parameterAsDouble, which returns the map scale
denominator (matching the standard in other parts of the
QGIS API).

Scale parameters are displayed to users using the standard
QgsScaleWidget, which includes the combo box of predefined
scales and a shortcut button to match the current map scale.
2019-03-13 16:52:29 +10:00
Nyall Dawson
0003e91f27 Add methods to resolve parameters to layouts/layout items 2019-03-12 08:16:52 +10:00
Nyall Dawson
ba82954ac5 [processing] Add new parameter type for layout item objects 2019-03-12 08:16:52 +10:00
Nyall Dawson
dd49720863 [processing] Add new parameter type for print layout names 2019-03-12 08:16:52 +10:00
Nyall Dawson
107b48a430 Add NULLPTR macro for use in doxygen comments
For the c++ api dox this expands to "\c nullptr" (the
\c directive indicates a code literal value), and for sipify/Python
it expands to ``None`` (`` is sphinx annotation for literal values)

Makes for nicer dox for both c++ and Python!
2019-02-27 09:41:11 +10:00
Nyall Dawson
b6d66becab Sipify 2019-02-27 09:41:11 +10:00
Nyall Dawson
ffa49df9fb Fix misleading dox 2019-02-01 17:54:28 +11:00
Nyall Dawson
63b6a77702 [processing] Add API to convert a parameter definition to an equivalent
Python constructor string
2019-01-29 18:15:40 +11:00
Nyall Dawson
5acd7ffaef [processing] Add API to set default unit to distance parameters
Otherwise the API forces use of a corresponding CRS parameter in
order to determine the relevant distance unit, but this is not
always desirable
2018-12-18 04:39:06 +10:00
Peter Petrik
e71660215c [processing] add QgsProcessingParameterMeshLayer parameter 2018-12-17 11:50:53 +01:00
Nyall Dawson
11ea28a5b3 [FEATURE][processing] Add a new parameter type for authentication config
This adds a new available parameter type for processing algorithms,
QgsProcessingParameterAuthConfig, allowing selection from available
authentication configurations (and creation of new ones).

It allows creation of processing algorithm which can fully take
advantage of QGIS' mature authentication handling, avoiding the
need to use insecure string parameters for users to input
sensitive logon credentials.

QgsProcessingParameterAuthConfig parameters are evaluated using
QgsProcessingAlgorithm.parameterAsString(), which returns the
selected authentication configuration ID.
2018-12-15 08:23:10 +10:00
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
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
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
bef88f30df Minor processing parameter evaluation refactoring 2018-08-14 18:56:14 +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
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
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
2cb8a33884 Fix broken see also links 2018-05-25 11:16:18 +10:00
Denis Rouzaud
7df2593caf move auto generated sip file in dedicated folder 2018-05-14 10:23:37 -04:00