Companion curve enhancements (#5947)
* Add point to custom curve using mouse click * Add more curve enhancements delete and resize points * add scene constructor
This commit is contained in:
committed by
Bertrand Songis
parent
13c5387dc9
commit
d460f005c6
@@ -23,6 +23,8 @@
|
||||
|
||||
#include "modeledit.h"
|
||||
#include "eeprominterface.h"
|
||||
#include <QGraphicsScene>
|
||||
#include <QGraphicsView>
|
||||
|
||||
enum CopyAction {
|
||||
CURVE_COPY,
|
||||
@@ -43,6 +45,20 @@ struct CurveCreatorTemplate {
|
||||
curveFunction function;
|
||||
};
|
||||
|
||||
class CustomScene : public QGraphicsScene
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CustomScene(QGraphicsView * view);
|
||||
|
||||
signals:
|
||||
void newPoint(int, int);
|
||||
|
||||
protected:
|
||||
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * event) override;
|
||||
};
|
||||
|
||||
class Curves : public ModelPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -67,6 +83,9 @@ class Curves : public ModelPanel
|
||||
void onNodeUnfocus();
|
||||
void on_curveType_currentIndexChanged(int index);
|
||||
void on_curveApply_clicked();
|
||||
void onSceneNewPoint(int x, int y);
|
||||
void onPointSizeEdited();
|
||||
void onNodeDelete();
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent(QResizeEvent *event);
|
||||
@@ -85,7 +104,7 @@ class Curves : public ModelPanel
|
||||
void updateCurvePoints();
|
||||
bool allowCurveType(int points, CurveData::CurveType type);
|
||||
void setPointY(int i, int x, int y);
|
||||
|
||||
CustomScene * scene;
|
||||
};
|
||||
|
||||
#endif // _CURVES_H_
|
||||
|
||||
Reference in New Issue
Block a user