Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
Draw.h
Go to the documentation of this file.
1#pragma once
2#include <QPainter>
3#include <misc/global.h>
4#include <qevent.h>
5
6namespace sf
7{
8
15{
16 public:
21
26 {
28 roNone = 0x0,
30 roLeft = 0x1,
32 roRight = 0x2,
34 roTop = 0x4,
36 roBottom = 0x8,
37 };
38
53 bool ruler(
54 QPainter& painter, ERulerOrientation ro, const QColor& color, const QColor& font_color, const QRect& bounds, const QRect& area, double start, double stop,
55 int digits, const QString& unit
56 ) const;
57
62 {
64 goHorizontal = 0x1,
66 goVertical = 0x2
67 };
68
80 bool gridLines(QPainter& painter, EGridOrientation go, const QColor& color, const QRect& bounds, double start, double stop, unsigned digits) const;
81
90 bool textCross(QPainter& painter, const QRect& bounds, const QString& text, const QColor& color);
91
99 void gaugeBarPanel(QWidget* widget, QPaintEvent* event, double progress, const QString& str = {});
100
101 private:
105 const double _sepFactor;
106
110 static struct Tick
111 {
112 int Value;
113 int Ticks;
114 } _tickListVertical[], _tickListHorizontal[];
115};
116
117}// namespace sf
contains functions for drawing general stuff for graphs.
Definition Draw.h:15
bool ruler(QPainter &painter, ERulerOrientation ro, const QColor &color, const QColor &font_color, const QRect &bounds, const QRect &area, double start, double stop, int digits, const QString &unit) const
Draws a ruler for example around a graph.
ERulerOrientation
Orientation for drawing a graph ruler.
Definition Draw.h:26
void gaugeBarPanel(QWidget *widget, QPaintEvent *event, double progress, const QString &str={})
Draws a horizontal gauge rectangle inside a styled panel.
bool gridLines(QPainter &painter, EGridOrientation go, const QColor &color, const QRect &bounds, double start, double stop, unsigned digits) const
Draws the lines in the graph as the ruler ticks.
bool textCross(QPainter &painter, const QRect &bounds, const QString &text, const QColor &color)
Draws a cross with text rectangle in the middle.
EGridOrientation
Orientation for drawing grid lines in a graph.
Definition Draw.h:62
Draw()
Default constructor.
Value container class able to performing arithmetic functions.
Definition Value.h:19
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10