git-svn-id: svn://db.shs.com.ru/libs@315 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -445,6 +445,17 @@ void BlockItem::mouseMoveEvent(QGraphicsSceneMouseEvent * event) {
|
|||||||
//QGraphicsItem::mouseMoveEvent(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
|
#define _POS(m) (i - ((cp.size() - 1) / 2)) * m
|
||||||
|
|
||||||
void BlockItem::arrangePins() {
|
void BlockItem::arrangePins() {
|
||||||
|
|||||||
@@ -161,6 +161,8 @@ protected:
|
|||||||
int type() const {return Type;}
|
int type() const {return Type;}
|
||||||
QRectF boundingRect() const;
|
QRectF boundingRect() const;
|
||||||
void mouseMoveEvent(QGraphicsSceneMouseEvent * event);
|
void mouseMoveEvent(QGraphicsSceneMouseEvent * event);
|
||||||
|
void hoverEnterEvent(QGraphicsSceneHoverEvent * event);
|
||||||
|
void hoverLeaveEvent(QGraphicsSceneHoverEvent * event);
|
||||||
double left() const {return boundingRect().left();}
|
double left() const {return boundingRect().left();}
|
||||||
double right() const {return boundingRect().right();}
|
double right() const {return boundingRect().right();}
|
||||||
double top() const {return boundingRect().top();}
|
double top() const {return boundingRect().top();}
|
||||||
@@ -174,6 +176,9 @@ protected:
|
|||||||
QMap<Qt::Alignment, QVector<BlockItemPin * > > pins_;
|
QMap<Qt::Alignment, QVector<BlockItemPin * > > pins_;
|
||||||
QList<QGraphicsItem * > decors_;
|
QList<QGraphicsItem * > decors_;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void blockHoverEnter(BlockItem * b);
|
||||||
|
void blockHoverLeave(BlockItem * b);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -823,6 +823,8 @@ void BlockView::addItem(QGraphicsItem * item) {
|
|||||||
}
|
}
|
||||||
if (item->data(1006) == "item") {
|
if (item->data(1006) == "item") {
|
||||||
connect((BlockItem*)item, SIGNAL(destroyed(QObject*)), this, SLOT(removedBlock(QObject*)), Qt::UniqueConnection);
|
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<QGraphicsItem*>() << item);
|
emitActionEvent(BlockItemBase::BlockAdd, QList<QGraphicsItem*>() << item);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,6 +207,8 @@ public slots:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void blockDoubleClicked(BlockItem * );
|
void blockDoubleClicked(BlockItem * );
|
||||||
|
void blockHoverEnter(BlockItem * );
|
||||||
|
void blockHoverLeave(BlockItem * );
|
||||||
void busDoubleClicked(BlockBusItem * );
|
void busDoubleClicked(BlockBusItem * );
|
||||||
void schemeAction(BlockItemBase::Action action, QList<QGraphicsItem * > items);
|
void schemeAction(BlockItemBase::Action action, QList<QGraphicsItem * > items);
|
||||||
void blockRemoved(BlockItem * item);
|
void blockRemoved(BlockItem * item);
|
||||||
|
|||||||
Reference in New Issue
Block a user