PDA

View Full Version : ListView problems



waitingforzion
24th December 2009, 23:57
I am just beginning to learn Qt and have read in the independent QT tutorial about QListView and QListViewItem. When I try to create an instance of QListViewItem, QtCreator's code completion feature does not show the constructor details. Furthermore, it is not listed in the API in the help option. I'm wondering whether I am looking at two different versions of Qt, but it looks like QListViewItem is not supported in the version I am using. So if anyone could help me, I'd like to know how to manipulate list items in ListView and TreeView controls. I'm sorry, but I'm having difficulty with the API reference.

Coises
25th December 2009, 00:15
I think you must be looking at this tutorial (http://www.digitalfanatics.org/projects/qt_tutorial/). It is based on Qt 3.3; the current version of Qt is 4.6.

QListView now works with the Model/View Architecture (http://doc.trolltech.com/latest/model-view-programming.html), which was introduced in Qt 4.0. The documentation at that last link might help you get started.

waitingforzion
26th December 2009, 01:24
Thank you so much. I've got it working now.