revellix
10th October 2011, 14:19
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.
#include ...
class UserInput : public QWidget
{
Q_OBJECT
public:
explicit UserInput(QWidget *parent = 0);
QLineEdit *inputLine;
}
#2
#include ...
class algorithmus : public QThread
{
Q_OBJECT
public:
explicit algorithmus(QWidget *parent)
Now in the Contructor of the QWidget
....
calc = new algorithmus(this);
Finally I want to access the QLineEdit in the QWidget for the calculation in QThread:
....
return this->parent()->inputLine.toInt() + 1000; //f.e.
Is this even possible?? I am a newbie :)
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.
#include ...
class UserInput : public QWidget
{
Q_OBJECT
public:
explicit UserInput(QWidget *parent = 0);
QLineEdit *inputLine;
}
#2
#include ...
class algorithmus : public QThread
{
Q_OBJECT
public:
explicit algorithmus(QWidget *parent)
Now in the Contructor of the QWidget
....
calc = new algorithmus(this);
Finally I want to access the QLineEdit in the QWidget for the calculation in QThread:
....
return this->parent()->inputLine.toInt() + 1000; //f.e.
Is this even possible?? I am a newbie :)