Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My suggestion is to use State Machine to manager all your status. It's fairly easy to extend also.</p> <ol> <li>Read the State Machine Framework documents in Qt Help.</li> <li>After you have some basic knowledge on Qt state machine framework, you may understand the approach below.</li> </ol> <p>a.) Define necessary state, e.g. Guest, Logged In, Logged Out. You may have 3 dialogs (I defined an additional logged out dialog here) for each state, connect the state entered signal to dialog show slot, and connect state exited signal to dialog hide slot. In this way you don't need to worry about when to show/hide a dialog, just focus on the transition of states.</p> <p>b). Define signals for dialogs, for example, signal "loggedIn" for loginWindow, signal "loggedOut" for TasksWindow, add a transition trigged by signal "loggedIn" from state Guest to Logged in. </p> <p>c). So the initial state of the state machine is "guest", when this state entered, your loginWindow shows up. After log in information has been verfied, a "loggedIn" signal emitted, and the state of the machine will change from "guest" to "Logged In", so the loginWindow will be hide when "Guest" state exited, and your TasksWindow will show up when "Logged In" state entered.</p> <p>d). You may end the session by clicking "log out" in your TasksWindow, also what you need to do is to define trisitions for states change.</p> <p>e). A trick here: You can define a final state and connect the "finished" or "stopped" signal of the state machine to your application "quit" slot. Then after you have done all the things, the application will be closed automatically by state machine.</p> <p>Easy to maintence and extend, and the logic is very clear by using state machine.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload