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

#include <SofaWindowProfiler.h>

The ProfilerChartView class is a override 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 override of QtCharts::QChartView to be able to catch mouse selection and update all widgets of.

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

Protected Attributes

int m_bufferSize
 copy of the series 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 (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)
 Override to catch mouse selection on the graph. More...
 
virtual void drawForeground (QPainter *painter, const QRectF &rect)
 Override to draw line at the step selected. More...
 

Signals

void pointSelected (int)
 signal emitted 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

◆ m_bufferSize

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

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

◆ m_lineOrigin

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

◆ m_lineSelect

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

2D point of the line to draw the selection

◆ m_maxY

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

Stored value of the Y axis max.

◆ m_pointSelected

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

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

Constructor details

◆ ProfilerChartView()

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

Function details

◆ drawForeground()

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

Override to draw line at the step selected.

◆ mousePressEvent()

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

Override to catch mouse selection on the graph.

◆ pointSelected

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

signal emitted when a step has been selected on the graph

Parameters
intis the step number

◆ updateSelection

void sofa::gui::qt::ProfilerChartView::updateSelection ( int  x)
slot

method to update the selection on the graph.

◆ updateYMax()

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

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