| 414 | } |
| 415 | |
| 416 | KDevelop::IOutputViewModel *OutputWidget::outputViewModel() const |
| 417 | { |
| 418 | auto view = qobject_cast<QAbstractItemView*>(currentWidget()); |
| 419 | if( !view || !view->isVisible()) |
| 420 | return nullptr; |
| 421 | |
| 422 | QAbstractItemModel *absmodel = view->model(); |
| 423 | auto* iface = qobject_cast<KDevelop::IOutputViewModel*>(absmodel); |
| 424 | if ( ! iface ) |
| 425 | { |
| 426 | // try if it's a proxy model? |
| 427 | if ( auto* proxy = qobject_cast<QAbstractProxyModel*>(absmodel) ) |
| 428 | { |
| 429 | iface = qobject_cast<KDevelop::IOutputViewModel*>(proxy->sourceModel()); |
| 430 | } |
| 431 | } |
| 432 | return iface; |
| 433 | } |
| 434 | |
| 435 | void OutputWidget::eventuallyDoFocus() |
| 436 | { |