Hi all, I hope this is an easy question. How do I go about solving this problem I have with setText
This is my code:
string line;
ifstream myfile("example.txt");
if (myfile.is_open()) // Checks to see whether myfile opens
{
getline(myfile, line);
ui->QuestionBox->setText(line);
} else ui->QuestionBox->setText("An error has occured!");
string line;
ifstream myfile("example.txt");
if (myfile.is_open()) // Checks to see whether myfile opens
{
getline(myfile, line);
ui->QuestionBox->setText(line);
} else ui->QuestionBox->setText("An error has occured!");
To copy to clipboard, switch view to plain text mode
It keeps throwing up an error. Is this because setText is supposed to have a QString associated with it... if so how do i overcome this problem. C++ didn't confuse me until I started learning QT, now nothing seems to work
Thanks for your help
Bookmarks