mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-25 05:38:46 -05:00
Display cursor location (in seconds) on the Fast Graph.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7086 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
f93c305ce2
commit
fc8811176e
19
fastplot.cpp
19
fastplot.cpp
@ -34,6 +34,7 @@ FPlotter::FPlotter(QWidget *parent) : //FPlotter Constructor
|
||||
m_ScalePixmap.fill(Qt::white);
|
||||
drawScale();
|
||||
draw();
|
||||
setMouseTracking(true);
|
||||
}
|
||||
|
||||
FPlotter::~FPlotter() { } // Destructor
|
||||
@ -211,6 +212,24 @@ void FPlotter::draw() //draw()
|
||||
update(); //trigger a new paintEvent
|
||||
}
|
||||
|
||||
void FPlotter::mouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
QPainter painter(&m_HorizPixmap);
|
||||
int x=event->x();
|
||||
// int y=event->y();
|
||||
float t=x/m_pixPerSecond;
|
||||
QString t1;
|
||||
t1.sprintf("%4.1f",t);
|
||||
if(m_t1.length()==4) {
|
||||
painter.setPen(Qt::black);
|
||||
painter.drawText (380,90,m_t1);
|
||||
}
|
||||
painter.setPen(Qt::yellow);
|
||||
painter.drawText (380,90,t1);
|
||||
update();
|
||||
m_t1=t1;
|
||||
}
|
||||
|
||||
void FPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent
|
||||
{
|
||||
int x=event->x();
|
||||
|
@ -45,6 +45,7 @@ protected:
|
||||
|
||||
private slots:
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseMoveEvent(QMouseEvent *event);
|
||||
|
||||
private:
|
||||
|
||||
@ -57,6 +58,7 @@ private:
|
||||
QString m_HDivText[483];
|
||||
QString m_t;
|
||||
QString m_t0;
|
||||
QString m_t1;
|
||||
|
||||
double m_pixPerSecond;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user