pcaeiro
5th August 2009, 12:23
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
void MainWindow::open_Edificio()
{
ui->centralwidget->hide();
static Edificio *edif = new Edificio(this);
ui->centralwidget = edif;
ui->centralwidget->show();
}
How can i do the same from a Qwidget class like Edificio in edificio.cpp for instance?
thanks for the atention
Paulo
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
void MainWindow::open_Edificio()
{
ui->centralwidget->hide();
static Edificio *edif = new Edificio(this);
ui->centralwidget = edif;
ui->centralwidget->show();
}
How can i do the same from a Qwidget class like Edificio in edificio.cpp for instance?
thanks for the atention
Paulo