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()
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
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").
* [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
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!
* make QgsWkbTypes a Q_GADGET and declare GeometryType as Q_ENUM
* include QObject
* remove extra include
* move QgsWkbTypes to moc headers
* run sip_include
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.