ESGRAF48/source/PrintableModel.h

24 lines
665 B
C
Raw Permalink Normal View History

2018-12-15 15:12:20 +00:00
#pragma once
#include <QTextTableFormat>
2018-12-15 15:31:51 +00:00
#include <QTextTable>
2018-12-15 15:12:20 +00:00
class PrintableModel
{
public:
virtual void printTo(QTextCursor &cursor) const = 0;
protected:
static QTextTableFormat defaultTableFormat();
2018-12-15 15:31:51 +00:00
static void setCellText(QTextTable &table, int row, int column, const QString &text);
static void setCellChecked(QTextTable &table, int row, int column, bool check);
static void setCellBackground(QTextTable &table, int row, int column, const QColor &color);
template<typename NumberType>
static void setCellNumber(QTextTable &table, int row, int column, const NumberType &number)
{
setCellText(table, row, column, QString::number(number));
}
2018-12-15 15:12:20 +00:00
};