mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
desktop: let tag-widget completion popup accept composition events
Attn: horrible hack! For some reason the completion-popup does not have the Qt::WA_InputMethodEnabled flag set. Thus, if the popup is open composition of characters breaks. Therefore, when starting completion, explicitly set the flag on the popup. This is 100% not how this was intended, but seems to work for now. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
803727395b
commit
941aaf5b65
1 changed files with 14 additions and 2 deletions
|
@ -96,6 +96,18 @@ void TagWidget::inputMethodEvent(QInputMethodEvent *e)
|
||||||
reparse();
|
reparse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Call complete on a QCompleter and set the WA_InputMethodEnabled on
|
||||||
|
// the popup if a popup is opened. We need that flag, otherwise composition
|
||||||
|
// events are not forwarded to the widget and the user cannot enter
|
||||||
|
// multi-key characters as long as the popup is active.
|
||||||
|
static void complete(QCompleter *completer)
|
||||||
|
{
|
||||||
|
completer->complete();
|
||||||
|
QWidget *popup = completer->popup();
|
||||||
|
if (popup)
|
||||||
|
popup->setAttribute(Qt::WA_InputMethodEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
void TagWidget::reparse()
|
void TagWidget::reparse()
|
||||||
{
|
{
|
||||||
highlight();
|
highlight();
|
||||||
|
@ -112,10 +124,10 @@ void TagWidget::reparse()
|
||||||
if (popup)
|
if (popup)
|
||||||
popup->hide();
|
popup->hide();
|
||||||
} else {
|
} else {
|
||||||
m_completer->complete();
|
complete(m_completer);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m_completer->complete();
|
complete(m_completer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue