diff --git a/map65/plotter.cpp b/map65/plotter.cpp index 245264dd3..20b0f81b6 100644 --- a/map65/plotter.cpp +++ b/map65/plotter.cpp @@ -16,6 +16,7 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor setAutoFillBackground(false); setAttribute(Qt::WA_OpaquePaintEvent, false); setAttribute(Qt::WA_NoSystemBackground, true); + setMouseTracking(true); m_StartFreq = 100; m_nSpan=65; //Units: kHz @@ -763,6 +764,23 @@ void CPlotter::setLockTxRx(bool b) } } +void CPlotter::mouseMoveEvent (QMouseEvent * event) +{ + int h = m_WaterfallPixmap.height(); + int x=event->x(); + int y=event->y(); + bool lower=(y > 30+h); + float freq=FreqfromX(x); + float df=m_fSample/32768.0; + int ndf=x*df + m_ZoomStartFreq; + if(lower) { + QToolTip::showText(event->globalPos(),QString::number(ndf)); + } else { + QToolTip::showText(event->globalPos(),QString::number(freq)); + } + QWidget::mouseMoveEvent(event); +} + double CPlotter::rxFreq() { return floor(datcom_.fcenter) + 0.001*m_fQSO + 0.000001*m_DF; diff --git a/map65/plotter.h b/map65/plotter.h index 2d372c6c6..6f2922458 100644 --- a/map65/plotter.h +++ b/map65/plotter.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "commons.h" @@ -82,6 +83,7 @@ protected: //re-implemented widget event handlers void paintEvent(QPaintEvent *event); void resizeEvent(QResizeEvent* event); + void mouseMoveEvent(QMouseEvent * event) override; private: