13 #ifndef QmitkLabelToggleItemDelegate_h
14 #define QmitkLabelToggleItemDelegate_h
17 #include <QStyledItemDelegate>
53 bool editorEvent(QEvent* event, QAbstractItemModel* model,
const QStyleOptionViewItem& option,
54 const QModelIndex& index)
override;
62 void paint(QPainter* painter,
const QStyleOptionViewItem& option,
63 const QModelIndex& index)
const override;
71 QSize
sizeHint(
const QStyleOptionViewItem& option,
const QModelIndex& index)
const override;
#define MITKSEGMENTATIONUI_EXPORT
Item delegate for rendering and toggling boolean properties (e.g., visibility, lock) in a QmitkMultiL...
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
Returns the preferred size for the toggle icon.
QmitkLabelToggleItemDelegate(const QIcon &onIcon, const QIcon &offIcon, QObject *parent=nullptr)
Constructs the toggle item delegate with on/off icons.
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Paints the on or off icon based on the current value.
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override
Handles mouse click events to toggle the boolean property.