22 explicit Graph(
const QPalette& palette = {});
49 void setBounds(
const QFontMetrics& fontMetrics,
const QRect& bounds);
59 const QRect&
paint(QPainter& painter,
const QRect& bounds,
const QRegion& region = null_ref<QRegion>());
152 } _top, _left, _right, _bottom;
ERulerOrientation
Orientation for drawing a graph ruler.
Definition Draw.h:25
EGridOrientation
Orientation for drawing grid lines in a graph.
Definition Draw.h:62
Class for drawing a graph having optional rulers and grid. This class uses sf::Draw class for drawing...
Definition Graph.h:17
EColor
Colors enumeration of colors in the graph. Used by setColor function.
Definition Graph.h:80
@ cRulerLine
Definition Graph.h:84
@ cGridLines
Definition Graph.h:86
@ cGraphBackground
Definition Graph.h:90
@ cGraphForeground
Definition Graph.h:92
@ cRulerText
Definition Graph.h:82
@ cRulerBackground
Definition Graph.h:88
QVector< QColor > _colors
Holds the colors for painting the rulers en grid.
Definition Graph.h:111
void paintPlotCross(QPainter &painter, const QString &text)
Paints a cross with text in the plot area. Used when a plot can not be painted.
void setRuler(Draw::ERulerOrientation ro, double start, double stop, int digits, const QString &unit)
Sets and thus enabling the ruler for the passed orientation.
const QRect & paint(QPainter &painter, const QRect &bounds, const QRegion ®ion=null_ref< QRegion >())
Paints the graph. Paints the graph passing the passed boundaries and the optional region when handlin...
QRect _plotArea
Holds the last calculated graph area rectangle.
Definition Graph.h:169
void setColor(EColor index, QColor color)
Allows setting of individual indexed colors for the graph.
RulerInfo * getRulerInfo(Draw::ERulerOrientation ro)
Gets the ruler information by orientation.
const QRect & getPlotArea() const
Gets the remaining area to plot the graph after rulers and grid have been painted.
Graph(const QPalette &palette={})
Constructor passing a palette.
void setGrid(Draw::EGridOrientation go, Draw::ERulerOrientation ro)
Enables grid painting in the graph. When painting this enables drawing grid for the passed orientatio...
void setBounds(const QFontMetrics &fontMetrics, const QRect &bounds)
Sets the bounding rectangle for the graph for painting in. Paints the graph passing the passed bounda...
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10
_MISC_FUNC int digits(double value)
Returns the amount of digits which are significant for the value. When the value is 12300....
Holds information on the rulers. Holds set and calculated information.
Definition Graph.h:118
QRect rect
Rectangle for the ticks.
Definition Graph.h:146
QString unit
unit text.
Definition Graph.h:138
QRect bounds
Bounds of the ruler area for painting value texts i.e.
Definition Graph.h:142