Results 1 to 5 of 5

Thread: QSocketNotifier can not enable from an other thread.

Threaded View

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

    Default QSocketNotifier can not enable from an other thread.

    I have a two classes derived from QThread

    First class emits a signal to the second class when an event occurs. I connected these signal and slot with queud connection explicitly. Second class try to write to a tcp socket created in the run block of the second class. but it gives the error "QSocketNotifier can not enable from an other thread." I coul not understand why this happen.

    Code is beriefly below :

    Qt Code:
    1. connect(firstClass,SIGNAL(send(int )),secondClass,SLOT(response(int )),Qt::QueuedConnection);
    2.  
    3. firstClass::emitSignal()
    4. {
    5. emit send(1);
    6. }
    7.  
    8. secondClass::run()
    9. {
    10. m_socket = new QTcpSocket();
    11. ....
    12. ...
    13. }
    14. secondClass::response(int a_data)
    15. {
    16. m_socket->write(".....");
    17. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 3rd August 2008 at 17:50. Reason: missing [code] tags

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.