animation in blockview 2
git-svn-id: svn://db.shs.com.ru/libs@317 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -495,8 +495,10 @@ void BlockBusItem::hoverMoveEvent(QGraphicsSceneHoverEvent * e) {
|
||||
if (temp_) return;
|
||||
QPointF sp = e->scenePos();
|
||||
int pp = selPoint;
|
||||
int ps = selSegment;
|
||||
bool empt = !(selPoint >= 0 || selSegment >= 0);
|
||||
testPoint(sp, &selPoint, &selSegment);
|
||||
if (selPoint >= 0 && pp < 0) {
|
||||
if ((selPoint >= 0 && pp != selPoint) || (selSegment >= 0 && ps != selSegment)) {
|
||||
if (((BlockView *)scene()->views().back())->isBlockAnimationEnabled()) {
|
||||
setPointSize(0);
|
||||
anim_point_size.start();
|
||||
@@ -504,6 +506,12 @@ void BlockBusItem::hoverMoveEvent(QGraphicsSceneHoverEvent * e) {
|
||||
}
|
||||
|
||||
if (selPoint >= 0 || selSegment >= 0) {
|
||||
if (empt) {
|
||||
QList<BlockItemPin * > pins = connectedPins();
|
||||
foreach (BlockItemPin * p, pins) {
|
||||
p->animAccept();
|
||||
}
|
||||
}
|
||||
setToolTip(tt);
|
||||
update();
|
||||
return;
|
||||
@@ -674,20 +682,20 @@ void BlockBusItem::mouseReleaseEvent(QGraphicsSceneMouseEvent * e) {
|
||||
if (moved) {
|
||||
simplify(false);
|
||||
if (lm_point) {
|
||||
QMetaObject::invokeMethod(scene()->views().back(), "endBusPointMove", Qt::QueuedConnection);
|
||||
emitAction(BlockItemBase::BusPointMove);
|
||||
} else {
|
||||
reconnect();
|
||||
emitAction( BlockItemBase::BusSegmentMove);
|
||||
}
|
||||
}
|
||||
QMetaObject::invokeMethod(scene()->views().back(), "endBusPointMove");
|
||||
moved = new_segment = false;
|
||||
QGraphicsObject::mouseReleaseEvent(e);
|
||||
}
|
||||
|
||||
|
||||
void BlockBusItem::paint(QPainter * p, const QStyleOptionGraphicsItem * o, QWidget * w) {
|
||||
ph.setWidthF(pen_width + 1.);
|
||||
ph.setWidthF(pen_width + point_size / 2.);
|
||||
pu.setWidthF(pen_width);
|
||||
pa.setWidthF(pen_width);
|
||||
pr.setWidthF(pen_width);
|
||||
|
||||
Reference in New Issue
Block a user