MCPcopy Create free account
hub / github.com/KDE/kdevelop / checkFocus

Method checkFocus

plugins/quickopen/quickopenplugin.cpp:1136–1159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1134}
1135
1136void QuickOpenLineEdit::checkFocus()
1137{
1138 qCDebug(PLUGIN_QUICKOPEN) << "checking focus" << m_widget;
1139 if (m_widget) {
1140 QWidget* focusWidget = QApplication::focusWidget();
1141 bool focusWidgetInsideThis = focusWidget ? insideThis(focusWidget) : false;
1142 if (QApplication::focusWindow() && isVisible() && !isHidden() && (!focusWidget || (focusWidget && focusWidgetInsideThis))) {
1143 qCDebug(PLUGIN_QUICKOPEN) << "setting focus to line edit";
1144 activateWindow();
1145 setFocus();
1146 } else {
1147 qCDebug(PLUGIN_QUICKOPEN) << "deactivating because check failed, focusWidget" << focusWidget << "insideThis" << focusWidgetInsideThis;
1148 deactivate();
1149 }
1150 } else {
1151 if (ICore::self()->documentController()->activeDocument()) {
1152 ICore::self()->documentController()->activateDocument(ICore::self()->documentController()->activeDocument());
1153 }
1154
1155 //Make sure the focus is somewhere else, even if there is no active document
1156 setEnabled(false);
1157 setEnabled(true);
1158 }
1159}
1160
1161QLineEdit* QuickOpenPlugin::createQuickOpenLine(const QStringList& scopes, const QStringList& type, IQuickOpen::QuickOpenType kind)
1162{

Callers

nothing calls this directly

Calls 3

activeDocumentMethod · 0.80
documentControllerMethod · 0.80
activateDocumentMethod · 0.80

Tested by

no test coverage detected