I have a QFormLayout where the left widgets are QLabels and the right widgets are of various types. I want to get notified when the mouse enters any part of a form-row, so I can display an explanation of that row in my statusbar.
Currently I have a QLabel subclass called HoverableLabel which exposes "mouseEntered" and "mouseLeft" signals (emitted in my reimplementations of enterEvent and leaveEvent). This works, but:
What's the Qt-blessed approach to this kind of problem?
Some things I can think of:
Neither is very nice.
I ended up using the first of the two solutions. Good enough, and with some work it can be isolated into a reusable subclass of QFormLayout.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.