Issue
I've got a QGraphicsScene
in which I added QPushButtons
inside QGraphicsProxyWidgets
. Is there a way to display tooltips for those buttons? The setToolTip
works but nothing appear when I hover on the buttons. Do I need to specify some flag on the QGraphicsScene/View
?
A simplified version of the button creation code :
class Button(QPushButton):
def __init__(self, scene):
super(Button, self).__init__()
self.proxy = QGraphicsProxyWidget()
self.proxy.setWidget(self)
scene.addItem(self.proxy)
self.setToolTip("tooltip")
Thanks in advance !
Solution
Setting the tooltip on the proxy didn't work either, sadly, but a coworker looked a bit further in my code and found why neither proxy nor button's tooltip worked : I had set an override on the QGraphicsView mouseMoveEvent
, which might have broken the hover event. Adding a...
else :
super(CustomGraphicsView, self).mouseMoveEvent(event)
...at the end of the mouseMoveEvent
override solved the problem. Sorry for the mistake, and thanks for the help !
Answered By - Loukana
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.