BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
ViewDelegate to show progress bar JobQueuListView. More...
Signals | |
void | cancelButtonClicked (const QModelIndex &index) |
Public Member Functions | |
JobListViewDelegate (QWidget *parent) | |
bool | editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) |
void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const |
Private Member Functions | |
void | drawCustomProjectBar (const JobItem *item, QPainter *painter, const QStyleOptionViewItem &option) const |
QRect | getButtonRect (QRect optionRect) const |
returns rectangle for button More... | |
QRect | getProgressBarRect (QRect optionRect) const |
returns rectangle for progress bar More... | |
QRect | getTextRect (QRect optionRect) const |
returns rectangle for text More... | |
Private Attributes | |
QStyle::State | m_buttonState |
QMap< QString, QColor > | m_status_to_color |
ViewDelegate to show progress bar JobQueuListView.
Definition at line 25 of file JobListViewDelegate.h.
JobListViewDelegate::JobListViewDelegate | ( | QWidget * | parent | ) |
Definition at line 26 of file JobListViewDelegate.cpp.
References m_buttonState, and m_status_to_color.
|
signal |
Referenced by editorEvent(), and JobListWidget::setModel().
|
private |
Definition at line 107 of file JobListViewDelegate.cpp.
References JobItem::getProgress(), getProgressBarRect(), JobItem::getStatus(), and m_status_to_color.
Referenced by paint().
bool JobListViewDelegate::editorEvent | ( | QEvent * | event, |
QAbstractItemModel * | model, | ||
const QStyleOptionViewItem & | option, | ||
const QModelIndex & | index | ||
) |
Definition at line 71 of file JobListViewDelegate.cpp.
References ASSERT, cancelButtonClicked(), getButtonRect(), JobModel::getJobItemForIndex(), JobItem::isRunning(), and m_buttonState.
|
private |
returns rectangle for button
Definition at line 154 of file JobListViewDelegate.cpp.
Referenced by editorEvent(), and paint().
|
private |
returns rectangle for progress bar
Definition at line 143 of file JobListViewDelegate.cpp.
Referenced by drawCustomProjectBar().
|
private |
returns rectangle for text
Definition at line 132 of file JobListViewDelegate.cpp.
Referenced by paint().
void JobListViewDelegate::paint | ( | QPainter * | painter, |
const QStyleOptionViewItem & | option, | ||
const QModelIndex & | index | ||
) | const |
Definition at line 36 of file JobListViewDelegate.cpp.
References ASSERT, drawCustomProjectBar(), getButtonRect(), JobModel::getJobItemForIndex(), getTextRect(), JobItem::isRunning(), SessionItem::itemName(), and m_buttonState.
|
private |
Definition at line 40 of file JobListViewDelegate.h.
Referenced by JobListViewDelegate(), editorEvent(), and paint().
|
private |
Definition at line 48 of file JobListViewDelegate.h.
Referenced by JobListViewDelegate(), and drawCustomProjectBar().