mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 07:17:43 +02:00
only send fake event to the OGLWidget
This commit is contained in:
parent
503de083f8
commit
a4fcff6b19
1 changed files with 4 additions and 8 deletions
|
@ -721,15 +721,11 @@ void Menu::aboutApp() {
|
||||||
|
|
||||||
void sendFakeEnterEvent() {
|
void sendFakeEnterEvent() {
|
||||||
QPoint lastCursorPosition = QCursor::pos();
|
QPoint lastCursorPosition = QCursor::pos();
|
||||||
|
QGLWidget* glWidget = Application::getInstance()->getGLWidget();
|
||||||
|
|
||||||
QWindowList windows = QGuiApplication::topLevelWindows();
|
QPoint windowPosition = glWidget->mapFromGlobal(lastCursorPosition);
|
||||||
foreach(QWindow* window, windows) {
|
QEnterEvent enterEvent = QEnterEvent(windowPosition, windowPosition, lastCursorPosition);
|
||||||
if (window->isActive()) {
|
QCoreApplication::sendEvent(glWidget, &enterEvent);
|
||||||
QPoint windowPosition = window->mapFromGlobal(lastCursorPosition);
|
|
||||||
QEnterEvent enterEvent = QEnterEvent(windowPosition, windowPosition, lastCursorPosition);
|
|
||||||
QCoreApplication::sendEvent(window, &enterEvent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const int QLINE_MINIMUM_WIDTH = 400;
|
const int QLINE_MINIMUM_WIDTH = 400;
|
||||||
|
|
Loading…
Reference in a new issue