How to hide mouse arrows in QT

Link to this article: How to hide the mouse arrow under QT_K North Carolina Code's Blog-CSDN Blog

1. Hide arrows

Header #include < QCursor >
qmake QT += gui

1. If you only want to not display the mouse pointer in a certain widget, then call it in the constructor of the widget

QWidget::setCursor(QCursor(Qt::BlankCursor));

2. If you want the entire application not to display the mouse pointer, call it after instantiating Application

QApplication::setOverrideCursor(Qt::BlankCursor);

3. You can show or hide the mouse pointer under any control or page

this->setCursor(Qt::BlankCursor);   //隐藏鼠标
this->setCursor(Qt::ArrowCursor);  //显示正常鼠标

2. Other uses

Qt’s built-in mouse style (CursorShape) is as follows:

Guess you like

Origin blog.csdn.net/T19900/article/details/129602663