示例#1
0
void QtWebPageEventHandler::updateTextInputState()
{
    if (m_postponeTextInputStateChanged)
        return;

    const EditorState& editor = m_webPageProxy->editorState();

    if (!m_webView->hasFocus())
        return;

    // Ignore input method requests not due to a tap gesture.
    if (!editor.isContentEditable)
        setInputPanelVisible(false);
}
示例#2
0
void QtWebPageEventHandler::doneWithGestureEvent(const WebGestureEvent& event, bool wasEventHandled)
{
    if (event.type() != WebEvent::GestureSingleTap)
        return;

    m_postponeTextInputStateChanged = false;

    if (!wasEventHandled || !m_webView->hasFocus())
        return;

    const EditorState& editor = m_webPageProxy->editorState();
    bool newVisible = editor.isContentEditable;

    setInputPanelVisible(newVisible);
}
void QtWebPageEventHandler::updateTextInputState()
{
    if (m_postponeTextInputStateChanged)
        return;

    const EditorState& editor = m_webPageProxy->editorState();

    m_webView->setFlag(QQuickItem::ItemAcceptsInputMethod, editor.isContentEditable);

    if (!m_webView->hasActiveFocus())
        return;

    qApp->inputMethod()->update(Qt::ImQueryInput | Qt::ImEnabled | Qt::ImHints);

    setInputPanelVisible(editor.isContentEditable);
}