I wrote a function:

Qt Code:
  1. #include<qstring.h>
  2.  
  3. void Calculator::calculation(QString &operation, QString &text_display)
  4. {
  5. QString a_string = "", b_string = "", result_string = "";
  6. double a, b, result;
  7. int position = 0, i, j;
  8.  
  9. while(1)
  10. {
  11. if ( ( position = operation.find('*') ) == -1 ) break;
  12.  
  13. for( i = position; i = 0 ; i-- )
  14. {
  15. if( operation.at( i ) == '*' || operation.at( i ) == '/' || operation.at( i ) == '+' || operation.at( i ) == '-' )
  16. break;
  17. a_string += operation.at( i );
  18. }
  19. for( j = position; j < operation.length() ; j++ )
  20. {
  21. if( operation.at( j ) == '*' || operation.at( j ) == '/' || operation.at( j ) == '+' || operation.at( j ) == '-' )
  22. break;
  23. b_string += operation.at( j );
  24. }
  25. a = a_string.toDouble();
  26. b = b_string.toDouble();
  27. result = a*b;
  28. result_string = result_string.setNum( result, 'f', 10 );
  29. operation.replace( i, i + j + 1, result_string );
  30. }
  31. text_display = result_string;
  32. ui.display->setText( text_display );
  33. }
To copy to clipboard, switch view to plain text mode 

Compiler says that QString class has no member function called 'find' (line 11), but when I read QString documentation...

http://doc.trolltech.com/3.3/qstring.html#find

...it's right there. Every other function like lenght() or at() works. What's wrong then?