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

Public Member Functions

virtual Qt::DropAction accepts (const QDropEvent *e, const QModelIndex &dropIndex)
 
virtual bool acceptsMimeData (const QMimeData *data)
 
 AlbumModelDragDropHandler (AbstractAlbumModel *model)
 
virtual QMimeData * createMimeData (const QList< Album * > &)
 
virtual bool dropEvent (QAbstractItemView *view, const QDropEvent *e, const QModelIndex &droppedOn)
 
virtual QStringList mimeTypes () const
 
AbstractAlbumModelmodel () const
 
 ~AlbumModelDragDropHandler () override
 

Protected Attributes

AbstractAlbumModelm_model
 

Constructor & Destructor Documentation

◆ AlbumModelDragDropHandler()

Digikam::AlbumModelDragDropHandler::AlbumModelDragDropHandler ( AbstractAlbumModel model)
explicit

◆ ~AlbumModelDragDropHandler()

Digikam::AlbumModelDragDropHandler::~AlbumModelDragDropHandler ( )
override

Member Function Documentation

◆ accepts()

Qt::DropAction Digikam::AlbumModelDragDropHandler::accepts ( const QDropEvent *  e,
const QModelIndex &  dropIndex 
)
virtual

Returns if the given mime data is accepted for drop on dropIndex. Returns the proposed action, or Qt::IgnoreAction if not accepted.

Reimplemented in Digikam::TagDragDropHandler, and Digikam::AlbumDragDropHandler.

Referenced by Digikam::AbstractAlbumTreeView::dragMoveEvent().

◆ acceptsMimeData()

bool Digikam::AlbumModelDragDropHandler::acceptsMimeData ( const QMimeData *  data)
virtual

Returns if the given mime data can be handled. acceptsMimeData shall return true if a drop of the given mime data will be accepted on any index or place at all. If this returns false, the more specific method accepts() will not be called for this drag. The default implementation uses mimeTypes() to check for supported mime types. There is usually no need to reimplement this.

References mimeTypes().

Referenced by Digikam::AbstractAlbumTreeView::dragEnterEvent().

◆ createMimeData()

QMimeData * Digikam::AlbumModelDragDropHandler::createMimeData ( const QList< Album * > &  )
virtual

Create a mime data object for starting a drag from the given Albums

Reimplemented in Digikam::TagDragDropHandler, and Digikam::AlbumDragDropHandler.

◆ dropEvent()

bool Digikam::AlbumModelDragDropHandler::dropEvent ( QAbstractItemView *  view,
const QDropEvent *  e,
const QModelIndex &  droppedOn 
)
virtual

Gives the view and the occurring drop event. The index is the index where the drop was dropped on. It may be invalid (dropped on decoration, viewport) Returns true if the event is to be accepted.

Reimplemented in Digikam::TagDragDropHandler, and Digikam::AlbumDragDropHandler.

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

◆ mimeTypes()

QStringList Digikam::AlbumModelDragDropHandler::mimeTypes ( ) const
virtual

Returns the supported mime types. Called by the default implementation of model's mimeTypes().

Reimplemented in Digikam::TagDragDropHandler, and Digikam::AlbumDragDropHandler.

Referenced by acceptsMimeData().

◆ model()

AbstractAlbumModel * Digikam::AlbumModelDragDropHandler::model ( ) const

References m_model.

Member Data Documentation

◆ m_model

AbstractAlbumModel* Digikam::AlbumModelDragDropHandler::m_model
protected

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