python segfaulting, MemoryError (PyQt)

Denis L no at spam.com
Tue Apr 28 13:07:30 EDT 2009


"Phil Thompson" <phil at riverbankcomputing.com> wrote in message 
news:mailman.4699.1240932385.11746.python-list at python.org...

> If there was a bug with lambda slots it's been fixed by now.

I just tried it and I'm getting the same errors with regular functions.

Could you try running the code bellow? What output you are getting when 
barTextChanged is called?

On my system self.foo and text point to the same QString object.

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *

class Options(QDialog):
    def __init__(self):
        QDialog.__init__(self)

        fooEdit = QLineEdit()
        self.connect(fooEdit, SIGNAL('textChanged(QString)'),
                     self.fooTextChanged)

        barEdit = QLineEdit()
        self.connect(barEdit, SIGNAL('textChanged(QString)'),
                     self.barTextChanged)

        layout = QVBoxLayout()
        layout.addWidget(fooEdit)
        layout.addWidget(barEdit)
        self.setLayout(layout)

    def fooTextChanged(self, text):
        self.foo = text

    def barTextChanged(self, text):
        print self.foo, text, id(self.foo), id(text)

def main(args):
    app = QApplication(args)
    dialog = Options()
    dialog.show()
    app.exec_()

if __name__ == '__main__':
    main(sys.argv)





More information about the Python-list mailing list