Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to use state machine to avoid overlapping of 2 popup in qt ?
Qt embedded developer last edited by Qt embedded developer
i have seen overlapping of ui screen and popup in my qt application.
when in my current screen i opened popup at that time i given option to close the popup on click of ok button.
now until user not click on ok button my popup will not get close. during same time if my embedded product click on shut down hardware button at same time shutting down popup will get open.
so that both popup get overlapped due to this implementation. how to handle this situation using statemachine ?
Do you mean handle both dialog at the same time ?
1] base ui class screen has several state. when first time we entering in screen one message box open which ask user to click on ok to close.
now until user not click on ok . that message box remains there.
2] now at same time from hardware switch pressed at same time one new popup with shutting down message comes.
problem : this shutdown popup need to come on top of message box but this popup comes back side of popup.
how to handle this situation so that shutdown popup comes above message box
@Qt-embedded-developer Can't you close the first dialog before showing the second one?
Is this widgets or QML?
It's rather rare one uses a state machine with the widgets, but anyway. The way to do it is the same as with QML. Define two states, one that is the main window shown, one that is the dialog shown. When the event arrives, transition between the states. Use the https://doc.qt.io/qt-5/qstate.html#assignProperty method to bind specific properties of the widgets to the states (e.g. the window visibility).
@jsulm No because its waiting for user to click on ok . and at same time due to shutdown button clicked the shutdown label came . this both situation need to show at same time