QFile myFile
("C:/Users/gozde/Desktop/gözde.txt");
const QString content
= in.
readLine();
QString searchString
("INCLUDE_DIRECTORIES(");
do{
line = in.readLine();
if (!line.contains(searchString, Qt::CaseSensitive))
{
}
} while(line!=")");
QFile myFile("C:/Users/gozde/Desktop/gözde.txt");
myFile.open(QIODevice::ReadOnly);
QTextStream in (&myFile);
const QString content = in.readLine();
QString searchString("INCLUDE_DIRECTORIES(");
QString line;
do{
line = in.readLine();
if (!line.contains(searchString, Qt::CaseSensitive))
{
QString one = in.readLine();
}
} while(line!=")");
To copy to clipboard, switch view to plain text mode
So with this code you are reading your file and doing absolutely nothing with the contents. If you want to add the strings to your tree widget, don't you think it would make more sense to do this in the place where you are actually filling your tree widget?
If you want to read the file in main(), then the least you could do is to store the strings in a QStringList, then add a method to your MainWindow class that you can call, passing the QStringList as an argument. In that function, you add each string to your tree.
Bookmarks