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

Public Member Functions

 AbstractItemDragDropHandler (QAbstractItemModel *const model)
 
virtual Qt::DropAction accepts (const QDropEvent *e, const QModelIndex &dropIndex)
 Returns if the given mime data is accepted for drop on dropIndex.
 
virtual bool acceptsMimeData (const QMimeData *data)
 Returns if the given mime data can be handled.
 
virtual QMimeData * createMimeData (const QList< QModelIndex > &)
 Create a mime data object for starting a drag from the given Albums.
 
virtual bool dropEvent (QAbstractItemView *view, const QDropEvent *e, const QModelIndex &droppedOn)
 Gives the view and the occurring drop event.
 
virtual QStringList mimeTypes () const
 Returns the supported mime types.
 
virtual QAbstractItemModel * model () const
 

Protected Attributes

QAbstractItemModel * m_model = nullptr
 

Member Function Documentation

◆ accepts()

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

Returns the proposed action, or Qt::IgnoreAction if not accepted.

Reimplemented in Digikam::ImportDragDropHandler, Digikam::ItemDragDropHandler, and ShowFoto::ShowfotoDragDropHandler.

◆ acceptsMimeData()

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

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.

◆ createMimeData()

QMimeData * Digikam::AbstractItemDragDropHandler::createMimeData ( const QList< QModelIndex > &  )
virtual

◆ dropEvent()

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

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::ImportDragDropHandler, Digikam::ItemDragDropHandler, and ShowFoto::ShowfotoDragDropHandler.

◆ mimeTypes()

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

Called by the default implementation of model's mimeTypes().

Reimplemented in Digikam::ImportDragDropHandler, Digikam::ItemDragDropHandler, and ShowFoto::ShowfotoDragDropHandler.