I am in ArchLinux with OpenBox, and I want to hide the cursor in full screen mode in a Qt 4.8 application. I know about some other question, but no one works every time: sometimes the cursor hides, sometimes not. I was not able to understand exactly when the problem occurs, but I think that this may be due to the screensaver, because if I test my application right after restarting the computer, the mouse cursor will not be visible (and this is what I want), but if I test this function during the day, the mouse cursor is still displayed in full screen.
This is my code:
void MainWindow::toggleFullScreen() { if(!this->isFullScreen()) { this->showFullScreen(); #ifdef Q_WS_QWS QWSServer::setCursorVisible( false ); #endif } else { this->showNormal(); } }
nkint source share