you can provide some bool flags or even status function, which will describe the child object' state.
simple example:
enum State
{
Idle = 0,
Running,
Error
};
int currentState(); //returns current state from State enum
State _state; //variable for storing current state
enum State
{
Idle = 0,
Running,
Error
};
int currentState(); //returns current state from State enum
State _state; //variable for storing current state
To copy to clipboard, switch view to plain text mode
then you can check child' state or even block parent object waiting for state changes.
for example
ChildObject obj;
obj.run();
while(ChildObject::Running == obj.currentState)
qApp->processEvents();
...
ChildObject obj;
obj.run();
while(ChildObject::Running == obj.currentState)
qApp->processEvents();
...
To copy to clipboard, switch view to plain text mode
and another Qt-styled solution is using signal-slot connection, which is of course the best one.
Bookmarks