Hello all,
what's going wrong here:
I'm reading in a list of integers from QSettings and that means doing some juggling with QList<QVariant>, no problem but I get a crash on leaving the function.
QList<QVariant> widths;
//fill the QList with some default value
for(int col=0; col<tableWidget->columnCount(); ++col){
widths << 80;//some standard width
}
//read a QVariant from QSettings and convert it to a QList<QVariant>
widths = settings.value("column widths").toList();
//or with a default value
widths
= settings.
value("column widths",
QVariant(widths
)).
toList();
//then I use the widths variable and get a crash on leaving the function
QList<QVariant> widths;
//fill the QList with some default value
for(int col=0; col<tableWidget->columnCount(); ++col){
widths << 80;//some standard width
}
//read a QVariant from QSettings and convert it to a QList<QVariant>
widths = settings.value("column widths").toList();
//or with a default value
widths = settings.value("column widths", QVariant(widths)).toList();
//then I use the widths variable and get a crash on leaving the function
To copy to clipboard, switch view to plain text mode
thanks
K
Bookmarks