digiKam
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

Qt::DropAction accepts (const QDropEvent *e, const QModelIndex &dropIndex) override
 
virtual bool acceptsMimeData (const QMimeData *data)
 
ItemAlbumModelalbumModel () const
 
QMimeData * createMimeData (const QList< QModelIndex > &) override
 
bool dropEvent (QAbstractItemView *view, const QDropEvent *e, const QModelIndex &droppedOn) override
 
 ItemDragDropHandler (ItemModel *const model)
 
QStringList mimeTypes () const override
 
ItemModelmodel () const
 
void setReadOnlyDrop (bool readOnly)
 

Protected Attributes

QAbstractItemModel * m_model
 
bool m_readOnly
 

Constructor & Destructor Documentation

◆ ItemDragDropHandler()

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

Member Function Documentation

◆ accepts()

Qt::DropAction Digikam::ItemDragDropHandler::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 albumModel(), Digikam::DItemDrag::canDecode(), Digikam::DTagListDrag::canDecode(), Digikam::DCameraItemListDrag::canDecode(), Digikam::DCameraDragObject::canDecode(), Digikam::CopyAction, and Digikam::MoveAction.

◆ 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().

◆ addToGroup

void Digikam::ItemDragDropHandler::addToGroup ( const ItemInfo pick,
const QList< ItemInfo > &  infos 
)
signal

Referenced by dropEvent().

◆ albumModel()

ItemAlbumModel * Digikam::ItemDragDropHandler::albumModel ( ) const

References model().

Referenced by accepts(), and dropEvent().

◆ assignTags

void Digikam::ItemDragDropHandler::assignTags ( const QList< ItemInfo > &  list,
const QList< int > &  tagIDs 
)
signal

Referenced by dropEvent().

◆ createMimeData()

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

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

Reimplemented from Digikam::AbstractItemDragDropHandler.

References Digikam::ItemInfo::albumId(), Digikam::ItemInfo::fileUrl(), Digikam::ItemInfo::id(), Digikam::ItemModel::imageInfos(), and model().

◆ dragDropSort

void Digikam::ItemDragDropHandler::dragDropSort ( const ItemInfo pick,
const QList< ItemInfo > &  infos 
)
signal

Referenced by dropEvent().

◆ dropEvent()

bool Digikam::ItemDragDropHandler::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 addToGroup(), Digikam::ItemCategorizedView::albumAt(), Digikam::TableViewTreeView::albumAt(), Digikam::ItemInfo::albumId(), albumModel(), Digikam::ItemCategorizedView::allItemInfos(), Digikam::AssignTagAction, assignTags(), Digikam::DItemDrag::canDecode(), Digikam::DTagListDrag::canDecode(), Digikam::DCameraItemListDrag::canDecode(), Digikam::DigikamItemView::confirmFaces(), Digikam::DIO::copy(), Digikam::CopyAction, Digikam::ItemAlbumModel::currentAlbums(), Digikam::DTagListDrag::decode(), Digikam::DItemDrag::decode(), dragDropSort(), Digikam::GroupAndMoveAction, Digikam::TAlbum::hasProperty(), Digikam::Album::id(), Digikam::ItemCategorizedView::imageFilterModel(), Digikam::ItemModel::imageInfo(), Digikam::ImportUI::instance(), Digikam::ItemInfo::isNull(), Digikam::FaceTags::isPerson(), Digikam::Album::isRoot(), itemInfosDropped(), m_readOnly, Digikam::ImageSortFilterModel::mapToSourceItemModel(), model(), Digikam::DIO::move(), Digikam::MoveAction, Digikam::NoAction, Digikam::TagPropertyName::person(), Digikam::Album::PHYSICAL, Digikam::ItemCategorizedView::selectedItemInfosCurrentFirst(), Digikam::ImportUI::slotDownload(), Digikam::SortAction, Digikam::Album::TAG, Digikam::Album::type(), Digikam::FaceTags::unconfirmedPersonTagId(), Digikam::FaceTags::unknownPersonTagId(), and urlsDropped().

◆ itemInfosDropped

void Digikam::ItemDragDropHandler::itemInfosDropped ( const QList< ItemInfo > &  infos)
signal

Referenced by dropEvent().

◆ mimeTypes()

QStringList Digikam::ItemDragDropHandler::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()

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

◆ setReadOnlyDrop()

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

Enables a mode in which dropping will never start an operation which copies or moves files on disk. Only the signals are emitted.

References m_readOnly.

◆ urlsDropped

void Digikam::ItemDragDropHandler::urlsDropped ( const QList< QUrl > &  urls)
signal

Referenced by dropEvent().

Member Data Documentation

◆ m_model

QAbstractItemModel* Digikam::AbstractItemDragDropHandler::m_model
protectedinherited

◆ m_readOnly

bool Digikam::ItemDragDropHandler::m_readOnly
protected

Referenced by dropEvent(), and setReadOnlyDrop().


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