Well,this is what I have so far:
void Victims::save()
{
set.beginGroup("setting");
int grows = ui->tw->rowCount();
int gcols = ui->tw->columnCount();
for(int i = 0; i < grows ;i++)
{
for(int j = 0; j < gcols ;j++)
{
tmp = widgetItem(i,j)->text(); //tmp is a string.
if ( tmp.isEmpty() )
break;
}
set.setValue("victims", tmp); //tmp will be the string that will be put into set.value(),correct?
}
set.endGroup();
}
void Victims::save()
{
QSettings set("vic","tims");
set.beginGroup("setting");
int grows = ui->tw->rowCount();
int gcols = ui->tw->columnCount();
for(int i = 0; i < grows ;i++)
{
for(int j = 0; j < gcols ;j++)
{
QTableWidgetItem* widgetItem = ui->tw->item(grows, gcols);
tmp = widgetItem(i,j)->text(); //tmp is a string.
if ( tmp.isEmpty() )
break;
}
set.setValue("victims", tmp); //tmp will be the string that will be put into set.value(),correct?
}
set.endGroup();
}
To copy to clipboard, switch view to plain text mode
However it gives me an error: widgetItem cannot be used as a function :/
Am I on the right way?
Bookmarks