mmm286
5th August 2009, 06:49
Hi,
I have a file with encoding with UTF-8 Unicode text.
I read from file to insert the fields file in a qtablewidget. For do this I do:
QTextStream ins(&file);
while (!ins.atEnd()) {
QString line = ins.readLine();
QTableWidgetItem *item = new QTableWidgetItem;
item->setText(line);
tabla->setItem(b,0,item);
tabla->setRowHeight(b,20);
b++;
}
Everything it's ok and the qtablewidget shows me the fields with accents.
But then I try to assign a variable to a cell selected with:
titulo= tabla->item(rowd,cold)->text();
And I see that this variable have strange characters instead of accents.
How could I solved that?
Many thanks and sorry for my english!
I have a file with encoding with UTF-8 Unicode text.
I read from file to insert the fields file in a qtablewidget. For do this I do:
QTextStream ins(&file);
while (!ins.atEnd()) {
QString line = ins.readLine();
QTableWidgetItem *item = new QTableWidgetItem;
item->setText(line);
tabla->setItem(b,0,item);
tabla->setRowHeight(b,20);
b++;
}
Everything it's ok and the qtablewidget shows me the fields with accents.
But then I try to assign a variable to a cell selected with:
titulo= tabla->item(rowd,cold)->text();
And I see that this variable have strange characters instead of accents.
How could I solved that?
Many thanks and sorry for my english!