Remove code already ported to the new profile.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-05-23 21:29:14 -03:00 committed by Dirk Hohndel
parent 963178d3d4
commit e6c294f718
2 changed files with 0 additions and 33 deletions

View file

@ -480,37 +480,6 @@ void DivePlannerGraphics::mouseMoveEvent(QMouseEvent *event)
#endif
}
void DivePlannerGraphics::mousePressEvent(QMouseEvent *event)
{
if (event->modifiers()) {
QGraphicsView::mousePressEvent(event);
return;
}
QPointF mappedPos = mapToScene(event->pos());
if (event->button() == Qt::LeftButton) {
Q_FOREACH (QGraphicsItem *item, scene()->items(mappedPos, Qt::IntersectsItemBoundingRect, Qt::AscendingOrder, transform())) {
if (DiveHandler *h = qgraphicsitem_cast<DiveHandler *>(item)) {
activeDraggedHandler = h;
activeDraggedHandler->setBrush(Qt::red);
originalHandlerPos = activeDraggedHandler->pos();
}
}
}
QGraphicsView::mousePressEvent(event);
}
void DivePlannerGraphics::mouseReleaseEvent(QMouseEvent *event)
{
if (activeDraggedHandler) {
/* we already deal with all the positioning in the life update,
* so all we need to do here is change the color of the handler */
activeDraggedHandler->setBrush(QBrush(Qt::white));
activeDraggedHandler = 0;
drawProfile();
}
}
DiveHandler::DiveHandler() : QGraphicsEllipseItem()
{
setRect(-5, -5, 10, 10);

View file

@ -160,8 +160,6 @@ protected:
virtual void showEvent(QShowEvent *event);
virtual void resizeEvent(QResizeEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
qreal fromPercent(qreal percent, Qt::Orientation orientation);
public
slots: