Hi everyone!

My problem is seems to be similar as jayw710's so I didn't opened a new topic.

I'm designing an application what have a main window.
This was designed in the QT Designer.
I'm subclassed it with the QDevelop IDE to the mainwindowimpl.cpp , .h
It generated the MainWindowImpl class.

I was designed an other dialog whit the designer, subclassed it in the same way.
This is created the smenu.cpp and the smenu.h header file with the settingsmenu class.
I have inculded the smenu.h into the mainwindow.h.
In the class definition of the MainWindowImpl, I created a pointer to the dialog.

Qt Code:
  1. class MainWindowImpl : public QMainWindow, public Ui::FoAblak
  2. {
  3.  
  4. Q_OBJECT
  5. public:
  6. MainWindowImpl( QWidget * parent = 0, Qt::WFlags f = 0 );
  7. ~MainWindowImpl();
  8.  
  9. Ui::FoAblak ui;
  10.  
  11. smenu *settingsMenu;
  12. int volume;
To copy to clipboard, switch view to plain text mode 


In the constructor of the MainWindowImpl I create an object from it.

Qt Code:
  1. MainWindowImpl::MainWindowImpl( QWidget * parent, Qt::WFlags f)
  2. : QMainWindow(parent, f)
  3. {
  4. _mixerfd = open("/dev/mixer", O_RDWR);
  5. ui.setupUi(this);
  6. smenu = new settingsMenu(this);
  7.  
  8. ...
  9. void doSomething()
  10. {
  11. qWarning() << "it work's";
  12. };
To copy to clipboard, switch view to plain text mode 

When I press a button in the main window I call the smenu->show()
The dialog appears, and everything is fine.

But -- and there is my big problem -- I would like to acces from this dialog the MainWindow 's functions, variables, etc.
I know that I have to do something with the constructor's first argument the parent pointer.
For example I can access the mainwindow's width with the parent->width(), but I can not do it with the parent->doSomething().
I would like to ask it from you how can I do it?