Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
6.9.0
-
None
-
-
2025wk18s1QtforAndroid
Description
When a QDialog is opened, it's not responsive, except if you resize it to occupy full screen.
See simple example here:
main.cpp:
#include <QApplication> #include "mainwindow.h" int main( int argc, char* argv[] ) { QApplication app(argc, argv); MainWindow wnd; wnd.show(); return app.exec(); }
mainwindow.h:
#pragma once #include <QMainWindow> class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget* parent = NULL); public slots: void showDialog(); };
mainwindow.cpp:
#include "mainwindow.h" #include <QDialog> #include <QPushButton> #include <QVBoxLayout> #include <QDialogButtonBox> MainWindow::MainWindow( QWidget* parent ) : QMainWindow(parent) { QPushButton* centralWidget = new QPushButton("Open dialog",this); setCentralWidget(centralWidget); connect( centralWidget, &QPushButton::clicked, this, &MainWindow::showDialog ); } void MainWindow::showDialog() { QDialog dlg; dlg.setLayout(new QVBoxLayout); QDialogButtonBox* box = new QDialogButtonBox(QDialogButtonBox::Ok,&dlg); connect( box, &QDialogButtonBox::accepted, &dlg, &QDialog::accept ); dlg.layout()->addWidget(box); QRect geometry = this->geometry(); dlg.setGeometry( geometry ); dlg.exec(); }
With this code, QDIalog's "OK" button can be clicked.
If you comment `dlg.setGeometry( geometry );`, then the OK button cannot be clicked. Dialog does not get any user input (any Qt control is not responsive, not only buttons).
Note that hitting phones "bakc" button closes the QDialog, so the app is still running fine, only user inputs on screen are not taken into account.
I did not see this issue with odre version of Qt like 6.2.2.
Attachments
Issue Links
- duplicates
-
QTBUG-130576 Touches Are Handled Incorrectly with QDialog on Qt 6.8.x Android
-
- Closed
-