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. Querying the event loop
Forum Updated to NodeBB v4.3 + New Features

Querying the event loop

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.7k Views 2 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.
  • P Offline
    P Offline
    pgroen
    wrote on last edited by
    #1

    Hi,

    For this application we're developing, we have a pretty "noisy" event loop. Even to the point where we suspect it will "choke up".
    Necessary or not, is not really the discussion here. What I would like to know if there is a way to query the event loop, to see if there are events "queued" and especially, how many..

    Kind Regards,

    Peter M. Groen

    Peter M. Groen
    Open Systems Development

    'Will Killing Time Affect The Future?'
    'I think It Will, In The End'

    ? 1 Reply Last reply
    0
    • P pgroen

      Hi,

      For this application we're developing, we have a pretty "noisy" event loop. Even to the point where we suspect it will "choke up".
      Necessary or not, is not really the discussion here. What I would like to know if there is a way to query the event loop, to see if there are events "queued" and especially, how many..

      Kind Regards,

      Peter M. Groen

      ? Offline
      ? Offline
      A Former User
      wrote on last edited by A Former User
      #2

      @pgroen Hi! You can get the number of the currently pending events of the application's main event loop like this:

      #include "mainwindow.h"
      #include <QApplication>
      #include <QDebug>
      
      extern uint qGlobalPostedEventsCount(); // from qapplication.cpp
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          MainWindow w;
          w.show();
      
          qDebug() << qGlobalPostedEventsCount();
      
          return a.exec();
      }
      
      1 Reply Last reply
      4

      • Login

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