Open spectrum markers dialog at current mouse position

pull/1462/head
f4exb 2022-10-01 07:32:55 +02:00
rodzic 44b0ef63c8
commit 7e35eeb69c
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -23,6 +23,7 @@
#include <QToolTip>
#include <QFileDialog>
#include <QMessageBox>
#include <QDesktopWidget>
#include "gui/glspectrumgui.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(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();
}