47 Commits

Author SHA1 Message Date
Even Rouault
e55107f85c QgsDataItem::createChildren(): fix SIP generated C++ method
The SIP_FACTORY annotation didn't do the job for a Python implementation
of createChildren(). We must write a custom VirtualCatcherCode to make
sure that if the returned QgsDataItem elements are Python objects they
aren't killed too early.

Fixes the new added test, which uses to crash before the fix,
and corresponds to the use case of a plugin defining its own data items.

Has been checked not to cause memory leaks.

The change of SIP_FACTORY to SIP_TRANSFERBACK is to avoid a memory
leak when Python calls a C++ createChildren() implementation. Was found
by making test_provider_ogr.py::testDataItems() loop on its call to
createChildren()
2020-11-16 08:57:42 +10:00
Even Rouault
af9da65c23 Add QgsLayerItem::iconForWkbType() and QgsWkbTypes::translatedDisplayString()
and use them to avoid a lot of copy&paste in "New layer XXXX" dialogs and
providers.
2020-11-12 10:19:55 +10:00
Peter Petrik
13ecb8c452 add simple browser integration 2020-10-27 05:29:14 +10:00
Peter Petrik
9c27d4ae91 bunch of other file skeletons 2020-10-27 05:29:14 +10:00
Matthias Kuhn
42af1efa18 Fix a bunch of doc issues 2020-10-22 20:42:14 +02:00
Alessandro Pasotti
399bebaf44 Fields items: various fixes and enhancements
1. expose geometry fields for PG Fixes #37666
2. add a warning message when deleting a pk
3. add a warning message when deleting a geom col
2020-10-05 12:06:54 +02:00
Nyall Dawson
f496173bd7 Fix messy doxygen blocks which mess with sipify script
Fixes #38291
2020-08-20 17:01:35 +10:00
Alessandro Pasotti
4473b2cc77 New data item for browser connection roots
in order to distinguish it from schema and layer collections.
2020-07-16 12:22:20 +02:00
Alessandro Pasotti
d8a45f92a3 New table dialog menu provider 2020-07-14 15:25:20 +02:00
Alessandro Pasotti
0981644c22 SIP: add factory for layer() 2020-07-08 17:19:19 +02:00
Alessandro Pasotti
f2858b24f2 Connections API: drop/add column
Also: expose it in the browser.

Implemented for:

- PG
- GPKG
- Spatialite
- MSSQL
2020-07-08 17:19:19 +02:00
Alessandro Pasotti
9125690340 Expose columns to browser for PG, SL, GPKG and MSSQL
First part of QEP https://github.com/qgis/QGIS-Enhancement-Proposals/issues/171
2020-07-08 17:19:19 +02:00
Alessandro Pasotti
f00d2099ba Expose DB fields to the browser 2020-07-08 17:19:19 +02:00
Nyall Dawson
8d4f00b0af Remove TODO comments included in public API documentation
This is just "airing our dirty laundry". We don't want/need end users
to see this.
2020-06-15 13:43:58 +10:00
Nyall Dawson
81a9db9f57 [sipify] Fix creation of cross references 2020-06-15 13:43:58 +10:00
Nyall Dawson
c795ddb1e9 Updates 2020-06-11 13:29:59 +10:00
Nyall Dawson
adf0fe32d9 Dox 2020-06-09 19:49:15 +10:00
Nyall Dawson
a9d6b04f77 [browser] Refine refreshConnections method to avoid triggering a full
refresh of ALL browser content

Instead limit refresh to the provider associated with the item only
(and provide a means for items to refresh a different provider, e.g.
to allow the geopackage connection item to be refreshed when a
new connection is added through a directory item)

Fixes #37007
2020-06-09 19:49:15 +10:00
Martin Dobias
5ec1890643 Moved to proper QgsMapLayer subclass + icon + optional tile borders 2020-03-27 12:08:40 +01:00
Alessandro Pasotti
867d0f6fdd Data items: add data provider origin key
Adds the data provider key of the data provider
that created the item.

Also keeps a map between data *item* provider name
(AKA data item provider "key") and the data provider
name (AKA data provider "key").
2020-03-10 14:50:23 +01:00
Nyall Dawson
37a4c10a4d Fix broken browser directory paths
And improve documentation

Fixes #34169
2020-02-13 14:22:12 +10:00
Peter Petrik
ecd90c6ecb
[FEATURE] Allow customization of the items shown in browser (#33679)
* [FEATURE] Allow customization of the items show is browser. User can select in Interface Customization dialog to hide some of the items in the browser panel

Funded by Limerick City and County Council
2020-01-15 10:08:58 +01:00
Denis Rouzaud
758d7cff4a run sipify to update deprecation annotations 2019-10-15 13:17:38 +02:00
Peter Petrik
635c1b54d8 Allow to use WMS as static provider 2019-09-04 07:49:09 +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
Denis Rouzaud
375a0aa253 create scope based enum for QgsMapLayer::LayerType >> QgsMapLayerType
the enum is moved out of the class
this will allow forward declaration more easily since the enum is not nested in the class
2019-03-24 21:40:33 -05: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
Nyall Dawson
ceaf97b204 Remove a totally unused enum 2019-02-09 07:27:39 +10:00
Nyall Dawson
48e05434e4 Dox++ 2019-02-09 07:27:39 +10:00
Nyall Dawson
35ddb3b630 [browser] Provide mime data for directory items
Allows them to be dragged and dropped to file widgets
2019-02-09 07:27:39 +10:00
Nyall Dawson
d61694cb42 Deprecate QgsDataItem API for setting item CRS
This is no longer used by QGIS (it was only ever used by the standalone
browser)
2019-02-07 04:14:16 +11:00
signedav
1136aabf5b delete layer action only on items that have capability "delete"
check if the item with the menu has this capability and only handle the selected items with this capabiltiy
2018-11-21 10:46:39 +01:00
signedav
a1ea0ac540 action deleteLayer in the dataitemproviders
implemented for derived functions in:
- `QgsGeoPackageAbstractLayerItem`
- `QgsSLLayerItem`
- `QgsPGLayerItem`
- `QgsMssqlLayerItem`
2018-11-20 10:49:50 +01:00
signedav
fa062461b6 pass items to delete layer activity 2018-11-15 09:10:00 +01:00
Nyall Dawson
48e7e204c0 Move some browser directory action handling from core/gui to app 2018-11-04 21:07:27 +10:00
Nyall Dawson
5c5f2ed7e3 Add method to get QgsLayerItem::LayerType from a map layer 2018-11-01 20:41:08 +10:00
Nyall Dawson
b2df588a38 Fix see also link 2018-10-11 17:52:47 +10:00
Nyall Dawson
5beb4e2b8d Followup 9cad526, allow item rename through browser model 2018-10-11 17:52:47 +10: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
nirvn
3235fb5422 [ui] resurrect home folder 2018-10-03 14:03:40 +07:00
Nyall Dawson
d50ccff69e [browser] Fix tiny folder icons on hidpi screens
QStyle::standardPixmap is deprecated and not hi-dpi friendly.
Unfortunately, there's no equivalent of QIcon::addPixmap
for QIcons themselves -- so it's **impossible** in current Qt
API to handle the ON/OFF icon states.

Believe me... there's NOOOOOOO way. I've looked. I've tried.
It's not possible.

This means we have to change the logic for showing open/closed
folders in browser. This commit revises the logic to show the
open icon for any *populated* folders, regardless of whether
they are opened or not.
2018-10-01 09:15:47 +10:00
Nyall Dawson
f8bc97030b Remove extra space added before first line of docstring 2018-05-28 08:22:11 +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
Denis Rouzaud
7df2593caf move auto generated sip file in dedicated folder 2018-05-14 10:23:37 -04:00