BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
The result model of a AutomaticDataLoader1D (for showing the import results in a table view). More...
Public Types | |
enum class | ColumnType { none , line , fileContent , raw , processed , error } |
Public Member Functions | |
AutomaticDataLoader1DResultModel (RealDataItem *item) | |
virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
virtual int | rowCount (const QModelIndex &parent) const override |
QVector< int > | sectionsOfColumnType (ColumnType type) const |
The table header sections which belong to the given column type. More... | |
Protected Member Functions | |
virtual QString | cellText (ColumnType type, int row, int col) const override |
The text of the given cell. More... | |
virtual int | columnCount (ColumnType type) const override |
The number of existing columns related to the given column type. More... | |
virtual QString | headerTextOfCalculatedColumn (int column) const override |
Return the table header text for the given column. More... | |
virtual int | rowCount () const override |
The row count of the result table. More... | |
virtual bool | rowHasError (const QModelIndex &index) const |
Returns whether the row given in the index contains errors. More... | |
virtual bool | rowHasError (int row) const override |
Returns whether the row given in the index contains errors. Row counting starts with 0. More... | |
virtual bool | rowIsSkipped (const QModelIndex &index) const |
Returns whether the row given in the index is a skipped row. More... | |
virtual bool | rowIsSkipped (int row) const override |
Returns whether the row given in the index is a skipped row. Row counting starts with 0. More... | |
Private Member Functions | |
ColumnType | columnType (const QModelIndex &index) const |
Calculates the column type of the given index. More... | |
ColumnType | columnType (int section) const |
Calculates the column type of the real header view section. More... | |
int | firstSectionOfColumnType (ColumnType type) const |
Calculates the first real header view section of the given column type. More... | |
int | lastSectionOfColumnType (ColumnType type) const |
Calculates the last real header view section of the given column type. More... | |
Private Attributes | |
RealDataItem * | m_item |
QIcon | m_warningIcon |
The result model of a AutomaticDataLoader1D (for showing the import results in a table view).
Definition at line 23 of file AutomaticDataLoader1DResultModel.h.
|
stronginherited |
Enumerator | |
---|---|
none | |
line | |
fileContent | |
raw | |
processed | |
error |
Definition at line 26 of file AbstractDataLoaderResultModel.h.
AutomaticDataLoader1DResultModel::AutomaticDataLoader1DResultModel | ( | RealDataItem * | item | ) |
Definition at line 19 of file AutomaticDataLoader1DResultModel.cpp.
|
overrideprotectedvirtual |
The text of the given cell.
For convenience, column starts at 0 for the given column type, therefore it is not the same as the "real" section in the table header. This method will not be called for every row/column present in the table. Instead, optimizations will be done before calling it. E.g. the calculated values for lines which contain errors will never be called. Also raw or calculated contents will not be queried if a line is skipped.
Implements AbstractDataLoaderResultModel.
Definition at line 59 of file AutomaticDataLoader1DResultModel.cpp.
References AbstractDataLoaderResultModel::data(), DataItem::getOutputData(), m_item, AbstractDataLoaderResultModel::processed, rowCount(), and RealDataItem::specularDataItem().
|
overrideprotectedvirtual |
The number of existing columns related to the given column type.
0 if the type is not present at all.
Implements AbstractDataLoaderResultModel.
Definition at line 54 of file AutomaticDataLoader1DResultModel.cpp.
References AbstractDataLoaderResultModel::processed.
|
overridevirtualinherited |
Definition at line 42 of file AbstractDataLoaderResultModel.cpp.
References AbstractDataLoaderResultModel::error, AbstractDataLoaderResultModel::fileContent, AbstractDataLoaderResultModel::line, AbstractDataLoaderResultModel::processed, and AbstractDataLoaderResultModel::raw.
Referenced by AbstractDataLoaderResultModel::firstSectionOfColumnType(), and AbstractDataLoaderResultModel::lastSectionOfColumnType().
|
privateinherited |
Calculates the column type of the given index.
Definition at line 193 of file AbstractDataLoaderResultModel.cpp.
Referenced by AbstractDataLoaderResultModel::data(), and AbstractDataLoaderResultModel::headerData().
|
privateinherited |
Calculates the column type of the real header view section.
Definition at line 175 of file AbstractDataLoaderResultModel.cpp.
References AbstractDataLoaderResultModel::error, AbstractDataLoaderResultModel::fileContent, AbstractDataLoaderResultModel::firstSectionOfColumnType(), AbstractDataLoaderResultModel::lastSectionOfColumnType(), AbstractDataLoaderResultModel::line, AbstractDataLoaderResultModel::none, AbstractDataLoaderResultModel::processed, and AbstractDataLoaderResultModel::raw.
|
overridevirtualinherited |
Definition at line 62 of file AbstractDataLoaderResultModel.cpp.
References AbstractDataLoaderResultModel::cellText(), AbstractDataLoaderResultModel::columnType(), SessionItemUtils::DecorationRole(), AbstractDataLoaderResultModel::error, AbstractDataLoaderResultModel::fileContent, AbstractDataLoaderResultModel::firstSectionOfColumnType(), SessionItemUtils::ForegroundRole(), AbstractDataLoaderResultModel::line, AbstractDataLoaderResultModel::m_warningIcon, AbstractDataLoaderResultModel::processed, AbstractDataLoaderResultModel::raw, AbstractDataLoaderResultModel::rowHasError(), AbstractDataLoaderResultModel::rowIsSkipped(), and SessionItemUtils::ToolTipRole().
Referenced by cellText(), and rowCount().
|
privateinherited |
Calculates the first real header view section of the given column type.
Returns -1 if the column type does not exist.
Definition at line 198 of file AbstractDataLoaderResultModel.cpp.
References AbstractDataLoaderResultModel::columnCount(), AbstractDataLoaderResultModel::error, AbstractDataLoaderResultModel::fileContent, AbstractDataLoaderResultModel::line, AbstractDataLoaderResultModel::processed, and AbstractDataLoaderResultModel::raw.
Referenced by AbstractDataLoaderResultModel::columnType(), AbstractDataLoaderResultModel::data(), AbstractDataLoaderResultModel::headerData(), AbstractDataLoaderResultModel::lastSectionOfColumnType(), and AbstractDataLoaderResultModel::sectionsOfColumnType().
|
overridevirtualinherited |
Definition at line 138 of file AbstractDataLoaderResultModel.cpp.
References AbstractDataLoaderResultModel::columnType(), AbstractDataLoaderResultModel::error, AbstractDataLoaderResultModel::fileContent, AbstractDataLoaderResultModel::firstSectionOfColumnType(), AbstractDataLoaderResultModel::headerTextOfCalculatedColumn(), AbstractDataLoaderResultModel::line, AbstractDataLoaderResultModel::processed, and AbstractDataLoaderResultModel::raw.
|
overrideprotectedvirtual |
Return the table header text for the given column.
For convenience, column starts at 0 for first calculated column, therefore it is not the same as the "real" section in the table header.
Implements AbstractDataLoaderResultModel.
Definition at line 43 of file AutomaticDataLoader1DResultModel.cpp.
|
privateinherited |
Calculates the last real header view section of the given column type.
Returns -1 if the column type does not exist.
Definition at line 232 of file AbstractDataLoaderResultModel.cpp.
References AbstractDataLoaderResultModel::columnCount(), and AbstractDataLoaderResultModel::firstSectionOfColumnType().
Referenced by AbstractDataLoaderResultModel::columnType(), and AbstractDataLoaderResultModel::sectionsOfColumnType().
|
overrideprotectedvirtual |
The row count of the result table.
Implements AbstractDataLoaderResultModel.
Definition at line 29 of file AutomaticDataLoader1DResultModel.cpp.
References AbstractDataLoaderResultModel::data(), DataItem::getOutputData(), m_item, and RealDataItem::specularDataItem().
Referenced by cellText().
|
overridevirtualinherited |
Definition at line 57 of file AbstractDataLoaderResultModel.cpp.
References AbstractDataLoaderResultModel::rowCount().
|
protectedvirtualinherited |
Returns whether the row given in the index contains errors.
Only override this for performance reasons.
Definition at line 246 of file AbstractDataLoaderResultModel.cpp.
Referenced by AbstractDataLoaderResultModel::data().
|
overrideprotectedvirtual |
Returns whether the row given in the index contains errors. Row counting starts with 0.
Implements AbstractDataLoaderResultModel.
Definition at line 24 of file AutomaticDataLoader1DResultModel.cpp.
|
protectedvirtualinherited |
Returns whether the row given in the index is a skipped row.
Only override this for performance reasons.
Definition at line 241 of file AbstractDataLoaderResultModel.cpp.
Referenced by AbstractDataLoaderResultModel::data().
|
overrideprotectedvirtual |
Returns whether the row given in the index is a skipped row. Row counting starts with 0.
Implements AbstractDataLoaderResultModel.
Definition at line 38 of file AutomaticDataLoader1DResultModel.cpp.
|
inherited |
The table header sections which belong to the given column type.
Empty if this column type is not present at all.
Definition at line 163 of file AbstractDataLoaderResultModel.cpp.
References AbstractDataLoaderResultModel::firstSectionOfColumnType(), and AbstractDataLoaderResultModel::lastSectionOfColumnType().
Referenced by SpecularDataImportWidget::updatePreview().
|
private |
Definition at line 36 of file AutomaticDataLoader1DResultModel.h.
Referenced by cellText(), and rowCount().
|
privateinherited |
Definition at line 93 of file AbstractDataLoaderResultModel.h.
Referenced by AbstractDataLoaderResultModel::AbstractDataLoaderResultModel(), and AbstractDataLoaderResultModel::data().