[PyQt] help: beforeUpdate QSqlRecord bus error
Scott Frankel
frankel at circlesfx.com
Sun Aug 22 00:03:48 BST 2010
Hi all,
Can anyone please help shed light on why methods performed on a
QSqlRecord object would cause bus error crashes?
I'm trying to view data before it's written to my database.
Connecting to my table model's beforeUpdate signal provides me with
access to the QSqlRecord for the updating row. The problem is that
calling count() or isEmpty(), let alone anything more interesting,
causes my app to crash with a bus error.
The salient pieces look like this:
self.theModel = QtSql.QSqlTableModel(self)
self.theModel.setEditStrategy(QtSql.QSqlTableModel.OnManualSubmit)
self.connect(self.theModel, QtCore.SIGNAL("beforeUpdate(int,
QSqlRecord &)"), self.test)
def test(self, row, record):
print "test() ...", row
print "count: ", record.count()
See the attached sample app, line 112, for a working example. The app
crashes when the "commit" button is pressed, as it ponders
record.count() on line 117.
Thanks in advance!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: beforeUpdateTest.py
Type: text/x-python-script
Size: 4826 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100821/42c6d8c0/attachment.bin>
-------------- next part --------------
More information about the PyQt
mailing list