I did this
QList<QVariant> widths;
for(int col=0; col<tableWidget->columnCount(); ++col){
widths << header->sectionSize ( header->logicalIndex ( col ) ) ;
}
settings.setValue("column widths", widths);
QList<QVariant> widths;
for(int col=0; col<tableWidget->columnCount(); ++col){
widths << header->sectionSize ( header->logicalIndex ( col ) ) ;
}
settings.setValue("column widths", widths);
To copy to clipboard, switch view to plain text mode
and I get a nice list in the settings (registry)
The list is read correctly. I can see each value with a test variable in the loop. eg.
for(int col=0; col<tableWidget->columnCount(); ++col){
header->resizeSection ( col, 80);//widths.at(col).toInt() ) ;
int thing = widths.at(col).toInt();//have a look at what's in the list - everything ok
}
QHeaderView* header = tableWidget->horizontalHeader();
for(int col=0; col<tableWidget->columnCount(); ++col){
header->resizeSection ( col, 80);//widths.at(col).toInt() ) ;
int thing = widths.at(col).toInt();//have a look at what's in the list - everything ok
}
To copy to clipboard, switch view to plain text mode
I have the feeling it's something to do with some allocation or other....
K
Bookmarks