SOFA API  99934cbc
Open source framework for multi-physics simuation
sofa::gui::qt::ProfilerChartView Class Reference

#include <SofaWindowProfiler.h>

The ProfilerChartView class is a overide of QtCharts::QChartView to be able to catch mouse selection and update all widgets of. More...

Inheritance diagram for sofa::gui::qt::ProfilerChartView:

Detailed Description

The ProfilerChartView class is a overide of QtCharts::QChartView to be able to catch mouse selection and update all widgets of.

See also
SofaWindowProfiler Will also overide drawForeground to draw a line to show the selected step.

Protected Attributes

int m_bufferSize
 copy of the serie size to check if selection is not out of bound More...
 
QPointF m_lineSelect
 2D point of the line to draw the selection More...
 
QPointF m_lineOrigin
 
int m_pointSelected
 Step number selected on the graph. -1 if none. More...
 
int m_maxY
 Stored value of the Y axis max. More...
 

Public Member Functions

 ProfilerChartView (QtCharts::QChart *chart, QWidget *parent, int bufferSize)
 
void updateYMax (int y)
 method to update the max value of the Y axis (for line rendering). More...
 

Protected Member Functions

virtual void mousePressEvent (QMouseEvent *event)
 Overide to catch mouse selection on the graph. More...
 
virtual void drawForeground (QPainter *painter, const QRectF &rect)
 Overide to draw line at the step selected. More...
 

Signals

void pointSelected (int)
 signal emited when a step has been selected on the graph More...
 

Public Slots

void updateSelection (int x)
 method to update the selection on the graph. More...
 

Attribute details

int sofa::gui::qt::ProfilerChartView::m_bufferSize
protected

copy of the serie size to check if selection is not out of bound

QPointF sofa::gui::qt::ProfilerChartView::m_lineOrigin
protected
QPointF sofa::gui::qt::ProfilerChartView::m_lineSelect
protected

2D point of the line to draw the selection

int sofa::gui::qt::ProfilerChartView::m_maxY
protected

Stored value of the Y axis max.

int sofa::gui::qt::ProfilerChartView::m_pointSelected
protected

Step number selected on the graph. -1 if none.

Constructor details

sofa::gui::qt::ProfilerChartView::ProfilerChartView ( QtCharts::QChart *  chart,
QWidget parent,
int  bufferSize 
)

Function details

void sofa::gui::qt::ProfilerChartView::drawForeground ( QPainter *  painter,
const QRectF &  rect 
)
protectedvirtual

Overide to draw line at the step selected.

void sofa::gui::qt::ProfilerChartView::mousePressEvent ( QMouseEvent *  event)
protectedvirtual

Overide to catch mouse selection on the graph.

void sofa::gui::qt::ProfilerChartView::pointSelected ( int  )
signal

signal emited when a step has been selected on the graph

Parameters
intis the step number
void sofa::gui::qt::ProfilerChartView::updateSelection ( int  x)
slot

method to update the selection on the graph.

void sofa::gui::qt::ProfilerChartView::updateYMax ( int  y)
inline

method to update the max value of the Y axis (for line rendering).