You could have also used something in MainWindow ctor like -
connect(m_button, SIGNAL(clicked()), this, SLOT(toggleFormat()));
// and in MainWindow::toggleFormat()
MainWindow::toggleFormat()
{ del->toggleFormat();
m_view->update();
}
connect(m_button, SIGNAL(clicked()), this, SLOT(toggleFormat()));
// and in MainWindow::toggleFormat()
MainWindow::toggleFormat()
{ del->toggleFormat();
m_view->update();
}
To copy to clipboard, switch view to plain text mode
This would keep the work of delegate to only render. I dont think it was good that delegate tells view to update. I guess its the controller / creator's job.
Bookmarks