15 #ifndef BORNAGAIN_GUI_VIEW_JOB_JOBLISTVIEWDELEGATE_H
16 #define BORNAGAIN_GUI_VIEW_JOB_JOBLISTVIEWDELEGATE_H
18 #include <QItemDelegate>
31 void paint(QPainter* painter,
const QStyleOptionViewItem& option,
32 const QModelIndex& index)
const override;
34 bool editorEvent(QEvent* event, QAbstractItemModel* model,
const QStyleOptionViewItem& option,
35 const QModelIndex& index)
override;
43 const QStyleOptionViewItem& option)
const;
JobStatus
The JobStatus enum lists the possible states of a job.
ViewDelegate to show progress bar JobQueuListView.
JobListViewDelegate(QWidget *parent)
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override
void cancelButtonClicked(const QModelIndex &index)
QRect getProgressBarRect(QRect optionRect) const
Returns rectangle for progress bar.
QStyle::State m_buttonState
QRect getTextRect(QRect optionRect) const
Returns rectangle for text.
QRect getButtonRect(QRect optionRect) const
Returns rectangle for button.
QMap< JobStatus, QColor > m_status_to_color
void drawCustomProjectBar(const JobItem *item, QPainter *painter, const QStyleOptionViewItem &option) const