22 static QColor backgroundColorFileContent;
23 static QColor backgroundColorRawContent;
24 static QColor backgroundColorProcessedContent;
25 static QColor backgroundColorErrors;
26 static QColor skippedLineTextColor;
29 QColor Palette::backgroundColorFileContent(239, 237, 248);
30 QColor Palette::backgroundColorRawContent(247, 240, 210);
31 QColor Palette::backgroundColorProcessedContent(191, 232, 242);
32 QColor Palette::backgroundColorErrors(247, 140, 146);
33 QColor Palette::skippedLineTextColor(Qt::lightGray);
59 return parent.isValid() ? 0 :
rowCount();
70 if (role == Qt::BackgroundRole) {
73 return Palette::backgroundColorFileContent;
75 return Palette::backgroundColorFileContent;
77 return rowIsSkipped(index) ? QVariant() : Palette::backgroundColorRawContent;
81 : Palette::backgroundColorProcessedContent;
84 : Palette::backgroundColorErrors;
92 return Palette::skippedLineTextColor;
96 if (role == Qt::DisplayRole) {
99 return QString::number(index.row() + 1);
102 QString lineContent =
104 lineContent.replace(
"\t",
" --> ");
111 return cellText(colType, index.row(),
117 return cellText(colType, index.row(),
130 return QVariant(Qt::AlignRight | Qt::AlignVCenter);
141 if (role == Qt::DisplayRole && orientation == Qt::Horizontal) {
146 return "File content (text)";
148 return QString(
"Column %1 raw")
154 return "Parser warnings";
160 return QAbstractTableModel::headerData(section, orientation, role);
165 QVector<int> sections;
182 if (firstSection < 0)
204 return lineColumnCount > 0 ? 0 : -1;
211 return hasRawContent ? lineColumnCount + fileContentColumnCount : -1;
216 return hasProcessedContent
223 return hasParsingErrors
235 if (firstSection == -1)
Defines class AbstractDataLoaderResultModel.
virtual QString headerTextOfCalculatedColumn(int column) const =0
Return the table header text for the given column.
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
int firstSectionOfColumnType(ColumnType type) const
Calculates the first real header view section of the given column type.
AbstractDataLoaderResultModel()
QVector< int > sectionsOfColumnType(ColumnType type) const
The table header sections which belong to the given column type.
virtual bool rowIsSkipped(const QModelIndex &index) const
Returns whether the row given in the index is a skipped row.
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const override
virtual QString cellText(ColumnType type, int row, int column) const =0
The text of the given cell.
virtual bool rowHasError(const QModelIndex &index) const
Returns whether the row given in the index contains errors.
ColumnType columnType(const QModelIndex &index) const
Calculates the column type of the given index.
virtual int rowCount() const =0
The row count of the result table.
int lastSectionOfColumnType(ColumnType type) const
Calculates the last real header view section of the given column type.
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
QVariant DecorationRole(const SessionItem &item)
Returns tooltip for given item.
QVariant ToolTipRole(const SessionItem &item, int ncol=0)
Returns tooltip for given item.
QVariant ForegroundRole(const SessionItem &item)
Returns text color for given item.