summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-04-22 17:24:10 (GMT)
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-04-22 17:36:50 (GMT)
commitb250e23a418f991bb979158e119bdb78cddc8228 (patch)
tree1ccf179156ddf18ede8c7116fb6743198957fbf0
parent5a7f626f3c6d5d5e2ceaa2c7db9de5b51deca637 (diff)
downloadQt-b250e23a418f991bb979158e119bdb78cddc8228.zip
Qt-b250e23a418f991bb979158e119bdb78cddc8228.tar.gz
Qt-b250e23a418f991bb979158e119bdb78cddc8228.tar.bz2
Don't emit QApplication::focusChanged for no reason
The Qt::NoFocusReason is used when Qt temporarily moves the focus to the QMenuBar while switching from one widget to another. While this did not result in a QFocusEvent, it did result in emitting the QApplication::focusChanged signal. This in turn caused a slowness in Qt Creator, since it wanted to update the current context and find filter. The fix here makes sure the focusChanged signal is not emitted when the focus reason is Qt::NoFocusReason, since these focus changes are not interesting for the application. Reviewed-by: mae
-rw-r--r--src/gui/kernel/qapplication.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 1624b9d..d0b1790 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -2100,8 +2100,8 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason)
if (that)
QApplication::sendEvent(that->style(), &in);
}
+ emit qApp->focusChanged(prev, focus_widget);
}
- emit qApp->focusChanged(prev, focus_widget);
}
}