PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 1013 - connect to QSqlTableModel.primeInsert() causes crash
: connect to QSqlTableModel.primeInsert() causes crash
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtSql
: 1.0.6
: PC MS Windows XP/Vista/7
: P3 major
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2011-09-26 15:21 EEST by Maciej Pawlisz
Modified: 2011-11-29 21:28 EET (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Pawlisz 2011-09-26 15:21:19 EEST
Code:
app= QApplication([])
db= QSqlDatabase.addDatabase('QSQLITE')
db.setDatabaseName(':memory:')
db.open()
query=QSqlQuery()
query.exec_('CREATE TABLE "foo" (id INT);')
model = QSqlTableModel()
model.setTable('foo')
def test(row,record):
    print 'test'
model.primeInsert.connect(test)
model.select()
QTimer.singleShot(1000,lambda: model.insertRow(0))
view=QTableView()
view.setModel(model)
view.show()
app.exec_()

Additionaly, when I made a connection in my project I've got this error,
instead of crash:

TypeError: Can't call meta function because I have no idea how to handle
QSqlRecord&
Comment 1 Hugo Parente Lima 2011-10-31 16:24:30 EET
Fixed in commit:

pyside/3b70d65b9c866beadb334263f0c40474377f0967
Comment 2 Luciano Wolf 2011-11-29 21:28:40 EET
Released on PySide 1.0.9. Closing.