Added fat lines around summary squares
This commit is contained in:
parent
ab862aeaf1
commit
1695174303
5 changed files with 67 additions and 15 deletions
|
@ -116,10 +116,12 @@ void V2SvkModel::printSummary(QPainter &painter, unsigned int v2Points, unsigned
|
|||
auto width = painter.device()->width();
|
||||
auto height = 1.5 * painter.fontMetrics().lineSpacing();
|
||||
|
||||
painter.drawText(0, 0, 0.85 * width, height, Qt::AlignRight | Qt::AlignVCenter,
|
||||
painter.drawText(0, 0, 0.91 * width, height, Qt::AlignRight | Qt::AlignVCenter,
|
||||
"Rohwertpunkte Total:");
|
||||
PrintableModel::drawResultSquare(painter, 0, false, v2Points);
|
||||
PrintableModel::drawResultSquare(painter, 0, true, svkPoints);
|
||||
|
||||
painter.setPen(resultPen());
|
||||
drawNumberSquare(painter, 0.93 * width, 0, v2Points);
|
||||
drawNumberSquare(painter, 0.97 * width, 0, svkPoints);
|
||||
|
||||
painter.translate(0, 3 * height);
|
||||
}
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
#include "VerbEndModel.h"
|
||||
|
||||
VerbEndModel::VerbEndModel(QObject *parent)
|
||||
: PrintableModel(parent)
|
||||
: PrintableModel(parent)
|
||||
{
|
||||
m_title = "Subtest 2: Verbendstellungsregel (VE)";
|
||||
|
||||
m_tests = { { "Telefonat",
|
||||
{ "Kausal", "Kausal", "Relativ", "Kausal",
|
||||
"Final", "Temporal", "Temporal" } },
|
||||
{ "Zaubertrick", { "Relativ", "Final", "Kausal", "Final",
|
||||
"Temporal", "Kausal", "Temporal" } },
|
||||
{ "Zauberregel", { "Temporal", "Kausal", "Final", "Relativ",
|
||||
"Temporal", "Relativ" } } };
|
||||
m_tests = {
|
||||
{"Telefonat", {"Kausal", "Kausal", "Relativ", "Kausal", "Final", "Temporal", "Temporal"}},
|
||||
{"Zaubertrick", {"Relativ", "Final", "Kausal", "Final", "Temporal", "Kausal", "Temporal"}},
|
||||
{"Zauberregel", {"Temporal", "Kausal", "Final", "Relativ", "Temporal", "Relativ"}}};
|
||||
}
|
||||
|
||||
void VerbEndModel::write(ESGRAF48::VerbEndModel &model) const
|
||||
|
@ -100,4 +97,32 @@ void VerbEndModel::read(const ESGRAF48::VerbEndModel &model)
|
|||
|
||||
emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
|
||||
}
|
||||
|
||||
|
||||
unsigned int VerbEndModel::getKausalPoints() const
|
||||
{
|
||||
auto points = [&](unsigned int testId, unsigned int itemId) {
|
||||
return m_tests.at(testId).items().at(itemId).points();
|
||||
};
|
||||
|
||||
return points(0, 0) + points(0, 1) + points(0, 3) + points(1, 2) + points(1, 5) + points(2, 1);
|
||||
}
|
||||
|
||||
void VerbEndModel::printSummary(QPainter &painter) const
|
||||
{
|
||||
painter.setFont(tableFont());
|
||||
|
||||
auto width = painter.device()->width();
|
||||
auto height = 1.5 * painter.fontMetrics().lineSpacing();
|
||||
|
||||
painter.drawText(0, 0, 0.71 * width, height, Qt::AlignRight | Qt::AlignVCenter,
|
||||
"Rohwertpunkte Kausalsätze:");
|
||||
painter.drawText(0, 0, 0.95 * width, height, Qt::AlignRight | Qt::AlignVCenter,
|
||||
"Rohwertpunkte Total:");
|
||||
|
||||
drawNumberSquare(painter, 0.73 * width, 0, getKausalPoints());
|
||||
|
||||
painter.setPen(resultPen());
|
||||
drawNumberSquare(painter, 0.97 * width, 0, getKausalPoints());
|
||||
|
||||
painter.translate(0, 3 * height);
|
||||
}
|
||||
|
|
|
@ -12,4 +12,9 @@ public:
|
|||
|
||||
void write(ESGRAF48::VerbEndModel &model) const;
|
||||
void read(const ESGRAF48::VerbEndModel &model);
|
||||
|
||||
unsigned int getKausalPoints() const;
|
||||
|
||||
protected:
|
||||
void printSummary(QPainter &painter) const override;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue