Hello friends,

how can I access my QTexEdit from another class or from a Thread.

Qt Code:
  1. thr_startReadTrackFile = new readTrackFile(selectedFile, bodyEdit);
  2. thr_startReadTrackFile->start();
To copy to clipboard, switch view to plain text mode 

when I append a line to the TextEdit in my Thread I have an Error .....

my Thread declaration looks like
Qt Code:
  1. //**************************************************************************
  2. class readTrackFile : public QThread
  3. //**************************************************************************
  4. {
  5. Q_OBJECT
  6. public:
  7. readTrackFile(const QString &p_inFile,
  8. QTextEdit *p_bodyEditCopy,
  9. QObject* parent = 0);
  10. virtual ~readTrackFile() { }
  11.  
  12. public slots:
  13. protected:
  14. void run();
  15. private:
  16. QString qstr_inFile;
  17. QTextEdit* bodyEditCopy;
To copy to clipboard, switch view to plain text mode 

and in the implemantion

Qt Code:
  1. void readTrackFile::run()
  2. {
  3. ...
  4.  
  5. QFile inFile(qstr_inFile);
  6. QString qstr_textLine;
  7.  
  8. if(inFile.exists() )
  9. {
  10. if (inFile.open(QFile::ReadOnly | QFile::Text) )
  11. {
  12. QTextStream filestream( &inFile );
  13.  
  14. ...
  15. while (!filestream.atEnd())
  16. {
  17. qstr_textLine = filestream.readLine();
  18. if(qstr_textLine.count(";",Qt::CaseInsensitive)== 36)
  19. {
  20. bodyEditCopy->append(qstr_textLine);
  21.  
  22. ...
  23. }
  24. else
  25. {
  26. ...
  27. ...
  28. ...
  29. }
  30. }
  31. }
  32. }
  33. inFile.close();
  34. }
To copy to clipboard, switch view to plain text mode 

Could anybody see the misunderstanding from my side....