Hello,

i have a slight problem and i think im just missing something obvious here, so instead of pulling my hair out i decided to ask for help


this is my class declaration
Qt Code:
  1. #ifndef PARSER_H
  2. #define PARSER_H
  3.  
  4. #include <QFile>
  5. #include <QTextStream>
  6. #include <QString>
  7. #include <QTextStream>
  8. #include <QMessageBox>
  9. #include <QDebug>
  10. class parser : public QObject
  11.  
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit parser(QObject *parent = 0);
  16.  
  17. void proces_line(QString line);
  18. int read_line();
  19.  
  20.  
  21. private:
  22.  
  23. };
  24.  
  25. #endif // PARSER_H
To copy to clipboard, switch view to plain text mode 

and the implemenation
Qt Code:
  1. #include "parser.h"
  2.  
  3. parser::parser(QObject *parent) :
  4. QObject(parent)
  5. {
  6.  
  7.  
  8. }
  9. void parser::proces_line(QString line)
  10. {
  11. qDebug()<<"im reading";
  12. }
  13. int parser::read_line()
  14. {
  15. QFile file("C:/Qt/test/downloaded.txt");
  16.  
  17. if(!file.exists())
  18. {
  19. qDebug()<<"the file does not exist";
  20. return 1;
  21. }
  22. if(!file.open(QIODevice::ReadOnly | QIODevice::Text))
  23. {
  24. qDebug()<<"failed to open";
  25. return 1;
  26. }
  27. QTextStream in_stream(&file);
  28. QString line=in_stream.readLine();
  29.  
  30.  
  31. while (!line.isNull())
  32. {
  33. process_line(line); ***
  34. line = in_stream.readLine();
  35. }
  36.  
  37. ;
  38. return 0;
  39. }
To copy to clipboard, switch view to plain text mode 

*** this is where i get a C3861: 'process_line)':identifier not found

and main

Qt Code:
  1. #include "mainwindow.h"
  2. #include "parser.h"
  3. #include <QApplication>
  4.  
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. QApplication a(argc, argv);
  9. MainWindow w;
  10. w.show();
  11.  
  12.  
  13. parser p;
  14. p.read_line();
  15.  
  16.  
  17. return a.exec();
  18. }
To copy to clipboard, switch view to plain text mode 
im trying to build a class (just a skeleton code) to parse my txt file (need to grab some specific information from it)
so some tips would also be welcome if you spot something.

thx in advance