QCanvasView(theCanvas, theViewWindow, 0, Qt::WRepaintNoErase),
myCurrentItem(0),
myHilightedItem(0),
- mySelectedItem(0)
+ mySelectedItem(0),
+ myMovingDone(false)
{
printf("Construct QxGraph_CanvasView\n");
setName("QxGraph_CanvasView");
return;
}
+ if ( myOperation == WINDOWFIT )
+ { // Fit area
+ return;
+ }
+
if ( theEvent->button() == Qt::LeftButton && theEvent->state() == Qt::ControlButton
||
myOperation == ZOOMVIEW )
//draw new selected rectangle
QPen pen(Qt::black,1,Qt::SolidLine);
aRect1->setPen(pen);
- aRect1->setZ(3);
+ aRect1->setZ(1E+6);
aRect1->show();
mySelectedRect = aRect1;
canvas()->update();
+
+ return;
}
if ( myOperation == ZOOMVIEW )
if ( anActItem && anActItem->isResizing() )
{ // to resize items on canvas view
anActItem->resize(aPoint);
+ myMovingDone = true;
return;
}
}
myCurrentItem->moveBy(aPoint.x() - myPoint.x(),
aPoint.y() - myPoint.y());
+ myMovingDone = true;
myPoint = aPoint;
canvas()->update();
-
+
// scroll contents if mouse is outside
QRect r(contentsX(), contentsY(), visibleWidth(), visibleHeight());
if (!r.contains(theEvent->pos())) {
}
}
- if ( theEvent->button() == LeftButton )
+ if ( theEvent->button() == LeftButton && !myMovingDone )
{
// Selection mechanism
QCanvasItemList aList = canvas()->collisions(aPoint);
}
}
}
+
+ myMovingDone = false;
}
void QxGraph_CanvasView::contentsMouseDoubleClickEvent(QMouseEvent* theEvent)