Hello, I am porting some Qt software from Linux to Windows. It went smoothly, except for two problems:
1) I had to comment out this line of code, that made my QGraphicsView render with OpenGL:
gui.
graphicsView->setViewport
(new QGLWidget);
gui.graphicsView->setViewport(new QGLWidget);
To copy to clipboard, switch view to plain text mode
If it was enabled, at runtime I would get warning: ASSERT: "dst.depth() == 32" in file qgl.cpp, line 1688
2) My program no longer detects arrow keystrokes. I can see they're being consumed by the QGraphicsView, because they wrongly cause the user to scroll through the graphics view. In Linux, the problem was solved by adding
gui.graphicsView->setFocusPolicy(Qt::NoFocus);
gui.graphicsView->setFocusPolicy(Qt::NoFocus);
To copy to clipboard, switch view to plain text mode
In Windows, it doesn't help. Could it be because I am no longer using OpenGL? All other keystrokes are still detected normally, like so:
void MainWindow
::keyPressEvent(QKeyEvent *keyEvent
){...
}
void MainWindow::keyPressEvent(QKeyEvent *keyEvent){...}
To copy to clipboard, switch view to plain text mode
What should I do?
Bookmarks