19#include <QAbstractItemView>
28class ItemViewHoverButton;
45 virtual void setActive(
bool active);
53 virtual void mouseMoved(QMouseEvent* e,
const QRect& visualRect,
const QModelIndex& index);
54 virtual void paint(QPainter* p,
const QStyleOptionViewItem& option,
const QModelIndex& index);
56 void setView(QAbstractItemView* view);
57 QAbstractItemView* view()
const;
59 void setDelegate(QAbstractItemDelegate* delegate);
60 QAbstractItemDelegate* delegate()
const;
66 void update(
const QModelIndex& index);
77 virtual void visualChange();
87 bool affectsMultiple(
const QModelIndex& index)
const;
88 QList<QModelIndex> affectedIndexes(
const QModelIndex& index)
const;
89 int numberOfAffectedIndexes(
const QModelIndex& index)
const;
94 bool viewHasMultiSelection()
const;
98 QAbstractItemView* m_view =
nullptr;
99 QAbstractItemDelegate* m_delegate =
nullptr;
102#define REQUIRE_DELEGATE(Delegate) \
106 void setDelegate(Delegate* delegate) { ItemDelegateOverlay::setDelegate(delegate); } \
107 Delegate* delegate() const { return static_cast<Delegate*>(ItemDelegateOverlay::delegate()); } \
108 virtual bool acceptsDelegate(QAbstractItemDelegate*d) const override { return dynamic_cast<Delegate*>(d); } \
134 void setActive(
bool active)
override;
153 QWidget* parentWidget()
const;
159 virtual bool checkIndex(
const QModelIndex& index)
const;
165 virtual void viewportLeaveEvent(QObject* obj, QEvent* event);
171 virtual void widgetEnterEvent();
172 virtual void widgetLeaveEvent();
177 void widgetEnterNotifyMultiple(
const QModelIndex& index);
178 void widgetLeaveNotifyMultiple();
179 virtual QString notifyMultipleMessage(
const QModelIndex&,
int number);
184 bool checkIndexOnEnter(
const QModelIndex& index)
const;
191 virtual void slotEntered(
const QModelIndex& index);
196 virtual void slotReset();
197 virtual void slotViewportEntered();
198 virtual void slotRowsRemoved(
const QModelIndex& parent,
int start,
int end);
199 virtual void slotLayoutChanged();
203 bool eventFilter(QObject* obj, QEvent* event)
override;
207 QWidget* m_widget =
nullptr;
209 bool m_mouseButtonPressedOnWidget =
false;
225 void setActive(
bool active)
override;
242 QWidget* createWidget()
override;
243 void visualChange()
override;
247 void slotEntered(
const QModelIndex& index)
override;
248 void slotReset()
override;
269 void setActive(
bool active)
override;
271 bool isPersistent()
const;
279 void setPersistent(
bool persistent);
280 void enterPersistentMode();
281 void leavePersistentMode();
287 QModelIndex index()
const;
295 void slotEntered(
const QModelIndex& index)
override;
296 void slotReset()
override;
297 void slotViewportEntered()
override;
298 void slotRowsRemoved(
const QModelIndex& parent,
int start,
int end)
override;
299 void slotLayoutChanged()
override;
300 void viewportLeaveEvent(QObject* obj, QEvent* event)
override;
301 void hide()
override;
307 virtual void setFocusOnWidget();
310 virtual void showOnIndex(
const QModelIndex& index);
317 Private*
const d =
nullptr;
335 QList<ItemDelegateOverlay*> overlays()
const;
339 void setAllOverlaysActive(
bool active);
340 void setViewOnAllOverlays(QAbstractItemView* view);
341 void removeAllOverlays();
342 void mouseMoved(QMouseEvent* e,
const QRect& visualRect,
const QModelIndex& index);
347 void requestNotification(const QModelIndex& index, const QString& message);
348 void hideNotification();
353 virtual void drawOverlays(QPainter* p,
const QStyleOptionViewItem& option,
const QModelIndex& index)
const;
356 virtual void overlayDestroyed(QObject* o);
Definition itemdelegateoverlay.h:323
virtual QAbstractItemDelegate * asDelegate()=0
Returns the delegate, typically, the derived class.
ItemDelegateOverlayContainer()=default
QList< ItemDelegateOverlay * > m_overlays
Definition itemdelegateoverlay.h:363
virtual ~ItemDelegateOverlayContainer()=default
Definition itemdelegateoverlay.h:31
virtual bool acceptsDelegate(QAbstractItemDelegate *) const
Definition itemdelegateoverlay.h:62
~ItemDelegateOverlay() override=default
void update(const QModelIndex &index)
void requestNotification(const QModelIndex &index, const QString &message)
Definition datefolderview.cpp:34