Qt 5.10 Book Examples
Printer.h
Go to the documentation of this file.
1 // ======================================================================
2 // Printer.h
3 // ======================================================================
4 // This file is a part of the book
5 // "Qt 5.10 Professional programming with C++"
6 // http://qt-book.com
7 // ======================================================================
8 // Copyright (c) 2017 by Max Schlee
9 // ======================================================================
10 
11 #pragma once
12 
13 #include <QWidget>
14 
15 class QPrinter;
16 class QPaintDevice;
17 
18 // ======================================================================
19 class Printer : public QWidget {
20  Q_OBJECT
21 
22 private:
23  QPrinter* m_pprinter;
24 
25 protected:
26  virtual void paintEvent(QPaintEvent* pe );
27  void draw (QPaintDevice* ppd);
28 
29 public:
30  Printer(QWidget* pwgt = 0);
31  virtual ~Printer();
32 
33 public slots:
34  void slotPrint();
35 };
void draw(QPaintDevice *ppd)
Definition: Printer.cpp:45
void slotPrint()
Definition: Printer.cpp:34
Printer(QWidget *pwgt=0)
Definition: Printer.cpp:16
virtual void paintEvent(QPaintEvent *pe)
Definition: Printer.cpp:28
virtual ~Printer()
Definition: Printer.cpp:22