Try to hide cursor in output window, when desired

This commit is contained in:
Alexandre Quessy
2014-10-20 17:13:37 -04:00
parent 363b5795ba
commit af84795c78
4 changed files with 43 additions and 7 deletions
+27 -7
View File
@@ -36,6 +36,24 @@ OutputGLWindow::OutputGLWindow(MainWindow* mainWindow, QWidget* parent, const QG
// Save window geometry.
_geometry = saveGeometry();
_pointerIsVisible = true;
}
void OutputGLWindow::setCursorVisible(bool visible)
{
_pointerIsVisible = visible;
if (_pointerIsVisible)
{
this->setCursor(Qt::BlankCursor);
_pointerIsVisible = false;
}
else
{
this->setCursor(Qt::ArrowCursor);
_pointerIsVisible = true;
}
}
void OutputGLWindow::closeEvent(QCloseEvent *event)
@@ -47,14 +65,16 @@ void OutputGLWindow::closeEvent(QCloseEvent *event)
void OutputGLWindow::keyPressEvent(QKeyEvent *event)
{
// Escape from full screen mode.
if (isFullScreen() && event->key() == Qt::Key_Escape)
if (event->key() == Qt::Key_Escape)
{
setFullScreen(false);
emit fullScreenToggled(false);
}
else if (event->key() == Qt::Key_Escape)
{
// pass
if (isFullScreen())
{
setFullScreen(false);
emit fullScreenToggled(false);
} else {
setFullScreen(true);
emit fullScreenToggled(true);
}
}
else
{