Class: QgsCptCityDataItem¶
Base class for all items in a QgsCptCityBrowserModel
model.
Class Hierarchy¶
Base classes¶
Subclasses¶
A logical collection of subcollections and color ramps for use in |
|
An item that represents a layer that can be opened with one of the providers for a |
Methods
Returns |
|
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsCptCityDataItem. See the FAQ for more details.
Returns |
|
Inserts a new child using alphabetical order based on mName, emits necessary signal to model before and after, sets parent and connects signals. |
|
Returns a vector of children items. |
|
Removes and deletes a child item, signals to browser are emitted. |
|
Returns |
|
Tries to process the data dropped on this item. |
|
Returns the total count of "leaf" items (all children which are end nodes). |
|
Populates children using children vector created by |
|
Removes a child item but doesn't delete it, signals to browser are emitted. |
Static Methods
Finds a child index in vector of items using '==' operator. |
Signals
Emitted before child items are added to this item. |
|
Emitted before child items are removed from this data item. |
|
Emitted after child items have been added to this data item. |
|
Emitted after child items have been removed from this data item. |
Attributes
- class qgis.core.QgsCptCityDataItem[source]¶
Bases:
QObject
- AllRamps = 4¶
- Collection = 1¶
- ColorRamp = 0¶
- Directory = 2¶
- Selection = 3¶
- class Type¶
Bases:
int
- virtual acceptDrop(self) bool [source]¶
Returns
True
if the item accepts drag & dropped layers - e.g. for import.Deprecated since version 3.40: Is unused and will be removed in QGIS 4.0.
- Return type:
bool
- virtual addChildItem(self, child: QgsCptCityDataItem | None, refresh: bool = False)[source]¶
Inserts a new
child
using alphabetical order based on mName, emits necessary signal to model before and after, sets parent and connects signals.The
refresh
argument will refresh the populated item by emitting signals to the model.- Parameters:
child (Optional[QgsCptCityDataItem])
refresh (bool = False)
- signal beginInsertItems(parent: QgsCptCityDataItem, first: int, last: int)[source]¶
Emitted before child items are added to this item.
This signal must be followed by
endInsertItems()
.- Parameters:
parent (QgsCptCityDataItem) – the parent item having children added
first (int) – index of first child item to be added
last (int) – index last child item, after the addition has occurred
See also
- signal beginRemoveItems(parent: QgsCptCityDataItem, first: int, last: int)[source]¶
Emitted before child items are removed from this data item.
This signal must be followed by
endRemoveItems()
.- Parameters:
parent (QgsCptCityDataItem) – the parent item having children removed
first (int) – index of first child item to be removed
last (int) – index of the last child item to be removed
See also
- virtual createChildren(self) List[QgsCptCityDataItem] ¶
Returns a vector of children items.
- Return type:
List[QgsCptCityDataItem]
- virtual deleteChildItem(self, child: QgsCptCityDataItem | None)[source]¶
Removes and deletes a child
item
, signals to browser are emitted.- Parameters:
child (Optional[QgsCptCityDataItem])
- signal endInsertItems[source]¶
Emitted after child items have been added to this data item.
This signal will always be preceded by
beginInsertItems()
.See also
- signal endRemoveItems[source]¶
Emitted after child items have been removed from this data item.
This signal will always be preceded by
beginRemoveItems()
.See also
- virtual equal(self, other: QgsCptCityDataItem | None) bool [source]¶
Returns
True
if this item is equal to another
item.- Parameters:
other (Optional[QgsCptCityDataItem])
- Return type:
bool
- static findItem(items: Iterable[QgsCptCityDataItem], item: QgsCptCityDataItem | None) int [source]¶
Finds a child index in vector of items using ‘==’ operator.
- Parameters:
items (Iterable[QgsCptCityDataItem])
item (Optional[QgsCptCityDataItem])
- Return type:
int
- virtual handleDrop(self, data: QMimeData | None, action: Qt.DropAction) bool [source]¶
Tries to process the
data
dropped on this item.Deprecated since version 3.40: Is unused and will be removed in QGIS 4.0.
- Parameters:
data (Optional[QMimeData])
action (Qt.DropAction)
- Return type:
bool
- virtual icon(self, size: QSize) QIcon [source]
- Parameters:
size (QSize)
- Return type:
QIcon
- virtual leafCount(self) int [source]¶
Returns the total count of “leaf” items (all children which are end nodes).
- Return type:
int
- virtual paramWidget(self) QWidget | None [source]¶
Deprecated since version 3.40.
Is unused and will be removed in QGIS 4.0.
- Return type:
Optional[QWidget]
- virtual populate(self)[source]¶
Populates children using children vector created by
createChildren()
.
- virtual removeChildItem(self, child: QgsCptCityDataItem | None) QgsCptCityDataItem | None [source]¶
Removes a
child
item but doesn’t delete it, signals to browser are emitted.- Return type:
Optional[QgsCptCityDataItem]
- Returns:
pointer to the removed item or
None
if no such item was found- Parameters:
child (Optional[QgsCptCityDataItem])
- type(self) QgsCptCityDataItem.Type [source]¶
- Return type: