mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Process events just after starting the StateMachine
This is needed because of a braindead issue on the Qt event loop: http://stackoverflow.com/questions/10059721/qt-qstatemachine-sync-problems-initial-state-not-set-on-started-signali For the "event 1" to be received, the machine must already be in a state that react to that signal. Even it was a queued connection, the slot would be queued but only after the signal was received, which it isn't since there is no connection yet at that point. To solve your problem, you can wait for the machine is in "state A" before emitting the signal: machine->start(); qApp->processEvents(); Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
49f8456ce8
commit
677e75fbe4
1 changed files with 1 additions and 0 deletions
|
@ -292,6 +292,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
|
|||
|
||||
// Starting the transitions:
|
||||
stateMachine->start();
|
||||
qApp->processEvents();
|
||||
scene()->installEventFilter(this);
|
||||
#ifndef QT_NO_DEBUG
|
||||
QTableView *diveDepthTableView = new QTableView();
|
||||
|
|
Loading…
Add table
Reference in a new issue