159 Commits

Author SHA1 Message Date
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
signedav
090db0d86b setProjectTranslator
...in QgsReadWriteContext creation
implementation of projectTranslator where needed

use of DefaultTranslator to have default translation funtion derived from QgsProjectTranslator

beautify code
2018-08-07 14:31:17 +02:00
signedav
2bfe2296e5 tests, project store and other
not yet working all translations
project handling can be improved
project store after translation working
and fix some errors
tests not ready yet
2018-08-07 14:31:17 +02:00
Nyall Dawson
66c17880be Modify kdbush to store feature id alonside point, for optimised storage/retrieval 2018-07-07 10:54:47 +10:00
Nyall Dawson
0df1056dd4 [FEATURE] QgsSpatialIndexKDBush
A very fast static spatial index for 2D points based on a flat KD-tree,
using https://github.com/mourner/kdbush.hpp

Compared to QgsSpatialIndex, this index:
 - supports single point features only (no multipoints)
 - is static (features cannot be added or removed from the index after construction)
 - is much faster!
 - supports true "distance based" searches, i.e. return all points within a radius
from a search point
2018-07-07 10:54:47 +10:00
Peter Petrik
69fa26183f fix travis errors 2018-05-30 12:26:36 +02:00
Peter Petrik
7af2e68e23 misc optimization for geometries and fixes 2018-05-30 10:06:23 +02:00
Martin Dobias
94f56b61a8 Build/test fixes 2018-05-16 17:26:59 -04:00
Peter Petrik
3fc99c04c1 code cleanup 2018-05-16 17:02:35 +02:00
Peter Petrik
aea3dccea7 [FEATURE] Rendering of vector data on mesh layers
Rudimentary support of rendering of vector data (e.g. velocity) on mesh map layers.
Rendering can be adjusted by QgsMeshRenderer*Settings. Only in Python
API, no GUI widgets for styling present.
2018-05-16 12:56:35 +02:00
Denis Rouzaud
847f0e1829 adapt sipify scripts and test to place auto generated sip files in dedicated folder 2018-05-14 10:44:11 -04:00
Denis Rouzaud
648562d2b7 do not expose task and make it thread safe 2018-05-07 08:20:59 -04:00