Results 1 to 3 of 3

Thread: Qt 4.7 limit on number of signals?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2011
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Qt 4.7 limit on number of signals?

    I've been trying to migrate an application from Qt 4.6.2 to 4.7.0, and had a problem in 4.7 where I can only successfully connect a certain number of signals.

    I've written a simple test program in Python using the PySide bindings that demonstrates the problem. In the test program, on each timer timeout, a new signal is defined and connected to a callback, and all signals defined thus far are emitted. The source-code for this small test is in attached test.py and also listed at the bottom of this post.

    Using Qt 4.6.2, this works as I expected, with the output in attached qt4.6.2output.txt

    Qt Code:
    1. $ python test.py
    2. 0
    3. 0 1
    4. 0 1 2
    5. 0 1 2 3
    6. 0 1 2 3 4
    7. 0 1 2 3 4 5
    8. 0 1 2 3 4 5 6
    9. 0 1 2 3 4 5 6 7
    10. 0 1 2 3 4 5 6 7 8
    11. 0 1 2 3 4 5 6 7 8 9
    12. 0 1 2 3 4 5 6 7 8 9 10
    13. 0 1 2 3 4 5 6 7 8 9 10 11
    14. 0 1 2 3 4 5 6 7 8 9 10 11 12
    15. 0 1 2 3 4 5 6 7 8 9 10 11 12 13
    16. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
    17. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
    18. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
    19. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
    To copy to clipboard, switch view to plain text mode 


    But using Qt 4.7.0, the callback is not called for new signals after a limit has been reached: in the example the limit was 11. The output is in attached 4.7.0output.txt.

    Qt Code:
    1. $ python test.py
    2. 0
    3. 0 1
    4. 0 1 2
    5. 0 1 2 3
    6. 0 1 2 3 4
    7. 0 1 2 3 4 5
    8. 0 1 2 3 4 5 6
    9. 0 1 2 3 4 5 6 7
    10. 0 1 2 3 4 5 6 7 8
    11. 0 1 2 3 4 5 6 7 8 9
    12. 0 1 2 3 4 5 6 7 8 9 10
    13. 0 1 2 3 4 5 6 7 8 9 10 11
    14. 0 1 2 3 4 5 6 7 8 9 10 11
    15. 0 1 2 3 4 5 6 7 8 9 10 11
    16. 0 1 2 3 4 5 6 7 8 9 10 11
    17. 0 1 2 3 4 5 6 7 8 9 10 11
    18. 0 1 2 3 4 5 6 7 8 9 10 11
    19. 0 1 2 3 4 5 6 7 8 9 10 11
    20. 0 1 2 3 4 5 6 7 8 9 10 11
    To copy to clipboard, switch view to plain text mode 

    The system with Qt 4.6.2 installed runs Ubuntu 10.04
    Qt Code:
    1. $ cat /proc/version
    2. Linux version 2.6.32-26-generic (buildd@rothera) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #48-Ubuntu SMP Wed Nov 24 09:00:03 UTC 2010
    3. $ apt-cache show libqtcore4
    4. ...
    5. Version: 4:4.6.2-0ubuntu5.1
    To copy to clipboard, switch view to plain text mode 

    The system with Qt 4.7.0 installed runs Ubuntu 10.10
    Qt Code:
    1. $ cat /proc/version
    2. Linux version 2.6.35-24-virtual (buildd@vernadsky) (gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) ) #42-Ubuntu SMP Thu Dec 2 05:01:52 UTC 2010
    3. $ apt-cache show libqtcore4
    4. ...
    5. Version: 4:4.7.0-0ubuntu4
    To copy to clipboard, switch view to plain text mode 

    Here is the source code for the example:

    Qt Code:
    1. import sys
    2. from PySide import QtCore, QtGui
    3.  
    4. class Window(QtGui.QMainWindow):
    5.  
    6. def __init__(self):
    7. super(Window, self).__init__()
    8. self.timer = QtCore.QTimer(self)
    9. self.timer.timeout.connect(self.onTimeout)
    10. self.n = 0
    11.  
    12. self.timer.start(1000)
    13.  
    14. @QtCore.Slot()
    15. def onTimeout(self):
    16.  
    17. exec("Window.sig%d = QtCore.Signal(object, object)" % self.n)
    18. eval("self.sig%d" % self.n).connect(self.onSignalN)
    19.  
    20. for i in xrange(self.n+1):
    21. eval("self.sig%d[object, object]" % i).emit( i,self )
    22.  
    23. self.n += 1
    24. print ""
    25.  
    26. @QtCore.Slot(object, object)
    27. def onSignalN(self, o1, o2):
    28. print o1,
    29.  
    30. app = QtGui.QApplication(sys.argv)
    31.  
    32. win = Window()
    33.  
    34. win.resize(320, 240)
    35. win.setWindowTitle("Hello, World!")
    36. win.show()
    37.  
    38. sys.exit(app.exec_())
    To copy to clipboard, switch view to plain text mode 

    Ranen
    Attached Files Attached Files
    Last edited by rghosh; 9th February 2011 at 09:27.

Similar Threads

  1. Replies: 1
    Last Post: 24th October 2010, 11:09
  2. UDP IP layer limit
    By mhoover in forum General Programming
    Replies: 1
    Last Post: 1st August 2009, 16:13
  3. Upper limit on number of widgets?
    By jdiewald in forum Qt Programming
    Replies: 1
    Last Post: 29th September 2008, 23:00
  4. QThread and signals (linux/UNIX signals not Qt Signals)
    By Micawber in forum Qt Programming
    Replies: 1
    Last Post: 28th November 2007, 22:18
  5. Limit number of row/column in QGridLayout
    By EricF in forum Qt Programming
    Replies: 2
    Last Post: 18th October 2007, 19:54

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.