BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Provides decorations (text color, icons, etc) for SessionModel in SessionModelView context. More...
Public Member Functions | |
SessionDecorationModel (QObject *parent, SessionModel *model=nullptr) | |
QVariant | data (const QModelIndex &index, int role) const |
void | setSessionModel (SessionModel *model) |
Private Member Functions | |
QVariant | createIcon (const QModelIndex &index) const |
QVariant | textColor (const QModelIndex &index) const |
Returns text color. Disabled SessionItem's will appear in gray. More... | |
Private Attributes | |
SessionModel * | m_model |
Provides decorations (text color, icons, etc) for SessionModel in SessionModelView context.
It is implemented as identity proxy model, so it has one-to-one data structure as in source SessionModel.
Definition at line 27 of file SessionDecorationModel.h.
|
explicit |
Definition at line 84 of file SessionDecorationModel.cpp.
References setSessionModel().
|
private |
Definition at line 113 of file SessionDecorationModel.cpp.
References SessionModel::itemForIndex(), and m_model.
Referenced by data().
QVariant SessionDecorationModel::data | ( | const QModelIndex & | index, |
int | role | ||
) | const |
Definition at line 96 of file SessionDecorationModel.cpp.
References createIcon(), SessionItemUtils::DecorationRole(), SessionItemUtils::ForegroundRole(), and textColor().
void SessionDecorationModel::setSessionModel | ( | SessionModel * | model | ) |
Definition at line 90 of file SessionDecorationModel.cpp.
References m_model.
Referenced by ModelTreeView::ModelTreeView(), and SessionDecorationModel().
|
private |
Returns text color. Disabled SessionItem's will appear in gray.
Definition at line 123 of file SessionDecorationModel.cpp.
References SessionItem::isEnabled(), SessionModel::itemForIndex(), and m_model.
Referenced by data().
|
private |
Definition at line 40 of file SessionDecorationModel.h.
Referenced by createIcon(), setSessionModel(), and textColor().