Class: QgsCptCityDataItem

Base class for all items in a QgsCptCityBrowserModel model.

Class Hierarchy

Inheritance diagram of qgis.core.QgsCptCityDataItem

Base classes

QObject

Subclasses

QgsCptCityCollectionItem

A logical collection of subcollections and color ramps for use in QgsCptCityBrowserModel.

QgsCptCityColorRampItem

An item that represents a layer that can be opened with one of the providers for a QgsCptCityBrowserModel.

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:
signal beginInsertItems[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal beginRemoveItems[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

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]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal endRemoveItems[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

virtual equal(self, other: QgsCptCityDataItem | None) bool[source]

Returns True if this item is equal to an other 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:
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

hasChildren(self) bool[source]
Return type:

bool

virtual icon(self) QIcon[source]
virtual icon(self, size: QSize) QIcon
Return type:

QIcon

info(self) str[source]
Return type:

str

isPopulated(self) bool[source]

Returns True if the item is already populated.

Return type:

bool

isValid(self) bool[source]
Return type:

bool

virtual leafCount(self) int[source]

Returns the total count of “leaf” items (all children which are end nodes).

Return type:

int

name(self) str[source]
Return type:

str

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]

path(self) str[source]
Return type:

str

virtual populate(self)[source]

Populates children using children vector created by createChildren().

virtual refresh(self)[source]
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])

rowCount(self) int[source]
Return type:

int

setIcon(self, icon: QIcon)[source]
Parameters:

icon (QIcon)

setToolTip(self, msg: str | None)[source]
Parameters:

msg (Optional[str])

shortInfo(self) str[source]
Return type:

str

toolTip(self) str[source]
Return type:

str

type(self) QgsCptCityDataItem.Type[source]
Return type:

QgsCptCityDataItem.Type