0

I am writing Ui application for an embedded device running on Embedded Linux. Each widget has QSS styles for "focused" cases. But widget that has focus does not get styled immediately after I press it.

While debugging I realized that mousePressEvent() is not called when I press, but it is called right before mouseReleaseEvent() or mouseMoveEvent(). In other words, mousePressEvent() is not called until I release or make the first move of mouse (my finger in this case).

I overloaded mousePressEvent(), mouseMoveEvent() and mouseReleaseEvent() to print debug messages. Here are the differences between expected and real logs:

// Expected
// (my action) debug message
(I touch the screen) "mouse pressed"
(I release)          "mouse released"

// Real case
(I touch)                     // nothing is printed
(I release) "mouse pressed"
            "mouse released"

In the desktop application, with actual mouse everything works as expected.

Problem is in the target device.

It is my first project with Embedded Linux and target device. I do not know what to do. What I should check, compare, install/remove. In which direction I should go/do research. What is going on here?

Bobur
  • 545
  • 1
  • 6
  • 21
  • Qt is trying to handle all platforms "equally well" (or "equally poor"). Mouse is complicated, especially if it's a "finger". Any reason you are staying with Qt version that was released in 2011? They might have fixed it since. https://en.wikipedia.org/wiki/Qt_version_history – Vlad Feinstein Mar 10 '22 at 02:32
  • @VladFeinstein It is legacy software, trying to use it a new hardware. Porting to Qt5 seems very time consuming. Interestingly, this problem doesn't show up in the devices which were released 10 years ago, around at the same time with Qt4.8. – Bobur Mar 10 '22 at 02:38
  • legacy software must run on legacy hardware then :) Please note: I don't know if it will work with modern Qt. – Vlad Feinstein Mar 10 '22 at 04:07
  • It seems my question was already asked and correctly answered in other thread https://stackoverflow.com/a/14345036/6407320 – Bobur Mar 10 '22 at 04:55

0 Answers0