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

Signals

void addToGroup (const ItemInfo &pick, const QList< ItemInfo > &infos)
 
void assignTags (const QList< ItemInfo > &list, const QList< int > &tagIDs)
 
void dragDropSort (const ItemInfo &pick, const QList< ItemInfo > &infos)
 
void itemInfosDropped (const QList< ItemInfo > &infos)
 
void urlsDropped (const QList< QUrl > &urls)
 

Public Member Functions

 ItemDragDropHandler (ItemModel *const model)
 
Qt::DropAction accepts (const QDropEvent *e, const QModelIndex &dropIndex) override
 Returns if the given mime data is accepted for drop on dropIndex.
 
ItemAlbumModelalbumModel () const
 
QMimeData * createMimeData (const QList< QModelIndex > &) override
 Create a mime data object for starting a drag from the given Albums.
 
bool dropEvent (QAbstractItemView *view, const QDropEvent *e, const QModelIndex &droppedOn) override
 Gives the view and the occurring drop event.
 
QStringList mimeTypes () const override
 Returns the supported mime types.
 
ItemModelmodel () const override
 
void setReadOnlyDrop (bool readOnly)
 Enables a mode in which dropping will never start an operation which copies or moves files on disk.
 
- Public Member Functions inherited from Digikam::AbstractItemDragDropHandler
 AbstractItemDragDropHandler (QAbstractItemModel *const model)
 
virtual bool acceptsMimeData (const QMimeData *data)
 Returns if the given mime data can be handled.
 

Protected Attributes

bool m_readOnly = false
 
- Protected Attributes inherited from Digikam::AbstractItemDragDropHandler
QAbstractItemModel * m_model = nullptr
 

Member Function Documentation

◆ accepts()

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

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

Reimplemented from Digikam::AbstractItemDragDropHandler.

◆ createMimeData()

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

◆ dropEvent()

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

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.

◆ mimeTypes()

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

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

Reimplemented from Digikam::AbstractItemDragDropHandler.

◆ model()

ItemModel * Digikam::ItemDragDropHandler::model ( ) const
overridevirtual

◆ setReadOnlyDrop()

void Digikam::ItemDragDropHandler::setReadOnlyDrop ( bool  readOnly)

Only the signals are emitted.