Hi,

In my application, I have a problem with find a word in the QTextBrowser.

For some texts,
It finds occurrence of the text in the whole document when it reached end of document, it reports "Text not found" rather than "Search reached end of the document".

At the same time if the user presses the "FIND" subsequently, find process goes one step backwardly to the document and then proceed from the starting of the document.

Note:
The above problem is not for all the text in the document.

This is my Code snippet:
Qt Code:
  1. bool DWCHelpWindow::findTextInWindow ( const QString& searchStr, QString& resultStr, bool cs, bool wo, bool forward ) {
  2. if ( !bIsLimitReached ) {
  3. if ( m_browser->find ( searchStr, cs, wo, forward ) ) {//m_browser is member of QTextBrowser
  4. resultStr = "";
  5. bIsLimitReached = FALSE;
  6. return TRUE;
  7. } else {
  8. if ( m_browser->find ( searchStr, cs, wo, ( !forward ) ) ) {
  9. if ( !bIsLimitReached ) {
  10. if ( forward ) {
  11. m_browser->find ( searchStr, cs, wo, ( forward ) );
  12. resultStr = "Search reached end of the document";
  13. } else {
  14. m_browser->find ( searchStr, cs, wo, ( forward ) );
  15. resultStr = "Search reached start of the document";
  16. }
  17. }
  18. bIsLimitReached = TRUE;
  19. } else {
  20. resultStr = "Text not found";
  21. }
  22. return FALSE;
  23. }
  24. } else
  25. return FALSE;
  26. }
To copy to clipboard, switch view to plain text mode 
I could not figure out the problem.
plz any help.