![]() |
digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
|
Public Member Functions | |
AbstractWidgetDelegateOverlay (QObject *const parent) | |
This class provides functionality for using a widget in an overlay. | |
void | setActive (bool active) override |
If active is true, this will call createWidget(), initialize the widget for use, and setup connections for the virtual slots. | |
![]() | |
ItemDelegateOverlay (QObject *const parent=nullptr) | |
virtual bool | acceptsDelegate (QAbstractItemDelegate *) const |
QAbstractItemDelegate * | delegate () const |
virtual void | mouseMoved (QMouseEvent *e, const QRect &visualRect, const QModelIndex &index) |
Only these two methods are implemented as virtual methods. | |
virtual void | paint (QPainter *p, const QStyleOptionViewItem &option, const QModelIndex &index) |
void | setDelegate (QAbstractItemDelegate *delegate) |
void | setView (QAbstractItemView *view) |
QAbstractItemView * | view () const |
Protected Slots | |
virtual void | slotEntered (const QModelIndex &index) |
Default implementation shows the widget iff the index is valid and checkIndex returns true. | |
virtual void | slotLayoutChanged () |
virtual void | slotReset () |
Default implementations of these three slots call hide() | |
virtual void | slotRowsRemoved (const QModelIndex &parent, int start, int end) |
virtual void | slotViewportEntered () |
![]() | |
virtual void | visualChange () |
Called when any change from the delegate occurs - when the overlay is installed, when size hints, styles or fonts change. | |
Protected Member Functions | |
virtual bool | checkIndex (const QModelIndex &index) const |
bool | checkIndexOnEnter (const QModelIndex &index) const |
Utility method called from slotEntered. | |
virtual QWidget * | createWidget ()=0 |
Create your widget here. | |
bool | eventFilter (QObject *obj, QEvent *event) override |
virtual void | hide () |
Called when the widget shall be hidden (mouse cursor left index, viewport, uninstalled etc.). | |
virtual QString | notifyMultipleMessage (const QModelIndex &, int number) |
QWidget * | parentWidget () const |
virtual void | viewportLeaveEvent (QObject *obj, QEvent *event) |
Called when a QEvent::Leave of the viewport is received. | |
virtual void | widgetEnterEvent () |
Called when a QEvent::Enter resp. | |
void | widgetEnterNotifyMultiple (const QModelIndex &index) |
A sample implementation for above methods. | |
virtual void | widgetLeaveEvent () |
void | widgetLeaveNotifyMultiple () |
![]() | |
QList< QModelIndex > | affectedIndexes (const QModelIndex &index) const |
bool | affectsMultiple (const QModelIndex &index) const |
For the context that an overlay can affect multiple items: Assuming the currently overlayed index is given. | |
int | numberOfAffectedIndexes (const QModelIndex &index) const |
bool | viewHasMultiSelection () const |
Utility method. | |
Protected Attributes | |
bool | m_mouseButtonPressedOnWidget = false |
QWidget * | m_widget = nullptr |
![]() | |
QAbstractItemDelegate * | m_delegate = nullptr |
QAbstractItemView * | m_view = nullptr |
Additional Inherited Members | |
![]() | |
void | hideNotification () |
void | requestNotification (const QModelIndex &index, const QString &message) |
void | update (const QModelIndex &index) |
|
explicit |
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.
|
protectedvirtual |
Reimplemented in Digikam::AssignNameOverlay, Digikam::FaceRejectionOverlay, Digikam::GroupIndicatorOverlay, Digikam::ItemCoordinatesOverlay, Digikam::ItemFullScreenOverlay, Digikam::ItemRotateOverlay, Digikam::ShowHideVersionsOverlay, Digikam::ActionVersionsOverlay, ShowFoto::ShowfotoCoordinatesOverlay, Digikam::ImportCoordinatesOverlay, Digikam::ImportLockOverlay, Digikam::ImportDownloadOverlay, and Digikam::ImportRotateOverlay.
|
protectedpure virtual |
When creating the object, pass parentWidget() as parent widget. Ownership of the object is passed. It will be deleted in setActive(false).
Implemented in Digikam::AssignNameOverlay, Digikam::GroupIndicatorOverlay, Digikam::ItemCoordinatesOverlay, Digikam::ItemRatingOverlay, Digikam::TagsLineEditOverlay, Digikam::HoverButtonDelegateOverlay, ShowFoto::ShowfotoCoordinatesOverlay, Digikam::ImportCoordinatesOverlay, Digikam::ImportLockOverlay, Digikam::ImportDownloadOverlay, and Digikam::ImportRatingOverlay.
|
protectedvirtual |
Default implementation hide()s m_widget.
Reimplemented in Digikam::ItemRatingOverlay, Digikam::TagsLineEditOverlay, Digikam::PersistentWidgetDelegateOverlay, and Digikam::ImportRatingOverlay.
|
protected |
|
overridevirtual |
If active is false, this will delete the widget and disconnect all signal from model and view to this object (!)
Reimplemented from Digikam::ItemDelegateOverlay.
Reimplemented in Digikam::FaceRejectionOverlay, Digikam::ItemCoordinatesOverlay, Digikam::ItemFullScreenOverlay, Digikam::ItemRotateOverlay, Digikam::ItemSelectionOverlay, Digikam::ShowHideVersionsOverlay, Digikam::ActionVersionsOverlay, Digikam::HoverButtonDelegateOverlay, Digikam::PersistentWidgetDelegateOverlay, ShowFoto::ShowfotoCoordinatesOverlay, Digikam::ImportCoordinatesOverlay, Digikam::ImportLockOverlay, Digikam::ImportDownloadOverlay, Digikam::ImportRotateOverlay, Digikam::AssignNameOverlay, Digikam::GroupIndicatorOverlay, Digikam::ItemRatingOverlay, Digikam::TagsLineEditOverlay, and Digikam::ImportRatingOverlay.
|
protectedvirtualslot |
Reimplemented in Digikam::GroupIndicatorOverlay, Digikam::ItemCoordinatesOverlay, Digikam::ItemRatingOverlay, Digikam::TagsLineEditOverlay, Digikam::PersistentWidgetDelegateOverlay, ShowFoto::ShowfotoCoordinatesOverlay, Digikam::ImportCoordinatesOverlay, Digikam::ImportLockOverlay, Digikam::ImportDownloadOverlay, and Digikam::ImportRatingOverlay.
|
protectedvirtualslot |
Reimplemented in Digikam::PersistentWidgetDelegateOverlay.
|
protectedvirtual |
The default implementation hide()s.
Reimplemented in Digikam::AssignNameOverlay, and Digikam::PersistentWidgetDelegateOverlay.
|
protectedvirtual |
QEvent::Leave event for the widget is received. The default implementation does nothing.
Reimplemented in Digikam::AssignNameOverlay, Digikam::FaceRejectionOverlay, Digikam::ItemFullScreenOverlay, Digikam::ItemRatingOverlay, Digikam::ItemRotateOverlay, Digikam::ImportRatingOverlay, and Digikam::ImportRotateOverlay.