aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/coreview/adder.h
blob: 9de81a1fce55bcc822e6f95947460dab1a302cae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef ADDER_H
#define ADDER_H

#include <QGraphicsItem>
#include <QPainter>
#include <QGraphicsSimpleTextItem>
#include "connection.h"

namespace coreview {

class Adder : public QGraphicsItem {
public:
    Adder();
    ~Adder();

    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);

    void setPos(qreal x, qreal y);
    const Connector *connector_in_a() const;
    const Connector *connector_in_b() const;
    const Connector *connector_out() const;

private:
    QGraphicsSimpleTextItem plus;

    Connector *con_in_a, *con_in_b, *con_out;
};

}

#endif // ADDER_H