title: C++ GUI Text Not Displaying
body: <p>Basically I made a simple program to search a text file for a certain word. However my text file does not display in the textEdit Object it just displays it blank. I properly placed the text file into the resources and everything. I would really appreciate some input.   </p>
  
  <pre><code>#include &lt;QtCore/QFile&gt;
  #include &lt;QtCore/QTextStream&gt;
  #include "find.h"
  #include "ui_find.h"
  
  Find::Find(QWidget *parent) : QWidget(parent), ui(new Ui::Find)
  {
      ui-&gt;setupUi(this); //sets up user interface
      getTextFile();
  }
  
  Find::~Find()
  {
      delete ui;
  }
  
  void Find::on_goButton_clicked()
  {
      QString word = ui-&gt;lineEdit-&gt;text(); //gets text and stores in word
      ui-&gt;textEdit-&gt;find(word, QTextDocument::FindWholeWords);
  }
  
  void Find::getTextFile()
  {
      QFile myFile(":/textfile.txt"); //what file
      myFile.open(QIODevice::ReadOnly); //opens file
  
      QTextStream textStream(&amp;myFile); //convert to stream
      QString line = textStream.readAll(); //store into variable
      myFile.close(); //close file
  
      ui-&gt;textEdit-&gt;setPlainText(line); //display text
      QTextCursor textCursor = ui-&gt;textEdit-&gt;textCursor(); //moves cursor into position
      textCursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor, 1); //moves cursor into position
  
  }
  </code></pre>
  
  <p>The application output also has this in red letters QIODevice::read: device not open</p>