Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.7.0, 5.15.2, 6.0.0
-
-
e5686b35f07ea54f59e81d04a054bd832bee69b9 (qt/qtbase/dev) 05408a4e5fd1c411371983d75e361f23597cf4c7 (qt/tqtc-qtbase/5.15), 02f1e72d5 (dev)
-
2022wk36FOQtforAndroid, 2022wk38FOQtforAndroid, 2022wk40FOQtforAndroid, 2022wk42FOQtforAndroid, 2022wk44FOQtforAndroid, 2022wk46FOQtforAndroid, 2022wk48FOQtforAndroid, 2022wk50FOQtforAndroid
Description
Running an app on Android, I have a QDialog with a few edit fields (`QLineEdit`) and a `QDialogButtonBox`. When user enters text in one of my `QLineEdit`, then press "OK" button from Android virtual keyboard, it accepts the dialog (as if I clicked "OK" on the `QDialogButtonBox`), while user expects to commit the text to the currently selected edit field so that he can move to the next one...
This is really annoying and makes it almost impossible to deploy apps with dialog requesting many user inputs. A workaround would really be appreciated.
Sample program:
#include <QApplication> #include <QDialog> #include <QDialogButtonBox> #include <QPushButton> #include <QVBoxLayout> #include <QLineEdit> class MyDialog : public QDialog { public: MyDialog() { QVBoxLayout* layout = new QVBoxLayout(this); layout->addWidget( new QLineEdit( this ) ); layout->addWidget( new QLineEdit( this ) ); QDialogButtonBox* box = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this ); connect( box, SIGNAL(accepted()), this, SLOT(accept()) ); connect( box, SIGNAL(rejected()), this, SLOT(reject()) ); layout->addWidget( box ); box->button(QDialogButtonBox::Ok)->setAutoDefault( false ); box->button(QDialogButtonBox::Ok)->setDefault( false ); box->button(QDialogButtonBox::Cancel)->setAutoDefault( false ); box->button(QDialogButtonBox::Cancel)->setDefault( false ); } }; int main( int argc, char* argv[] ) { QApplication app(argc, argv); MyDialog dlg; dlg.show(); return app.exec(); }
Attachments
Issue Links
- relates to
-
QTBUG-92241 Virtual keyboard "OK" button must not accept the QDialog
- Reported
-
QTBUG-92051 The keyboard does not appear after changing the focus
- Closed
- mentioned in
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...