Sure, so when I load a file I get the fileName and then call the insertFileName() function which is a function of the QTreeWidget subclass to have the name of the file listed in the tree as I load, This function is:
@
void myTreeWidget::insertFileName(QString fileName)
{
int i = 0;
bool full = true;
QTreeWidgetItem* item = new QTreeWidgetItem(this);
item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEditable |Qt::ItemIsEnabled | Qt::ItemIsSelectable);
QString fName = withoutPath(fileName);
QString stype = 'String';
while(full)
{
if(topLevelItem(i))
i++;
else
{
item->setText(0, fName);
item->setCheckState(0, Qt::Checked);
item->setText(1, stype);
insertTopLevelItem(i, item);
setCurrentItem(item, 0);
full = false;
}
}
}
@
So this loads the files fine but can't uncheck any of the loaded files. The point of being able to check or uncheck is that with that I want to update the display of my application so I need to be able to set checked (to make visible) or viceversa..