digiKam
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)
 
virtual bool acceptsMimeData (const QMimeData *data)
 
virtual QMimeData * createMimeData (const QList< QModelIndex > &)
 
virtual bool dropEvent (QAbstractItemView *view, const QDropEvent *e, const QModelIndex &droppedOn)
 
virtual QStringList mimeTypes () const
 
QAbstractItemModel * model () const
 
virtual ~AbstractItemDragDropHandler ()
 

Protected Attributes

QAbstractItemModel * m_model
 

Constructor & Destructor Documentation

◆ AbstractItemDragDropHandler()

Digikam::AbstractItemDragDropHandler::AbstractItemDragDropHandler ( QAbstractItemModel *const  model)
explicit

◆ ~AbstractItemDragDropHandler()

Digikam::AbstractItemDragDropHandler::~AbstractItemDragDropHandler ( )
virtual

Member Function Documentation

◆ accepts()

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

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

◆ acceptsMimeData()

bool Digikam::AbstractItemDragDropHandler::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::DragDropViewImplementation::dragEnterEvent().

◆ createMimeData()

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

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

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

Referenced by Digikam::DragDropModelImplementation::mimeData(), and Digikam::TableViewModel::mimeData().

◆ dropEvent()

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

Referenced by Digikam::DragDropViewImplementation::dropEvent(), and Digikam::DragDropViewImplementation::paste().

◆ mimeTypes()

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

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

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

Referenced by acceptsMimeData(), Digikam::DragDropModelImplementation::mimeTypes(), and Digikam::TableViewModel::mimeTypes().

◆ model()

QAbstractItemModel * Digikam::AbstractItemDragDropHandler::model ( ) const

References m_model.

Member Data Documentation

◆ m_model

QAbstractItemModel* Digikam::AbstractItemDragDropHandler::m_model
protected

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