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

Public Member Functions

Qt::DropAction accepts (const QDropEvent *e, const QModelIndex &dropIndex) override
 
virtual bool acceptsMimeData (const QMimeData *data)
 
QMimeData * createMimeData (const QList< QModelIndex > &) override
 
bool dropEvent (QAbstractItemView *view, const QDropEvent *e, const QModelIndex &droppedOn) override
 
 ImportDragDropHandler (ImportItemModel *const model)
 
QStringList mimeTypes () const override
 
ImportItemModelmodel () const
 

Protected Attributes

QAbstractItemModel * m_model
 

Constructor & Destructor Documentation

◆ ImportDragDropHandler()

Digikam::ImportDragDropHandler::ImportDragDropHandler ( ImportItemModel *const  model)
explicit

Member Function Documentation

◆ accepts()

Qt::DropAction Digikam::ImportDragDropHandler::accepts ( const QDropEvent *  e,
const QModelIndex &  dropIndex 
)
overridevirtual

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

Reimplemented from Digikam::AbstractItemDragDropHandler.

References Digikam::DItemDrag::canDecode(), Digikam::DTagListDrag::canDecode(), Digikam::DCameraItemListDrag::canDecode(), Digikam::DCameraDragObject::canDecode(), Digikam::CopyAction, and Digikam::MoveAction.

Referenced by dropEvent().

◆ acceptsMimeData()

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

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 Digikam::AbstractItemDragDropHandler::mimeTypes().

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

◆ createMimeData()

QMimeData * Digikam::ImportDragDropHandler::createMimeData ( const QList< QModelIndex > &  )
overridevirtual

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

Reimplemented from Digikam::AbstractItemDragDropHandler.

References Digikam::ImportItemModel::camItemInfos(), Digikam::CamItemInfo::folder, model(), and Digikam::CamItemInfo::name.

◆ dropEvent()

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

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 from Digikam::AbstractItemDragDropHandler.

References accepts(), Digikam::DItemDrag::canDecode(), Digikam::DigikamApp::instance(), Digikam::ImportUI::instance(), Digikam::ItemIconView::selectedUrls(), Digikam::ImportUI::slotUploadItems(), and Digikam::DigikamApp::view().

◆ mimeTypes()

QStringList Digikam::ImportDragDropHandler::mimeTypes ( ) const
overridevirtual

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

Reimplemented from Digikam::AbstractItemDragDropHandler.

References Digikam::DItemDrag::mimeTypes(), Digikam::DTagListDrag::mimeTypes(), Digikam::DCameraItemListDrag::mimeTypes(), and Digikam::DCameraDragObject::mimeTypes().

◆ model()

ImportItemModel * Digikam::ImportDragDropHandler::model ( ) const

Member Data Documentation

◆ m_model

QAbstractItemModel* Digikam::AbstractItemDragDropHandler::m_model
protectedinherited

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