new BlockView::newBusFinished
This commit is contained in:
@@ -67,59 +67,49 @@ public:
|
||||
InputOutput = 0x3
|
||||
};
|
||||
|
||||
void setPen(const QPen & p) { ell_item.setPen(p); }
|
||||
QPen pen() const { return ell_item.pen(); }
|
||||
void setBrush(const QBrush & b) { ell_item.setBrush(b); }
|
||||
QBrush brush() const { return ell_item.brush(); }
|
||||
|
||||
int busType() const { return bus_type; }
|
||||
Qt::Alignment alignment() const { return align; }
|
||||
QString text() const { return text_item.text(); }
|
||||
State state() const { return state_; }
|
||||
|
||||
void setBusType(int type_) { bus_type = type_; }
|
||||
void setAlignment(Qt::Alignment a) {
|
||||
align = a;
|
||||
_init(true);
|
||||
}
|
||||
void setText(const QString & t) {
|
||||
text_item.setText(t);
|
||||
_init(true);
|
||||
}
|
||||
void setState(State s);
|
||||
|
||||
void saveState() { sstate_.push(state_); }
|
||||
bool restoreState() {
|
||||
if (sstate_.isEmpty()) return false;
|
||||
setState(sstate_.pop());
|
||||
return true;
|
||||
}
|
||||
void clearStateStack() { sstate_.clear(); }
|
||||
|
||||
void enlargePin(bool enlarge);
|
||||
|
||||
BlockItem * parent() const { return parent_; }
|
||||
QList<BlockBusItem *> connectedBuses() const { return buses_; }
|
||||
|
||||
enum {
|
||||
Type = UserType + 3
|
||||
};
|
||||
|
||||
void setPen(const QPen & p);
|
||||
QPen pen() const;
|
||||
void setBrush(const QBrush & b);
|
||||
QBrush brush() const;
|
||||
|
||||
int busType() const { return bus_type; }
|
||||
Qt::Alignment alignment() const { return align; }
|
||||
QString text() const;
|
||||
State state() const { return state_; }
|
||||
|
||||
void setBusType(int type_);
|
||||
void setAlignment(Qt::Alignment a);
|
||||
void setText(const QString & t);
|
||||
void setState(State s);
|
||||
|
||||
void saveState();
|
||||
bool restoreState();
|
||||
void clearStateStack();
|
||||
|
||||
void enlargePin(bool enlarge);
|
||||
|
||||
|
||||
BlockItem * parent() const { return parent_; }
|
||||
QList<BlockBusItem *> connectedBuses() const { return buses_; }
|
||||
|
||||
public slots:
|
||||
void animAccept();
|
||||
|
||||
protected:
|
||||
void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0) {}
|
||||
QRectF boundingRect() const {
|
||||
return ell_item.boundingRect().translated(ell_item.pos()) | text_item.boundingRect().translated(text_item.pos());
|
||||
}
|
||||
int type() const { return Type; }
|
||||
QVariant itemChange(GraphicsItemChange change, const QVariant & value);
|
||||
void hoverEnterEvent(QGraphicsSceneHoverEvent * e);
|
||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent * e);
|
||||
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override {}
|
||||
QRectF boundingRect() const override;
|
||||
int type() const override { return Type; }
|
||||
QVariant itemChange(GraphicsItemChange change, const QVariant & value) override;
|
||||
void hoverEnterEvent(QGraphicsSceneHoverEvent * e) override;
|
||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent * e) override;
|
||||
void _init(bool affect_parent = false);
|
||||
void _reparent();
|
||||
QGraphicsView * _view() const;
|
||||
|
||||
int bus_type;
|
||||
State state_;
|
||||
QGraphicsEllipseItem ell_item;
|
||||
|
||||
Reference in New Issue
Block a user