Sun, 13 Mar 2022 22:56:22 +0100
After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
#ifndef _PRINTERDIALOG_H #define _PRINTERDIALOG_H #include <QDialog> #include <QPrinter> #include <QPainter> enum JobType { PR_SUPPLIES, PR_YEASTBANK }; namespace Ui { class PrinterDialog; } class PrinterDialog : public QDialog { Q_OBJECT public: /** * @brief Construct a new Printer Dialog * @param parent */ explicit PrinterDialog(int job, int rec, QWidget *parent = 0); /** * @brief Destroy the Printer Dialog */ ~PrinterDialog(); public slots: void printDocument(QPrinter *printer); private: int p_job; int p_rec; void printHeader(QPainter *painter, QString title); }; #endif