Re: [PyQt] KHTMLPart mouse events
Am Saturday, 10. January 2009 schrieben Sie: On Friday 09 January 2009 08:50:07 am Christoph Burgmer wrote: It seems that khtmlMousePressEvent (khtml::MousePressEvent* event) is the right place to do that, but the sip-file does not have those mouse event methods, they are commented out. [snip] I suspect that khtml::MousePressEvent is not a class that's exposed in the public KDE API - meaning it's declared in some file that PyKDE doesn't wrap. So if you got one, you couldn't do anything with it anyway, since it's not a wrapped class. However, there are mouse events (QMouseEvent) available in KHTMLView, and you can get the KHTMLView object from the part by calling it's view() method. [snip] Thanks for the answer. I finally ported my main view from KHTMLPart to QWebView and a few lines give me what I want + portability to pure Qt for later. class CharacterView(QtWebKit.QWebView): def mousePressEvent(self, event): QtWebKit.QWebView.mousePressEvent(self, event) if event.button() == QtCore.Qt.MidButton: self.emit(QtCore.SIGNAL(midButtonRelease)) Christoph ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] KHTMLPart mouse events
Jim, Simon, I hope you can help me. I am trying to track a user's MidButton mouse click to track paste actions. It seems that khtmlMousePressEvent (khtml::MousePressEvent* event) is the right place to do that, but the sip-file does not have those mouse event methods, they are commented out. Can that be changed in a later version? Is there a reason for them not being activated? The KHTMLPart itself does the MidButton action in these methods[1]. Christoph [1] http://api.kde.org/4.x-api/kdelibs-apidocs/khtml/html/khtml__part_8cpp- source.html#l06061 ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] KHTMLPart mouse events
On Friday 09 January 2009 08:50:07 am Christoph Burgmer wrote: Jim, Simon, I hope you can help me. I am trying to track a user's MidButton mouse click to track paste actions. It seems that khtmlMousePressEvent (khtml::MousePressEvent* event) is the right place to do that, but the sip-file does not have those mouse event methods, they are commented out. Can that be changed in a later version? Is there a reason for them not being activated? The KHTMLPart itself does the MidButton action in these methods[1]. I suspect that khtml::MousePressEvent is not a class that's exposed in the public KDE API - meaning it's declared in some file that PyKDE doesn't wrap. So if you got one, you couldn't do anything with it anyway, since it's not a wrapped class. However, there are mouse events (QMouseEvent) available in KHTMLView, and you can get the KHTMLView object from the part by calling it's view() method. Don't know if those will do what you want, but it seems like they should. Jim ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt