Results 1 to 13 of 13

Thread: do control return back returning to previous slot/function from where signal generate

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default do control return back returning to previous slot/function from where signal generate

    hello everybody,
    I have a place in code shown below where slot emits dataAvailable(). After that control will pass to corresponding slot. Do control returns back after execution of that slot.

    Qt Code:
    1. void MyThread::run()
    2. {
    3.  
    4.  
    5.  
    6. int fd0 = open("/home/prince/mydev01",O_RDWR|O_NONBLOCK);
    7.  
    8. while( ! _end )
    9. {
    10. read(fd0,&x,sizeof(int));
    11. read(fd0,&y,sizeof(int));
    12. emit dataAvailable();
    13. _semaphore.acquire();
    14. }
    15. close(fd0);
    16.  
    17. emit stopThreadSignal();
    18. cout<<"\tdataAvailable called";
    19.  
    20. }
    To copy to clipboard, switch view to plain text mode 

    In this case dataAvailable() leads to
    Qt Code:
    1. void MyDialog::receiveOnRead()
    2. {
    3.  
    4. QString sx;
    5. sx.setNum(mth.x);
    6. QString sy;
    7. sy.setNum(mth.y);
    8. label->setText(sx+QString(" ") +sy);
    9. cout<<"From dialog thread"<<mth.x<<" "<<mth.y;
    10. }
    To copy to clipboard, switch view to plain text mode 

    It just replaces the lable text.

    Well i am sorry i keep asking such related questin again n again but ihave some doubts still prsisting. I have tried with some test pgms which donot make concept clear.
    Last edited by quickNitin; 12th June 2006 at 10:41. Reason: change in code

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
  •  
Qt is a trademark of The Qt Company.