| 1134 | } |
| 1135 | |
| 1136 | void 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 | |
| 1161 | QLineEdit* QuickOpenPlugin::createQuickOpenLine(const QStringList& scopes, const QStringList& type, IQuickOpen::QuickOpenType kind) |
| 1162 | { |
nothing calls this directly
no test coverage detected