Implemented printing for late skills tests
This commit is contained in:
parent
f6c2da5edc
commit
98196e05d6
11 changed files with 100 additions and 11 deletions
|
@ -172,7 +172,7 @@ void CheckableTestModel::printTableTo(QTextCursor &cursor) const
|
|||
currentColumn++;
|
||||
}
|
||||
|
||||
setCellText(*table, currentRow + 1, 12, QString::number(test.getPoints()));
|
||||
setCellNumber(*table, currentRow + 1, 12, test.getPoints());
|
||||
|
||||
currentRow += 2;
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ void CheckableTestModel::printSummaryTo(QTextCursor &cursor) const
|
|||
QTextTable *table = cursor.insertTable(1, 4, tableFormat);
|
||||
|
||||
setCellText(*table, 0, 1, "Rohwertpunkte Total:");
|
||||
setCellText(*table, 0, 3, QString::number(getPoints()));
|
||||
setCellNumber(*table, 0, 3, getPoints());
|
||||
}
|
||||
|
||||
void CheckableTestModel::setCellText(QTextTable &table, int row, int column, const QString &text)
|
||||
|
|
|
@ -41,6 +41,12 @@ protected:
|
|||
static void setCellText(QTextTable &table, int row, int column, const QString &text);
|
||||
static void setCellChecked(QTextTable &table, int row, int column, bool check);
|
||||
|
||||
template <typename NumberType>
|
||||
static void setCellNumber(QTextTable &table, int row, int column, const NumberType &number)
|
||||
{
|
||||
setCellText(table, row, column, QString::number(number));
|
||||
}
|
||||
|
||||
private:
|
||||
CheckableItems &getItems(const QModelIndex &index);
|
||||
const CheckableItems &getItems(const QModelIndex &index) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue