mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-28 23:28:49 -05:00
Display cursor position on Wide graph as a ToolTip.
This commit is contained in:
parent
dbaffea0cd
commit
5c4878a00a
@ -56,6 +56,7 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor
|
||||
setAutoFillBackground(false);
|
||||
setAttribute(Qt::WA_OpaquePaintEvent, false);
|
||||
setAttribute(Qt::WA_NoSystemBackground, true);
|
||||
setMouseTracking(true);
|
||||
m_bReplot=false;
|
||||
|
||||
// contextual pop up menu
|
||||
@ -697,6 +698,13 @@ void CPlotter::setRxFreq (int x) //setRxFreq
|
||||
|
||||
int CPlotter::rxFreq() {return m_rxFreq;} //rxFreq
|
||||
|
||||
void CPlotter::mouseMoveEvent (QMouseEvent * event)
|
||||
{
|
||||
int x=event->x();
|
||||
QToolTip::showText(event->globalPos(),QString::number(int(FreqfromX(x))));
|
||||
QWidget::mouseMoveEvent(event);
|
||||
}
|
||||
|
||||
void CPlotter::mouseReleaseEvent (QMouseEvent * event)
|
||||
{
|
||||
if (Qt::LeftButton == event->button () and m_mode!="FST4W") {
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <QImage>
|
||||
#include <QVector>
|
||||
#include <QColor>
|
||||
#include <QToolTip>
|
||||
|
||||
#define VERT_DIVS 7 //specify grid screen divisions
|
||||
#define HORZ_DIVS 20
|
||||
@ -91,6 +92,7 @@ protected:
|
||||
//re-implemented widget event handlers
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
void mouseMoveEvent(QMouseEvent * event) override;
|
||||
void mouseReleaseEvent (QMouseEvent * event) override;
|
||||
void mouseDoubleClickEvent (QMouseEvent * event) override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user