The problem is, at the beggining of the aplication, one subwindow is showed, this subwindow can be opened with a button in the menu bar, but the problem is that if i close that subwindow, and i click on the button of the menu bar, nothing happens. My code is this:
void Interfaz::crearInicio(){
Inicio *sub_inicio = new Inicio;
mdiArea->addSubWindow(sub_inicio);
sub_inicio->setAttribute(Qt::WA_DeleteOnClose);
mdiArea->setActiveSubWindow(qobject_cast<QMdiSubWindow *>(sub_inicio));
sub_inicio->showMaximized();
}
void Interfaz::crearAcciones(){
connect (ui.inicioAct, SIGNAL(triggered()), this, SLOT (crearInicio()));
}
void Interfaz::crearInicio(){
Inicio *sub_inicio = new Inicio;
mdiArea->addSubWindow(sub_inicio);
sub_inicio->setAttribute(Qt::WA_DeleteOnClose);
mdiArea->setActiveSubWindow(qobject_cast<QMdiSubWindow *>(sub_inicio));
sub_inicio->showMaximized();
}
void Interfaz::crearAcciones(){
connect (ui.inicioAct, SIGNAL(triggered()), this, SLOT (crearInicio()));
}
To copy to clipboard, switch view to plain text mode
ui.inicio is the button in the menu bar.
Bookmarks