diff options
-rw-r--r-- | qt-ui/diveplanner.cpp | 50 | ||||
-rw-r--r-- | qt-ui/diveplanner.h | 1 |
2 files changed, 0 insertions, 51 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 2c0b429d0..b594861ae 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -430,56 +430,6 @@ void DivePlannerGraphics::showEvent(QShowEvent *event) fitInView(sceneRect(), Qt::IgnoreAspectRatio); } - -void DivePlannerGraphics::mouseMoveEvent(QMouseEvent *event) -{ - QPointF mappedPos = mapToScene(event->pos()); - -#if 0 - double xpos = timeLine->valueAt(mappedPos); - double ypos = depthLine->valueAt(mappedPos); - - xpos = (xpos > timeLine->maximum()) ? timeLine->posAtValue(timeLine->maximum()) : (xpos < timeLine->minimum()) ? timeLine->posAtValue(timeLine->minimum()) : timeLine->posAtValue(xpos); - - ypos = (ypos > depthLine->maximum()) ? depthLine->posAtValue(depthLine->maximum()) : (ypos < depthLine->minimum()) ? depthLine->posAtValue(depthLine->minimum()) : depthLine->posAtValue(ypos); - - verticalLine->setPos(xpos, fromPercent(0, Qt::Vertical)); - horizontalLine->setPos(fromPercent(0, Qt::Horizontal), ypos); - - depthString->setPos(fromPercent(1, Qt::Horizontal), ypos); - timeString->setPos(xpos + 1, fromPercent(95, Qt::Vertical)); - - if (isPointOutOfBoundaries(mappedPos)) - return; - - depthString->setText(get_depth_string(depthLine->valueAt(mappedPos), true, false)); - timeString->setText(QString::number(rint(timeLine->valueAt(mappedPos))) + "min"); - - // calculate the correct color for the depthString. - // QGradient doesn't returns it's interpolation, meh. - double percent = depthLine->percentAt(mappedPos); - QColor &startColor = profile_color[SAMPLE_SHALLOW].first(); - QColor &endColor = profile_color[SAMPLE_DEEP].first(); - short redDelta = (endColor.red() - startColor.red()) * percent + startColor.red(); - short greenDelta = (endColor.green() - startColor.green()) * percent + startColor.green(); - short blueDelta = (endColor.blue() - startColor.blue()) * percent + startColor.blue(); - depthString->setBrush(QColor(redDelta, greenDelta, blueDelta)); - - if (activeDraggedHandler) - moveActiveHandler(mappedPos, handles.indexOf(activeDraggedHandler)); - if (!handles.count()) - return; - - if (handles.last()->x() > mappedPos.x()) { - verticalLine->setPen(QPen(QBrush(Qt::red), 0, Qt::SolidLine)); - horizontalLine->setPen(QPen(QBrush(Qt::red), 0, Qt::SolidLine)); - } else { - verticalLine->setPen(QPen(Qt::DotLine)); - horizontalLine->setPen(QPen(Qt::DotLine)); - } -#endif -} - DiveHandler::DiveHandler() : QGraphicsEllipseItem() { setRect(-5, -5, 10, 10); diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h index e6b534430..524c95f55 100644 --- a/qt-ui/diveplanner.h +++ b/qt-ui/diveplanner.h @@ -159,7 +159,6 @@ public: protected: virtual void showEvent(QShowEvent *event); virtual void resizeEvent(QResizeEvent *event); - virtual void mouseMoveEvent(QMouseEvent *event); qreal fromPercent(qreal percent, Qt::Orientation orientation); public slots: |