60 Commits

Author SHA1 Message Date
Nyall Dawson
c16a1e2b3d Update enums 2024-01-19 19:44:48 +10:00
Germap
43511aced2
Update qgsfunction.py, homogenize referenced_columns subsection 2023-11-18 17:53:29 -05:00
Germap
e69f2bf0f8
Update python/core/additions/qgsfunction.py
Avoid using 'slightly' since this could be a considerable performance improvement depending on the provider.

Co-authored-by: Matthias Kuhn <matthias@opengis.ch>
2023-11-17 17:36:23 -05:00
Germán Carrillo
ac80a3782e Avoid None as value for referenced_columns (use empty list instead) in qgsfunction.py documentation 2023-11-02 16:31:45 +01:00
Denis Rouzaud
c76b86e26b
move enum QgsMapLayerProxyModel::Filter to Qgis (#54891) 2023-10-11 13:57:01 +02:00
Denis Rouzaud
30a641111d
Merge pull request #52847 from 3nids/settings-treewidget
Settings editors
2023-05-02 21:31:35 +02:00
Denis Rouzaud
d888ee2a70
use public method 2023-05-01 09:57:09 +02:00
Yoann Quenach de Quivillic
ccb868f626 Harmonize doc 2023-04-29 14:25:11 +02:00
Yoann Quenach de Quivillic
947931ad2b Fix qgsfunction decorator args handling 2023-04-29 14:25:11 +02:00
Denis Rouzaud
91effce867 fix import 2023-02-03 09:05:37 +01:00
Denis Rouzaud
34eb0826c3 change QgsSettings to QgsSettingsTree in code base 2023-02-03 09:05:37 +01:00
Denis Rouzaud
f9e21602d2
add name method for settings + improve dox (#51661) 2023-01-31 15:48:08 +00:00
Denis Rouzaud
7d628998d5 follow-up rename QgsSettingsTreeElement to QgsSettingsTreeNode 2023-01-30 10:03:39 +10:00
Denis Rouzaud
dd99bb02ac avoid API break in method signature 2023-01-17 06:56:57 +01:00
Denis Rouzaud
44039d164c sipify them all 2023-01-16 09:00:49 +01:00
Harrissou Sant-anna
0dffc593e2 Add missing blank line to allow parameters display in docs 2022-12-31 06:56:48 +10:00
Harrissou Sant-anna
d249049256 make params easier to find in PyQgsSettingsEntryEnumFlag docs 2022-12-16 11:23:02 +01:00
Denis Rouzaud
158cd3174d forward options to base constructor 2022-04-14 08:39:15 +02:00
Denis Rouzaud
3926e97cda pyqgis implementation for Qgis.Settings.Options.SaveEnumFlagAsInt 2022-04-14 08:39:15 +02:00
Denis Rouzaud
378c7f594a apply same changes to PyQgsSettingsEntryEnumFlag 2022-03-08 14:37:59 +01:00
Denis Rouzaud
d3d91950bf fix python implementation of enum/flag setting 2022-03-01 12:09:47 +01:00
Denis Rouzaud
d06b1f1ff9 replace setVariantValue method to avoid API break 2022-03-01 12:09:47 +01:00
Hannes
1877b3634a Show full traceback on Python expression function exception 2022-02-19 09:00:34 +10:00
Denis Rouzaud
d2be87210a
fix PyQGIS API docs building (#43387)
* fix PyQGIS API docs building

The current building of the PyQGIS API doc relies on the fact that the first line is a signature.
If not given, it should be empty.

* Update qgssettingsentry.py
2021-05-25 17:26:56 +02:00
Damiano
221d9f7f01 Fix docstrings 2021-04-27 14:15:56 +02:00
Damiano
1def5e7b94 Python QgsSettingsEnum and Flag unified in QgsSettingsEnumFlag 2021-04-26 15:10:53 +02:00
Damiano
97f1a645f0 Changed SettingsType to scoped enum 2021-04-15 09:58:39 +02:00
Damiano
abb8e80c1f Added functionality to override default value for settings entries 2021-04-14 19:49:57 +02:00
Damiano
9082cfa268 Fixed trailing space 2021-04-14 18:13:51 +02:00
Damiano
4891bd6ebb Added support for settings with keys with multiple dynamic parts 2021-04-14 18:05:41 +02:00
Damiano
9762206731 Removed Settings struct / unified Enum/Flag logic in one base class 2021-04-14 15:41:49 +02:00
Damiano
3c5f9b1e91 Python implementation for QgsSettingsEntryEnum/Flag and fixed docstrings 2021-04-07 14:02:08 +02:00
Nyall Dawson
4fe99d8d6c Add better __repr__ methods for QgsDateTimeRange, QgsDateRange 2021-03-25 08:01:51 +10:00
Nyall Dawson
1040fe8705 Don't silently swallow exceptions in python context managers
Notably this causes processing modules to silently fail to load
without any warnings if the required dependancies (such as pyscopg2)
are not installed
2021-03-04 07:39:47 +10:00
Nyall Dawson
278ccb8e85 Fix crash when trying to use meta enums on some platforms
Keeping references to static meta objects and meta enums around seems
to avoid the crash
2020-11-14 14:37:38 +10:00
Denis Rouzaud
cdc2f7fde8
fix PyQGIS docs for QgsProviderMetadata (#37552)
fixes https://github.com/qgis/pyqgis/issues/55
2020-07-03 11:36:11 +02:00
Nyall Dawson
82c298a703 Show startup profile timings in developer/debugging tools panel
Instead of hiding this information on the console, let's expose it
to users. QGIS startup times have been an ongoing issue for a number
of years, so let's help provide users with some tools to help
track down what's causing these (*hint* it's probably a plugin *hint*)
2020-05-19 04:35:34 +10:00
Matthias Kuhn
a5f557f085 Fix escaping issues 2020-05-05 23:22:12 +02:00
Nyall Dawson
a06e707a15 Better repr for QgsProcessingFeatureSourceDefinition 2020-03-29 05:56:23 +10:00
Juergen E. Fischer
b830a4a448 qgsfunction: replace deprecated inspect.getargspec() to inspect.getfullargspec() 2019-11-07 22:47:08 +01:00
Matthias Kuhn
abf9880182 Cleanup python code 2019-11-02 15:01:59 +01:00
Matthias Kuhn
52f0994bf6 Various fixes 2019-11-02 15:01:59 +01:00
Matthias Kuhn
208ea9b033 More Q_GLOBAL_STATIC
Because it's pure fun
2019-11-02 15:01:59 +01:00
Matthias Kuhn
a50287514b Q_GLOBAL_STATIC for QgsDataProvider 2019-11-02 15:01:59 +01:00
Martin Dobias
90910b0447 Patch QgsProviderMetadata in Python to avoid API break
In C++ we do not support QgsProviderMetadata(key, description, createFunc) anymore,
but for python code we can have a patched class that still supports createFunc.

Why not keep the variant with createFunc in C++ as well? Because... SIP!
With newly added virtual methods in QgsProviderMetadata, SIP started to generate
a sip-specific subclass to handle derived classes in Python, however due to the variant
with PyObject* and custom MethodCode it was getting confused about what constructors
are available in C++ and failing to compile.
2019-06-21 18:27:36 +02:00
Nyall Dawson
48d2a37057 [FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.

To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.

This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.

The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-04-03 02:31:27 +10:00
Nyall Dawson
fdfe0cee23 [api][needs-docs] Allow registering PyQGIS using a nice decorator syntax
This allows nice and simple, elegant construction of checks for
Python.

To use, Python based checks should use the decorator syntax:

  from qgis.core import check

  @check.register(type=QgsAbstractValidityCheck.TypeLayoutCheck)
  def my_layout_check(context, feedback):
    results = ...
    return results

Or, a more complete example. This one throws a warning when attempting
to export a layout with a map item set to the Web Mercator projection:

  @check.register(type=QgsAbstractValidityCheck.TypeLayoutCheck)
  def layout_map_crs_choice_check(context, feedback):
    layout = context.layout
    results = []
    for i in layout.items():
      if isinstance(i, QgsLayoutItemMap) and i.crs().authid() == 'EPSG:3857':
        res = QgsValidityCheckResult()
        res.type = QgsValidityCheckResult.Warning
        res.title='Map projection is misleading'
        res.detailedDescription='The projection for the map item {} is set to <i>Web Mercator (EPSG:3857)</i> which misrepresents areas and shapes. Consider using an appropriate local projection instead.'.format(i.displayName())
        results.append(res)

    return results
2019-01-11 09:51:04 +10:00
Matthias Kuhn
a1b6a2cb7f Fix docs 2018-07-02 06:16:49 -05:00
Matthias Kuhn
45fdd0fb31 Add documentation for @qgsfunction 2018-07-01 06:31:26 -05:00
Matthias Kuhn
60730abba7 Add missing import 2018-06-30 09:40:13 -05:00