DDASToys for NSCLDAQ  6.2-000
Public Member Functions | Protected Member Functions | List of all members
QRootCanvas Class Reference

A ROOT canvas embedded in a Qt application. More...

Inheritance diagram for QRootCanvas:
Inheritance graph
[legend]
Collaboration diagram for QRootCanvas:
Collaboration graph
[legend]

Public Member Functions

 QRootCanvas (FitManager *pFitMgr, QWidget *parent=nullptr)
 Constructor. More...
 
virtual ~QRootCanvas ()
 Destructor.
 
TCanvas * getCanvas ()
 Return a pointer to the ROOT canvas. More...
 
void drawHit (const ddastoys::DDASFitHit &hit)
 Draw hit data on the canvas. More...
 
void clear ()
 Clear and update the ROOT canvas.
 

Protected Member Functions

virtual void mouseMoveEvent (QMouseEvent *e)
 Handle Qt mouse move events on the ROOT canvas. More...
 
virtual void mousePressEvent (QMouseEvent *e)
 Handle Qt mouse press events on the ROOT canvas. More...
 
virtual void mouseReleaseEvent (QMouseEvent *e)
 Handle Qt mouse release events on the ROOT canvas. More...
 
virtual void paintEvent (QPaintEvent *)
 Handle resize events in ROOT.
 
virtual void resizeEvent (QResizeEvent *)
 Handle paint events in ROOT.
 

Detailed Description

A ROOT canvas embedded in a Qt application.

Embedded ROOT canvas in a Qt application. Overrides Qt event handling for resize and paint events (e.g. re-draw after the canvas is hidden behind another window) as well as mouse events. This allows us to manipulate the ROOT canvas as expected: zooming on axes, right click actions, etc. Drawing on the canvas is bog-standard ROOT.

Constructor & Destructor Documentation

◆ QRootCanvas()

QRootCanvas::QRootCanvas ( FitManager pFitMgr,
QWidget *  parent = nullptr 
)

Constructor.

Parameters
pFitMgrPointer to a FitManager for plotting fit data. The FitManager object is handled by the caller.
parentPointer to QWidget parent object (optional, default=nullptr).

Construct a QWidget and register it with the ROOT graphics backend. The canvas does not own the FitManager object.

Member Function Documentation

◆ drawHit()

void QRootCanvas::drawHit ( const ddastoys::DDASFitHit hit)

Draw hit data on the canvas.

Parameters
hitReferences the hit we're plotting data from

◆ getCanvas()

TCanvas* QRootCanvas::getCanvas ( )
inline

Return a pointer to the ROOT canvas.

Returns
Pointer to the ROOT canvas object.

◆ mouseMoveEvent()

void QRootCanvas::mouseMoveEvent ( QMouseEvent *  e)
protectedvirtual

Handle Qt mouse move events on the ROOT canvas.

Parameters
ePointer to the QMouseEvent to handle

◆ mousePressEvent()

void QRootCanvas::mousePressEvent ( QMouseEvent *  e)
protectedvirtual

Handle Qt mouse press events on the ROOT canvas.

Parameters
ePointer to the QMouseEvent to handle

◆ mouseReleaseEvent()

void QRootCanvas::mouseReleaseEvent ( QMouseEvent *  e)
protectedvirtual

Handle Qt mouse release events on the ROOT canvas.

Parameters
ePointer to the QMouseEvent to handle

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