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

Public Slots

void enterPersistentMode ()
 
void leavePersistentMode ()
 
void setPersistent (bool persistent)
 
void storeFocus ()
 

Signals

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

Public Member Functions

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

Protected Slots

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
 
void hide () override
 
QModelIndex index () const
 
virtual QString notifyMultipleMessage (const QModelIndex &, int number)
 
int numberOfAffectedIndexes (const QModelIndex &index) const
 
QWidget * parentWidget () const
 
void restoreFocus ()
 
virtual void setFocusOnWidget ()
 
virtual void showOnIndex (const QModelIndex &index)
 see slotEntered() More...
 
void slotEntered (const QModelIndex &index) override
 
void slotLayoutChanged () override
 
void slotReset () override
 
void slotRowsRemoved (const QModelIndex &parent, int start, int end) override
 
void slotViewportEntered () override
 
bool viewHasMultiSelection () const
 
void viewportLeaveEvent (QObject *obj, QEvent *event) override
 
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

◆ PersistentWidgetDelegateOverlay()

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

This class offers additional / modified behavior: When a "persistent" mode is entered, it will not move by mouse hover, but stay and only move on mouse click. If the overlay widget had focus, it will be restored on show.

◆ ~PersistentWidgetDelegateOverlay()

Digikam::PersistentWidgetDelegateOverlay::~PersistentWidgetDelegateOverlay ( )
override

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 Digikam::AbstractWidgetDelegateOverlay::widgetEnterNotifyMultiple().

◆ checkIndex()

◆ checkIndexOnEnter()

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

◆ createWidget()

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

◆ delegate()

◆ enterPersistentMode

void Digikam::PersistentWidgetDelegateOverlay::enterPersistentMode ( )
slot

◆ eventFilter()

◆ hide()

void Digikam::PersistentWidgetDelegateOverlay::hide ( )
overrideprotectedvirtual

Called when the widget shall be hidden (mouse cursor left index, viewport, uninstalled etc.). Default implementation hide()s m_widget.

Reimplemented from Digikam::AbstractWidgetDelegateOverlay.

References Digikam::AbstractWidgetDelegateOverlay::hide(), and Digikam::AbstractWidgetDelegateOverlay::m_widget.

Referenced by Digikam::AssignNameOverlay::hide(), setPersistent(), and slotEntered().

◆ hideNotification

void Digikam::ItemDelegateOverlay::hideNotification ( )
signalinherited

◆ index()

◆ isPersistent()

bool Digikam::PersistentWidgetDelegateOverlay::isPersistent ( ) const

◆ leavePersistentMode

void Digikam::PersistentWidgetDelegateOverlay::leavePersistentMode ( )
slot

◆ 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 
)
protectedvirtualinherited

◆ 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

◆ restoreFocus()

void Digikam::PersistentWidgetDelegateOverlay::restoreFocus ( )
protected

References setFocusOnWidget().

Referenced by showOnIndex().

◆ setActive()

void Digikam::PersistentWidgetDelegateOverlay::setActive ( bool  active)
overridevirtual

If active is true, this will call createWidget(), initialize the widget for use, and setup connections for the virtual slots. If active is false, this will delete the widget and disconnect all signal from model and view to this object (!)

Reimplemented from Digikam::AbstractWidgetDelegateOverlay.

References leavePersistentMode(), Digikam::ItemDelegateOverlay::m_view, and Digikam::AbstractWidgetDelegateOverlay::setActive().

Referenced by Digikam::AssignNameOverlay::setActive().

◆ setDelegate()

◆ setFocusOnWidget()

void Digikam::PersistentWidgetDelegateOverlay::setFocusOnWidget ( )
protectedvirtual

Reimplement to set the focus on the correct subwidget. Default implementation sets focus on widget()

Reimplemented in Digikam::AssignNameOverlay.

References Digikam::AbstractWidgetDelegateOverlay::m_widget.

Referenced by restoreFocus().

◆ setPersistent

void Digikam::PersistentWidgetDelegateOverlay::setPersistent ( bool  persistent)
slot

Enters persistent mode. The overlay is moved because of mouse hover.

References hide(), showOnIndex(), and slotEntered().

Referenced by enterPersistentMode(), leavePersistentMode(), slotLayoutChanged(), slotReset(), slotRowsRemoved(), and viewportLeaveEvent().

◆ setView()

◆ showOnIndex()

void Digikam::PersistentWidgetDelegateOverlay::showOnIndex ( const QModelIndex &  index)
protectedvirtual

◆ slotEntered()

void Digikam::PersistentWidgetDelegateOverlay::slotEntered ( const QModelIndex &  index)
overrideprotectedvirtual

Most overlays reimplement this slot to get the starting point for repositioning a widget etc. This class instead provides showOnIndex() which you shall use for this purpose.

Reimplemented from Digikam::AbstractWidgetDelegateOverlay.

References Digikam::AbstractWidgetDelegateOverlay::checkIndexOnEnter(), hide(), index(), Digikam::AbstractWidgetDelegateOverlay::m_widget, and showOnIndex().

Referenced by setPersistent().

◆ slotLayoutChanged()

void Digikam::PersistentWidgetDelegateOverlay::slotLayoutChanged ( )
overrideprotectedvirtual

◆ slotReset()

void Digikam::PersistentWidgetDelegateOverlay::slotReset ( )
overrideprotectedvirtual

Default implementations of these three slots call hide()

Reimplemented from Digikam::AbstractWidgetDelegateOverlay.

References setPersistent(), and Digikam::AbstractWidgetDelegateOverlay::slotReset().

◆ slotRowsRemoved()

void Digikam::PersistentWidgetDelegateOverlay::slotRowsRemoved ( const QModelIndex &  parent,
int  start,
int  end 
)
overrideprotectedvirtual

◆ slotViewportEntered()

void Digikam::PersistentWidgetDelegateOverlay::slotViewportEntered ( )
overrideprotectedvirtual

◆ storeFocus

void Digikam::PersistentWidgetDelegateOverlay::storeFocus ( )
slot

◆ update

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

◆ view()

◆ viewHasMultiSelection()

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

◆ viewportLeaveEvent()

void Digikam::PersistentWidgetDelegateOverlay::viewportLeaveEvent ( QObject *  obj,
QEvent *  event 
)
overrideprotectedvirtual

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

Reimplemented from Digikam::AbstractWidgetDelegateOverlay.

References setPersistent(), and Digikam::AbstractWidgetDelegateOverlay::viewportLeaveEvent().

Referenced by Digikam::AssignNameOverlay::viewportLeaveEvent().

◆ visualChange

void Digikam::ItemDelegateOverlay::visualChange ( )
protectedvirtualslotinherited

◆ widgetEnterEvent()

void Digikam::AbstractWidgetDelegateOverlay::widgetEnterEvent ( )
protectedvirtualinherited

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 Digikam::AbstractWidgetDelegateOverlay::eventFilter().

◆ widgetEnterNotifyMultiple()

◆ widgetLeaveEvent()

◆ widgetLeaveNotifyMultiple()

Member Data Documentation

◆ m_delegate

QAbstractItemDelegate* Digikam::ItemDelegateOverlay::m_delegate
protectedinherited

◆ m_mouseButtonPressedOnWidget

bool Digikam::AbstractWidgetDelegateOverlay::m_mouseButtonPressedOnWidget
protectedinherited

◆ m_view

◆ m_widget

QWidget* Digikam::AbstractWidgetDelegateOverlay::m_widget
protectedinherited

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(), Digikam::AbstractWidgetDelegateOverlay::eventFilter(), Digikam::AbstractWidgetDelegateOverlay::hide(), Digikam::TagsLineEditOverlay::hide(), hide(), Digikam::ItemRatingOverlay::ratingWidget(), Digikam::ImportRatingOverlay::ratingWidget(), Digikam::AbstractWidgetDelegateOverlay::setActive(), setFocusOnWidget(), Digikam::ItemRatingOverlay::slotDataChanged(), Digikam::ImportRatingOverlay::slotDataChanged(), Digikam::AbstractWidgetDelegateOverlay::slotEntered(), Digikam::ItemRatingOverlay::slotEntered(), Digikam::TagsLineEditOverlay::slotEntered(), 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: