void MainWindow::focusChanged( QWidget * old, QWidget * now){ QWidget *qwgt=now->parentWidget(); if(qwgt!=NULL) { if(qwgt->objectName()=="toolBox") { this->focusNextChild(); } }}
const QObjectList list = ui->toolBox->children(); for(int i=0; i<list.count(); i++) { QWidget *wgtCurr = qobject_cast<QWidget*>(list.at(i)); if(wgtCurr!=NULL) wgtCurr->setFocusPolicy(Qt::NoFocus); }