I have two main windows, the first launches the state machine class which creates a second main window.
The second window then is modified using , for example
_pushbutton->setVisible(true); // or false
Each state (corresponds to a method) is generally connected to the next state using slots; the signal comes from the pushbutton of the prior state.
But my problem is that I do not see updates sometimes, even when I do :
_pushbutton->setVisible(bool);
_pushbutton->update();
_lineedit->setVisible(bool);
_lineedit->update();
I tried even to create a new MainWindow for every state to no avail. I tried using show()
_mainwindow->show();
after every update also. My state machine seems to work for the first few simple states with just changes to a QLabel. Once the lineEdit widget is used, the updates seem to falter. ( I was successful in obtaining the text input however.)
Also in general am I connecting my states correctly ? (Can this design cause the stack to explode ? There are no cycles here BTW, I swear.) I have two ways to connect, either through a direct call or by a connect:
void State::state3()
{
...
state4(); // direct call
}
void State::state4()
{
...
connect(_pushbutton, SIGNAL(clicked()), this, SLOT(state5())); // by connect
}
I had trouble seeing an update esp after a sleep() / Sleep() / usleep() call (I tried all 3) as well.
↧