本页内容

QInputMethodQueryEvent Class

QInputMethodQueryEvent 类提供了一个由输入上下文发送给输入对象的事件。更多内容...

头文件: #include <QInputMethodQueryEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
继承自: QEvent

公共函数

QInputMethodQueryEvent(Qt::InputMethodQueries queries)
Qt::InputMethodQueries queries() const
void setValue(Qt::InputMethodQuery query, const QVariant &value)
QVariant value(Qt::InputMethodQuery query) const

受保护函数

QInputMethodQueryEvent(QInputMethodQueryEvent &&)
QInputMethodQueryEvent &operator=(QInputMethodQueryEvent &&)
QInputMethodQueryEvent &operator=(const QInputMethodQueryEvent &other)

详细说明

输入法使用该方法查询对象的一组属性,以便支持复杂输入法操作,例如对周围文本的支持和重新转换。

queries() 指定要查询的属性。

该对象应在事件上调用setValue(),以填充所请求的数据,然后才调用accept()。

成员函数文档

[explicit] QInputMethodQueryEvent::QInputMethodQueryEvent(Qt::InputMethodQueries queries)

根据queries 中指定的属性,构建一个查询事件。

[protected delete] QInputMethodQueryEvent::QInputMethodQueryEvent(QInputMethodQueryEvent &&)

通过移动构造一个QInputMethodQueryEvent 实例。该函数已被删除。

Qt::InputMethodQueries QInputMethodQueryEvent::queries() const

返回该事件查询到的属性。

void QInputMethodQueryEvent::setValue(Qt::InputMethodQuery query, const QVariant &value)

将属性query 设置为value 。

另请参阅 value()。

QVariant QInputMethodQueryEvent::value(Qt::InputMethodQuery query) const

返回属性query 的值。

另请参阅 setValue()。

[protected delete] QInputMethodQueryEvent &QInputMethodQueryEvent::operator=(QInputMethodQueryEvent &&)

将other 按移动赋值方式赋值给此QInputMethodQueryEvent 实例。该函数已被删除。

[noexcept protected default] QInputMethodQueryEvent &QInputMethodQueryEvent::operator=(const QInputMethodQueryEvent &other)

将other 复制并赋值给此QInputMethodQueryEvent 实例。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.