mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-09 01:56:00 -05:00
Use existing Qt functionality to get cursor position
Might resolve issues with cursor position detection on non-X windows on Linux
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <QJsonDocument>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QGuiApplication>
|
||||
#include <QCursor>
|
||||
#include <unordered_map>
|
||||
#include <regex>
|
||||
#include <set>
|
||||
@@ -980,3 +981,9 @@ int findIdxInRagne(QComboBox *list, int start, int stop,
|
||||
}
|
||||
return foundIdx;
|
||||
}
|
||||
|
||||
std::pair<int, int> getCursorPos()
|
||||
{
|
||||
auto cursorPos = QCursor::pos();
|
||||
return {cursorPos.x(), cursorPos.y()};
|
||||
}
|
||||
|
||||
@@ -88,3 +88,4 @@ void addSelectionGroup(QComboBox *selection, const QStringList &group,
|
||||
bool addSeparator = true);
|
||||
int findIdxInRagne(QComboBox *list, int start, int stop,
|
||||
const std::string &value);
|
||||
std::pair<int, int> getCursorPos();
|
||||
|
||||
Reference in New Issue
Block a user