When the client loads the application, then you will first need to show the login window and then when the client is authenticated, you can close the login window and show the main window.

1. Have a class called LoginDlg which will need to reimplement QDialog. This dialog will have couple of input boxes (For username, password etc) and couple of buttons (ok, cancel).

2. connect the pressed singal of ok button to a slot in this class.

3. When ok is pressed, this slot can then send the information to the server for authentication.

4. Once you get a positive response, create the main window and close the login dialog.

If you look into the file options.ui.h, it has the slot called apply(), which is called when the "apply" button is clicked. In that slot, a new widget is created, which pops up when the "apply" button is pressed. Your case is also something similar