exec() locking up 9th Gen iPad
-
This only happens on actual hardware not in the simulator.
Due to not owning every iPad ever I don't know if it happens on other models but do know it doesn't happen on 6th Gen.
Taking the following toy program when the exec() gets called on the dialog instead of the expected popup appearing and being able to be interacted with the main-thread gets stuck in CFRunLoopSpecific as shown in the image.(the same behaviour also happens with exec() on drag events shown in second image).
Is this a QT issue where I need to go file a bug report or a apple issue where I need to file a bug report or am I doing something obviously wrong?
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); red = new QPushButton(this); red ->setGeometry(400,400,50,50); red->setStyleSheet("background-color: red; border-radius: 25;"); connect(red,&QPushButton::clicked,this,[this](){ popup *temp = new popup(this); if(temp->exec() == QDialog::Accepted){ return; } delete temp; }); } MainWindow::~MainWindow() { delete ui; } popup::popup(QWidget *parent): QDialog(parent) { setWindowFlags(this->windowFlags() | Qt::FramelessWindowHint); setWindowFlags(this->windowFlags() | Qt::Popup); setAttribute(Qt::WA_TranslucentBackground); this->setGeometry(300,300,50,50); blue = new QPushButton(this); blue ->setGeometry(0,0,50,50); blue->setStyleSheet("background-color: blue; border-radius: 25;"); connect(blue,&QPushButton::clicked,this,[this](){ this->done(QDialog::Rejected); }); }
this happens with QT versions 5.12.12, 5.15.2, 6.2.4,6.3.0
-
Hi,
If memory serves well, there was a member of this forum who recently had an issue with the event loop due to changes on the iOS side.
One way to work around your issue would be to use the open method with your dialog so you would not have a secondary loop.
-
Hi,
If memory serves well, there was a member of this forum who recently had an issue with the event loop due to changes on the iOS side.
One way to work around your issue would be to use the open method with your dialog so you would not have a secondary loop.
@SGaist While that would work for QDialog if requiring rewriting to deal with none blocking nature of open vs exec. The same issue was also happening with QDrag and that I couldn't find a work around.
-
Hi, I also don't have an iPad to test on, but it might be worth a shot to test your own flavor of exec() because Qt's built-in QDialog::exec() applies a filter to its event processing. This is usually a good thing but perhaps the tapping of the Ok button in your dialog gets stuck because of some iPad peculiarity.
Just a wild shot but you could change:
... connect(red,&QPushButton::clicked,this,[this](){ popup *temp = new popup(this); if(temp->exec() == QDialog::Accepted){ return; } delete temp; }); } ...
to
... connect(red,&QPushButton::clicked,this,[this]( { popup *temp = new popup(this); temp->show(); QEventLoop eventloop; eventLoop.exec(); return; } delete temp; }); ...
This doesn't check if you tapped Ok or Cancel but that's a later problem :-)
-
Hi, I also don't have an iPad to test on, but it might be worth a shot to test your own flavor of exec() because Qt's built-in QDialog::exec() applies a filter to its event processing. This is usually a good thing but perhaps the tapping of the Ok button in your dialog gets stuck because of some iPad peculiarity.
Just a wild shot but you could change:
... connect(red,&QPushButton::clicked,this,[this](){ popup *temp = new popup(this); if(temp->exec() == QDialog::Accepted){ return; } delete temp; }); } ...
to
... connect(red,&QPushButton::clicked,this,[this]( { popup *temp = new popup(this); temp->show(); QEventLoop eventloop; eventLoop.exec(); return; } delete temp; }); ...
This doesn't check if you tapped Ok or Cancel but that's a later problem :-)
@hskoglund tried what you suggested and same issue but kinda expected that. Not having a iPad to hand to test it is expected since out of the 4 iPad models I tried only 1 has the issue and it gets stuck before the prompt is shown.
-
You should check the bug report system, I think a ticket was opened on it with regard to that other user who had the issue similar to yours.
-
I have the same problem.
I have tried all iPad versions up to 8 and it only happens on the 9th generation
I opened a ticket on bugreports.qt.io (https://bugreports.qt.io/browse/QTBUG-103583) but it hasn't been processed yet -
I have the same problem.
I have tried all iPad versions up to 8 and it only happens on the 9th generation
I opened a ticket on bugreports.qt.io (https://bugreports.qt.io/browse/QTBUG-103583) but it hasn't been processed yet@Piero60 said in exec() locking up 9th Gen iPad:
I opened a ticket on bugreports.qt.io (https://bugreports.qt.io/browse/QTBUG-103583) but it hasn't been processed yet
Thanks for writing up your report. It looks like https://bugreports.qt.io/browse/QTBUG-98651 -- see the comments for a few different workarounds.