NeTrainSim 0.1.1 beta
The Open-Source Network Trains Simulator
 
Loading...
Searching...
No Matches
CustomPlot Class Reference

The CustomPlot class is a subclass of QCustomPlot, providing additional functionality and customization. More...

#include <customplot.h>

Inheritance diagram for CustomPlot:

Public Slots

void resetZoom ()
 Slot function for handling zoom reset.
 

Signals

void zoomReset ()
 Signal emitted when the zoom is reset.
 
void pointLeftSelected (QPointF point)
 Signal emitted when a data point on the left side is selected.
 
void pointRightSelected (QPointF point)
 Signal emitted when a data point on the right side is selected.
 

Public Member Functions

 CustomPlot (QWidget *parent=nullptr)
 Constructs a CustomPlot object.
 

Protected Member Functions

virtual void mousePressEvent (QMouseEvent *event) override
 Reimplemented mousePressEvent from QCustomPlot.
 
virtual void mouseDoubleClickEvent (QMouseEvent *event) override
 Reimplemented mouseDoubleClickEvent from QCustomPlot.
 
virtual void mouseMoveEvent (QMouseEvent *event) override
 Reimplemented mouseMoveEvent from QCustomPlot.
 
virtual void mouseReleaseEvent (QMouseEvent *event) override
 Reimplemented mouseReleaseEvent from QCustomPlot.
 
virtual void wheelEvent (QWheelEvent *event) override
 Reimplemented wheelEvent from QCustomPlot.
 

Detailed Description

The CustomPlot class is a subclass of QCustomPlot, providing additional functionality and customization.

This class extends the QCustomPlot widget to handle mouse events and zoom reset functionality. It also includes methods for panning, retrieving points positions, and emitting signals for selected points.

Author
Ahmed Aredah
Date
6/7/2023

Constructor & Destructor Documentation

◆ CustomPlot()

CustomPlot::CustomPlot ( QWidget *  parent = nullptr)
explicit

Constructs a CustomPlot object.

Parameters
parentThe parent widget.
Author
Ahmed Aredah
Date
6/7/2023

Member Function Documentation

◆ mouseDoubleClickEvent()

void CustomPlot::mouseDoubleClickEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Reimplemented mouseDoubleClickEvent from QCustomPlot.

Parameters
eventThe mouse double-click event.
Author
Ahmed Aredah
Date
6/7/2023

◆ mouseMoveEvent()

void CustomPlot::mouseMoveEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Reimplemented mouseMoveEvent from QCustomPlot.

Parameters
eventThe mouse move event.
Author
Ahmed Aredah
Date
6/7/2023

◆ mousePressEvent()

void CustomPlot::mousePressEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Reimplemented mousePressEvent from QCustomPlot.

Parameters
eventThe mouse press event.
Author
Ahmed Aredah
Date
6/7/2023

◆ mouseReleaseEvent()

void CustomPlot::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Reimplemented mouseReleaseEvent from QCustomPlot.

Parameters
eventThe mouse release event.
Author
Ahmed Aredah
Date
6/7/2023

◆ pointLeftSelected

void CustomPlot::pointLeftSelected ( QPointF  point)
signal

Signal emitted when a data point on the left side is selected.

Parameters
pointThe position of the selected point.
Author
Ahmed Aredah
Date
6/7/2023

◆ pointRightSelected

void CustomPlot::pointRightSelected ( QPointF  point)
signal

Signal emitted when a data point on the right side is selected.

Parameters
pointThe position of the selected point.
Author
Ahmed Aredah
Date
6/7/2023

◆ resetZoom

void CustomPlot::resetZoom ( )
slot

Slot function for handling zoom reset.

Author
Ahmed Aredah
Date
6/7/2023

◆ wheelEvent()

void CustomPlot::wheelEvent ( QWheelEvent *  event)
overrideprotectedvirtual

Reimplemented wheelEvent from QCustomPlot.

Parameters
eventThe wheel event.
Author
Ahmed Aredah
Date
6/7/2023

◆ zoomReset

void CustomPlot::zoomReset ( )
signal

Signal emitted when the zoom is reset.

Author
Ahmed Aredah
Date
6/7/2023