from PyQt4 import QtGui
from PyQt4 import QtCore

class MyScrollBar(QtGui.QScrollBar):
    
    def __init__(self, parent=None):
        super(MyScrollBar, self).__init__(parent)
        self.setOrientation(QtCore.Qt.Vertical)
        self.setObjectName('my_scrollbar')

#    def wheelEvent(self, event):
#        print 'wheeling the scrollbar from wheelEvent()'
#        return QtGui.QScrollBar.wheelEvent(self, event)

    def event(self, e):
        if (e.type() == QtCore.QEvent.Wheel):
            print "wheeling the scrollbar from event()"
            return True
        return QtGui.QScrollBar.event(self, e)


if __name__ == '__main__':
    import sys
    app = QtGui.QApplication(sys.argv)
    s = MyScrollBar()
    s.show()
    sys.exit(app.exec_())
