24 #ifndef DIGIKAM_ITEM_DELEGATE_OVERLAY_H
25 #define DIGIKAM_ITEM_DELEGATE_OVERLAY_H
29 #include <QAbstractItemView>
38 class ItemViewHoverButton;
55 virtual void setActive(
bool active);
63 virtual void mouseMoved(QMouseEvent* e,
const QRect& visualRect,
const QModelIndex& index);
64 virtual void paint(QPainter* p,
const QStyleOptionViewItem& option,
const QModelIndex& index);
66 void setView(QAbstractItemView* view);
67 QAbstractItemView* view()
const;
69 void setDelegate(QAbstractItemDelegate* delegate);
70 QAbstractItemDelegate* delegate()
const;
76 void update(
const QModelIndex& index);
87 virtual void visualChange();
97 bool affectsMultiple(
const QModelIndex& index)
const;
99 int numberOfAffectedIndexes(
const QModelIndex& index)
const;
104 bool viewHasMultiSelection()
const;
112 #define REQUIRE_DELEGATE(Delegate) \
116 void setDelegate(Delegate* delegate) { ItemDelegateOverlay::setDelegate(delegate); } \
117 Delegate* delegate() const { return static_cast<Delegate*>(ItemDelegateOverlay::delegate()); } \
118 virtual bool acceptsDelegate(QAbstractItemDelegate*d) const override { return dynamic_cast<Delegate*>(d); } \
144 void setActive(
bool active)
override;
163 QWidget* parentWidget()
const;
169 virtual bool checkIndex(
const QModelIndex& index)
const;
175 virtual void viewportLeaveEvent(QObject* obj, QEvent* event);
181 virtual void widgetEnterEvent();
182 virtual void widgetLeaveEvent();
187 void widgetEnterNotifyMultiple(
const QModelIndex& index);
188 void widgetLeaveNotifyMultiple();
189 virtual QString notifyMultipleMessage(
const QModelIndex&,
int number);
194 bool checkIndexOnEnter(
const QModelIndex& index)
const;
201 virtual void slotEntered(
const QModelIndex& index);
206 virtual void slotReset();
207 virtual void slotViewportEntered();
208 virtual void slotRowsRemoved(
const QModelIndex& parent,
int start,
int end);
209 virtual void slotLayoutChanged();
213 bool eventFilter(QObject* obj, QEvent* event)
override;
235 void setActive(
bool active)
override;
252 QWidget* createWidget()
override;
253 void visualChange()
override;
257 void slotEntered(
const QModelIndex& index)
override;
258 void slotReset()
override;
279 void setActive(
bool active)
override;
281 bool isPersistent()
const;
289 void setPersistent(
bool persistent);
290 void enterPersistentMode();
291 void leavePersistentMode();
297 QModelIndex index()
const;
305 void slotEntered(
const QModelIndex& index)
override;
306 void slotReset()
override;
307 void slotViewportEntered()
override;
308 void slotRowsRemoved(
const QModelIndex& parent,
int start,
int end)
override;
309 void slotLayoutChanged()
override;
310 void viewportLeaveEvent(QObject* obj, QEvent* event)
override;
311 void hide()
override;
317 virtual void setFocusOnWidget();
320 virtual void showOnIndex(
const QModelIndex& index);
349 void setAllOverlaysActive(
bool active);
350 void setViewOnAllOverlays(QAbstractItemView* view);
351 void removeAllOverlays();
352 void mouseMoved(QMouseEvent* e,
const QRect& visualRect,
const QModelIndex& index);
363 virtual void drawOverlays(QPainter* p,
const QStyleOptionViewItem& option,
const QModelIndex& index)
const;
366 virtual void overlayDestroyed(QObject* o);
Definition: itemdelegateoverlay.h:333
virtual QAbstractItemDelegate * asDelegate()=0
Returns the delegate, typically, the derived class.
ItemDelegateOverlayContainer()=default
QList< ItemDelegateOverlay * > m_overlays
Definition: itemdelegateoverlay.h:373
virtual ~ItemDelegateOverlayContainer()=default
Definition: itemdelegateoverlay.h:41
QAbstractItemView * m_view
Definition: itemdelegateoverlay.h:108
virtual bool acceptsDelegate(QAbstractItemDelegate *) const
Definition: itemdelegateoverlay.h:72
void update(const QModelIndex &index)
void requestNotification(const QModelIndex &index, const QString &message)
QAbstractItemDelegate * m_delegate
Definition: itemdelegateoverlay.h:109
Definition: datefolderview.cpp:43