#ifndef LOCALCUSTOMPLOT_H
#define LOCALCUSTOMPLOT_H

#include <qcustomplot.h>

class LocalCustomPlot : public QCustomPlot
{
    Q_OBJECT
public:
    LocalCustomPlot(QWidget *parent = nullptr);
protected:
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
private:
    QRectF getTextBoundingRect(QCPItemText* textItem);

    QCPItemText* _draggedTextItem = nullptr;
    QPoint _lastMousePos;
};

#endif // LOCALCUSTOMPLOT_H
