Details
-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
None
-
5.8.0
Description
I'm deploying a Qt application under Android. When a QLineEdit length is limited (using setMaxLength), the Android virutal keyboard lets me enter more characters than allowed and later the QlineEdit content is truncated when virtual keyboard is closed.
Would eb much better to have this limit be handled in real time not to let user enter more characters than expected
#include <QApplication> #include <QMainWindow> #include <QVBoxLayout> #include <QLineEdit> int main( int argc, char* argv[] ) { // See https://stackoverflow.com/q/45030312/3336423 QApplication app( argc, argv ); QMainWindow wnd; QWidget widget( &wnd ); wnd.setCentralWidget( &widget ); widget.setLayout( new QVBoxLayout(&widget) ); QLineEdit edit( &wnd ); edit.setMaxLength( 10 ); widget.layout()->addWidget( &edit ); wnd.show(); return app.exec(); }