digiKam
Digikam::AbstractWidgetDelegateOverlay Class Referenceabstract
+ Inheritance diagram for Digikam::AbstractWidgetDelegateOverlay:

Signals

void hideNotification ()
 
void requestNotification (const QModelIndex &index, const QString &message)
 
void update (const QModelIndex &index)
 

Public Member Functions

 AbstractWidgetDelegateOverlay (QObject *const parent)
 
virtual bool acceptsDelegate (QAbstractItemDelegate *) const
 
QAbstractItemDelegate * delegate () const
 
virtual void mouseMoved (QMouseEvent *e, const QRect &visualRect, const QModelIndex &index)
 
virtual void paint (QPainter *p, const QStyleOptionViewItem &option, const QModelIndex &index)
 
void setActive (bool active) override
 
void setDelegate (QAbstractItemDelegate *delegate)
 
void setView (QAbstractItemView *view)
 
QAbstractItemView * view () const
 

Protected Slots

virtual void slotEntered (const QModelIndex &index)
 
virtual void slotLayoutChanged ()
 
virtual void slotReset ()
 
virtual void slotRowsRemoved (const QModelIndex &parent, int start, int end)
 
virtual void slotViewportEntered ()
 
virtual void visualChange ()
 

Protected Member Functions

QList< QModelIndex > affectedIndexes (const QModelIndex &index) const
 
bool affectsMultiple (const QModelIndex &index) const
 
virtual bool checkIndex (const QModelIndex &index) const
 
bool checkIndexOnEnter (const QModelIndex &index) const
 
virtual QWidget * createWidget ()=0
 
bool eventFilter (QObject *obj, QEvent *event) override
 
virtual void hide ()
 
virtual QString notifyMultipleMessage (const QModelIndex &, int number)
 
int numberOfAffectedIndexes (const QModelIndex &index) const
 
QWidget * parentWidget () const
 
bool viewHasMultiSelection () const
 
virtual void viewportLeaveEvent (QObject *obj, QEvent *event)
 
virtual void widgetEnterEvent ()
 
void widgetEnterNotifyMultiple (const QModelIndex &index)
 
virtual void widgetLeaveEvent ()
 
void widgetLeaveNotifyMultiple ()
 

Protected Attributes

QAbstractItemDelegate * m_delegate
 
bool m_mouseButtonPressedOnWidget
 
QAbstractItemView * m_view
 
QWidget * m_widget
 

Constructor & Destructor Documentation

◆ AbstractWidgetDelegateOverlay()

Digikam::AbstractWidgetDelegateOverlay::AbstractWidgetDelegateOverlay ( QObject *const  parent)
explicit

This class provides functionality for using a widget in an overlay. You must reimplement at least createWidget to return your widget. Per default it will be shown when the cursor enters an index and hidden when left. Reimplement slotEntered() and mouseMove() for more fine grained control.

Member Function Documentation

◆ acceptsDelegate()

virtual bool Digikam::ItemDelegateOverlay::acceptsDelegate ( QAbstractItemDelegate *  ) const
inlinevirtualinherited

◆ affectedIndexes()

◆ affectsMultiple()

bool Digikam::ItemDelegateOverlay::affectsMultiple ( const QModelIndex &  index) const
protectedinherited

For the context that an overlay can affect multiple items: Assuming the currently overlayed index is given. Will an operation affect only the single item, or multiple? If multiple, retrieve the affected selection.

References Digikam::ItemDelegateOverlay::view(), and Digikam::ItemDelegateOverlay::viewHasMultiSelection().

Referenced by Digikam::ItemDelegateOverlay::affectedIndexes(), Digikam::ItemDelegateOverlay::numberOfAffectedIndexes(), and widgetEnterNotifyMultiple().

◆ checkIndex()

◆ checkIndexOnEnter()

bool Digikam::AbstractWidgetDelegateOverlay::checkIndexOnEnter ( const QModelIndex &  index) const
protected

Utility method called from slotEntered

References checkIndex().

Referenced by slotEntered(), and Digikam::PersistentWidgetDelegateOverlay::slotEntered().

◆ createWidget()

virtual QWidget* Digikam::AbstractWidgetDelegateOverlay::createWidget ( )
protectedpure virtual

◆ delegate()

◆ eventFilter()

bool Digikam::AbstractWidgetDelegateOverlay::eventFilter ( QObject *  obj,
QEvent *  event 
)
overrideprotected

◆ hide()

void Digikam::AbstractWidgetDelegateOverlay::hide ( )
protectedvirtual

◆ hideNotification

void Digikam::ItemDelegateOverlay::hideNotification ( )
signalinherited

◆ mouseMoved()

void Digikam::ItemDelegateOverlay::mouseMoved ( QMouseEvent *  e,
const QRect &  visualRect,
const QModelIndex &  index 
)
virtualinherited

Only these two methods are implemented as virtual methods. For all other events, connect to the view's signals. There are a few signals specifically for overlays and all QAbstractItemView standard signals.

Referenced by Digikam::ItemDelegateOverlayContainer::mouseMoved().

◆ notifyMultipleMessage()

QString Digikam::AbstractWidgetDelegateOverlay::notifyMultipleMessage ( const QModelIndex &  ,
int  number 
)
protectedvirtual

◆ numberOfAffectedIndexes()

int Digikam::ItemDelegateOverlay::numberOfAffectedIndexes ( const QModelIndex &  index) const
protectedinherited

◆ paint()

void Digikam::ItemDelegateOverlay::paint ( QPainter *  p,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
)
virtualinherited

◆ parentWidget()

◆ requestNotification

void Digikam::ItemDelegateOverlay::requestNotification ( const QModelIndex &  index,
const QString &  message 
)
signalinherited

◆ setActive()

◆ setDelegate()

◆ setView()

◆ slotEntered

◆ slotLayoutChanged

void Digikam::AbstractWidgetDelegateOverlay::slotLayoutChanged ( )
protectedvirtualslot

◆ slotReset

void Digikam::AbstractWidgetDelegateOverlay::slotReset ( )
protectedvirtualslot

◆ slotRowsRemoved

void Digikam::AbstractWidgetDelegateOverlay::slotRowsRemoved ( const QModelIndex &  parent,
int  start,
int  end 
)
protectedvirtualslot

◆ slotViewportEntered

void Digikam::AbstractWidgetDelegateOverlay::slotViewportEntered ( )
protectedvirtualslot

◆ update

void Digikam::ItemDelegateOverlay::update ( const QModelIndex &  index)
signalinherited

◆ view()

◆ viewHasMultiSelection()

bool Digikam::ItemDelegateOverlay::viewHasMultiSelection ( ) const
protectedinherited

◆ viewportLeaveEvent()

void Digikam::AbstractWidgetDelegateOverlay::viewportLeaveEvent ( QObject *  obj,
QEvent *  event 
)
protectedvirtual

Called when a QEvent::Leave of the viewport is received. The default implementation hide()s.

Reimplemented in Digikam::PersistentWidgetDelegateOverlay, and Digikam::AssignNameOverlay.

References hide().

Referenced by eventFilter(), and Digikam::PersistentWidgetDelegateOverlay::viewportLeaveEvent().

◆ visualChange

void Digikam::ItemDelegateOverlay::visualChange ( )
protectedvirtualslotinherited

◆ widgetEnterEvent()

void Digikam::AbstractWidgetDelegateOverlay::widgetEnterEvent ( )
protectedvirtual

Called when a QEvent::Enter resp. QEvent::Leave event for the widget is received. The default implementation does nothing.

Reimplemented in Digikam::ImportRotateOverlay, Digikam::ImportRatingOverlay, Digikam::ItemRotateOverlay, Digikam::ItemRatingOverlay, Digikam::ItemFullScreenOverlay, Digikam::FaceRejectionOverlay, and Digikam::AssignNameOverlay.

Referenced by eventFilter().

◆ widgetEnterNotifyMultiple()

◆ widgetLeaveEvent()

◆ widgetLeaveNotifyMultiple()

Member Data Documentation

◆ m_delegate

QAbstractItemDelegate* Digikam::ItemDelegateOverlay::m_delegate
protectedinherited

◆ m_mouseButtonPressedOnWidget

bool Digikam::AbstractWidgetDelegateOverlay::m_mouseButtonPressedOnWidget
protected

Referenced by eventFilter().

◆ m_view

◆ m_widget

QWidget* Digikam::AbstractWidgetDelegateOverlay::m_widget
protected

Referenced by Digikam::TagsLineEditOverlay::addTagsLineEdit(), Digikam::HoverButtonDelegateOverlay::button(), Digikam::GroupIndicatorOverlay::buttonWidget(), Digikam::ItemCoordinatesOverlay::buttonWidget(), ShowFoto::ShowfotoCoordinatesOverlay::buttonWidget(), Digikam::ImportCoordinatesOverlay::buttonWidget(), Digikam::ImportLockOverlay::buttonWidget(), Digikam::ImportDownloadOverlay::buttonWidget(), Digikam::GroupIndicatorOverlay::checkIndex(), Digikam::ItemCoordinatesOverlay::checkIndex(), ShowFoto::ShowfotoCoordinatesOverlay::checkIndex(), Digikam::ImportCoordinatesOverlay::checkIndex(), Digikam::ImportLockOverlay::checkIndex(), Digikam::ImportDownloadOverlay::checkIndex(), eventFilter(), hide(), Digikam::TagsLineEditOverlay::hide(), Digikam::PersistentWidgetDelegateOverlay::hide(), Digikam::ItemRatingOverlay::ratingWidget(), Digikam::ImportRatingOverlay::ratingWidget(), setActive(), Digikam::PersistentWidgetDelegateOverlay::setFocusOnWidget(), Digikam::ItemRatingOverlay::slotDataChanged(), Digikam::ImportRatingOverlay::slotDataChanged(), slotEntered(), Digikam::ItemRatingOverlay::slotEntered(), Digikam::TagsLineEditOverlay::slotEntered(), Digikam::PersistentWidgetDelegateOverlay::slotEntered(), Digikam::ImportRatingOverlay::slotEntered(), Digikam::ItemRatingOverlay::slotRatingChanged(), Digikam::ImportRatingOverlay::slotRatingChanged(), Digikam::TagsLineEditOverlay::slotTagChanged(), Digikam::AssignNameOverlay::updatePosition(), Digikam::GroupIndicatorOverlay::updatePosition(), Digikam::ItemCoordinatesOverlay::updatePosition(), Digikam::ItemRatingOverlay::updatePosition(), Digikam::TagsLineEditOverlay::updatePosition(), ShowFoto::ShowfotoCoordinatesOverlay::updatePosition(), Digikam::ImportCoordinatesOverlay::updatePosition(), Digikam::ImportLockOverlay::updatePosition(), Digikam::ImportDownloadOverlay::updatePosition(), Digikam::ImportRatingOverlay::updatePosition(), Digikam::ItemRatingOverlay::updateRating(), Digikam::ImportRatingOverlay::updateRating(), Digikam::AssignNameOverlay::viewportLeaveEvent(), Digikam::AssignNameOverlay::visualChange(), Digikam::GroupIndicatorOverlay::visualChange(), Digikam::ItemCoordinatesOverlay::visualChange(), Digikam::ItemRatingOverlay::visualChange(), Digikam::TagsLineEditOverlay::visualChange(), Digikam::HoverButtonDelegateOverlay::visualChange(), ShowFoto::ShowfotoCoordinatesOverlay::visualChange(), Digikam::ImportCoordinatesOverlay::visualChange(), Digikam::ImportLockOverlay::visualChange(), Digikam::ImportDownloadOverlay::visualChange(), and Digikam::ImportRatingOverlay::visualChange().


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