OutputPanes::hasFocus() needs to check the window's focus widget

QWidget::hasFocus() returns false if the window isn't active.

Task-number: QTCREATORBUG-13361
Change-Id: I7152ec2139bbb255c2a722e378a111dc4bc2ed62
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Daniel Teske
2014-11-07 15:48:36 +01:00
parent e3419dc5ac
commit 69a3b0ee54
7 changed files with 13 additions and 7 deletions

View File

@@ -306,7 +306,10 @@ void AppOutputPane::visibilityChanged(bool /* b */)
bool AppOutputPane::hasFocus() const
{
return m_tabWidget->currentWidget() && m_tabWidget->currentWidget()->hasFocus();
QWidget *widget = m_tabWidget->currentWidget();
if (!widget)
return false;
return widget->window()->focusWidget() == widget;
}
bool AppOutputPane::canFocus() const