202 Commits

Author SHA1 Message Date
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
Nyall Dawson
49d56f6c19 [FEATURE] Add new layout item type for manually created tables
Allows for creation of tables with contents manually entered by users
(i.e. spreadsheet style), so that users can create completely custom
tables.

Supports control custom cell contents, foreground and background colors.
2020-01-14 19:08:20 +13:00
Nyall Dawson
5704412d96 New class QgsTableCell
Encapsulates the contents and formatting options for a single cell
in a table (e.g. background and foreground color)
2020-01-14 19:08:20 +13:00
Nyall Dawson
1f7140bfc5 New class QgsLocalDefaultSettings
This class contains a variety of default setting values. These values are local, profile
specific settings which may have been configured or tweaked by the user (as opposed to
global, fixed default settings).

The values encapsulated here should be inherited when creating new objects such as new
QGIS projects.

Typically, the QgsSettings backend is used to store and retrieve these local settings.

The intention here is to provide stable, structured and easily discoverable
methods for setting and retrieve these settings, rather than forcing raw QSetting
handling.
2020-01-09 17:10:30 +13:00
Nyall Dawson
410da5e358 New class QgsProjectDisplaySettings
This class (attached to a QgsProject object) provides a place to
store and retrieve settings related to project display behavior,
e.g. the numeric formats used for bearings and coordinates
2020-01-09 17:10:30 +13:00
Nyall Dawson
7affde6624 Add numeric formatter for currency values 2020-01-08 16:20:43 +13:00
Nyall Dawson
d445487c0d Add numeric formatter for scientific notation 2020-01-08 16:20:43 +13:00
Nyall Dawson
8bcba4780e Add percentage numeric formatter 2020-01-08 16:20:43 +13:00
Nyall Dawson
d0b5a01729 [api] Add registry and interface for QgsNumericFormats
QgsNumericFormat subclasses provide a means to format a numeric value
as a string, applying various formatting options. E.g. a default
string to value formatter (included here) includes settings for
controlling the number of decimal places, whether a thousands separator
should be shown, whether a leading + sign should be shown, whether
trailing zeros should be shown.

This PR also includes a formatter for bearings, allowing various
formats of numeric bearings to be applied (e.g. control over decimal
places, etc + control over whether direction E/W suffixes are shown,
or whether values should be limited to either the +/- 180 range or
0-360 degree range)

When formatting values, a QgsNumericFormatContext class is used
to provide context. Currently, this includes the thousands and
decimal separators to apply when formatting (which are taken by
default from the user's locale).

A registry of formatters is included to allow easy addition of
other formats in future (e.g. currencies, percentages, scientific
notation, etc...) and to allow plugin based formats.

The intention is to follow this up with gui configuration widgets
for the formats, and then expose them in various places through
the qgis ui (e.g. in the range editor widget for fields, in scalebar
numbers, as an option for formatting numeric labels, etc)
2020-01-08 16:20:43 +13:00
David Marteau
5bf8d2cd26
Pass project when creating relation from Xml
Fix dependency inconsistency to project from QgsRelationManager
    by forcing  'QgsRelation::createFromXml' to rely on project passed
    to 'QgsRelationManager' instead of using 'QgisProject::instance()'
2019-12-20 23:56:17 +01:00
Nyall Dawson
b1bbc8511b [labeling] Move settings related to removing labels (e.g. max no
of labels, min size for labels) to a new class QgsLabelThinningSettings

This new class is designed to contain settings related to how the label
engine removes candidate label positions and reduces the number of
displayed labels.
2019-12-12 07:44:11 +10:00
Nyall Dawson
a8adb2d6c2 Code shuffle: move all labeling related code into src/core/labeling
So that these files are all grouped together, making it easier to locate
all the components of the labeling engine and hopefully making things
easier to navigate
2019-12-11 14:05:44 +10:00
Peter Petrik
d1dd68ae11 remove averaging settings class and expore averaging methods outside qgis core 2019-12-05 07:08:50 +01:00
Nyall Dawson
9f63f49230 Move label obstacle settings out to their own class, and monkey patch around
to maintain current API

QgsPalLayerSettings is way too heavy, and we need to start refactoring
this into smaller atomic components
2019-12-03 19:38:24 +10:00
Vincent Cloarec
6d4c995a28 [FEATURE] API for rendering frames for mesh vector dataset animation (particles) (#33110)
* [FEATURE] API for rendering frames for mesh vector dataset animation (particles) 

Adds a renderer to generate frames that represent particle traces in a vector field of a mesh layer. The renderer cannot be chosen in the current GUI, however crayfish plugin can use API to generate avi/gif files with nice animations representing the movement of (random) particles in the mesh layer vector field.
2019-11-29 09:06:47 +01:00
Nyall Dawson
204bd47b19 [FEATURE][diagrams] New diagram type "stacked bars"
Stacks bars of varying colors for each attribute on top of each other
vertically or horizontally.

Sponsored by SLYR
2019-11-24 19:11:21 +10:00
Denis Rouzaud
16ca39ce21 fix sip 2019-11-07 10:01:26 +01:00
Hugo Mercier
845894b313
[FEATURE] Selective masking (#30747)
* [FEATURE] Selective masking

Advanced rendering feature that allows the definition of 'masks' areas around labels or with a new typ of symbol layer. These masks will "un-draw" symbol layers of other layers underneath.
It modifies the rendering process by adding an optional second pass.
2019-11-07 08:17:25 +01:00
Matthias Kuhn
4294dda083 Resipify 2019-11-03 21:05:34 +01:00
Nyall Dawson
65490ab13e Move QgsProject map scales settings to a new class, QgsProjectViewSettings
attached to QgsProject

And deprecate old getters/setters

The goal here is to create a place for project view related settings (e.g.
map scales, default extent, possibly future things like a fixed project
maximum area of interest, etc). Currently these are all handled in an
ad-hoc way, e.g. sometimes in project custom keys, sometimes inside
xml saved and restored by map canvases. But both these approaches break
important use case for plugins, e.g. creating a project from scratch
which will zoom to a desired extent on load. That's totally impossible
in the current API, unless you resort to extremely fragile manual
xml crafting...
2019-10-31 14:59:39 +10: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
Nyall Dawson
b1ee295a95 Make QgsConditionalLayerStyles a QObject
and add a "changed" signal to it, so that we can tell when the
layer's conditional styles change
2019-09-25 16:55:33 +10:00
Denis Rouzaud
e31e9a32b8 fix false boolean not shown as so in attribute table 2019-09-23 17:08:08 +02:00
rldhont
cc58cba93d API: Define QgsVectorLayerServerProperties to manage QGIS Server properties like WMS DImensions 2019-09-07 16:07:10 +02:00
Nyall Dawson
1afa6a8ec5 New class QgsBookmarkManagerModel
Move bookmark model logic to core, add tests
2019-09-04 14:19:47 +10:00
Nyall Dawson
d8300987e8 [FEATURE][API] New class QgsBookmarkManager
Attached to QgsProject, this provides a stable, supported method
of managing project bookmarks (vs the old undocumented, not stable
approach of directly manipulating project keys)
2019-09-04 14:19:47 +10:00
Denis Rouzaud
5fd76ffb9a [FEATURE] add logarithmic scale method for graduated renderer
So easy with new API :)
2019-09-03 08:08:38 +02:00
Denis Rouzaud
68a9ea5d70 move src/core/symbology/classification to src/core/classification 2019-09-02 09:46:40 +02:00
Denis Rouzaud
41495058d1 run sipify 2019-08-30 12:45:37 +02:00
David Signer
272d022dbc sip include 2019-08-29 08:26:28 +02:00
David Signer
5c38b4bdc8 stored expression base class with read write methods 2019-08-29 08:24:15 +02:00
Denis Rouzaud
44acec6b8a
move QgsRenderRange and QgsRendererRangeLabelFormat to their own file (#31464) 2019-08-28 14:22:07 +02: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
c71cd4b5fc Initial work on rendered feature handler interface
Adds an interface for classes which provider custom
handlers for features rendered as part of a map render job.

QgsRenderedFeatureHandlerInterface objects are registered
in the QgsMapSettings objects used to construct map render
jobs. During the rendering operation, the handleRenderedFeature()
method will be called once for every rendered feature, allowing
the handler to perform some custom task based on the provided
information.

They can be used for custom tasks which operate on a set of
rendered features, such as creating spatial indexes of the
location and rendered symbology bounding box of all features
rendered on a map.
2019-08-07 21:53:16 +10:00
Nyall Dawson
a0f6ee7541 Sipify 2019-07-31 11:03:06 +10:00
Matthias Kuhn
4e33bc1fcf
Merge pull request #30610 from signedav/fix_valuerelation
Fix multi-selection on value relation widget using string fields
2019-07-25 18:16:25 +02:00
David Signer
201dd0850b renamed QgsArrayUtils to QgsPostgresStringUtils 2019-07-17 16:50:58 +02:00
David Signer
380d5c7706 sip stuff 2019-07-17 07:03:18 +02:00
Nyall Dawson
298e2fe25e Add a model for news feeds 2019-07-15 12:52:20 +10:00
Nyall Dawson
af365c6144 Create QgsNewsFeedParser class for parsing QGIS style news feeds
Designed to work with the server specs from https://github.com/elpaso/qgis-feed
2019-07-15 12:52:20 +10:00
Nyall Dawson
b298a197e7 Start on registry 2019-07-11 13:03:12 +10:00
Nyall Dawson
fb1a610007 Early prototype of label callouts 2019-07-11 13:03:12 +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
Nyall Dawson
545e8bcf2c Add utility class for proj to Python bindings 2019-03-27 12:53:15 +10:00
Peter Petrik
37faa0d883
Add option to format time in mesh layer (#9452)
[feature] [mesh] #20731 add option to format time in mesh layer

There is new settings dialog that can be opened by button next to time slider. User can set reference time and time format (e.g. 2019-03-21 22:01:11).
2019-03-15 08:42:28 +01:00
nirvn
b5146db92e Use the QgsSqliteUtils system tables list in DB Manager 2019-03-01 12:30:04 +07:00
Nyall Dawson
69f45e389c Refactor QgsExpressionContext and move QgsExpressionContextUtils
out to its own header

Avoids slow recompilation caused by changes to the frequently
modified QgsExpressionContextUtils class
2019-02-13 07:59:30 +10:00
Nyall Dawson
4908ef1641 Revert "Revert QgsBlockingNetworkRequest"
With recent changes in QgsNetworkAccessManager this should be
safe to resurrect (fingers crossed!). Also simplify code a lot,
because now QgsNetworkAccessManager handles waking the worker
thread after the auth request is handled.

Add a lot more tests
2019-02-01 21:44:53 +11:00
Denis Rouzaud
aef0b6586c
move QgsDefaultValue to moc headers (#9000)
* move QgsDefaultValue to moc headers

because it is a Q_GADGET

* sip include
2019-01-28 09:12:10 -05:00
Peter Petrik
27c670e78d expose mesh spatial index similarly to vector spatial index to API. fix travis issues and documentation 2019-01-24 16:24:46 +01:00