I think anda_skoa means something like this:
// pseudocode
void MainWindow::on_pushButton_3_clicked()
{
switch ( userType )
{
case User:
showUserWindow();
break;
case Doctor:
showDoctorWindow();
break;
case Administrator:
showAdminWindow();
break;
default:
// error - no such user type
break;
}
}
// pseudocode
void MainWindow::on_pushButton_3_clicked()
{
switch ( userType )
{
case User:
showUserWindow();
break;
case Doctor:
showDoctorWindow();
break;
case Administrator:
showAdminWindow();
break;
default:
// error - no such user type
break;
}
}
To copy to clipboard, switch view to plain text mode
Obviously, your code will store the "userType" based on the previous button the user clicked.
By the way, "pushButton_3" is a pretty bad name for a variable. A year from now, when you have to fix something in this code, will you remember which GUI button is the one named "pushButton_3" in the code? You'd probably have a much easier job if it were named "connectButton" or "joinButton" instead.
Bookmarks