Results 1 to 3 of 3

Thread: How can i prozess a slot function partially before moving on?

  1. #1
    Join Date
    Dec 2008
    Posts
    16
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How can i prozess a slot function partially before moving on?

    Hey,

    Sorry for the bad title... but i dont know how to describe my problem properly in a few words.

    I Have a slot function in my QWidget derived class:
    Qt Code:
    1. void TrackWindow::createMask() {
    2. cout("Building mask..."); //writes some text on a QTextEdit
    3. bee_radar->createMask(); // processes some Image Data
    4. cout("Mask created.");
    5. display_mode_box->setCurrentIndex(1);
    6. displayMode(1);
    7. }
    To copy to clipboard, switch view to plain text mode 

    If i call that slot by a Signal, it processes all the steps, and then displays the text at once. But i want to send "Building Mask" to my QTextEdit WIdget first,display it, and then process the other steps. How can i do that?

    Thanks for your help!
    Cal
    Last edited by jpn; 19th December 2008 at 19:08. Reason: changed [quote] to [code] tags

  2. #2
    Join Date
    Nov 2008
    Posts
    142
    Thanks
    3
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How can i prozess a slot function partially before moving on?

    You could try if QCoreApplication::processEvents solves your problem. Add a call to this method after you sent the text to your widget, and before doing the other stuff. This should give Qt a chance to update the widgets before you continue with your task.

  3. The following user says thank you to rexi for this useful post:

    Cal (19th December 2008)

  4. #3
    Join Date
    Dec 2008
    Posts
    16
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can i prozess a slot function partially before moving on?

    thanks! works perfectly!

Similar Threads

  1. QPSQL problem
    By LoneWolf in forum Installation and Deployment
    Replies: 60
    Last Post: 4th November 2009, 15:22
  2. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 13:57
  3. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 18:33
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 07:13
  5. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 13:52

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.