Hi guys

in short:

In the following class, how come only the last method appends to the
TextEdit ?

class MyTextEdit(QTextEdit):
    def __init__(self, parent = None):
        QTextEdit,__init__(self, parent)

    def mousePressEvent(self, event):
        if event.buttons() == Qt.LeftButton and event.modifiers() ==
Qt.ShiftModifier:
            pos = event.pos()
            self.append("(%s,%s)" % (pos.x(), pos.y())

    def mouseReleaseEvent(self, event):
        if event.modifiers() == Qt.ShiftModifier:
            pos = event.pos()
            self.append("(%s,%s)" % (pos.x(), pos.y())

    def mouseMoveEvent(self, event):
        if event.buttons() == Qt.LeftButton and event.modifiers() ==
Qt.ShiftModifier:
            pos = event.pos()
            self.append("(%s,%s)" % (pos.x(), pos.y())

I'm lost,
thanks guys

- Ole Johan 
-- 
View this message in context: 
http://old.nabble.com/overriding-mousePressedEvent-not-working-with-QTextEdit-tp27731934p27731934.html
Sent from the PyQt mailing list archive at Nabble.com.

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to