Hide cursor in fullscreen mode using Qt 4.8?

后端 未结 2 1300
陌清茗
陌清茗 2021-01-17 16:09

I\'m in a ArchLinux with OpenBox and I want to hide the cursor on fullscreen inside a Qt 4.8 application. I am aware about some other question about it but no one works ever

相关标签:
2条回答
  • 2021-01-17 16:36

    I want to hide the cursor on fullscreen ...

    You could set the cursor to be the blank cursor:

    widget->setCursor(Qt::BlankCursor);
    

    Also, as the docs state:

    Some underlying window implementations will reset the cursor if it leaves a widget even if the mouse is grabbed. If you want to have a cursor set for all widgets, even when outside the window, consider QApplication::setOverrideCursor().

    So you can call:

    QApplication::setOverrideCursor(Qt::BlankCursor);
    
    0 讨论(0)
  • 2021-01-17 16:47

    There is a program named unclutter that hides the mouse pointer. Here's an ArchLinux package:

    https://www.archlinux.org/packages/community/i686/unclutter/

    I currently use it on an embedded system for hiding the mouse cursor on a touchscreen.

    0 讨论(0)
提交回复
热议问题