61 Commits

Author SHA1 Message Date
Nyall Dawson
bf71382065 Don't try to reuse True value in enum, causes Python issue 2020-05-12 10:33:30 +10:00
Nyall Dawson
cb1e8445d3 Expose some more classes to Python, but mark as unstable API 2020-05-12 10:33:30 +10:00
Andrea Giudiceandrea
27f345f0bf
Fix tick-style scalebar when subdivisions ticks height > segments ticks height
Take the subivisions ticks height into accout, for ticksscalebar box size calculation and horizontal line and labels position, only if the number of subdivisions to draw is greater than 1
2020-05-11 09:14:24 +10:00
Nyall Dawson
8699f83d98 [FEATURE][layouts] Allow customisation of division and subdivision symbol
as distinct symbols vs the scalebar line symbol

Allows for styling division and subdivision symbols in a different
way compared with the horizontal line symbol in a tick scalebar

Sponsored by SLYR
2020-05-07 10:56:50 +10:00
Andrea Giudiceandrea
a3397a8a2e
[feature][layouts] Add subdivisions in ticks scalebar right segments
Adds the ability to create subdivisions for segments included in the right part of the ticksscalebar

Fixes #20341
2020-05-06 09:12:37 +10:00
Nyall Dawson
66a3b090da Maybe even LESS enum classes will help? 2020-05-04 05:38:48 +10:00
Nyall Dawson
6ec369e6b7 Travis says no to enum class 2020-05-04 05:38:48 +10:00
Nyall Dawson
9fb85d3bc8 [FEATURE][labeling] Permit data defined control over placing labels outside
polygons

Options are:
- 'yes': allow placing outside the polygon if needed
- 'no': don't allow outside placements
- 'force': only ever put this label outside the polygon
2020-05-04 05:38:48 +10:00
Nyall Dawson
51820badc1 [FEATURE][labeling] Add option to allow polygon labels to be placed
outside of polygon features when required

When a label can't be placed inside the polygon and this option is checked,
then it will be automatically placed at a nicely selected location
just outside of the polygon

Sponsored by QGIS Swiss user group!
2020-05-04 05:38:48 +10:00
Mathieu Pellerin
c0a29051b4 [FEATURE][digitizing] Add avoid intersection/overlap mode
This commit adds a new avoid intersection mode setting when
digitizing new features. The three available modes are:
- allow intersections/overlaps
- avoid intersections/overlaps on active layer
- avoid intersectonss/overlaps on layers list

The third mode is what QGIS has had for a while, except
its UI/UX is a bit messy. The layers list is setup by
the user via the advanced snapping configuration widgets,
but isn't connected at all with whether snapping is
enabled / disabled.

This new approach makes it explicit to user whether
newly-added features might be clipped or not, and
if so by which layer(s).

Finally, the new 'avoid intersections/overlaps on
active layer' is likely a far more useful behavior
than having a list of layers (for e.g., you might
be digitizing on a layer that can't have overlap
with itself but is fine to overlap with another
layer, the latter also in need of avoid overlap
_with itself_).
2020-04-10 13:42:07 +07:00
obrix
c7f7c9829d Regenerate qgssnappingconfig.py 2020-04-07 09:27:08 +02:00
Martin Dobias
5ec1890643 Moved to proper QgsMapLayer subclass + icon + optional tile borders 2020-03-27 12:08:40 +01:00
Nyall Dawson
d10267f3aa Spelling 2020-03-23 03:08:50 +10:00
Nyall Dawson
b63018520e Cleanup scalebar widget enabling code by adding flags to QgsScaleBarRenderer
subclasses, so that the subclass itself can indicate what settings
it respects and we can avoid all the hardcoded logic in the configuration
widget
2020-03-23 03:08:50 +10:00
Nyall Dawson
b2016551b3 Add missing file 2020-03-16 10:08:46 +10:00
Denis Rouzaud
a93db7d7c5
add a completer for the file widget when creating a new GPKG (#35072) 2020-03-15 22:22:18 +01:00
Nyall Dawson
1ae7344830 Promote temporal units to first class citizen of QGIS
Adds temporal units to QgsUnitTypes, and adds associated helper API
2020-03-12 20:06:25 +10:00
lbartoletti
dfa5cb68aa
New snapping modes: Centroid and middle of a segment (midpoint) (#33622)
Snap on centroid and midpoint segment [FEATURE][needs-docs]
2020-03-02 09:02:35 +01:00
Matthias Kuhn
f33762a50f Fix invalid escape sequence
/usr/lib/python3/dist-packages/qgis/core/__init__.py:195

  /usr/lib/python3/dist-packages/qgis/core/__init__.py:195: DeprecationWarning: invalid escape sequence \s

    QgsProcessingUtils.LayerHint.Mesh.__doc__ = "Mesh layer type  \since QGIS 3.6"

/usr/lib/python3/dist-packages/qgis/core/additions/qgsfunction.py:167

  /usr/lib/python3/dist-packages/qgis/core/additions/qgsfunction.py:167: DeprecationWarning: invalid escape sequence \*
2020-02-17 08:07:14 +10:00
Denis Rouzaud
9441fcc947
drag'n'drop improvements part 3 (#34479)
* drag'n'drop improvements

part 3

this completely removes hidden config accessible under double click
now a widget groupbox (by opposition to the field config) is shown on top of the right panel
2020-02-14 23:19:42 +01:00
Denis Rouzaud
18a7cd0659
[FEATURE] Add an option to set the default project file format (qgs/qgz) (#33872) 2020-01-17 12:12:02 +01:00
Nyall Dawson
0cd955743c Create QgsLabeling class for labeling related enums and constants,
and avoid inclusion of pal header in a public QGIS header

pal is an internal implementation detail -- it should not be exposed
publicly
2020-01-15 17:10:37 +13:00
Even Rouault
2c652040cd
Fix compilation error in qgsdxfexport.cpp
I'm not sure which of QT 5.9.0 or gcc 5.5.0 is not happy, but with both
of them, I get:
```
/opt/qt59/include/QtCore/qflags.h: In instantiation of ‘QFlags<T>& QFlags<T>::setFlag(Enum, bool) [with Enum = QgsDxfExport::DxfPolylineFlag]’:
/home/even/qgis/QGIS/src/core/dxf/qgsdxfexport.cpp:1102:68:   required from here
/opt/qt59/include/QtCore/qflags.h:153:46: error: no match for ‘operator~’ (operand type is ‘QgsDxfExport::DxfPolylineFlag’)
         return on ? (*this |= f) : (*this &= ~f);
```
2019-12-13 10:33:14 +01:00
Peter Petrik
b93dfdd0b3
[feature] Support datasets with data defined on faces in mesh calculator (#33248)
* [feature] support datasets with data defined on faces in mesh calculator, fix #30219, fix #30170

added "driver" and "group name" to the calculator interface.
MDAL now supports 3 drivers for storing results, so user must be able to choose appropriate driver and dataset group name (some drivers store multiple groups to 1 file)
2019-12-06 18:27:28 +01:00
Matthias Kuhn
e87ea5ef85 Add dox 2019-12-01 10:04:15 +01:00
Matthias Kuhn
f81b680aa1 DXF export preserve dashed line style
We do not (yet) support an option to guarantee stroked parts at corners.
So also do not set this flag in the DXF export.
2019-11-29 17:58:02 +01:00
Nyall Dawson
4294f5e546 Add missing file 2019-11-14 13:00:48 +10:00
Matthias Kuhn
e5df863302
Merge pull request #32629 from m-kuhn/dxf_hali_vali
[dxf] HAlign/VAlign support for TEXT
2019-11-07 16:37:06 +01:00
Denis Rouzaud
5910a7b9f1
Be more QML friendly (#32652)
* add Q_ENUM for QgsGeometry::OperationResult

* QgsVectorLayer::startEditing, commitChanges and editBuffer Q_INVOKABLE

* Fix indentation

* fix sip
2019-11-06 07:36:58 +01:00
Denis Rouzaud
8e40df8e26 add Q_ENUM macro to QgsVectorLayer::EditResult and SelectBehavior 2019-11-05 13:25:48 +01:00
Matthias Kuhn
0f5a4f7d2f [dxf] HAli/VAli support for TEXT 2019-11-04 16:47:48 +01:00
Matthias Kuhn
ec244b3338 Since 3.10.1 2019-10-31 08:42:15 +01:00
Matthias Kuhn
1886d70dca Typo 2019-10-30 19:10:19 +01:00
Matthias Kuhn
312c869268 Use class enum 2019-10-30 16:23:36 +01:00
Denis Rouzaud
dceb8223f8 switch back to non scoped enum
there is an issue in SIP when mixing non-scoped and scoped enums in the same class
see https://www.riverbankcomputing.com/hg/sip/rev/ccc4eda868de

and if switching all to scoped enum, there is a conversion issue in slot
for MessageLevel (whhen connection QgsMessageLog::messageReceived)
2019-10-02 15:53:15 +02:00
Denis Rouzaud
86550e9837 create a method in QgsGui to determine if running Python macros is allowed 2019-10-02 15:53:15 +02:00
Denis Rouzaud
96e8abde39 use an enum for enable macros possibilities 2019-10-02 15:53:14 +02:00
Nyall Dawson
57ee33ed71 Add missing file 2019-09-26 09:05:22 +10:00
Nyall Dawson
c02686dbd0 Add API for volume units to QgsUnitTypes
Complements the existing API for distance and area handling
2019-09-09 20:12:45 +10:00
Alessandro Pasotti
a3c4eb9947
Providers connections interface API
This is the implementation of the new DB connections API (grant proposal 2019).
Summary

The new API makes it available to QGIS core a new interface for provider connections and will allow to:

    replace the provider specific QgsSettings management in QGIS4 (save/load connections from the settings) NOT IN SCOPE FOR NOW.
    provide a unified API for common operations on DB connections:
        executeSql and get the results
        list tables names and properties and schemas
        create a new vector table (no rasters for now)
        create/rename/drop schemas and tables
        vacuum
       ....
2019-08-16 20:44:05 +02:00
Nyall Dawson
87f10e140e Fix generation of enum class Pydocs 2019-07-06 12:36:54 +10:00
Nyall Dawson
590d1aae9d [FEATURE][API] Visitor API for style entities
Adds a new visitor pattern API for creation of visitors which visit
all the style entities (symbols, color ramps, text formats, and
label styles) associated with different objects. Can be used on a
renderer, map layer, or project wide level.

E.g. on a project wide level, allows collection of ALL the style
symbols/color ramps/text settings inside a project, including those
in layouts or annotations!
2019-07-06 12:36:54 +10:00
Peter Petrik
62d615c2cd [QEP 149] Introduce static data providers [API BREAK]
- adds QgsProviderGuiRegistry and QgsProviderGuiMetadata
- adds QgsProjectStorageGuiRegistry
- requires providerMetadataFactory for dynamic data providers
- requires providerMetadataGuiFactory for dynamic data providers (GUI only)
- removes QgsProviderRegistry::WidgetMode
2019-06-18 15:15:36 +02:00
Nyall Dawson
0f1660990f Store vector layer wkb type in xml
We can use this when restoring the layer, if the uri turns out
to be invalid at that stage (e.g. a file has moved). By storing
and falling back to the last known wkb type, we avoid unnecessarily
discarding the existing layer renderer, and can still show the
expected layer type in the layer tree.
2019-04-18 18:41:09 +10:00
Denis Rouzaud
631c7016db
scope enum for QgsProcessing::LayerHint (#9639) 2019-03-27 17:23:36 -05:00
Denis Rouzaud
60682885c0
Small tweak to enum Python docs (#9631)
original credits to @nyalldawson
2019-03-26 14:00:37 -05:00
Denis Rouzaud
e232817e5b add missing doc 2019-03-25 11:00:17 -05:00
Denis Rouzaud
9a6ddbd5c1 also monkey patch the former enum type 2019-03-24 21:40:33 -05:00
Denis Rouzaud
38c2d4a03d fix dox for unnested enums 2019-03-24 21:40:33 -05:00
Denis Rouzaud
f45314245c run sipify 2019-03-24 21:40:33 -05:00