Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. What is meant by Local Event loop in Modal Dialog Context?
Forum Updated to NodeBB v4.3 + New Features

What is meant by Local Event loop in Modal Dialog Context?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.4k Views 1 Watching
  • 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.
  • B Offline
    B Offline
    blue_sky
    wrote on last edited by
    #1

    Qt doc says:
    void QDialog::done ( int r ) [virtual slot]

    Closes the dialog and sets its result code to r. If this dialog is shown with exec(), done() causes the local event loop to finish, and exec() to return r.

    If The main event loop is alive and dialog is still in main thread. What does it meant by local event loop?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dbzhang800
      wrote on last edited by
      #2

      QDialog::exec()/QMenu::exec()/... will start a local event loop.
      QDialog::open()/QMenu::popup()/... will not start a local event loop

      embedded event loop is rather easy to understand, when embededed eventloop running, it will look like this

      @
      while(...) //started by QCoreApplication::exec()
      {
      while(....) //embeded eventloop
      {
      processEvents(...);
      }
      processEvents(...);
      }
      @

      1 Reply Last reply
      0
      • B Offline
        B Offline
        blue_sky
        wrote on last edited by
        #3

        @
        myDialog.exec();

        inside myDialog slots..

        {
        ///////
        done(1);//here the Dialog invisible
        QProgressDialog dia;
        ////dialog related parameters
        foreach(---){
        //update progress ba
        qApp->processEvents();//does this line create crash,if written after done()?
        //////
        }

        }
        @
        [quote author="1+1=2" date="1387960808"]QDialog::exec()/QMenu::exec()/... will start a local event loop.
        QDialog::open()/QMenu::popup()/... will not start a local event loop

        embedded event loop is rather easy to understand, when embededed eventloop running, it will look like this

        @
        while(...) //started by QCoreApplication::exec()
        {
        while(....) //embeded eventloop
        {
        processEvents(...);
        }
        processEvents(...);
        }
        @[/quote]

        1 Reply Last reply
        0

        • Login

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