Important code:
class1
{
class1
{
...
...less important things
}
...
slot1
{
emit this->anotherView();
}
}
class1
{
class1
{
...
connect(this->ui.List,SIGNAL(itemDoubleClicked(QTableWidgetItem *)),this,SLOT(slot1(QTableWidgetItem *)));
...less important things
}
...
slot1
{
emit this->anotherView();
}
}
To copy to clipboard, switch view to plain text mode
and in main class:
MainClass
{
...
//anotherView run this method:
void changeanotherWidget(){
buffor = this->centralWidget();
if(buffor)
delete buffor;
this->anotherWidget= new AnotherWidget();
this->setCentralWidget(viewPatient);
...
//some connections
...
}
}
MainClass
{
...
//anotherView run this method:
void changeanotherWidget(){
QWidget *buffor;
buffor = this->centralWidget();
if(buffor)
delete buffor;
this->anotherWidget= new AnotherWidget();
this->setCentralWidget(viewPatient);
...
//some connections
...
}
}
To copy to clipboard, switch view to plain text mode
there is no more, i connect to signal anotherView only this slot
QObject::deleteLater -- don't help
Bookmarks