I have two classes that share the same ui.One is the main class called classM and other a sub class of classM called classS.

I am able to effect he ui in classM and get data from the ui(i have a line edit and a few more such input widgets)

But when i try to change the ui from the sublcass classS, it does nothing. It doesnt show any errors eother, but always gives back a blank string for text command in line edit.

This is the header of classM
Qt Code:
  1. namespace Ui
  2. {
  3. class classMui;
  4. }
  5. class classM : public QMainWindow
  6. {
  7. Q_OBJECT
  8. private:
  9. Ui::classMui *ui;
To copy to clipboard, switch view to plain text mode 

This is the header of classS

Qt Code:
  1. namespace Ui
  2. {
  3. class classMui;
  4. }
  5. class classS : public QMainWindow
  6. {
  7. Q_OBJECT
  8.  
  9. private:
  10. Ui::classMui *ui;
To copy to clipboard, switch view to plain text mode 

ui->passEdit->text();;

I am able to get text for this same code in classM, where as in classS, it gives me a emty string.

what am i doing wrong?