! catches the MouseButtonPress-event and hides the tree view on mouse clicking. */
| 237 | catches the MouseButtonPress-event and hides the tree view on mouse clicking. |
| 238 | */ |
| 239 | bool TreeViewComboBox::eventFilter(QObject* object, QEvent* event) { |
| 240 | if ((object == m_groupBox) && event->type() == QEvent::MouseButtonPress) { |
| 241 | m_groupBox->hide(); |
| 242 | this->setFocus(); |
| 243 | return true; |
| 244 | } |
| 245 | return QComboBox::eventFilter(object, event); |
| 246 | } |
| 247 | |
| 248 | // SLOTs |
| 249 | void TreeViewComboBox::treeViewIndexActivated(const QModelIndex& index) { |