[PyQt] no mouseMoveEvent in QTextBrowser?
phil at riverbankcomputing.co.uk
Fri Jan 18 13:45:25 GMT 2008
On Friday 18 January 2008, martin.hammer at de.thalesgroup.com wrote:
> I'm trying to get a mouseMoveEvent from a QTextBrowser in a centralwidget
> of a QMainWindow. I can get mouseMoveEvents of the centralwidget but I
> don#t seem to be able to get them from the textBrowser. I tried none, one
> and both of commented line but nothing helped...
> Can anyone give me hint?
> class MainWindowForm(QtGui.QMainWindow):
> def __init__(self, parent=None):
> self.ui = Ui_MainWindow()
> #self.connect( self.ui.textBrowser,
> QtCore.SIGNAL("mouseMoveEvent(QMouseEvent *)"),
> #@QtCore.pyqtSignature("QMouseEvent *")
> def on_textBrowser_mouseMoveEvent(self, e):
> print "textBrowser mouse move"
> def mouseMoveEvent(self, ev):
> print "centralwidget mouse move"
Events aren't signals. You either need to sub-class QTextBrowser and
reimplement mouseMoveEvent() (as you have done for QMainWindow) or install an
More information about the PyQt