I have a QDialog which has some settings, on the basis of which, QTreeView or the whole QMainWindow needs to be updated or repainted or refreshed.
QDialog has two buttons:
Apply: This button needs to apply the settings to QMainWindow, such as color to QTreeView Columns. This is one example, there are more items such as QTableView etc. on QMainWindow which also needs to be updated on clicking this button.
Close: This button hides the QDialog.
I have tried invoking repaint/update function on QMainWindow on clicking Apply Button, but nothing works.
void MainWindow::refresh()
{
setUpdatesEnabled(true);
setWindowModified(true);
repaint();
update();
show();
}
However, on clicking close button, which calls hide on QDialog, the whole view on QMainWindow gets updated/repainted.
I need to do the exactly same thing on Apply button.
How to achieve this? What is the SLOT that QDialog->hide is calling on QMainWindow?