diff --git a/qad/blockview/blockitem.cpp b/qad/blockview/blockitem.cpp index 8e3bcdf..976f971 100644 --- a/qad/blockview/blockitem.cpp +++ b/qad/blockview/blockitem.cpp @@ -445,6 +445,17 @@ void BlockItem::mouseMoveEvent(QGraphicsSceneMouseEvent * event) { //QGraphicsItem::mouseMoveEvent(event); } + +void BlockItem::hoverEnterEvent(QGraphicsSceneHoverEvent * e) { + emit blockHoverEnter(this); +} + + +void BlockItem::hoverLeaveEvent(QGraphicsSceneHoverEvent * e) { + emit blockHoverLeave(this); +} + + #define _POS(m) (i - ((cp.size() - 1) / 2)) * m void BlockItem::arrangePins() { diff --git a/qad/blockview/blockitem.h b/qad/blockview/blockitem.h index 5cd39ea..ee20c30 100644 --- a/qad/blockview/blockitem.h +++ b/qad/blockview/blockitem.h @@ -161,6 +161,8 @@ protected: int type() const {return Type;} QRectF boundingRect() const; void mouseMoveEvent(QGraphicsSceneMouseEvent * event); + void hoverEnterEvent(QGraphicsSceneHoverEvent * event); + void hoverLeaveEvent(QGraphicsSceneHoverEvent * event); double left() const {return boundingRect().left();} double right() const {return boundingRect().right();} double top() const {return boundingRect().top();} @@ -174,6 +176,9 @@ protected: QMap > pins_; QList decors_; +signals: + void blockHoverEnter(BlockItem * b); + void blockHoverLeave(BlockItem * b); }; diff --git a/qad/blockview/blockview.cpp b/qad/blockview/blockview.cpp index 9c7d466..75bca40 100644 --- a/qad/blockview/blockview.cpp +++ b/qad/blockview/blockview.cpp @@ -823,6 +823,8 @@ void BlockView::addItem(QGraphicsItem * item) { } if (item->data(1006) == "item") { connect((BlockItem*)item, SIGNAL(destroyed(QObject*)), this, SLOT(removedBlock(QObject*)), Qt::UniqueConnection); + connect((BlockItem*)item, SIGNAL(blockHoverEnter(BlockItem*)), this, SIGNAL(blockHoverEnter(BlockItem*)), Qt::UniqueConnection); + connect((BlockItem*)item, SIGNAL(blockHoverLeave(BlockItem*)), this, SIGNAL(blockHoverLeave(BlockItem*)), Qt::UniqueConnection); emitActionEvent(BlockItemBase::BlockAdd, QList() << item); return; } diff --git a/qad/blockview/blockview.h b/qad/blockview/blockview.h index 24d95cc..34faba3 100644 --- a/qad/blockview/blockview.h +++ b/qad/blockview/blockview.h @@ -207,6 +207,8 @@ public slots: signals: void blockDoubleClicked(BlockItem * ); + void blockHoverEnter(BlockItem * ); + void blockHoverLeave(BlockItem * ); void busDoubleClicked(BlockBusItem * ); void schemeAction(BlockItemBase::Action action, QList items); void blockRemoved(BlockItem * item);