cumbia-qtcontrols 1.x
Qt widgets on top of the cumbia C++ library
QuPlotCanvasPainterComponent Class Reference

plot canvas painting can be delegated to this object More...

#include <quplotcanvaspaintercomponent.h>

Inheritance diagram for QuPlotCanvasPainterComponent:

Public Member Functions

 QuPlotCanvasPainterComponent ()
 
QString name () const
 returns the name of the component: "canvas_painter"
 
void attachToPlot (QuPlotBase *)
 in this method you would call QwtPlot::attach for the QwtPlotItem items in the component
 
void connectToPlot (QuPlotBase *)
 in this method you would create Qt signal/slot connections
 
void update (QPainter *p, const QuPlotBase *plot, const QList< QwtPlotCurve * >curves, const CuData &options)
 draws the canvas of the plot, writing the name of the curves, the zoom hint or other text on the background
 
- Public Member Functions inherited from QuPlotComponent
virtual ~QuPlotComponent ()
 

Detailed Description

plot canvas painting can be delegated to this object

This class is used to decorate the plot and display text on the canvas. QuPlotBase::drawCanvas uses this component.

Constructor & Destructor Documentation

◆ QuPlotCanvasPainterComponent()

QuPlotCanvasPainterComponent::QuPlotCanvasPainterComponent ( )

Member Function Documentation

◆ attachToPlot()

void QuPlotCanvasPainterComponent::attachToPlot ( QuPlotBase * plot)
inlinevirtual

in this method you would call QwtPlot::attach for the QwtPlotItem items in the component

Example
See QuPlotMarkerComponent::attachToPlot

Implements QuPlotComponent.

◆ connectToPlot()

void QuPlotCanvasPainterComponent::connectToPlot ( QuPlotBase * plot)
inlinevirtual

in this method you would create Qt signal/slot connections

Example
See QuPlotMarkerComponent::connectToPlot and QuPlotZoomComponent::connectToPlot

Implements QuPlotComponent.

◆ name()

QString QuPlotCanvasPainterComponent::name ( ) const
virtual

returns the name of the component: "canvas_painter"

Returns
the QString "canvas_painter"

Implements QuPlotComponent.

Referenced by QuPlotBase::init().

◆ update()

void QuPlotCanvasPainterComponent::update ( QPainter * p,
const QuPlotBase * plot,
const QList< QwtPlotCurve * > curves,
const CuData & options )

draws the canvas of the plot, writing the name of the curves, the zoom hint or other text on the background

Parameters
pthe QPainter
plotthe QuPlotBase
curvesthe list of QwtPlotCurve items
optionsthe options to configure the update
options
The possible options are as follows:
  • show_title: boolean, true to draw the title of the plot
  • show_zoom_hint: boolean, true if the text "Press shift key to zoom" has to be shown
  • zoom_disabled: boolean, true if zoom is disabled
The zoom hint is displayed if show_zoom_hint is true and zoom_disabled is false

Referenced by QuPlotBase::drawCanvas().


The documentation for this class was generated from the following files: