Hi!

I am not a experienced qt user and this question may have a basic solution or could be something that I am missing.

I have QT Gui Project and the ui's name is EFrw_client. The class EFrw_client has a function that looks like this:

Qt Code:
  1. void EFrwClient::gui_settings(QString level)
  2. {
  3. if (level == "starting")
  4. {
  5. //Gui Settings
  6. ui.setupUi(this);
  7. cout << "--Default Settings--" << endl;
  8. ui.frame_2->setVisible(false);
  9. ui.pushButton_6->setVisible(false);
  10. }
  11.  
  12. if (level == "power_user")
  13. {
  14. cout << "--Gui Settings--" << endl;
  15. ui.pushButton_6->setVisible(true);
  16. }
  17. }
To copy to clipboard, switch view to plain text mode 

The idea is to get a qstring with the user level and according to it, it will activate buttons. The functions is first called at the constructor with the parameter "starting".

When the user presses the login button another class, called EUserCtrl, is activated and this class is responsible to send the login name and password to a data server that check if the parameters match with a set in the database. Then, that server return the user information, which includes the login level. The class EUserCtrl gets the login level and calls the function gui_settings with the parameter "power_user":

Qt Code:
  1. EFrwClient *gui_class = new EFrwClient;
  2. gui_class->load_modules(name,loginlevel);
To copy to clipboard, switch view to plain text mode 

the function is suppose to do:
Qt Code:
  1. cout << "--Gui Settings--" << endl;
  2. ui.pushButton_6->setVisible(true);
To copy to clipboard, switch view to plain text mode 

but only the cout is executed...

What could be the problem?

Thanks in advance.