Skip to content
Snippets Groups Projects
Commit 4d1ed572 authored by Martin Hanzik's avatar Martin Hanzik Committed by Jan Trávníček
Browse files

Small cleanup

parent 67782352
No related branches found
No related tags found
No related merge requests found
...@@ -11,21 +11,22 @@ ...@@ -11,21 +11,22 @@
   
#define BOX_MARGIN 20 #define BOX_MARGIN 20
   
class WrapperBox;
class GraphicsConnection; class GraphicsConnection;
class WrapperBox;
   
class GraphicsBox : public QGraphicsObject class GraphicsBox : public QGraphicsObject
{ {
Q_OBJECT Q_OBJECT
public: public:
GraphicsBox(QString text, qreal x = 0, qreal y = 0); GraphicsBox(QString text, qreal x = 0, qreal y = 0);
virtual ~GraphicsBox(); ~GraphicsBox() override;
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *options, QWidget *widget);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *options, QWidget *widget) override;
void addOutput( GraphicsConnection* connection ); void addOutput( GraphicsConnection* connection );
virtual void addInput( GraphicsConnection* connection ); virtual void addInput( GraphicsConnection* connection );
void removeOutput(); void removeOutput();
virtual void removeInput( GraphicsConnection* connection ); virtual void removeInput( GraphicsConnection* connection );
QRectF boundingRect() const; QRectF boundingRect() const override;
QPointF getConnectionOrigin(); QPointF getConnectionOrigin();
virtual QPointF getConnectionTarget( GraphicsConnection* connection ); virtual QPointF getConnectionTarget( GraphicsConnection* connection );
friend class WrapperBox; friend class WrapperBox;
...@@ -38,8 +39,8 @@ protected: ...@@ -38,8 +39,8 @@ protected:
GraphicsConnection* m_InConnection = nullptr; GraphicsConnection* m_InConnection = nullptr;
WrapperBox* m_wrapper; WrapperBox* m_wrapper;
void finishMenu( QMenu * menu ); void finishMenu( QMenu * menu );
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override ;
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event); void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
private: private:
void setWrapper( WrapperBox* wrapper ); void setWrapper( WrapperBox* wrapper );
void setBoundingRectangle(); void setBoundingRectangle();
......
...@@ -11,10 +11,11 @@ class GraphicsScene : public QGraphicsScene ...@@ -11,10 +11,11 @@ class GraphicsScene : public QGraphicsScene
{ {
Q_OBJECT Q_OBJECT
public: public:
GraphicsScene(QObject * parent); explicit GraphicsScene(QObject * parent);
protected: protected:
void wheelEvent(QGraphicsSceneWheelEvent *event); void wheelEvent(QGraphicsSceneWheelEvent *event) override;
void mousePressEvent(QGraphicsSceneMouseEvent *event); void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
}; };
   
   
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment