[PyQt] accessing model's data of QListView

Panupat Chongstitwattana panupatc at gmail.com
Thu Jan 19 08:50:45 GMT 2012


I'm still a beginner and I can't figure this out from the documentations on
my own :(

I am using QSqlTableModel to access a table called "project".

projectModel = QSqlTableModel()
projectModel.setTable("project")
projectModel.select()

In projectModel, column(0) are the ID, column(1) are the names. QListView
is set to show column 1

projectView.setModelColumn(1)

Now when I click an item, I want to retrieve the ID on column(0) of the
selected item. Can anyone point me to some example how I can do this,
please?

Any help appreciate, thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20120119/b96db5b9/attachment.html>


More information about the PyQt mailing list