title: Qt C++ How do you get the cursor at the beginning of a textedit?
body: <p>Basically I made a simple search function, however it only works if the user moves the cursor to beginning of the textedit. I was wondering if there was anything I can do to make the cursor automatically appear there. Any input would be greatly appreciated.</p>
  
  <pre><code>void Dialog::on_pushButton_clicked()
  {
      QString month;
      QString day;
      QString year;
  
      month=ui-&gt;comboBox-&gt;currentText();
      day=ui-&gt;comboBox_2-&gt;currentText();
      year=ui-&gt;comboBox_3-&gt;currentText();
  
      QTextCursor textCursor = ui-&gt;textEdit-&gt;textCursor();
      textCursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor,1);
  
      QString date= month + "/" + day + "/" + year;
      qDebug() &lt;&lt; date;
      ui-&gt;textEdit-&gt;find(date, QTextDocument::FindWholeWords);
  
  }
  </code></pre>