only send fake event to the OGLWidget

This commit is contained in:
Stephen Birarda 2013-11-06 12:36:52 -08:00
parent 503de083f8
commit a4fcff6b19

View file

@ -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;