Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. exec() locking up 9th Gen iPad

exec() locking up 9th Gen iPad

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
9 Posts 5 Posters 591 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Flock Andrew
    wrote on last edited by Flock Andrew
    #1

    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);
    	});
    }
    

    Screen Shot 2022-05-17 at 12.27.42 AM.png
    Screen Shot 2022-05-26 at 12.15.12 AM.png

    this happens with QT versions 5.12.12, 5.15.2, 6.2.4,6.3.0

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      F 1 Reply Last reply
      0
      • SGaistS SGaist

        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.

        F Offline
        F Offline
        Flock Andrew
        wrote on last edited by
        #3

        @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.

        1 Reply Last reply
        0
        • hskoglundH Online
          hskoglundH Online
          hskoglund
          wrote on last edited by
          #4

          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 :-)

          F 1 Reply Last reply
          0
          • hskoglundH hskoglund

            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 :-)

            F Offline
            F Offline
            Flock Andrew
            wrote on last edited by
            #5

            @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.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • hskoglundH Online
                hskoglundH Online
                hskoglund
                wrote on last edited by
                #7

                Also, in addition to what @SGaist suggests, just guessing but perhaps there's some setting on the troublesome iPad that differs from the other 3, for example an Accessibiilty setting like bigger text..

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  Piero60
                  wrote on last edited by
                  #8

                  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

                  JKSHJ 1 Reply Last reply
                  0
                  • P Piero60

                    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

                    JKSHJ Offline
                    JKSHJ Offline
                    JKSH
                    Moderators
                    wrote on last edited by JKSH
                    #9

                    @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.

                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                    1 Reply Last reply
                    1

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved