Results 1 to 5 of 5

Thread: QSocketNotifier can not enable from an other thread.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2007
    Posts
    5
    Qt products
    Qt4

    Default Re: QSocketNotifier can not enable from an other thread.

    I did not understanda at all.

    Both thread class lives in main thread. but when I connect both thread with direct connection than, as I know , slot will invoked in the caller thread event loop. But , it does not have permission to use socket object , created in the second thread.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: QSocketNotifier can not enable from an other thread.

    Try to print QThread::currentThread() in the slot and you'll see the problem. I'd recommend reading the Multithreading presentation by Bradley T. Hughes from TT DevDays 2007. Especially the chapter starting from page 32 is important to understand.
    J-P Nurmi

  3. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: QSocketNotifier can not enable from an other thread.

    Quote Originally Posted by jpn View Post
    Try to print QThread::currentThread() in the slot and you'll see the problem. I'd recommend reading the Multithreading presentation by Bradley T. Hughes from TT DevDays 2007. Especially the chapter starting from page 32 is important to understand.
    cool article!

Similar Threads

  1. Replies: 5
    Last Post: 17th January 2008, 21:49
  2. Thread, Timer and Socket. Comuication problem
    By ^NyAw^ in forum Qt Programming
    Replies: 6
    Last Post: 17th January 2008, 16:48
  3. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  4. Replies: 10
    Last Post: 20th March 2007, 22:19
  5. Problem closing a QMainWindow in Qt4.2
    By ian in forum Qt Programming
    Replies: 11
    Last Post: 17th October 2006, 00:49

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.