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...
For Gerrit Dashboard: QTBUG-61652 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
347745,2 | QWidgets: show SoftwareInputPanel for key release | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: NEW | -2 | 0 |
335175,6 | Android: handle ImEnterKeyType flag | dev | qt/qtbase | Status: MERGED | +2 | 0 |
335176,4 | QWidgets: show SoftwareInputPanel for key release | dev | qt/qtbase | Status: MERGED | +2 | 0 |
347521,3 | Android: handle ImEnterKeyType flag | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
431873,12 | Android: Set EnterKeyNext as default type for QLineEdit | dev | qt/qtbase | Status: MERGED | +2 | 0 |
436476,5 | Android: Set EnterKeyNext as default type for TextInput | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |