Hello,

I'm developing an application in Qt4.5 with QTCreator.

My main idea is to have a MainWindow and various Qwidget classes that could be loaded to MainWindow centralWidget.

My problem is to have access to MainWindow centralWidget from a Qwidget class, that i suppose it is possible but i am not shore about that.

here is an example how i show a Qwidget class on MainWindow centralWidget from mainwindow.cpp
Qt Code:
  1. void MainWindow::open_Edificio()
  2. {
  3. ui->centralwidget->hide();
  4. static Edificio *edif = new Edificio(this);
  5. ui->centralwidget = edif;
  6. ui->centralwidget->show();
  7. }
To copy to clipboard, switch view to plain text mode 

How can i do the same from a Qwidget class like Edificio in edificio.cpp for instance?

thanks for the atention

Paulo