The Qt control fails to display the candidate word area above the virtual keyboard.
Unsolved
QML and Qt Quick
-
wrote 19 days ago last edited by xueyangfei 4 Oct 2025, 09:40
When using the virtual keyboard in the Qt control, the candidate word area fails to display above the virtual keyboard (outside the keyboard area). The candidate word area only appears when it is set to display below the virtual keyboard (within the keyboard area). When the candidate word area is configured to display above the virtual keyboard (outside the keyboard area), it only partially appears (showing a segment equal to the width of the key) when the letter keys above are clicked. I have adjusted the z-value of the ListView to ensure it is displayed on top.
Widget::Widget(QWidget *parent) : QWidget(parent) , ui(new Ui::Widget) { ui->setupUi(this); QVBoxLayout *layout = new QVBoxLayout(this); MyLineEdit *editChinese = new MyLineEdit(this); editChinese->setInputMethodHints(Qt::ImhNone); editChinese->setAttribute(Qt::WA_InputMethodEnabled,true); layout->addWidget(editChinese); MyLineEdit *editDigits = new MyLineEdit(this); editDigits->setInputMethodHints(Qt::ImhDigitsOnly); layout->addWidget(editDigits); editDigits->setAttribute(Qt::WA_InputMethodEnabled,true); setLayout(layout); }
1/1