2026年5月25日15:57:50
This commit is contained in:
@@ -1106,6 +1106,17 @@ void InputMethod::onInputMethodClicked(){
|
||||
|
||||
void InputMethod::onEnterClicked(){
|
||||
// userInputed("\n");
|
||||
|
||||
// 编辑界面的文本输入框,需要按下回车时触发回车事件,同时放弃焦点
|
||||
// 嘿!什么叫特事特办啊 byons@2026年5月25日
|
||||
if(m_edit && m_edit->property("Enter replace enter").toBool()) {
|
||||
QKeyEvent pressEvent(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier);
|
||||
QKeyEvent releaseEvent(QEvent::KeyRelease, Qt::Key_Enter, Qt::NoModifier);
|
||||
QApplication::sendEvent(m_edit, &pressEvent);
|
||||
QApplication::sendEvent(m_edit, &releaseEvent);
|
||||
m_edit->clearFocus();
|
||||
}
|
||||
|
||||
emit onEnterClickedConfirm();
|
||||
this->hide();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user