170 Commits

Author SHA1 Message Date
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
Nyall Dawson
b5379ce055 New class QgsNetworkReplyContent, which encapsulates the useful
information from a QNetworkReply in a container which is safe
and cheap to pass between threads

(QNetworkReplys are QObject based, so not safe to access or
pass between threads)

Use this new class in a thread safe QgsNetworkAccessManager::finished
signal, which is fired on the main thread QgsNetworkAccessManager instance
when responses are finished from any thread
2019-01-24 06:10:37 +11:00
Peter Petrik
7423a74915 add option to export mesh dataset to raster block (for processing algs) 2019-01-21 11:01:12 +01:00
lbartoletti
edadcb773f Refactoring of rectangle maptools
Adds a new geometry class QgsQuadrilateral, for 4 sided geometries.
2019-01-15 10:24:16 +11:00
Nyall Dawson
9d800d4268 Sipify 2019-01-03 04:53:07 +10:00
Nyall Dawson
7ccaa3df32 [FEATURE][API] Add flexible framework for custom "validity checks"
Adds a new interface QgsAbstractValidityCheck which defines
a single "check" which can be performed on a given QgsValidityCheckContext.
A new application-wide QgsValidityCheckRegistry registers
and manages instances of all known checks, and allows running
of all registered checks of a specific type at once.

Initially the framework is focused toward print layout validity
checks, but the interface has been designed to be generic enough
to allow alternative types of validity checks (e.g. project save
validity checks, processing model validity checks, etc.).

The API is designed to be used both by internal validity checks
and also to be extended by custom, organisation-specific
validity checks. E.g., for print layout validity checks we could have:
2019-01-03 04:53:07 +10:00
Nyall Dawson
f301f944bd Revert QgsBlockingNetworkRequest
Too many issues... I'm unsure if this is even possible now...
2018-12-23 20:19:03 +10:00
Nyall Dawson
1774e68f39 [FEATURE][API] New class for blocking (non-async) network requests
This new class, QgsBlockingNetworkRequest, is designed for
performing SAFE blocking requests. It is thread safe and
has full support for QGIS proxy and authentication settings.

This class should be used whenever a blocking network
request is required. Unlike implementations
which rely on QApplication::processEvents() or creation of a
QEventLoop, this class is completely
thread safe and can be used on either the main thread or
background threads without issue.

Redirects are automatically handled by the class.

After completion of a request, the reply content should be
retrieved by calling getReplyContent().
This method returns a QgsNetworkReplyContent container,
which is safe and cheap to copy and pass
between threads without issue.

The guts of this class have been copied from QgsWfsRequest (which
has been using the same approach since 3.2)
2018-12-21 09:05:45 +10:00
Nyall Dawson
e4959a6b9a New class QgsNetworkReplyContent
Encapsulates a network reply within a container which
is inexpensive to copy and safe to pass around between threads.
The default Qt QNetworkReply class is a QObject, which prevents
it from being copied and passed between threads. This class
grabs all the useful information from a QNetworkReply,
allowing the reply's content to be stored indefinetly without
concern for the lifetime of the QNetworkReply object itself.
2018-12-21 09:05:45 +10:00
Nyall Dawson
84838d1ec6 [FEATURE][API] Add a content cache for raster images
This new class QgsImageCache is the equivalent of QgsSvgCache
but for raster images.

QgsImageCache stores pre-rendered resampled versions of raster
image files, allowing efficient reuse without incurring the
cost of resampling on every render.

Additionally, it offers the other benefits QgsSvgCache has,
such as thread safety, ability to transparently download remote
images, and support for base64 encoded strings.
2018-12-05 11:14:13 +07:00
Nyall Dawson
22496dc139 Create a new abtract base class for file content caches (e.g. QgsSvgCache)
Generalise QgsSvgCache and split off into a common base class so
that we can re-use code with alternative similar caches, e.g. a
raster image cache.
2018-12-05 11:14:13 +07:00
Denis Rouzaud
107e646219 rename QgsLocatorWidgetCore to QgsLocatorModelBridge 2018-11-06 13:59:37 -04:00
Denis Rouzaud
20d8db9e28 Revert "create a core interface for QgsMapCanvas"
This reverts commit 79c5b35a3925336e01e9ac1a6a75fd32eb3b8cdd.
2018-11-06 10:09:12 -04:00
Denis Rouzaud
078b445057 move part of the logic of QgsLocatorWidget to core 2018-11-06 10:08:33 -04:00
Denis Rouzaud
79c5b35a39 create a core interface for QgsMapCanvas 2018-11-06 10:06:22 -04:00
Nyall Dawson
5d9d903fb0 Move browser proxy model to core library and expose as stable API
This class is useful for plugins and other areas of QGIS code which
want to expose a limited browser interface (e.g. a vector layer
only type layer picker)

Also add unit tests
2018-10-19 08:32:56 +10:00
Matthias Kuhn
df44275e86
Update core sip files 2018-10-15 14:28:07 +02:00
Denis Rouzaud
9fa8c356dd
make QgsWkbTypes a Q_GADGET and declare GeometryType as Q_ENUM (#8024)
* make QgsWkbTypes a Q_GADGET and declare GeometryType as Q_ENUM

* include QObject

* remove extra include

* move QgsWkbTypes to moc headers

* run sip_include
2018-10-05 10:25:35 -08:00
Matthias Kuhn
1c359f8acd
Add a new QML category "Geometry Options"
And rename QgsGeometryFixes to QgsGeometryOptions
2018-09-19 13:51:00 +02:00
Denis Rouzaud
2cabd48db1 fix sip include 2018-09-14 16:35:30 +10:00
nirvn
7f9edcafa0 Addition of a QgsHstoreUtils parse function 2018-09-14 11:21:40 +07:00
Nyall Dawson
c5ab5891e0 Add a QAbstractItemModel for showing the entities within a QgsStyle object
- also adds QgsStyleProxyModel which handles filtering of entities
- lots of unit tests
- new signals in QgsStyle for when symbols/tags/etc change (with tests)
2018-09-12 16:22:44 +10:00
Matthias Kuhn
273e99877b
Merge pull request #7805 from m-kuhn/vectordataproviderfeaturepool
Refactor QgsFeaturePool
2018-09-10 07:53:55 +02:00
Nyall Dawson
13ab5e51ac Fix build warning 2018-09-08 18:10:31 +10:00
Matthias Kuhn
ba5cfc356d Add RAII class QgsReadWriteLocker 2018-09-06 07:46:23 +02:00
Denis Rouzaud
8fdcbdd36c
distinct files for QgsMapLayerStyle and QgsMapLayerStyleManager (#7806) 2018-09-05 22:28:38 +02:00
Matthias Kuhn
507649ddbd Readd qgsfeature.h to CMakeLists.txt 2018-09-04 16:19:26 +02:00
Matthias Kuhn
db45686804 Adjust core_auto.sip 2018-09-04 15:55:29 +02:00
Matthias Kuhn
74fb0fabc6 Move QgsFeatureId to own header 2018-09-03 07:54:37 +02:00
Matthias Kuhn
063ccf4283 Move geometry fixes to separate class 2018-08-23 18:38:09 +02:00
Nyall Dawson
21693bd4a4 Add a QgsTask subclass for proxying progress reports from a
blocking operation via task manager

Allows use of the task manager progress reporting system from
operations which are blocking (and cannot be made background
tasks!), e.g. layout exporting, project loading.
2018-08-16 06:22:16 +10:00
Matthias Kuhn
da527be9a1 Fix sip bindings 2018-08-14 19:04:56 +02:00
Nyall Dawson
dfa5104855 Sipify 2018-08-14 09:24:43 +10:00