Results 1 to 3 of 3

Thread: How to wait till GUI contollers are changed?

  1. #1
    Join Date
    Sep 2011
    Posts
    24
    Qt products
    Qt4
    Platforms
    Windows

    Default How to wait till GUI contollers are changed?

    Hi,

    I want to disable some controllers on a button click and start a process after that. I put the controller settings in beginning of the slot.
    Here's the code.

    Qt Code:
    1. //OnClick event
    2.  
    3. btnStart->setEnabled(false); //Need this to disabled before process starts below
    4. btnBrowse->setEnabled(false); //Need this to disabled before process starts below
    5.  
    6. proc = new QProcess(this);
    7. .
    8. .
    9. .
    10. //..... this will wait till the process is finished
    To copy to clipboard, switch view to plain text mode 

    How can I achieve this?

    Thanks,
    Indika...

  2. #2
    Join Date
    Apr 2011
    Location
    Russia
    Posts
    85
    Thanks
    2
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to wait till GUI contollers are changed?

    Qt Code:
    1. connect( proc, SIGNAL(finished(int)), this, SLOT(procFinished(int)) );
    2. ...
    3. int procFinished( int status )
    4. {
    5. btnStart->setEnabled( true );
    6. btnBrowse->setEnabled( true );
    7. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Sep 2011
    Posts
    24
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to wait till GUI contollers are changed?

    Hi Jonny,

    I wanted to do is disabling the controllers before process starting. Can not disable them before the button click since the user has to set values from there. The code u have posted wait until the process end to enable controllers.

    Anyway thanks for the reply.

    Indika...
    Last edited by IndikaU; 13th October 2011 at 10:31.

Similar Threads

  1. Get QTimer's seconds till next timeout?
    By hakermania in forum Newbie
    Replies: 12
    Last Post: 12th February 2011, 23:49
  2. How to wait till QNetworkReply gives a result
    By Furkan in forum Qt Programming
    Replies: 3
    Last Post: 23rd November 2010, 10:00
  3. Replies: 5
    Last Post: 24th October 2010, 06:54
  4. Wait in thread till QTcp socket have some thing to read
    By hasnain in forum Qt Programming
    Replies: 2
    Last Post: 14th September 2010, 12:46
  5. Replies: 8
    Last Post: 27th October 2009, 09:07

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.