digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::ItemHistoryGraphModel Class Reference
+ Inheritance diagram for Digikam::ItemHistoryGraphModel:

Public Types

enum  ExtraRoles {
  IsImageItemRole = Qt::UserRole + 1000 , IsFilterActionItemRole = Qt::UserRole + 1001 , IsHeaderItemRole = Qt::UserRole + 1002 , IsCategoryItemRole = Qt::UserRole + 1003 ,
  IsSeparatorItemRole = Qt::UserRole + 1004 , IsSubjectImageRole = Qt::UserRole + 1010 , FilterActionRole = Qt::UserRole + 1020
}
 
enum  Mode { ImagesListMode , ImagesTreeMode , CombinedTreeMode }
 

Public Member Functions

 ItemHistoryGraphModel (QWidget *const parent)
 
FilterAction filterAction (const QModelIndex &index) const
 
bool hasImage (const ItemInfo &info)
 
ItemInfo imageInfo (const QModelIndex &index) const
 
DECLARE_MODEL_DRAG_DROP_METHODS ItemListModelimageModel () const
 Returns an internal image model used for entries representing images.
 
QModelIndex imageModelIndex (const QModelIndex &index) const
 If the given index is represented by the internal image model, return the image model's index.
 
QModelIndex indexForInfo (const ItemInfo &info) const
 Note: There may be multiple indexes for an info.
 
bool isFilterAction (const QModelIndex &index) const
 
bool isImage (const QModelIndex &index) const
 
Mode mode () const
 
void setHistory (const ItemInfo &subject, const ItemHistoryGraph &graph=ItemHistoryGraph())
 Set the history subject and the history graph.
 
void setMode (Mode mode)
 
ItemInfo subject () const
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 QAbstractItemModel implementation.
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
bool hasChildren (const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex parent (const QModelIndex &index) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role) override
 
- Public Member Functions inherited from Digikam::DragDropModelImplementation
 DragDropModelImplementation ()=default
 A class providing a sample implementation for a QAbstractItemModel redirecting drag-and-drop support to a handler.
 
virtual Qt::ItemFlags dragDropFlags (const QModelIndex &index) const
 Call from your flags() method, adding the relevant drag drop flags.
 
Qt::ItemFlags dragDropFlagsV2 (const QModelIndex &index) const
 This is an alternative approach to dragDropFlags().
 
AbstractItemDragDropHandlerdragDropHandler () const
 
bool dropMimeData (const QMimeData *, Qt::DropAction, int, int, const QModelIndex &)
 
virtual bool isDragEnabled (const QModelIndex &index) const
 
virtual bool isDropEnabled (const QModelIndex &index) const
 
QMimeData * mimeData (const QModelIndexList &indexes) const
 
QStringList mimeTypes () const
 
void setDragDropHandler (AbstractItemDragDropHandler *handler)
 Set a drag drop handler.
 
Qt::DropActions supportedDropActions () const
 Implements the relevant QAbstractItemModel methods for drag and drop.
 

Additional Inherited Members

- Protected Attributes inherited from Digikam::DragDropModelImplementation
AbstractItemDragDropHandlerm_dragDropHandler = nullptr
 

Member Function Documentation

◆ imageModel()

ItemListModel * Digikam::ItemHistoryGraphModel::imageModel ( ) const

Note: Set a thumbnail thread on this model if you need thumbnails.

◆ imageModelIndex()

QModelIndex Digikam::ItemHistoryGraphModel::imageModelIndex ( const QModelIndex &  index) const

Otherwise an invalid index is returned.

◆ indexForInfo()

QModelIndex Digikam::ItemHistoryGraphModel::indexForInfo ( const ItemInfo info) const

The index found first is returned.

◆ setHistory()

void Digikam::ItemHistoryGraphModel::setHistory ( const ItemInfo subject,
const ItemHistoryGraph graph = ItemHistoryGraph() 
)

Per default, the subject's history graph is read.