Nfrancisj
29th March 2016, 07:29
Hello,
Continuing on my studying of Qt, Id like to learn about MouseEvents and Events in general.
for testing i have a super basic window with just a single label on it.
I've turned on mouse tracking as per the docs instruction, but i dont know how to capture the signals. i dont see onMouseOver / Hover.
what I am trying to do:
when my mouse is over the label, it executes a function 'changedText' that changes the text to 'yay'
...
self.myLabel.setMouseTracking(True)
self.myLabel.setText('put mouse is over the label')
#function to call
def changeText():
self.myLabel.setText(' YaY!')
Cheers!
Continuing on my studying of Qt, Id like to learn about MouseEvents and Events in general.
for testing i have a super basic window with just a single label on it.
I've turned on mouse tracking as per the docs instruction, but i dont know how to capture the signals. i dont see onMouseOver / Hover.
what I am trying to do:
when my mouse is over the label, it executes a function 'changedText' that changes the text to 'yay'
...
self.myLabel.setMouseTracking(True)
self.myLabel.setText('put mouse is over the label')
#function to call
def changeText():
self.myLabel.setText(' YaY!')
Cheers!