diff --git a/agui2/Graphics/DoubleGraphicsBox.h b/agui2/Graphics/DoubleGraphicsBox.h index 6a7f7d474e2ee99f8f4d7eefa60efac938f46afb..6b119c9ba0905effebd214a237ef05019d5ffa25 100644 --- a/agui2/Graphics/DoubleGraphicsBox.h +++ b/agui2/Graphics/DoubleGraphicsBox.h @@ -5,7 +5,7 @@ class DoubleGraphicsBox : public GraphicsBox { Q_OBJECT public: - DoubleGraphicsBox(QString text, qreal x = 0, qreal y = 0) : GraphicsBox( text, x, y ) {} + DoubleGraphicsBox(QString text, qreal x = 0, qreal y = 0) : GraphicsBox( text, x, y, 2 ) {} // Decide which end handles the top or bottom in connecting virtual ~DoubleGraphicsBox(); virtual void addInput( GraphicsConnection* connection ); diff --git a/agui2/Graphics/GraphicsBox.cpp b/agui2/Graphics/GraphicsBox.cpp index 7ed45f8d6b7f177e0e860fcdd9124803e585ffef..ea7db09bb83874eb96adbbaf887e1c17b0068fdf 100644 --- a/agui2/Graphics/GraphicsBox.cpp +++ b/agui2/Graphics/GraphicsBox.cpp @@ -11,7 +11,7 @@ #include <Graphics/GraphicsConnection.h> #include <Graphics/GraphicsScene.h> -GraphicsBox::GraphicsBox(QString text, qreal x, qreal y) +GraphicsBox::GraphicsBox(QString text, qreal x, qreal y, uint8_t inputs, uint8_t outputs) : m_text(std::move(text)) , m_color(Qt::blue) { diff --git a/agui2/Graphics/GraphicsBox.h b/agui2/Graphics/GraphicsBox.h index 70e9bee4e5ccde11b06ab2323c21a39234feb439..4a31ad16f605a4753f63de886780cecfa2fb86c6 100644 --- a/agui2/Graphics/GraphicsBox.h +++ b/agui2/Graphics/GraphicsBox.h @@ -18,7 +18,7 @@ class GraphicsBox : public QGraphicsObject { Q_OBJECT public: - GraphicsBox(QString text, qreal x = 0, qreal y = 0); + explicit GraphicsBox(QString text, qreal x = 0, qreal y = 0, uint8_t inputs = 1, uint8_t outputs = 1); ~GraphicsBox() override; void paint(QPainter *painter, const QStyleOptionGraphicsItem *options, QWidget *widget) override; diff --git a/agui2/Graphics/InputGraphicsBox.h b/agui2/Graphics/InputGraphicsBox.h index 7bd3385cefe770cc1ee5fdc04d124fccc4c92dc4..dcc18d4f87b6478eed8ae87f59b66161f9a2da97 100644 --- a/agui2/Graphics/InputGraphicsBox.h +++ b/agui2/Graphics/InputGraphicsBox.h @@ -8,7 +8,7 @@ class InputGraphicsBox : public GraphicsBox { Q_OBJECT public: - InputGraphicsBox(qreal x = 0, qreal y = 0): GraphicsBox("Input", x, y) {} + InputGraphicsBox(qreal x = 0, qreal y = 0): GraphicsBox("Input", x, y, 0, 1) {} virtual ~InputGraphicsBox() {} virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *options, QWidget *widget); private slots: diff --git a/agui2/Graphics/OutputGraphicsBox.h b/agui2/Graphics/OutputGraphicsBox.h index 5b8baaba47fbed37834a2aacd3271ebb6e7a30aa..32702208a947c7349705672b6ce2b6fb483f6c6d 100644 --- a/agui2/Graphics/OutputGraphicsBox.h +++ b/agui2/Graphics/OutputGraphicsBox.h @@ -9,7 +9,7 @@ class OutputGraphicsBox : public GraphicsBox { Q_OBJECT public: - OutputGraphicsBox( qreal x = 0, qreal y = 0 ): GraphicsBox( "Output", x, y ) {} + OutputGraphicsBox( qreal x = 0, qreal y = 0 ): GraphicsBox( "Output", x, y, 1, 0 ) {} virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event); private slots: void on_SetOutput();