QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
|
Base class for all items in the model. More...
#include <qgscptcityarchive.h>
Public Types | |
enum | Type { ColorRamp , Collection , Directory , Selection , AllRamps } |
Signals | |
void | beginInsertItems (QgsCptCityDataItem *parent, int first, int last) |
Emitted before child items are added to this item. | |
void | beginRemoveItems (QgsCptCityDataItem *parent, int first, int last) |
Emitted before child items are removed from this data item. | |
void | endInsertItems () |
Emitted after child items have been added to this data item. | |
void | endRemoveItems () |
Emitted after child items have been removed from this data item. | |
Public Member Functions | |
QgsCptCityDataItem (QgsCptCityDataItem::Type type, QgsCptCityDataItem *parent, const QString &name, const QString &path) | |
virtual Q_DECL_DEPRECATED bool | acceptDrop () |
Returns true if the item accepts drag & dropped layers - e.g. | |
virtual void | addChildItem (QgsCptCityDataItem *child, bool refresh=false) |
Inserts a new child using alphabetical order based on mName, emits necessary signal to model before and after, sets parent and connects signals. | |
QVector< QgsCptCityDataItem * > | children () const |
virtual QVector< QgsCptCityDataItem * > | createChildren () |
Returns a vector of children items. | |
virtual void | deleteChildItem (QgsCptCityDataItem *child) |
Removes and deletes a child item, signals to browser are emitted. | |
virtual bool | equal (const QgsCptCityDataItem *other) |
Returns true if this item is equal to an other item. | |
virtual Q_DECL_DEPRECATED bool | handleDrop (const QMimeData *data, Qt::DropAction action) |
Tries to process the data dropped on this item. | |
bool | hasChildren () |
virtual QIcon | icon () |
virtual QIcon | icon (QSize size) |
QString | info () const |
bool | isPopulated () |
Returns true if the item is already populated. | |
bool | isValid () |
virtual int | leafCount () const |
Returns the total count of "leaf" items (all children which are end nodes). | |
QString | name () const |
virtual Q_DECL_DEPRECATED QWidget * | paramWidget () |
QgsCptCityDataItem * | parent () const |
QString | path () const |
virtual void | populate () |
Populates children using children vector created by createChildren(). | |
virtual void | refresh () |
virtual QgsCptCityDataItem * | removeChildItem (QgsCptCityDataItem *child) |
Removes a child item but doesn't delete it, signals to browser are emitted. | |
int | rowCount () |
void | setIcon (const QIcon &icon) |
void | setParent (QgsCptCityDataItem *parent) |
void | setToolTip (const QString &msg) |
QString | shortInfo () const |
QString | toolTip () const |
Type | type () const |
Static Public Member Functions | |
static int | findItem (QVector< QgsCptCityDataItem * > items, QgsCptCityDataItem *item) |
Finds a child index in vector of items using '==' operator. | |
Protected Attributes | |
QVector< QgsCptCityDataItem * > | mChildren |
QIcon | mIcon |
QString | mInfo |
QString | mName |
QgsCptCityDataItem * | mParent = nullptr |
QString | mPath |
bool | mPopulated |
QString | mShortInfo |
QString | mToolTip |
Type | mType |
bool | mValid |
Base class for all items in the model.
Definition at line 99 of file qgscptcityarchive.h.
Enumerator | |
---|---|
ColorRamp | |
Collection | |
Directory | |
Selection | |
AllRamps |
Definition at line 103 of file qgscptcityarchive.h.
QgsCptCityDataItem::QgsCptCityDataItem | ( | QgsCptCityDataItem::Type | type, |
QgsCptCityDataItem * | parent, | ||
const QString & | name, | ||
const QString & | path | ||
) |
Definition at line 514 of file qgscptcityarchive.cpp.
|
inlinevirtual |
Returns true
if the item accepts drag & dropped layers - e.g.
for import.
Definition at line 177 of file qgscptcityarchive.h.
|
virtual |
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.
Definition at line 581 of file qgscptcityarchive.cpp.
|
signal |
Emitted before child items are added to this item.
This signal must be followed by endInsertItems().
parent | the parent item having children added |
first | index of first child item to be added |
last | index last child item, after the addition has occurred |
|
signal |
Emitted before child items are removed from this data item.
This signal must be followed by endRemoveItems().
parent | the parent item having children removed |
first | index of first child item to be removed |
last | index of the last child item to be removed |
|
inline |
Definition at line 198 of file qgscptcityarchive.h.
|
virtual |
Returns a vector of children items.
Reimplemented in QgsCptCityDirectoryItem, QgsCptCitySelectionItem, and QgsCptCityAllRampsItem.
Definition at line 526 of file qgscptcityarchive.cpp.
|
virtual |
Removes and deletes a child item, signals to browser are emitted.
Definition at line 618 of file qgscptcityarchive.cpp.
|
signal |
Emitted after child items have been added to this data item.
This signal will always be preceded by beginInsertItems().
|
signal |
Emitted after child items have been removed from this data item.
This signal will always be preceded by beginRemoveItems().
|
virtual |
Returns true
if this item is equal to an other item.
Reimplemented in QgsCptCityColorRampItem, QgsCptCityDirectoryItem, and QgsCptCitySelectionItem.
Definition at line 695 of file qgscptcityarchive.cpp.
|
static |
Finds a child index in vector of items using '==' operator.
Definition at line 645 of file qgscptcityarchive.cpp.
|
inlinevirtual |
Tries to process the data dropped on this item.
Definition at line 184 of file qgscptcityarchive.h.
bool QgsCptCityDataItem::hasChildren | ( | ) |
Definition at line 576 of file qgscptcityarchive.cpp.
|
inlinevirtual |
Reimplemented in QgsCptCityColorRampItem.
Definition at line 199 of file qgscptcityarchive.h.
|
inlinevirtual |
Reimplemented in QgsCptCityColorRampItem.
Definition at line 200 of file qgscptcityarchive.h.
|
inline |
Definition at line 203 of file qgscptcityarchive.h.
|
inline |
Returns true
if the item is already populated.
Definition at line 141 of file qgscptcityarchive.h.
|
inline |
Definition at line 211 of file qgscptcityarchive.h.
|
virtual |
Returns the total count of "leaf" items (all children which are end nodes).
Reimplemented in QgsCptCityColorRampItem.
Definition at line 560 of file qgscptcityarchive.cpp.
|
inline |
Definition at line 201 of file qgscptcityarchive.h.
|
inlinevirtual |
Definition at line 170 of file qgscptcityarchive.h.
|
inline |
Definition at line 196 of file qgscptcityarchive.h.
|
inline |
Definition at line 202 of file qgscptcityarchive.h.
|
virtual |
Populates children using children vector created by createChildren().
Definition at line 532 of file qgscptcityarchive.cpp.
|
virtual |
Definition at line 656 of file qgscptcityarchive.cpp.
|
virtual |
Removes a child item but doesn't delete it, signals to browser are emitted.
nullptr
if no such item was found Definition at line 629 of file qgscptcityarchive.cpp.
int QgsCptCityDataItem::rowCount | ( | ) |
Definition at line 553 of file qgscptcityarchive.cpp.
|
inline |
Definition at line 206 of file qgscptcityarchive.h.
|
inline |
Definition at line 197 of file qgscptcityarchive.h.
|
inline |
Definition at line 208 of file qgscptcityarchive.h.
|
inline |
Definition at line 204 of file qgscptcityarchive.h.
|
inline |
Definition at line 209 of file qgscptcityarchive.h.
|
inline |
Definition at line 195 of file qgscptcityarchive.h.
|
protected |
Definition at line 217 of file qgscptcityarchive.h.
|
protected |
Definition at line 224 of file qgscptcityarchive.h.
|
protected |
Definition at line 221 of file qgscptcityarchive.h.
|
protected |
Definition at line 219 of file qgscptcityarchive.h.
|
protected |
Definition at line 216 of file qgscptcityarchive.h.
|
protected |
Definition at line 220 of file qgscptcityarchive.h.
|
protected |
Definition at line 218 of file qgscptcityarchive.h.
|
protected |
Definition at line 222 of file qgscptcityarchive.h.
|
protected |
Definition at line 223 of file qgscptcityarchive.h.
|
protected |
Definition at line 215 of file qgscptcityarchive.h.
|
protected |
Definition at line 225 of file qgscptcityarchive.h.