23#ifndef BCEVALUESETPLOT_HPP
24#define BCEVALUESETPLOT_HPP
27#include "qcustomplot.h"
54 setContextMenuPolicy(Qt::CustomContextMenu);
56 path = QString(
"../");
61 connect(
this,SIGNAL(mouseMove(QMouseEvent*)),
63 connect(
this,SIGNAL(mousePress(QMouseEvent*)),
69 connect(
this,SIGNAL(customContextMenuRequested(
const QPoint &)),
83 double x = this->xAxis->pixelToCoord(event->pos().x());
84 double y = this->yAxis->pixelToCoord(event->pos().y());
86 setToolTip(QString(
"%1 , %2").arg(x).arg(y));
92 double x = this->xAxis->pixelToCoord(event->pos().x());
93 double y = this->yAxis->pixelToCoord(event->pos().y());
107 QPoint globalPos = this->mapToGlobal(pos);
113 contextMenu.exec(globalPos);
119 QString newPath = QFileDialog::getSaveFileName(
this, tr(
"Save PDF"),
120 path, tr(
"PDF files (*.pdf)"));
122 if (newPath.isEmpty())
125 newPath = newPath +
".pdf";
126 QFileInfo fi(newPath);
127 path = fi.canonicalPath();
135 QString newPath = QFileDialog::getSaveFileName(
this, tr(
"Save PNG"),
136 path, tr(
"PNG files (*.png)"));
138 if (newPath.isEmpty())
141 newPath = newPath+
".png";
142 QFileInfo fi(newPath);
143 path = fi.canonicalPath();
QCustomPlot with Tool-tip and click functionality.
Definition: bcevaluesetplot.hpp:37
void getClickCoordinates(QMouseEvent *event)
Gets coordinates of the point where a click is made.
Definition: bcevaluesetplot.hpp:90
QString path
Path to screenshots.
Definition: bcevaluesetplot.hpp:47
void newEqmCoordinates(double x, double y)
Signals new coordinates after the user clicks on the plot.
void ShowContextMenu(const QPoint &pos)
Slot for showing context menu.
Definition: bcevaluesetplot.hpp:104
void savePNG()
Saves graph as a PNG.
Definition: bcevaluesetplot.hpp:133
QAction * savePNGAction
Pointer to QAction for saving PNG files.
Definition: bcevaluesetplot.hpp:38
QAction * savePDFAction
Pointer to QAction for saving PDF files.
Definition: bcevaluesetplot.hpp:45
void showPointToolTip(QMouseEvent *event)
Shows coordinates for point the mouse is hovering over.
Definition: bcevaluesetplot.hpp:81
void savePDF()
Saves graph as a PDF.
Definition: bcevaluesetplot.hpp:117
BCEValueSetPlot()
Constructor.
Definition: bcevaluesetplot.hpp:52