PDA

View Full Version : QListWidget Problem



pmabie
7th October 2007, 03:49
Hello Using Vista, Qt4.3.1 and Msvc 2005 pro

I created a ui form in the QT Designer and I am loading it thru ui.setupUi;

ui.setModel(indexModel);
when I try to set the Model I get a this error.
error C2248: 'QListWidget::setModel' : cannot access private member declared in class 'QListWidget'

I have made a QListWidget and tried to setModel , works fine .
QListWidget *dummy = new QListWidget();
dummy->setMode(indexModel);

I was wondering if anyone may have come across this one ,and what you did to fix it .

thanks .

jpn
7th October 2007, 06:52
Hi,

You don't use a model with QListWidget. QListWidget has its own built-in private model which works with QListWidgetItems. This is why QListWidget::setModel() has been made private, you can't change it. Use QListView if you want to use a real model.