forked from qt-creator/qt-creator
TextEditor: stop HoverHandlerRunner on focus out
Since we might get a result for a hover request after Qt Creator lost focus we need to prevent showing tool tips for a Qt Creator in the background. Change-Id: Iaa0eafdfe9340d2623fc4632dfc685463fd0d53a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -388,7 +388,6 @@ public:
|
||||
restart();
|
||||
}
|
||||
|
||||
private:
|
||||
void abortHandlers()
|
||||
{
|
||||
for (BaseHoverHandler *handler : m_handlers)
|
||||
@@ -396,6 +395,7 @@ private:
|
||||
m_currentHandlerIndex = -1;
|
||||
}
|
||||
|
||||
private:
|
||||
void restart()
|
||||
{
|
||||
abortHandlers();
|
||||
@@ -6717,6 +6717,7 @@ void TextEditorWidget::focusInEvent(QFocusEvent *e)
|
||||
void TextEditorWidget::focusOutEvent(QFocusEvent *e)
|
||||
{
|
||||
QPlainTextEdit::focusOutEvent(e);
|
||||
d->m_hoverHandlerRunner.abortHandlers();
|
||||
if (viewport()->cursor().shape() == Qt::BlankCursor)
|
||||
viewport()->setCursor(Qt::IBeamCursor);
|
||||
d->m_cursorFlashTimer.stop();
|
||||
|
Reference in New Issue
Block a user