How to reconnect signal to slot after object change?
Unsolved
General and Desktop
-
I have a table in my project and a model attached to it. After I set new model to my table, my connection flies off and I need to create a new one. So, will it be right like this?
void MainWindow::setNewModel() { disconnect(fileManager, &FileManager::setDefaultTableModel, this, &MainWindow::setNewTableModel); tableModel = new TableModel(this); ui->tableView->setModel(tableModel); connect(fileManager, &FileManager::setDefaultTableModel, this, &MainWindow::setNewTableModel); }
-
@Rozerchik said in How to reconnect signal to slot after object change?:
So, will it be right like this?
Yes