digiKam
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

virtual Qt::ItemFlags dragDropFlags (const QModelIndex &index) const
 
Qt::ItemFlags dragDropFlagsV2 (const QModelIndex &index) const
 
AbstractItemDragDropHandlerdragDropHandler () const
 
bool dropMimeData (const QMimeData *, Qt::DropAction, int, int, const QModelIndex &)
 
FilterAction filterAction (const QModelIndex &index) const
 
bool hasImage (const ItemInfo &info)
 
ItemInfo imageInfo (const QModelIndex &index) const
 
DECLARE_MODEL_DRAG_DROP_METHODS ItemListModelimageModel () const
 
QModelIndex imageModelIndex (const QModelIndex &index) const
 
QModelIndex indexForInfo (const ItemInfo &info) const
 Note: There may be multiple indexes for an info. The index found first is returned. More...
 
virtual bool isDragEnabled (const QModelIndex &index) const
 
virtual bool isDropEnabled (const QModelIndex &index) const
 
bool isFilterAction (const QModelIndex &index) const
 
bool isImage (const QModelIndex &index) const
 
 ItemHistoryGraphModel (QObject *const parent=nullptr)
 
QMimeData * mimeData (const QModelIndexList &indexes) const
 
QStringList mimeTypes () const
 
Mode mode () const
 
void setDragDropHandler (AbstractItemDragDropHandler *handler)
 
void setHistory (const ItemInfo &subject, const ItemHistoryGraph &graph=ItemHistoryGraph())
 
void setMode (Mode mode)
 
ItemInfo subject () const
 
Qt::DropActions supportedDropActions () const
 
 ~ItemHistoryGraphModel () override
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 QAbstractItemModel implementation. More...
 
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
 

Protected Attributes

AbstractItemDragDropHandlerm_dragDropHandler
 

Member Enumeration Documentation

◆ ExtraRoles

Enumerator
IsImageItemRole 
IsFilterActionItemRole 
IsHeaderItemRole 
IsCategoryItemRole 
IsSeparatorItemRole 
IsSubjectImageRole 
FilterActionRole 

◆ Mode

Enumerator
ImagesListMode 
ImagesTreeMode 
CombinedTreeMode 

Constructor & Destructor Documentation

◆ ItemHistoryGraphModel()

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

◆ ~ItemHistoryGraphModel()

Digikam::ItemHistoryGraphModel::~ItemHistoryGraphModel ( )
override

Member Function Documentation

◆ columnCount()

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

◆ data()

◆ dragDropFlags()

Qt::ItemFlags Digikam::DragDropModelImplementation::dragDropFlags ( const QModelIndex &  index) const
virtualinherited

Call from your flags() method, adding the relevant drag drop flags. Default implementation enables both drag and drop on the index if a drag drop handler is set. Reimplement to fine-tune. Note: There is an alternative below.

References Digikam::DragDropModelImplementation::m_dragDropHandler.

Referenced by Digikam::ItemModel::flags(), ShowFoto::ShowfotoItemModel::flags(), and Digikam::ImportItemModel::flags().

◆ dragDropFlagsV2()

Qt::ItemFlags Digikam::DragDropModelImplementation::dragDropFlagsV2 ( const QModelIndex &  index) const
inherited

This is an alternative approach to dragDropFlags(). dragDropFlagsV2 calls the virtual methods isDragEnabled() and isDropEnabled() which you then reimplement. Use simple dragDropFlags() if you need not customization, or reimplement dragDropFlags() if you fine-tune it yourself.

References Digikam::DragDropModelImplementation::isDragEnabled(), and Digikam::DragDropModelImplementation::isDropEnabled().

◆ dragDropHandler()

◆ dropMimeData()

bool Digikam::DragDropModelImplementation::dropMimeData ( const QMimeData *  ,
Qt::DropAction  ,
int  ,
int  ,
const QModelIndex &   
)
inherited

◆ filterAction()

FilterAction Digikam::ItemHistoryGraphModel::filterAction ( const QModelIndex &  index) const

References if_isItem, and index().

◆ flags()

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

References if_isItem, and index().

◆ hasChildren()

bool Digikam::ItemHistoryGraphModel::hasChildren ( const QModelIndex &  parent = QModelIndex()) const
override

References parent().

◆ hasImage()

bool Digikam::ItemHistoryGraphModel::hasImage ( const ItemInfo info)

◆ headerData()

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

QAbstractItemModel implementation.

◆ imageInfo()

ItemInfo Digikam::ItemHistoryGraphModel::imageInfo ( const QModelIndex &  index) const

◆ imageModel()

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

Returns an internal image model used for entries representing images. Note: Set a thumbnail thread on this model if you need thumbnails.

◆ imageModelIndex()

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

If the given index is represented by the internal image model, return the image model's index. Otherwise an invalid index is returned.

References if_isItem, and index().

Referenced by imageInfo().

◆ index()

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

◆ indexForInfo()

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

Note: There may be multiple indexes for an info. The index found first is returned.

References Digikam::ItemInfo::isNull(), and Digikam::ItemModel::retrieveItemInfo().

◆ isDragEnabled()

bool Digikam::DragDropModelImplementation::isDragEnabled ( const QModelIndex &  index) const
virtualinherited

◆ isDropEnabled()

bool Digikam::DragDropModelImplementation::isDropEnabled ( const QModelIndex &  index) const
virtualinherited

◆ isFilterAction()

bool Digikam::ItemHistoryGraphModel::isFilterAction ( const QModelIndex &  index) const

References index().

◆ isImage()

bool Digikam::ItemHistoryGraphModel::isImage ( const QModelIndex &  index) const

References index().

◆ mimeData()

QMimeData * Digikam::DragDropModelImplementation::mimeData ( const QModelIndexList &  indexes) const
inherited

◆ mimeTypes()

QStringList Digikam::DragDropModelImplementation::mimeTypes ( ) const
inherited

◆ mode()

ItemHistoryGraphModel::Mode Digikam::ItemHistoryGraphModel::mode ( ) const

Referenced by setMode().

◆ parent()

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

References index().

Referenced by hasChildren(), index(), and rowCount().

◆ rowCount()

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

References parent().

◆ setData()

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

References if_isItem, index(), and value.

◆ setDragDropHandler()

void Digikam::DragDropModelImplementation::setDragDropHandler ( AbstractItemDragDropHandler handler)
inherited

◆ setHistory()

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

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

References Digikam::ItemHistoryGraph::fromInfo(), Digikam::ItemHistoryGraph::isNull(), and subject().

Referenced by setMode().

◆ setMode()

void Digikam::ItemHistoryGraphModel::setMode ( Mode  mode)

References mode(), and setHistory().

◆ subject()

ItemInfo Digikam::ItemHistoryGraphModel::subject ( ) const

Referenced by setHistory().

◆ supportedDropActions()

Qt::DropActions Digikam::DragDropModelImplementation::supportedDropActions ( ) const
inherited

Implements the relevant QAbstractItemModel methods for drag and drop. All functionality is redirected to the handler. dropMimeData() always returns false, leaving implementation to the view.

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

Member Data Documentation

◆ m_dragDropHandler


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