I am writinga palindrome checker widget.
I get one error:
pallindrome.cpp:37: error: 'lineEdit' was not declared in this scope
Here is the code for the main method
Qt Code:
  1. void palindrome::check_palindrome()
  2. {
  3. int rem,rem2,rem3,rem4,digit;
  4. int place1,place2,place3,place4,place5;
  5.  
  6. QMessageBox msgbox;
  7.  
  8. digit=lineEdit.text();
  9. rem= digit % 10000;
  10. place1= (digit-rem)/10000;
  11. rem2= rem % 1000;
  12. place2= (rem-rem2)/1000;
  13. rem3 = rem2 % 100;
  14. place3= (rem2-rem3)/100;
  15. rem4 = rem3 % 10;
  16. place4= (rem3-rem4)/10;
  17. place5=digit-(10000*place1+1000*place2+100*place3+10*place4);
  18. if((place1==place5)&&(place2==place4))
  19. {
  20. msgbox.setText("number s a palindrome");
  21. msgbox.exec();
  22. }
To copy to clipboard, switch view to plain text mode 

I put the line lineEdit->text() in the UI file so I don't know why it is giving me this error.
I am followoing a similar logic to the last prolblem. The only thing that I might need to do is convert the
lineEdit to a number , if it isn't already done.