aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-05-23 21:32:25 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-24 07:32:01 -0700
commit8a1e4b04db048b3809456394c6c55643826a751b (patch)
tree81ed8383c8922f343298e736368964b1031d2f19
parente6c294f718c37e24729132c586b73b1dc0047acf (diff)
downloadsubsurface-8a1e4b04db048b3809456394c6c55643826a751b.tar.gz
Remove unused code.
This code is not ported to the new profile, but from what I can understand from it, it doesn't need to be. The purpose of this code was to setup the correct colors and strings for the current mouse position, we already do this on the Profile in a different way, on the Notification Area. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/diveplanner.cpp50
-rw-r--r--qt-ui/diveplanner.h1
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: