Does setFocusPolicy on a parent also sets the focus policy on it's children?
-
Hi. I have the following code for my MainWindow.
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); this->setFocusPolicy(Qt::NoFocus); }I was wondering whether the children of MainWindow would also have their FocusPolicy set to NoFocus. I would hope it does as in my use case I wish to turn off Focus for all ui elements.
-
Hi,
AFAIR, I would say no. But you can use findChildren and set the focus policy on all of them.