+void GLWidget::HandleMouseHiding(void)
+{
+ // Mouse watchdog timer handling. Basically, if the timeout value is
+ // greater than zero, decrement it. Otherwise, check for zero, if so, then
+ // hide the mouse and set the hideMouseTimeout value to -1 to signal that
+ // the mouse has been hidden.
+ if (hideMouseTimeout > 0)
+ hideMouseTimeout--;
+ else if (hideMouseTimeout == 0)
+ {
+ hideMouseTimeout--;
+ qApp->setOverrideCursor(Qt::BlankCursor);
+ }
+}
+
+
+// We use this as part of a watchdog system for hiding/unhiding the mouse. This
+// part shows the mouse (if hidden) and resets the watchdog timer.
+void GLWidget::CheckAndRestoreMouseCursor(void)
+{
+ // Has the mouse been hidden? (-1 means mouse was hidden)
+ if (hideMouseTimeout == -1)
+ qApp->restoreOverrideCursor();
+
+ hideMouseTimeout = 60;
+}
+
+
+// We check here for mouse movement; if there is any, show the mouse and reset
+// the watchdog timer.
+void GLWidget::mouseMoveEvent(QMouseEvent * /*event*/)
+{
+ CheckAndRestoreMouseCursor();
+}
+
+