Hi all, I have a topic which I would like to share with you PySide users, to try archive the best solution.
We have a bug[1] opened on bugzilla related to default signal signature to be used when you call connect function without specifying the signature. The most common case for this problem is the QComboBox.activated[2] this signal has 2 signatures: QComboBox.activated (int), QComboBox.activated (str). If you connect the signal without passing the signature then this have a different behavior on PySide and PyQt. In PySide the first (default) signature is the 'str' argument in PyQt is signature with 'int'. Then this can cause some incompatibilities when porting application from PyQt. Now we have some options to solve this problem. 1 - We can try follow the same default signature in PySide and PyQt, I do not know which rule PyQt follow but I think it is the first one export to Python. With this solution we will keep the compatibility with PyQt, but this will generate a lot of work to check all signals if they are registered in same order as PyQt, if PyQt change the order we will keep this update. 2- Other option is to keep our order without any preoccupation with PyQt. This will keep the things like they are now, without any extra work, but with incompatibilities. 3 - The last option is to make mandatory use of the signature when connecting signals. In my opinion this is the best solution, because this avoids mistakes and make the things compatible with PySide and PyQt with less work. The other good point of this option is: You can keep your code compatible with other Qt versions even though new signals are inserted before the old ones or if one signal with only one signature receive a new signature in future Qt versions. Ok these are the options I have found to solve this problem and close this bug. I would like to know your opinion about that. Which one do you prefer and why? [1]http://bugs.openbossa.org/show_bug.cgi?id=327 [2]http://www.pyside.org/docs/pyside/PySide/QtGui/QComboBox.html#PySide.QtGui.QComboBox.activated -- Renato Araujo Oliveira Filho Instituto Nokia de Tecnologia - INdT Mobile: +55 (81) 8704-2144 _______________________________________________ PySide mailing list [email protected] http://lists.openbossa.org/listinfo/pyside
