45 Commits

Author SHA1 Message Date
NEDJIMAbelgacem
ede1c6394e UI initial implementation for remote ept files 2021-04-08 14:26:31 -07:00
Denis Rouzaud
ba8a445850 run sipify 2021-03-22 21:13:52 +01:00
Nyall Dawson
4c50469bd0 Spelling 2021-03-01 10:35:43 +10:00
Nyall Dawson
4240e20248 Add API to QgsProviderRegistry to obtain user friendly warning messages
for when a URI cannot be opened in a QGIS install, but the URI
matches a format which could potentially be opened in a different QGIS
install.

This can be used to show user-friendly warning messages advising user why
a particular uri cannot be opened on their QGIS install. For example, if
a QGIS install is built without the PDAL library then las/laz files are
unusable, and this method can be used to retrieve a user-friendly warning
as to why the las/laz files cannot be used on their QGIS build.

Instead of just showing the user a generic "not a valid or recognized data
source" error, we can use this api to show more helpful URIs about the
specific uri.

Initially intended to help advise users why LAS/LAZ files cannot be
opened on their QGIS install, but also could be used e.g. by mdal
to advise users about missing third party libraries preventing
them from opening certain mesh files, etc....
2021-03-01 10:09:06 +10:00
Nyall Dawson
4984de792d Use TRANSFER_BACK annotation instead of FACTORY for QgsProviderRegistry::createProvider
Paraphrasing Phil Thomson's advice on https://www.riverbankcomputing.com/pipermail/pyqt/2017-July/039450.html:

"
/Factory/ is used when the instance returned is guaranteed to be new to Python.
In this case it isn't because it has already been seen when being returned by by the python function
creating the provider subclass.

(However for a different sub-class implemented in C++ then it would be the first time it was seen
by Python so the /Factory/ on create() would be correct.)

You might try using /TransferBack/ on createProvider() instead - that might be the best compromise.
2021-02-08 13:23:37 +10:00
Nyall Dawson
50b9beaad6 [sipify] Catch more class references and insert :py:class: annotations 2021-01-31 05:41:22 +10:00
Nyall Dawson
9c55b8bd6f Add Python repr for QgsProviderRegistry::ProviderCandidateDetails 2020-11-07 07:57:00 +10:00
Nyall Dawson
51762dd0ef Add API to QgsProviderMetadata to determine valid layer types
which the provider can use to open a specified URI
2020-11-07 03:22:22 +10:00
Nyall Dawson
787230e460 Spelling 2020-11-05 20:16:48 +10:00
Nyall Dawson
04dc5f5e56 Add API for providers to test whether a particular URI should be
blocklisted and hidden from the QGIS interface, e.g. it is an internal
detail only (or sidecar file) and shouldn't be shown in things like the
browser panel

And adds blocklists for .aux.xml, .shp.xml and .tif.xml files for
the ogr/gdal providers
2020-11-05 20:16:48 +10:00
Nyall Dawson
8abe4a1ec6 Refine API for QgsProviderRegistry tests for preferred provider
for a URI to better handle ties, add direct method to determine
whether a particular provider should defer handling of a certain
URI to another (better equipped) provider
2020-11-05 20:16:48 +10:00
Nyall Dawson
0ebe788877 Add API for providers to indicate their priority in opening a specified
URI

And add new method to QgsProviderRegistry to select the preferred
provider for opening a URI based on this
2020-11-04 18:49:11 +10:00
Nyall Dawson
7771417a2d Improve docs 2020-11-04 18:49:11 +10:00
Nyall Dawson
e59bab7f2e Add QgsProviderRegistry::filePointCloudFilters() for retrieving filter string of all supported point cloud types 2020-11-04 18:49:11 +10:00
Nyall Dawson
6885a1604c Methods in QgsProviderRegistry should not be virtual -- this class
is not designed to be subclassed
2020-11-04 18:49:11 +10:00
Nyall Dawson
d3adc10ec3 Move some todos so they don't sit between member doxygen and declaration
Sipify doesn't handle this, and drops off the docstring from the python method
2020-10-21 09:32:15 +10:00
rldhont
45e9ecb1c2 Trust layer metadata propagation
The trust flag at the projetc level is only used to read vector layer extent from xml, not from provider.

This flag was not available at the vector layer and data provider level.

We propose a new QgsMapLayer reading flag to propagate the trust layer metadata prohect's read flag an d a new provider options to trust datasource config.
Trusting the datasource config means that the provider can use estimated metadata, the primary key is unique and the detectable geometry type and srid are the same as the requested.
2020-09-09 09:35:32 +02:00
Harrissou Sant-anna
50c4efb6ca Fix corresponding dox and update debug message 2020-03-17 10:21:30 +10:00
Harrissou Sant-anna
21f39d127e Fix deprecated method redirection 2020-03-17 10:21:30 +10:00
Sandro Mani
20ea2ae4ae Add QgsProviderMetadata::encodeUri 2020-01-22 13:16:20 +01:00
Denis Rouzaud
758d7cff4a run sipify to update deprecation annotations 2019-10-15 13:17:38 +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
Martin Dobias
d155b1c877 Further updates from review 2019-06-25 15:38:07 +02:00
Martin Dobias
7659dd8b8b Misc fixes for provider registry/metadata deprecated functions 2019-06-20 12:32:44 +02:00
Martin Dobias
6918bac9df Revert API break and move WidgetMode back to QgsProviderRegistry 2019-06-20 10:49:36 +02:00
Martin Dobias
f6049e01d0 Misc fixes to get the branch compiling & running with Python
- grass data item provider fixes
- removed QgsProviderMetadata constructor (with std::function / PyObject) due to sip errors (api break)
- reverted DataCapability move to Qgis - back to QgsDataProvider (avoiding api breaks)
- WidgetMode enum documentation
- sipify monkey patching fix
- renamed WidgetMode's "None" to "Normal" value - in python None has special meaning (api break)
2019-06-19 23:02:11 +02: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
107b48a430 Add NULLPTR macro for use in doxygen comments
For the c++ api dox this expands to "\c nullptr" (the
\c directive indicates a code literal value), and for sipify/Python
it expands to ``None`` (`` is sphinx annotation for literal values)

Makes for nicer dox for both c++ and Python!
2019-02-27 09:41:11 +10:00
Nyall Dawson
a7ca08784c Nullptr consistency in dox 2019-02-27 09:41:11 +10:00
Nyall Dawson
b6d66becab Sipify 2019-02-27 09:41:11 +10:00
Peter Petrik
e4d490531c add support for browser dialog for mesh layer extensions too 2018-12-17 12:01:17 +01:00
Peter Petrik
64b81bd976 use file filters from MDAL 2018-12-17 12:01:17 +01:00
Nyall Dawson
4b32e7cc78 [afs] Implemented decodeUri for AFS provider
Allows retrieval of the web URL for an AFS layer
2018-11-07 15:30:17 +10:00
nirvn
f4a0e743fa Implement a QgsProviderRegistry decodeUri function + test 2018-08-16 16:46:01 +07:00
Alessandro Pasotti
6ece1aa543 registerProvider now returns a bool 2018-06-04 14:26:22 +02:00
Alessandro Pasotti
3aa630ca25 Added QgsDataProvider::ProviderOptions to the bindings 2018-06-01 14:18:44 +02:00
Alessandro Pasotti
6f3be9fa3d SIP updates 2018-06-01 10:55:17 +02:00
Alessandro Pasotti
9d66eb8db4 API to register new vector data providers 2018-06-01 10:53:46 +02:00
Nyall Dawson
9f650fead9 Fix incorrect param docstring when doxygen \param has extra
trailing spaces or uses tabs
2018-05-27 18:54:09 +10:00
Nyall Dawson
4b1b752633 Fix bad regex 2018-05-27 18:54:09 +10:00
Nyall Dawson
c864d22d1f Add "get ..." to doxygen compliance blacklist
Should be "gets ..." for consistent tense, or better yet
"returns ..." for consistency.
2018-05-27 14:05:06 +10:00
Nyall Dawson
1c615c15cc More documentation compliance
Use Qt style "returns .." tense instead of "return ..", and lock
this in with a documentation compliance unit test
2018-05-25 15:09:00 +10:00
Nyall Dawson
b813a6715e Fix API breaks 2018-05-25 11:40:57 +10:00
Nyall Dawson
44630b47ed Add QgsDataProvider::ProviderOptions struct to constructors
for data providers

Allows a way to pass generic settings to providers, e.g.
passing a datum transform context for use in provider's
constructors.
2018-05-25 11:40:57 +10:00
Denis Rouzaud
7df2593caf move auto generated sip file in dedicated folder 2018-05-14 10:23:37 -04:00