kopia lustrzana https://github.com/f4exb/sdrangel
Open spectrum markers dialog at current mouse position
rodzic
44b0ef63c8
commit
7e35eeb69c
|
@ -23,6 +23,7 @@
|
||||||
#include <QToolTip>
|
#include <QToolTip>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QDesktopWidget>
|
||||||
|
|
||||||
#include "gui/glspectrumgui.h"
|
#include "gui/glspectrumgui.h"
|
||||||
#include "dsp/fftwindow.h"
|
#include "dsp/fftwindow.h"
|
||||||
|
@ -475,6 +476,12 @@ void GLSpectrumGUI::on_markers_clicked(bool checked)
|
||||||
connect(m_markersDialog, SIGNAL(updateMarkersDisplay()), this, SLOT(updateMarkersDisplay()));
|
connect(m_markersDialog, SIGNAL(updateMarkersDisplay()), this, SLOT(updateMarkersDisplay()));
|
||||||
connect(m_markersDialog, SIGNAL(finished(int)), this, SLOT(closeMarkersDialog()));
|
connect(m_markersDialog, SIGNAL(finished(int)), this, SLOT(closeMarkersDialog()));
|
||||||
|
|
||||||
|
QPoint globalCursorPos = QCursor::pos();
|
||||||
|
int mouseScreen = qApp->desktop()->screenNumber(globalCursorPos);
|
||||||
|
QRect mouseScreenGeometry = qApp->desktop()->screen(mouseScreen)->geometry();
|
||||||
|
QPoint localCursorPos = globalCursorPos - mouseScreenGeometry.topLeft();
|
||||||
|
m_markersDialog->move(localCursorPos);
|
||||||
|
|
||||||
m_markersDialog->show();
|
m_markersDialog->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue