Commit 69a3b0ee authored by Daniel Teske's avatar Daniel Teske
Browse files

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: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent e3419dc5
......@@ -449,7 +449,10 @@ void SearchResultWindow::clearContents()
*/
bool SearchResultWindow::hasFocus() const
{
return d->m_widget->focusWidget() && d->m_widget->focusWidget()->hasFocus();
QWidget *widget = d->m_widget->focusWidget();
if (!widget)
return false;
return widget->window()->focusWidget() == widget;
}
/*!
......
......@@ -62,7 +62,7 @@ MessageOutputWindow::~MessageOutputWindow()
bool MessageOutputWindow::hasFocus() const
{
return m_widget->hasFocus();
return m_widget->window()->focusWidget() == m_widget;
}
bool MessageOutputWindow::canFocus() const
......
......@@ -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
......
......@@ -154,7 +154,7 @@ void CompileOutputWindow::updateWordWrapMode()
bool CompileOutputWindow::hasFocus() const
{
return m_outputWindow->hasFocus();
return m_outputWindow->window()->focusWidget() == m_outputWindow;
}
bool CompileOutputWindow::canFocus() const
......
......@@ -565,7 +565,7 @@ void TaskWindow::clearContents()
bool TaskWindow::hasFocus() const
{
return d->m_listview->hasFocus();
return d->m_listview->window()->focusWidget() == d->m_listview;
}
bool TaskWindow::canFocus() const
......
......@@ -187,7 +187,7 @@ bool QmlConsolePane::canFocus() const
bool QmlConsolePane::hasFocus() const
{
return m_consoleWidget->hasFocus();
return m_consoleWidget->window()->focusWidget() == m_consoleWidget;
}
void QmlConsolePane::setFocus()
......
......@@ -99,7 +99,7 @@ void TodoOutputPane::setFocus()
bool TodoOutputPane::hasFocus() const
{
return m_todoTreeView->hasFocus();
return m_todoTreeView->window()->focusWidget() == m_todoTreeView;
}
bool TodoOutputPane::canFocus() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment