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 ...
{
Q_OBJECT
public:
explicit UserInput
(QWidget *parent
= 0);
}
#include ...
class UserInput : public QWidget
{
Q_OBJECT
public:
explicit UserInput(QWidget *parent = 0);
QLineEdit *inputLine;
}
To copy to clipboard, switch view to plain text mode
#2
#include ...
{
Q_OBJECT
public:
explicit algorithmus
(QWidget *parent
)
#include ...
class algorithmus : public QThread
{
Q_OBJECT
public:
explicit algorithmus(QWidget *parent)
To copy to clipboard, switch view to plain text mode
Now in the Contructor of the QWidget
....
calc = new algorithmus(this);
....
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:
....
return [U]this->parent()->inputLine.toInt()[/U] + 1000; //f.e.
....
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
Bookmarks