Hi Folks,

I don't get it. I have a QWidget and a QThread(*parent). Now the QWidget starts the QThread(*parent). In this QThread I want to access the variables in the QWidget. Imagine the QWidget holds an iserinput like QLineEdit.

Finally I have two Headers:

#1.
Qt Code:
  1. #include ...
  2.  
  3. class UserInput : public QWidget
  4. {
  5. Q_OBJECT
  6. public:
  7. explicit UserInput(QWidget *parent = 0);
  8.  
  9. QLineEdit *inputLine;
  10. }
To copy to clipboard, switch view to plain text mode 

#2
Qt Code:
  1. #include ...
  2.  
  3. class algorithmus : public QThread
  4. {
  5. Q_OBJECT
  6. public:
  7. explicit algorithmus(QWidget *parent)
To copy to clipboard, switch view to plain text mode 

Now in the Contructor of the QWidget

Qt Code:
  1. ....
  2.  
  3. calc = new algorithmus(this);
To copy to clipboard, switch view to plain text mode 

Finally I want to access the QLineEdit in the QWidget for the calculation in QThread:

Qt Code:
  1. ....
  2.  
  3. return [U]this->parent()->inputLine.toInt()[/U] + 1000; //f.e.
To copy to clipboard, switch view to plain text mode 

Is this even possible?? I am a newbie