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 |
- 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
Trueif 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
childusing alphabetical order based on mName, emits necessary signal to model before and after, sets parent and connects signals.The
refreshargument will refresh the populated item by emitting signals to the model.- Parameters:
child (Optional[QgsCptCityDataItem])
refresh (bool = False)
- 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.
- createChildren(self) List[QgsCptCityDataItem]¶
Returns a vector of children items.
- Return type:
- 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.
- equal(self, other: QgsCptCityDataItem | None) bool[source]¶
Returns
Trueif this item is equal to anotheritem.- 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
datadropped 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
- 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
childitem but doesn’t delete it, signals to browser are emitted.- Return type:
Optional[QgsCptCityDataItem]
- Returns:
pointer to the removed item or
Noneif no such item was found- Parameters:
child (Optional[QgsCptCityDataItem])
- type(self) QgsCptCityDataItem.Type[source]¶
- Return type: