Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-118097

Port away from nested event loops

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.7.0 FF
    • dev
    • GRPC
    • All
    • 703f2e3ce (dev)
    • Foundation PM Staging

      We use nested QEventLoops at some places in QtGrpc, e.g. the function:

      QGrpcStatus QGrpcCallReply::waitForFinished() const
      {
          QEventLoop loop;
          QGrpcStatus status;
          QObject::connect(this, &QGrpcCallReply::errorOccurred, this,
                           [&status, &loop](const QGrpcStatus &error) {
                               status = error;
                               loop.quit();
                           });
          QObject::connect(this, &QGrpcCallReply::finished, &loop, &QEventLoop::quit);    loop.exec();
          return status;
      } 

      uses it. However, nesting event loops can cause conflicts with the main application event loop and can introduce all sorts of surprising behaviors as e.g. "stealing" the parent event loop.

       

        For Gerrit Dashboard: QTBUG-118097
        # Subject Branch Project Status CR V

            semlanik Alexey Edelev
            dennisoberst Dennis Oberst
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes