Class: QgsCptCityDataItem¶
Base class for all items in the model
Class Hierarchy¶
Base classes¶
Subclasses¶
A Collection: logical collection of subcollections and color ramps |
|
Item that represents a layer that can be opened with one of the |
Methods
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 |
|
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
- 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
- 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
- createChildren(self) List[QgsCptCityDataItem] ¶
Returns a vector of children items.
- Return type:
List[QgsCptCityDataItem]
- 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
- 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
- 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
- icon(self, size: QSize) QIcon [source]
- Parameters:
size (QSize)
- Return type:
QIcon
- leafCount(self) int [source]¶
Returns the total count of “leaf” items (all children which are end nodes).
- Return type:
int
- paramWidget(self) QWidget | None [source]¶
Deprecated since version 3.40.
Is unused and will be removed in QGIS 4.0.
- Return type:
Optional[QWidget]
- populate(self)[source]¶
Populates children using children vector created by
createChildren()
.
- 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: