17 #ifndef QGSCPTCITYARCHIVE_H 18 #define QGSCPTCITYARCHIVE_H 22 #include <QAbstractItemModel> 31 #define DEFAULT_CPTCITY_ARCHIVE "cpt-city-qgis-min" 47 static QString defaultBaseDir();
62 static void initArchives(
bool loadAll =
false );
63 static void initArchive(
const QString& archiveName,
const QString& archiveBaseDir );
64 static void initDefaultArchive();
65 static void clearArchives();
115 virtual int leafCount()
const;
119 virtual void refresh();
125 virtual void populate();
193 void emitEndInsertItems();
195 void emitEndRemoveItems();
199 void endInsertItems();
201 void endRemoveItems();
214 bool initialize =
false );
218 bool initialize =
false );
356 virtual QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
392 void refresh(
const QString& path );
413 void endInsertItems();
415 void endRemoveItems();
421 void removeRootItems();
QStringList selectionsList() const
virtual int rowCount(const QModelIndex &parent) const=0
QgsCptCityDataItem * mParent
QVector< QgsCptCityDataItem * > mItems
An "All ramps item", which contains all items in a flat hierarchy.
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const=0
static QgsCptCityArchive * defaultArchive()
QVector< QgsCptCityDataItem * > children() const
static QMap< QString, QgsCptCityArchive *> mArchiveRegistry
virtual bool canFetchMore(const QModelIndex &parent) const
const QgsCptCityColorRampV2 & ramp() const
virtual QList< QAction * > actions()
Item that represents a layer that can be opened with one of the providers.
QMap< QString, QStringList > mRampsMap
virtual QVector< QgsCptCityDataItem * > createChildren()
QgsCptCityArchive * mArchive
QVector< QgsCptCityDataItem *> selectionItems() const
void setIcon(const QIcon &icon)
virtual bool handleDrop(const QMimeData *, Qt::DropAction)
virtual bool equal(const QgsCptCityDataItem *other)
virtual bool acceptDrop()
A directory: contains subdirectories and color ramps.
void setToolTip(const QString &msg)
Base class for all items in the model.
QVector< QgsCptCityDataItem * > mSelectionItems
~QgsCptCityColorRampItem()
QgsCptCityColorRampV2 mRamp
virtual QVariant data(const QModelIndex &index, int role) const=0
A Collection: logical collection of subcollections and color ramps.
QVector< QgsCptCityDataItem * > mChildren
QString shortInfo() const
QString archiveName() const
#define DEFAULT_CPTCITY_ARCHIVE
QStringList mSelectionsList
static QMap< QString, QMap< QString, QString > > mCopyingInfoMap
void addChild(QgsCptCityDataItem *item)
void setParent(QgsCptCityDataItem *parent)
static QString mDefaultArchiveName
virtual bool hasChildren(const QModelIndex &parent) const
virtual int columnCount(const QModelIndex &parent) const=0
QVector< QgsCptCityDataItem * > mRootItems
virtual void fetchMore(const QModelIndex &parent)
virtual QWidget * paramWidget()
virtual QIcon icon(QSize size)
virtual Qt::ItemFlags flags(const QModelIndex &index) const
virtual int leafCount() const override
void setBaseDir(const QString &dirName)
QVector< QgsCptCityDataItem *> rootItems() const
A selection: contains subdirectories and color ramps.
QgsCptCityDataItem * parent() const
QVector< QgsCptCityDataItem *> mRootItems