MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / inputMethodEvent

Method inputMethodEvent

Telegram/SourceFiles/dialogs/dialogs_widget.cpp:4254–4273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4252}
4253
4254void Widget::inputMethodEvent(QInputMethodEvent *e) {
4255 const auto cursor = _search->rawTextEdit()->textCursor();
4256 bool isGettingInput = !e->commitString().isEmpty()
4257 || e->preeditString() != cursor.block().layout()->preeditAreaText()
4258 || e->replacementLength() > 0;
4259
4260 if (!isGettingInput || _postponeProcessSearchFocusChange) {
4261 Window::AbstractSectionWidget::inputMethodEvent(e);
4262 return;
4263 }
4264
4265 // This delay in search focus processing allows us not to create
4266 // _suggestions in case the event inserts some non-whitespace search
4267 // query while still show _suggestions animated, if it is a space.
4268 _postponeProcessSearchFocusChange = true;
4269 _search->setFocusFast();
4270 QCoreApplication::sendEvent(_search->rawTextEdit(), e);
4271 _postponeProcessSearchFocusChange = false;
4272 processSearchFocusChange();
4273}
4274
4275QVariant Widget::inputMethodQuery(Qt::InputMethodQuery query) const {
4276 return _search->rawTextEdit()->inputMethodQuery(query);

Callers

nothing calls this directly

Calls 4

isEmptyMethod · 0.45
layoutMethod · 0.45
blockMethod · 0.45
setFocusFastMethod · 0.45

Tested by

no test coverage detected