Results 1 to 6 of 6

Thread: Qprocess...hanging entire application!!!!

  1. #1
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Angry Qprocess...hanging entire application!!!!

    I have a few buttons which when clicked, execute the following type of commands

    kfmclient openURL media:/hda1/

    kfmclient exec Firefox.desktop

    etc

    Now the funny thing is that everything was working fine till yesterday and today !!!!!!!!!

    i.e the QProcess executes - i can use it normally, but my app at the back gets hung up! i have attached the snapshot of my app top right corner....the base colors of the windows/groupboxes etc are being displayed....also if i move the window (the one launched via QProcess) around, it just erases the contents of my app!!

    What do you think is wrong!

    Thanks

    ps: i tried doing startDetached(process_name), I also have waitForFinished(-1) enabled....but it seems the launched process never 'finishes' and thus control never returns back to my program!!!

    EDIT: when i run "ps -e" to see the issue i get this mentioned

    PID TTY 00:00:00 kfmclient <defunct>

    any relation?
    Attached Images Attached Images
    Last edited by nupul; 9th May 2006 at 13:25.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qprocess...hanging entire application!!!!

    Quote Originally Posted by nupul
    i tried doing startDetached(process_name)
    Could you post some code?

    Quote Originally Posted by nupul
    I also have waitForFinished(-1) enabled....
    QProcess::waitForFinished() is blocks the event loop --- that's why your application doesn't redraw itself. Better use signals & slots.

  3. #3
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Talking Re: Qprocess...hanging entire application!!!!

    well the waitForFinished(-1) is to display the BusyCursor (as clarified in my other thread).

    Now i reverted back to my old code which was like 8 lines less than this one and NO PROBLEM at all!!! i don't understand this. I remodified my old code and still no problem...at the moment my system is working just fine...but i fail to understand the queer behaviour!!

    as for posting the code....it's as simple as 2 lines....but has connection (maybe) with all the 2000-2500 lines!!!

    Nupul

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qprocess...hanging entire application!!!!

    Quote Originally Posted by nupul
    Now i reverted back to my old code which was like 8 lines less than this one and NO PROBLEM at all!!! i don't understand this. I remodified my old code and still no problem...at the moment my system is working just fine...but i fail to understand the queer behaviour!!
    It's hard to tell without seeing your code.

    Quote Originally Posted by nupul
    as for posting the code....it's as simple as 2 lines....but has connection (maybe) with all the 2000-2500 lines!!!
    You must decide what is relevant. If you can't identify the part that is responsible for the wrong behavior, then most likely you should refactor your code to improve its structure.

  5. #5
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: Qprocess...hanging entire application!!!!

    hmmm...let me clarify, the two lines of code are not related per se, it's just that why did i do it, may not be clear. Well as i said, there was no addition to code except for some window flags. I later found out that the programs which i was starting using QProcess::start, would keep displaying the BusyCursor, till the application didn't get finished. This made my app busy and unresponsive as the code wouldn't proceed. I changed the external apps needed to be invoked (QProcess::startDetached wasn't of much help either)

    before: (QProcess::start("konqueror")) <-------hung

    afterQProcess::start("kfmclient exec konqueror")) <---------didn't hang

    Qt Code:
    1. QApplicaition::setOverrideCursor(Qt::WaitCursor);
    2. // start(...)
    3. QApplication::restoreOverrideCursor();
    To copy to clipboard, switch view to plain text mode 


    This is what i was doing......but still can you throw more light on what must have happened and why?

    Nupul

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qprocess...hanging entire application!!!!

    Quote Originally Posted by nupul
    before: (QProcess::start("konqueror")) <-------hung
    after:(QProcess::start("kfmclient exec konqueror")) <---------didn't hang
    Do you use QProcess::waitForFinished()?

Similar Threads

  1. Replies: 8
    Last Post: 28th January 2015, 09:45
  2. Replies: 3
    Last Post: 20th November 2014, 07:10
  3. QProcess start automaticaly needed application
    By raphaelf in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2006, 14:11

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.