You are trying to append a std::string, but QTextEdit::append() takes a QString. As a fix you can say:
textEdit1
->append
(QString::fromStdString(v
[i
]));
textEdit1->append(QString::fromStdString(v[i]));
To copy to clipboard, switch view to plain text mode
But Qt has its own data structures and string class. I think you'll be happier in the long run if you learn to use those. They are easier anyway.
EDIT:
For example,
while(!file.atEnd())
{
list.push_back(line);
}
list.sort();
for(int i = 0; i < list.count(); i++)
{
textEdit1->append(list.at(i));
}
QStringList list;
while(!file.atEnd())
{
QString line = file.readLine(200);
list.push_back(line);
}
list.sort();
for(int i = 0; i < list.count(); i++)
{
textEdit1->append(list.at(i));
}
To copy to clipboard, switch view to plain text mode
Bookmarks