Results 1 to 3 of 3

Thread: QTcpServer problem in Python Qt

  1. #1
    Join Date
    Jun 2008
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question QTcpServer problem in Python Qt

    Hello.

    I'm using PyQt 4.2.
    My application uses a QTcpServer to implement the comunication between to GUI classes. (I want to send a message from one to another).

    I have class that extends QThread, which executes an infinite loop and listens to incomming connections. I also send messages from this thread. The application works fine when i use it as a member of GUI class. But when i use it as a standalone application in a main I don't receive any connections.

    Can anyone help.

  2. #2
    Join Date
    Aug 2007
    Posts
    166
    Thanks
    16
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTcpServer problem in Python Qt

    Did you call the exec() function in your Thread class run() function? This is needed to make your signals and slots to work.

  3. #3
    Join Date
    Jun 2008
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QTcpServer problem in Python Qt

    No , i'm not using exec() in run(), but the problem was related to exec() :
    I was creating a QApplication object, then opened an window and called exec_() to start the event loop. Then , after that window was closed i was creating by mistake another QApplication object for some other window and again _exec(). It works now, when i use just one QApplication and create one window from which I show the rest of the windows

    10x

Similar Threads

  1. Replies: 4
    Last Post: 23rd May 2008, 09:42
  2. Qt, Python and pop-ups
    By bashamehboob in forum Qt Programming
    Replies: 1
    Last Post: 29th September 2007, 19:33
  3. Replies: 7
    Last Post: 15th April 2007, 01:39
  4. Replies: 16
    Last Post: 7th March 2006, 15:57

Tags for this Thread

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.