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:

Qt Code:
  1. string line;
  2.  
  3. ifstream myfile("example.txt");
  4. if (myfile.is_open()) // Checks to see whether myfile opens
  5. {
  6. getline(myfile, line);
  7. ui->QuestionBox->setText(line);
  8.  
  9. } 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