digiKam
Digikam::TagMngrListModel Class Reference
+ Inheritance diagram for Digikam::TagMngrListModel:

Public Member Functions

ListItemaddItem (QList< QVariant > values)
 addItem - add new item to list More...
 
QList< ListItem * > allItems () const
 allItems - return all items from List, usually to be saved in KConfig More...
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
void deleteItem (ListItem *const item)
 
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QList< int > getDragNewSelection () const
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QMimeData * mimeData (const QModelIndexList &indexes) const override
 
QStringList mimeTypes () const override
 
QModelIndex parent (const QModelIndex &index) const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role) override
 
Qt::DropActions supportedDropActions () const override
 
 TagMngrListModel (QObject *const parent=nullptr)
 
 ~TagMngrListModel () override
 

Constructor & Destructor Documentation

◆ TagMngrListModel()

Digikam::TagMngrListModel::TagMngrListModel ( QObject *const  parent = nullptr)
explicit

◆ ~TagMngrListModel()

Digikam::TagMngrListModel::~TagMngrListModel ( )
override

Member Function Documentation

◆ addItem()

ListItem * Digikam::TagMngrListModel::addItem ( QList< QVariant >  values)

addItem - add new item to list

Parameters
values- A list of data for item: Name as QString, QBrush as background and qlonglong as id
Returns
- pointer to newly created listitem

containsItem will return a valid pointer if item with the same values is already added to it's children list.

◆ allItems()

QList< ListItem * > Digikam::TagMngrListModel::allItems ( ) const

allItems - return all items from List, usually to be saved in KConfig

◆ columnCount()

int Digikam::TagMngrListModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

References parent().

◆ data()

QVariant Digikam::TagMngrListModel::data ( const QModelIndex &  index,
int  role 
) const
override

Standard methods to be implemented when subcassing QAbstractItemModel

References Digikam::ListItem::data(), and index().

Referenced by dropMimeData().

◆ deleteItem()

void Digikam::TagMngrListModel::deleteItem ( ListItem *const  item)

◆ dropMimeData()

bool Digikam::TagMngrListModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
)
override

After drag-n-drop selection is messed up, store the interval were new items are and TagsMngrListView will update selection

References data(), and parent().

Referenced by Digikam::TagMngrListView::dropEvent().

◆ flags()

Qt::ItemFlags Digikam::TagMngrListModel::flags ( const QModelIndex &  index) const
override

References index().

◆ getDragNewSelection()

QList< int > Digikam::TagMngrListModel::getDragNewSelection ( ) const

◆ headerData()

QVariant Digikam::TagMngrListModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override

◆ index()

QModelIndex Digikam::TagMngrListModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

◆ mimeData()

QMimeData * Digikam::TagMngrListModel::mimeData ( const QModelIndexList &  indexes) const
override

References index().

Referenced by Digikam::TagMngrListView::startDrag().

◆ mimeTypes()

QStringList Digikam::TagMngrListModel::mimeTypes ( ) const
override

◆ parent()

QModelIndex Digikam::TagMngrListModel::parent ( const QModelIndex &  index) const
override

◆ rowCount()

int Digikam::TagMngrListModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

◆ setData()

bool Digikam::TagMngrListModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role 
)
override

References index(), parent(), and value.

◆ supportedDropActions()

Qt::DropActions Digikam::TagMngrListModel::supportedDropActions ( ) const
override

Reimplemented methods for handling drag-n-drop, encoding and decoding mime types

References Digikam::CopyAction, and Digikam::MoveAction.


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