This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
ESGRAF48/source/PrintableModel/PrintableModel.h

38 lines
967 B
C
Raw Normal View History

#pragma once
2019-02-03 18:53:51 +00:00
#include "CheckableTestModel.h"
#include <QPainter>
#include <QFont>
#include <QPen>
#include <QRect>
#include <QString>
2019-02-03 18:53:51 +00:00
class PrintableModel : public CheckableTestModel
{
2019-02-03 18:53:51 +00:00
Q_OBJECT
public:
2019-02-03 18:53:51 +00:00
PrintableModel(QObject *parent);
virtual void printTo(QPainter &painter) const;
static QFont h1Font();
static QFont h2Font();
static QFont tableFont();
static QPen tablePen();
static void drawTextSquare(QPainter &painter, const QRectF &cell, const QString &text);
static void drawCheckSquare(QPainter &painter, const QRectF &cell, bool checked);
static void drawResultSquare(QPainter &painter, double y, bool rightCell, unsigned int value);
static void drawGreySquare(QPainter &painter, const QRectF &cell);
2019-02-03 18:53:51 +00:00
protected:
static void drawHeader2(QPainter &painter, const QString &text);
virtual void printHeader(QPainter &painter) const;
virtual void printTests(QPainter &painter) const;
virtual void printSummary(QPainter &painter) const;
};