Oh well. I didn't have a reason for doing that, it was just plain ignorance.
I corrected that, and also one more thing. I eliminate the std::string from
std::string strtmp(attr->value());
oCol.item(i-1)->setText(QString::fromStdString(strtmp));
Standard c++ strings might not cope well with UTF-8 encoding. So I changed it to
QString strtmp(attr->value());
oCol.item(i-1)->setText(strtmp);
These two changes combined have solved it. Thank you very much!