mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-21 19:55:20 -05:00
Display cursor frequency on Wide graph (upper and lower) as a ToolTip.
This commit is contained in:
parent
56e8f0ceee
commit
7a57a399e0
@ -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;
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <QtGui>
|
||||
#include <QFrame>
|
||||
#include <QImage>
|
||||
#include <QToolTip>
|
||||
#include <cstring>
|
||||
#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:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user