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.h

24 lines
665 B
C++

#pragma once
#include <QTextTableFormat>
#include <QTextTable>
class PrintableModel
{
public:
virtual void printTo(QTextCursor &cursor) const = 0;
protected:
static QTextTableFormat defaultTableFormat();
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));
}
};