Results 1 to 1 of 1

Thread: QProcess finished slot not firing

  1. #1
    Join Date
    Jun 2009
    Posts
    66
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QProcess finished slot not firing

    I have a problem with my QProcess::finished slot not alway being fired.

    I have a situation where i spawn about 100 processes, and connect the finished signal of a process to a slot. The slot only gets fired on about 1/2 of the time.

    Code looks like this:

    int count = 100;
    while( count > 0 )
    {
    QProcess* pProcess = new QProcess();
    QStringList Args;
    QString App = MyApp;
    Args <<MyArgs;

    connect( pProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(MySlot(int, QProcess::ExitStatus)) );

    pProcess->start( App, Args );

    count--;
    }

    // Now start event loop which waits for processes to end
    QEventLoop pEventLoop= new QEventLoop();
    pEventLoop->exec();

    In My slot, i keep a counter of the number of processes that have completed, and will exit the event loop when all processes have finished.

    However i see 100 processes starting (I checked by putting a check on waitForStarted(), which always returns true), but when debugging, it only goes into the slot about 50 times.

    any thought why? If a process finishes, before i have exited my while loop that starts the processes, will the signals not fire?

    David


    }


    Added after 1 40 minutes:


    Looking in the debug output of visual studio, I have spotted my issue.

    QWinEventNotifier: Cannot have more than 62 enabled at one time

    Not totally sure what this means, but will be investigating.
    Last edited by doggrant; 10th November 2010 at 13:09.

Similar Threads

  1. QProcess::finished problems again
    By mdicosimo in forum Qt Programming
    Replies: 2
    Last Post: 23rd January 2009, 21:43
  2. QProcess object not emitting finished(int) signal
    By Tiansen in forum Qt Programming
    Replies: 13
    Last Post: 14th November 2008, 12:17
  3. Detect First QProcess finished in a group and kill other
    By Davidaino in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2008, 12:53
  4. QProcess::finished()
    By T1c4L in forum Qt Programming
    Replies: 11
    Last Post: 9th July 2008, 20:06
  5. Replies: 4
    Last Post: 13th February 2006, 11:35

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.