glbarcode++
 
Loading...
Searching...
No Matches
QtRenderer.hpp
Go to the documentation of this file.
1// QtRenderer.hpp
2//
3// Copyright (C) 2017-2026 Jaye Evins <evins@snaught.com>
4//
5// This file is part of glbarcode++.
6//
7// glbarcode++ is free software: you can redistribute it and/or modify
8// it under the terms of the GNU Lesser General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// glbarcode++ is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU Lesser General Public License for more details.
16//
17// You should have received a copy of the GNU Lesser General Public License
18// along with glbarcode++. If not, see <http://www.gnu.org/licenses/>.
19//
20
21#ifndef glbarcode_QtRenderer_hpp
22#define glbarcode_QtRenderer_hpp
23
24
25#include "Renderer.hpp"
26
27#include <QPainter>
28
29
30namespace glbarcode
31{
32
38 class QtRenderer : public Renderer
39 {
40 public:
45
49 QtRenderer( QPainter* painter );
50
54 ~QtRenderer() override;
55
60 QPainter* painter() const;
61
69
70
71 private:
72 /*
73 * Virtual methods implemented by QtRenderer.
74 */
75 void drawBegin( double w, double h ) override;
76 void drawEnd() override;
77 void drawLine( double x, double y, double w, double h ) override;
78 void drawBox( double x, double y, double w, double h ) override;
79 void drawText( double x, double y, double size, const std::string& text, HAlign halign = H_ALIGN_CENTER ) override;
80 void drawRing( double x, double y, double r, double w ) override;
81 void drawHexagon( double x, double y, double h ) override;
82
86 struct PrivateData;
87 PrivateData *d;
88 };
89
90}
91
92#endif // glbarcode_QtRenderer_hpp
Definition QtRenderer.hpp:39
QtRenderer(QPainter *painter)
QtRenderer & setPainter(QPainter *painter)
QPainter * painter() const
Definition Renderer.hpp:48
Definition Barcode.hpp:38
HAlign
Definition Enums.hpp:29
@ H_ALIGN_CENTER
Definition Enums.hpp:30