PDA

View Full Version : QListView in MainWindow.



learningqt
15th February 2012, 11:21
Hey,
I was trying to add a QListView in my MainWindow.

Could you help me with a really small example?

Thanks

ChrisW67
16th February 2012, 04:29
What have you tried? A QListView is just another widget, so any example of placing widgets into a main window is easily adapted. See also: QMainWindow::setCentralWidget() and layouts

myta212
16th February 2012, 05:44
Hi,
Like ChrisW67 answer, QListView is a widget. The sample how to use this widget is like QListView or QTableView. You can get more totural at QtDemo or from this link :

http://www.digitalfanatics.org/projects/qt_tutorial/chapter13.html (maybe you can get error when compile this code)

or from here :

http://toto-share.com/2012/02/qt-qlistview-tutorial (I get this code running without modification.)

Thank you.

Myta212