Reputation: 1113
In a C++ widget-app I have a QLineEdit. When the edit field got focus, the system opens and shows keyboard automatically. Because I have an RFID Scanner-Stick I don't need the system keyboard, rather it should stay closed/hidden! How can I reach this, or how can I catch the keyboard open event and close/hide it?
I would show you some code to simplify my description, but particular for this problem I don't have any code...
Upvotes: 2
Views: 675
Reputation: 1
your code hide keyboard success,but qlineedit losted focus state and have no mouse pointer,how to do this?thinks.
Upvotes: 0
Reputation: 333
To disable the automatic appearance of the software input keyboard entirely, you can use:
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setAutoSipEnabled(false);
(...)
}
If you want to force the display or hiding of the keyboard dynamically in your code, you can use:
QInputMethod* input = QGuiApplication::inputMethod();
input->setVisible([false | true]);
Note: I do not own any iOS devices to verify this will work for you. The above is from my experience with Qt and the software virtual keyboard on Android.
Upvotes: 3