...are you sure that your application can find the text file when you run it?
It seems that it can't... But why? I have this text file in the same directory with .pro, .cpp and .h files. And this directory is on the same disÑ, where Qt SDK is installed.
QList<QPair<
QString,QList<QString> > > list;
{
while(!stream.atEnd())
{
str = file.readLine();
...and store this lines in list
}
}
QFile file("words.txt");
QString str;
QList<QPair< QString,QList<QString> > > list;
if(file.open(QIODevice::ReadOnly | QIODevice::Text))
{
QTextStream stream(&file);
while(!stream.atEnd())
{
str = file.readLine();
...and store this lines in list
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks