QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Types | Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsCptCityBrowserModel Class Reference

#include <qgscptcityarchive.h>

Inheritance diagram for QgsCptCityBrowserModel:
Inheritance graph
[legend]

Public Types

enum  ViewType { Authors = 0, Selections = 1, List = 2 }
 

Public Slots

void beginInsertItems (QgsCptCityDataItem *parent, int first, int last)
 
void beginRemoveItems (QgsCptCityDataItem *parent, int first, int last)
 
void endInsertItems ()
 
void endRemoveItems ()
 

Public Member Functions

 QgsCptCityBrowserModel (QObject *parent=nullptr, QgsCptCityArchive *archive=QgsCptCityArchive::defaultArchive(), ViewType Type=Authors)
 
 ~QgsCptCityBrowserModel ()
 
bool canFetchMore (const QModelIndex &parent) const override
 
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const override
 Provides the number of columns of data exposed by the model. More...
 
void connectItem (QgsCptCityDataItem *item)
 
virtual QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 Used to supply item data to views and delegates. More...
 
QgsCptCityDataItemdataItem (const QModelIndex &idx) const
 Returns a list of mime that can describe model indexes. More...
 
void fetchMore (const QModelIndex &parent) override
 
QModelIndex findItem (QgsCptCityDataItem *item, QgsCptCityDataItem *parent=nullptr) const
 
QModelIndex findPath (const QString &path)
 return index of a path More...
 
virtual Qt::ItemFlags flags (const QModelIndex &index) const override
 Used by other components to obtain information about each item provided by the model. More...
 
bool hasChildren (const QModelIndex &parent=QModelIndex()) const override
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 Provides views with information to show in their headers. More...
 
virtual QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 Returns the index of the item in the model specified by the given row, column and parent index. More...
 
virtual QModelIndex parent (const QModelIndex &index) const override
 Returns the parent of the model item with the given index. More...
 
void refresh (const QString &path)
 
void refresh (const QModelIndex &index=QModelIndex())
 
void reload ()
 
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const override
 Provides the number of rows of data exposed by the model. More...
 
- Public Member Functions inherited from QAbstractItemModel
 QAbstractItemModel (QObject *parent)
 
virtual ~QAbstractItemModel ()
 
virtual QModelIndex buddy (const QModelIndex &index) const
 
virtual int columnCount (const QModelIndex &parent) const=0
 
void columnsAboutToBeInserted (const QModelIndex &parent, int start, int end)
 
void columnsAboutToBeMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
 
void columnsAboutToBeRemoved (const QModelIndex &parent, int start, int end)
 
void columnsInserted (const QModelIndex &parent, int start, int end)
 
void columnsMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
 
void columnsRemoved (const QModelIndex &parent, int start, int end)
 
virtual QVariant data (const QModelIndex &index, int role) const=0
 
void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 
virtual bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
 
bool hasIndex (int row, int column, const QModelIndex &parent) const
 
void headerDataChanged (Qt::Orientation orientation, int first, int last)
 
virtual QModelIndex index (int row, int column, const QModelIndex &parent) const=0
 
bool insertColumn (int column, const QModelIndex &parent)
 
virtual bool insertColumns (int column, int count, const QModelIndex &parent)
 
bool insertRow (int row, const QModelIndex &parent)
 
virtual bool insertRows (int row, int count, const QModelIndex &parent)
 
virtual QMap< int, QVariantitemData (const QModelIndex &index) const
 
void layoutAboutToBeChanged ()
 
void layoutChanged ()
 
virtual QModelIndexList match (const QModelIndex &start, int role, const QVariant &value, int hits, QFlags< Qt::MatchFlag > flags) const
 
virtual QMimeDatamimeData (const QModelIndexList &indexes) const
 
virtual QStringList mimeTypes () const
 
void modelAboutToBeReset ()
 
void modelReset ()
 
virtual QModelIndex parent (const QModelIndex &index) const=0
 
bool removeColumn (int column, const QModelIndex &parent)
 
virtual bool removeColumns (int column, int count, const QModelIndex &parent)
 
bool removeRow (int row, const QModelIndex &parent)
 
virtual bool removeRows (int row, int count, const QModelIndex &parent)
 
virtual void revert ()
 
const QHash< int, QByteArray > & roleNames () const
 
virtual int rowCount (const QModelIndex &parent) const=0
 
void rowsAboutToBeInserted (const QModelIndex &parent, int start, int end)
 
void rowsAboutToBeMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
 
void rowsAboutToBeRemoved (const QModelIndex &parent, int start, int end)
 
void rowsInserted (const QModelIndex &parent, int start, int end)
 
void rowsMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
 
void rowsRemoved (const QModelIndex &parent, int start, int end)
 
virtual bool setData (const QModelIndex &index, const QVariant &value, int role)
 
virtual bool setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role)
 
virtual bool setItemData (const QModelIndex &index, const QMap< int, QVariant > &roles)
 
void setSupportedDragActions (QFlags< Qt::DropAction > actions)
 
QModelIndex sibling (int row, int column, const QModelIndex &index) const
 
virtual void sort (int column, Qt::SortOrder order)
 
virtual QSize span (const QModelIndex &index) const
 
virtual bool submit ()
 
Qt::DropActions supportedDragActions () const
 
virtual Qt::DropActions supportedDropActions () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual ~QObject ()
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 

Protected Member Functions

void addRootItems ()
 
void removeRootItems ()
 
- Protected Member Functions inherited from QAbstractItemModel
void beginInsertColumns (const QModelIndex &parent, int first, int last)
 
void beginInsertRows (const QModelIndex &parent, int first, int last)
 
bool beginMoveColumns (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
 
bool beginMoveRows (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
 
void beginRemoveColumns (const QModelIndex &parent, int first, int last)
 
void beginRemoveRows (const QModelIndex &parent, int first, int last)
 
void beginResetModel ()
 
void changePersistentIndex (const QModelIndex &from, const QModelIndex &to)
 
void changePersistentIndexList (const QModelIndexList &from, const QModelIndexList &to)
 
QModelIndex createIndex (int row, int column, void *ptr) const
 
QModelIndex createIndex (int row, int column, int id) const
 
QModelIndex createIndex (int row, int column, quint32 id) const
 
void endInsertColumns ()
 
void endInsertRows ()
 
void endMoveColumns ()
 
void endMoveRows ()
 
void endRemoveColumns ()
 
void endRemoveRows ()
 
void endResetModel ()
 
QModelIndexList persistentIndexList () const
 
void reset ()
 
void resetInternalData ()
 
void setRoleNames (const QHash< int, QByteArray > &roleNames)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Protected Attributes

QgsCptCityArchivemArchive
 
QSize mIconSize
 
QVector< QgsCptCityDataItem * > mRootItems
 
ViewType mViewType
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Definition at line 324 of file qgscptcityarchive.h.

Member Enumeration Documentation

◆ ViewType

Enumerator
Authors 
Selections 
List 

Definition at line 330 of file qgscptcityarchive.h.

Constructor & Destructor Documentation

◆ QgsCptCityBrowserModel()

QgsCptCityBrowserModel::QgsCptCityBrowserModel ( QObject parent = nullptr,
QgsCptCityArchive archive = QgsCptCityArchive::defaultArchive(),
ViewType  Type = Authors 
)

Definition at line 1331 of file qgscptcityarchive.cpp.

◆ ~QgsCptCityBrowserModel()

QgsCptCityBrowserModel::~QgsCptCityBrowserModel ( )

Definition at line 1344 of file qgscptcityarchive.cpp.

Member Function Documentation

◆ addRootItems()

void QgsCptCityBrowserModel::addRootItems ( )
protected

Definition at line 1349 of file qgscptcityarchive.cpp.

◆ beginInsertItems

void QgsCptCityBrowserModel::beginInsertItems ( QgsCptCityDataItem parent,
int  first,
int  last 
)
slot

Definition at line 1643 of file qgscptcityarchive.cpp.

◆ beginRemoveItems

void QgsCptCityBrowserModel::beginRemoveItems ( QgsCptCityDataItem parent,
int  first,
int  last 
)
slot

Definition at line 1657 of file qgscptcityarchive.cpp.

◆ canFetchMore()

bool QgsCptCityBrowserModel::canFetchMore ( const QModelIndex parent) const
overridevirtual

Reimplemented from QAbstractItemModel.

Definition at line 1681 of file qgscptcityarchive.cpp.

◆ columnCount()

int QgsCptCityBrowserModel::columnCount ( const QModelIndex parent = QModelIndex()) const
overridevirtual

Provides the number of columns of data exposed by the model.

List models do not provide this function because it is already implemented in QAbstractListModel.

Definition at line 1473 of file qgscptcityarchive.cpp.

◆ connectItem()

void QgsCptCityBrowserModel::connectItem ( QgsCptCityDataItem item)

Definition at line 1669 of file qgscptcityarchive.cpp.

◆ data()

QVariant QgsCptCityBrowserModel::data ( const QModelIndex index,
int  role = Qt::DisplayRole 
) const
overridevirtual

Used to supply item data to views and delegates.

Generally, models only need to supply data for Qt::DisplayRole and any application-specific user roles, but it is also good practice to provide data for Qt::ToolTipRole, Qt::AccessibleTextRole, and Qt::AccessibleDescriptionRole. See the Qt::ItemDataRole enum documentation for information about the types associated with each role.

Definition at line 1383 of file qgscptcityarchive.cpp.

◆ dataItem()

QgsCptCityDataItem * QgsCptCityBrowserModel::dataItem ( const QModelIndex idx) const

Returns a list of mime that can describe model indexes.

Returns an object that contains serialized items of data corresponding to the list of indexes specified Handles the data supplied by a drag and drop operation that ended with the given action

Definition at line 1752 of file qgscptcityarchive.cpp.

◆ endInsertItems

void QgsCptCityBrowserModel::endInsertItems ( )
slot

Definition at line 1653 of file qgscptcityarchive.cpp.

◆ endRemoveItems

void QgsCptCityBrowserModel::endRemoveItems ( )
slot

Definition at line 1665 of file qgscptcityarchive.cpp.

◆ fetchMore()

void QgsCptCityBrowserModel::fetchMore ( const QModelIndex parent)
overridevirtual

Reimplemented from QAbstractItemModel.

Definition at line 1699 of file qgscptcityarchive.cpp.

◆ findItem()

QModelIndex QgsCptCityBrowserModel::findItem ( QgsCptCityDataItem item,
QgsCptCityDataItem parent = nullptr 
) const

Definition at line 1615 of file qgscptcityarchive.cpp.

◆ findPath()

QModelIndex QgsCptCityBrowserModel::findPath ( const QString path)

return index of a path

Definition at line 1479 of file qgscptcityarchive.cpp.

◆ flags()

Qt::ItemFlags QgsCptCityBrowserModel::flags ( const QModelIndex index) const
overridevirtual

Used by other components to obtain information about each item provided by the model.

In many models, the combination of flags should include Qt::ItemIsEnabled and Qt::ItemIsSelectable.

Reimplemented from QAbstractItemModel.

Definition at line 1373 of file qgscptcityarchive.cpp.

◆ hasChildren()

bool QgsCptCityBrowserModel::hasChildren ( const QModelIndex parent = QModelIndex()) const
overridevirtual

Reimplemented from QAbstractItemModel.

Definition at line 1463 of file qgscptcityarchive.cpp.

◆ headerData()

QVariant QgsCptCityBrowserModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
overridevirtual

Provides views with information to show in their headers.

The information is only retrieved by views that can display header information.

Reimplemented from QAbstractItemModel.

Definition at line 1433 of file qgscptcityarchive.cpp.

◆ index()

QModelIndex QgsCptCityBrowserModel::index ( int  row,
int  column,
const QModelIndex parent = QModelIndex() 
) const
overridevirtual

Returns the index of the item in the model specified by the given row, column and parent index.

Definition at line 1598 of file qgscptcityarchive.cpp.

◆ parent()

QModelIndex QgsCptCityBrowserModel::parent ( const QModelIndex index) const
overridevirtual

Returns the parent of the model item with the given index.

If the item has no parent, an invalid QModelIndex is returned.

Definition at line 1606 of file qgscptcityarchive.cpp.

◆ refresh() [1/2]

void QgsCptCityBrowserModel::refresh ( const QString path)

Definition at line 1587 of file qgscptcityarchive.cpp.

◆ refresh() [2/2]

void QgsCptCityBrowserModel::refresh ( const QModelIndex index = QModelIndex())

Definition at line 1633 of file qgscptcityarchive.cpp.

◆ reload()

void QgsCptCityBrowserModel::reload ( )

Definition at line 1578 of file qgscptcityarchive.cpp.

◆ removeRootItems()

void QgsCptCityBrowserModel::removeRootItems ( )
protected

Definition at line 1362 of file qgscptcityarchive.cpp.

◆ rowCount()

int QgsCptCityBrowserModel::rowCount ( const QModelIndex parent = QModelIndex()) const
overridevirtual

Provides the number of rows of data exposed by the model.

Definition at line 1446 of file qgscptcityarchive.cpp.

Member Data Documentation

◆ mArchive

QgsCptCityArchive* QgsCptCityBrowserModel::mArchive
protected

Definition at line 424 of file qgscptcityarchive.h.

◆ mIconSize

QSize QgsCptCityBrowserModel::mIconSize
protected

Definition at line 426 of file qgscptcityarchive.h.

◆ mRootItems

QVector<QgsCptCityDataItem*> QgsCptCityBrowserModel::mRootItems
protected

Definition at line 423 of file qgscptcityarchive.h.

◆ mViewType

ViewType QgsCptCityBrowserModel::mViewType
protected

Definition at line 425 of file qgscptcityarchive.h.


The documentation for this class was generated from the following files: