Results 1 to 11 of 11

Thread: Signals don't work

  1. #1
    Join Date
    Jan 2012
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Signals don't work

    I have an application with a lot of signals in it. On my development computer everything works perfect. But when I copy the application to the production pc the signals stop working.

    I use QExtSerialPort for serial communication with sms modems. The problem with the signals is only when there are some threads using the QExtSerialPort library.

    Is this a bug in qt?

  2. #2
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Signals don't work

    It's most definitely not a bug in Qt. Hope that helps.

  3. #3
    Join Date
    Jan 2012
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Signals don't work

    If it isn't a bug, what is it then? What could it be that the signals are working on my development pc but not on the production pc. The production pc is a server with win 2003 server. Is that a problem with qt?

  4. #4
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Signals don't work

    We are working on Win 2003 server and signals are working perfectly. Maybe You should show us some code.

  5. #5
    Join Date
    Jan 2012
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Signals don't work

    The code is really complex to show. I'm working on it for 3 months full time.

    I have a page and a thread. The thread collects data from a database and signal is to the page. When all is collected is signals the page that it may show the data.
    It works perfect on both pc's.

    In the same application I have also some threads that uses QExtSerialPort for serial communications. I can start and stop those threads from within the application. When I start the app with no threads everything works but when I activate some of the threads the signals stop working. I'm now trying to rewrite the serial communication code so I don't need QExtSerialPort any more. I hope it will fix the problem.

  6. #6
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Signals don't work

    If I understand correctly, only the app and the database thread work correctly, but app + database thread + serial port thread are so broken, that not even the database thread signals are delivered?

    If this is true, then from the information you gave I would assume that you initiate a serial port communication from the GUI thread by mistake and it hangs, such that no events are handled and no signals are received anymore. On one of the machines the serial port settings are different (the port number?) such that the communication is not successful so that's why it could hang.

    Try some more thorough debugging and problem analysis before you recode everything. Try reducing your code to a minimal structure and find a point where everything works and then add functionality piece by piece until it breaks. This way you can also generate more showable code and might get better help from the forum.

  7. #7
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Signals don't work

    Good news : we are using QExtSerialPort in another thread and it is working on Windows 2003 server too

  8. #8
    Join Date
    Jan 2012
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Signals don't work

    Quote Originally Posted by Lesiok View Post
    Good news : we are using QExtSerialPort in another thread and it is working on Windows 2003 server too
    Do you create the serialport in the constuctor or in the run?
    I create it in the constructor and get the data in the run.


    Added after 14 minutes:


    I think I found the problem. QExtSerialPort was using EventDriven and I changed it to Polling and now everything works.
    Last edited by Calypoter; 5th January 2012 at 09:44.

  9. #9
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Signals don't work

    Serialport is created in constructor. And we are using event driven mode.
    What version of QExtSerialPort You have ?

  10. #10
    Join Date
    Jan 2012
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Signals don't work

    I use version 1.2

  11. #11
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Signals don't work

    We are using 1.1

Similar Threads

  1. Replies: 15
    Last Post: 13th June 2010, 10:04
  2. after subclassing will the inbuild signals work
    By babu198649 in forum Qt Programming
    Replies: 2
    Last Post: 26th November 2007, 15:10
  3. can't make QAbstractItemView signals work
    By ber_44 in forum Qt Programming
    Replies: 1
    Last Post: 29th May 2007, 07:29
  4. QHttp signals don't work !!
    By probine in forum Qt Programming
    Replies: 11
    Last Post: 11th January 2007, 15:02

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.