I wanna put my custom widget in a QScrollArea, but in my custom widget, i reimplemented wheelEvent(e) and it never gets called. Im fine with the scroll area not having its mouse wheel scrolling functionality, I just need those wheelEvents to call my handler. I tried handling the events out at the level of the main window but I only got them when the scroll widget was at one of its extremes and couldn't have moved any further anyways, i need all of them.
heres a simplified version of my code
class custom(QWidget):
def __init__(self, parent=None):
super(custom, self).__init__(parent)
self.parent = parent
def wheelEvent(self,event):
print "Custom Widget's wheelEvent Handler"
class mainw(QMainWindow):
def __init__(self, parent=None):
super(mainw, self).__init__(parent)
scroll = QScrollArea()
self.tw = thread_widget(scroll)
scroll.setWidget(self.tw)
self.setCentralWidget(scroll)
def wheelEvent(self,event):
print "Main Window's wheelEvent Handler"
can someone explain to me how it is determined which event handler gets the events in this situation?