digiKam Developer Documentation: Digikam::AlbumModelDragDropHandler Class Reference

| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Digikam::AlbumModelDragDropHandler Class Reference
Inheritance diagram for Digikam::AlbumModelDragDropHandler:

## Public Member Functions
| AlbumModelDragDropHandler (AbstractAlbumModel *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< Album * > &)
| 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 AbstractAlbumModel * | model () const

## Protected Attributes
AbstractAlbumModel * | m_model = nullptr

## Member Function Documentation

## ◆ accepts()

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

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

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

## ◆ acceptsMimeData()

bool Digikam::AlbumModelDragDropHandler::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::AlbumModelDragDropHandler::createMimeData | ( | const QList< Album * > & |  | ) |
| virtual

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

## ◆ dropEvent()

bool Digikam::AlbumModelDragDropHandler::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::AlbumDragDropHandler, and Digikam::TagDragDropHandler.

## ◆ mimeTypes()

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

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

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