Hi,
Quote Originally Posted by Vash5556 View Post
Qt Code:
  1. void VashTextEditor::find()
  2. {
  3. FindDialog findDialog(this);
  4. if (!findDialog.exec())
  5. return;
  6.  
  7. const QString searchString = findDialog.getSearchString();
  8. bool test = documentEdit->find(searchString);
  9.  
  10. if (test)
  11. {
  12. QMessageBox::information(this, tr("Vash Text Editor"), tr("Expression found."));
  13. }
  14. else
  15. {
  16. QMessageBox::information(this, tr("Vash Text Editor"), tr("Expression not found."));
  17. }
  18. }
To copy to clipboard, switch view to plain text mode 
Seems fine, but to debug what does following code produce (at the end of your function)?

Qt Code:
  1. qWarning() << searchString;
  2. qWarning() << documentEdit->toPlainText();
  3. qWarning() << documentEdit->textCursor()->position();
To copy to clipboard, switch view to plain text mode 



Qt Code:
  1. void FindDialog::toggleFindButton()
  2. {
  3. QString currentText = findLineEdit->text();
  4.  
  5. if (!currentText.isEmpty())
  6. {
  7. findButton->setEnabled(true);
  8. }
  9. else
  10. {
  11. findButton->setEnabled(false);
  12. }
  13. }
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. findButton->setEnabled(!findLineEdit->text().isEmpty());
To copy to clipboard, switch view to plain text mode 
does the same.

P.s.: Expected is a normal string, no regular expression.