Note that there are some explanatory texts on larger screens.

plurals
  1. POQt for Embedded Linux: Hide cursor on startup
    text
    copied!<p>I'm developing a Qt application on a linux embedded system. The system has got a touchscreen, but also an OTG USB port, and it must be usable with a mouse.</p> <p>So my problem is, when the application starts, it shows a mouse cursor in the middle of the screen, and then it disapears when my main windows paint event occurs.</p> <p>When the application has started, I can hide/show the cursor if a mouse is plugged in, that works great, but I always have the cursor during the startup.</p> <p>I tried: QWSServer::setCursorVisible(false);</p> <p>or: qApp->setOverrideCursor(QCursor(Qt::BlankCursor));</p> <p>and the result is the same as described above.</p> <p>The only way I found to hide the cursor during startup was compiling Qt without the Cursor, but then I can't have a cursor when the mouse is plugged in (that's logic...).</p> <p>So if you have an idea, I would be happy to read it :-)</p> <p>Thanks, Sylvain</p> <p>EDIT: Okey so that's the QWS Server that shows the cursor on startup, I found that in qt/src/gui/embedded/qwscursor_qws.cpp:</p> <pre><code>void QWSServerPrivate::initializeCursor() { Q_Q(QWSServer); // setup system cursors #ifndef QT_NO_QWS_CURSOR // qt_screen-&gt;initCursor(sharedram + ramlen,true); // default cursor cursor = 0; setCursor(QWSCursor::systemCursor(Qt::ArrowCursor)); #endif q-&gt;sendMouseEvent(QPoint(swidth/2, sheight/2), 0); } </code></pre> <p>Now if I comment the "setCursor" instruction, that solves the problem, but that's kind of ugly to edit Qt source code to do that, so if you've got a better solution...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload