[PyQt] is there any reason why the former does not work?

Victor Noagbodji noagbodjivictor at gmail.com
Sun Oct 11 23:36:30 BST 2009


hello list,

i have tried in vain to get my head around this problem. (for the lack
of time please accept this rudimentary code)

view = QTableView()
view.setModel(QStandardItemModel())

print view.model() <---- returns None

but

view = QTableView()
model = QStandardItemModel()
view.setModel(model)

print view.model() <---- correctly prints
<PyQt4.QtGui.QStandardItemModel object at ...>

why is that happening?

-- 
paul victor noagbodji


More information about the PyQt mailing list