Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is the best practices in switching between application windows in Qt?
    primarykey
    data
    text
    <p>I have an application with the following UI forms deriving from QMainWindow</p> <ul> <li>LoginWindow</li> <li>TasksWindow</li> <li>DetailsWindow</li> </ul> <p>I'm supposed to login into the application in the LoginWindow where I will move to the TasksWindow. In the TasksWindow, I will choose an item from a combo box, and then I should move to the DetailsWindow and populate data related to that item. On the DetailsWindow, I will have a menu action to return me back to the TasksWindow.</p> <p>Currently, what I have in mind (and what I've tried) is this. In the main.cpp:</p> <pre><code>int main(int argc, char *argv[]) { QApplication app(argc, argv); LoginWindow loginWindow; loginWindow.showMaximized(); return app.exec(); } </code></pre> <p>And in the LoginWindow push button:</p> <pre><code>void LoginWindow::on_loginButton_clicked() { this-&gt;hide(); // hide the login window TasksWindow tasksWindow; tasksWindow.showMaximized(); } </code></pre> <p>is there a better way to do this? It is becoming unmanageable as now I have to include a reference to each window class that I'm supposed to go to, possibly creating circular references!</p> <p>Note that I'm doing this and compiling the application to be a Qt Symbian application.</p> <p>What is the best way to switch between application windows? I thought about using a QStackedWidget before, and actually tried it, but the problem then is that I would have to write all the code for handling the different events in the same file and also, the action menus are different across the windows.</p> <p>Help! :)</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.
 

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