No mouse cursor in Qt EGLFS on Yocto - qt

I am trying to use mouse cursor in Qt5 application.
When I run ./Qt5_CinematicExperience :
Failed to move cursor on screen HDMI1: -14
Could not set cursor on screen HDMI1: -6
There is no mouse cursor displayed on the screen.
Same results with another Qt5 application.
The click event seems to be working.
I am using Yocto rocko on kernel 4.14.24.
Do you think Qt5 needs a specific library to use mouse?
My mouse is present as input device in /dev/input/.
A cat command on /dev/input/event1 displays a lot of characters when I move the mouse.

Check if you have this line in your QT_QPA_EGLFS_KMS_CONFIG:
"hwcursor" : false

The problem isn't with the input device at all: it clearly works. It has to do with the cursor - the thing that you see on-screen that represents the position of the mouse. I'd guess that Qt tries to be clever about how it displays the cursor - as Groleo said, very likely the hardware or the drivers doen't support a hardware-accelerated mouse cursor.
You could easily see that the mouse works by implementing the mouse cursor yourself :)

Related

Last screen seen on cursor position after moving to a new screen

I'm running Qt 5.5.1 on my embedded Linux machine. When a mouse is connected the cursor is visible and work as expected, but, when I'm pressing on a widget to move to another screen the new screen is presented with the old screen view inside a small square (mouse background at the time of the press). Example:
It seems like it's a rendering issue. Your help is most welcome.

How to draw over everything on the screen using Qt?

The basic idea is: I would like to draw over everything on the screen.
One way I can imagine this is creating a transparent full-screen window without window controls (minimise, maximise, etc.) or borders. Then drawing into that window which is transparent. The problem I can think of is that I will be unable to control windows which are behind our transparent window.
How could I do something similar to this, without the mentioned problem? I would also like it to work on multiple operating systems if possible.
Edit:
The user will not be drawing with the mouse or other means on the screen, but will be able to continue use his desktop like normal, without that my program interferes in any way (other than the drawing on the screen). My program will only display something on the screen, which the user will be unable to interact with (at least that's the plan).
Qt 5 implements it:
QWidget w;
w.setWindowFlags(Qt::WindowTransparentForInput);
Qt 4 didn't support this functionality yet - see QTBUG-13559. The bug report had a hint on what needed to be done for Windows.
The method you describe is the one to use; a transparent full-screen window.
If you're using the left mouse button to draw, you'll need a mechanism of switching modes to be able to select items through the window and send events to the operating system.

Hide cursor in fullscreen mode using Qt 4.8?

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 every time: sometimes the cursor is hiding, sometimes not. I didn't managed to understand exactly when the problem occurs but I think that maybe is it related with the screensaver because if I test my application just after the computer is restarted the mouse cursor is no visible (and it is what I want) but if I test this feature during the day the mouse cursor is still visible in fullscreen.
This is my code:
void MainWindow::toggleFullScreen()
{
if(!this->isFullScreen())
{
this->showFullScreen();
#ifdef Q_WS_QWS
QWSServer::setCursorVisible( false );
#endif
}
else
{
this->showNormal();
}
}
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);
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.

Is it possible in Qt to move the mouse and make it "click" anywhere on screen?

Title says it all! My program should run in background and sometimes move to a coordinate and do a mousepress. I can move the mouse, but I can't make it click. Is it possible somehow?

Flex: How to avoid flickering cursor for custom cursor on mouse down

I set a custom cursor using the CursorManager on a sprite's mouse down event.
The custom cursor is shown. However, when I keep the mouse pressed the system cursor shows as well and is flickering.
Any idea how to prevent this?
I've tried:
- higher cursor priorities
- preventing the default in the mouse down event
nothing seems to work.
Changing the cursor just on mouse over works fine.
Thanks
Stefan
PS:
- Safari on Mac
- Flash debug player 10.0.2.54

Resources