Dear list!

I guess, I have to report a bug concerning the number of parameters of QAbstractItemDelegate.closeEditor signal:

I updated to 1.0.8 on my Ubuntu 11.10, but test also on MacOS with PySide 1.0.6. The same code is not behaving the same on both versions, even if the documentation is absolutely identical: 1.0.6: PySide.QtGui.QAbstractItemDelegate.closeEditor(/editor/[, /hint=NoHint/]) 1.0.8: PySide.QtGui.QAbstractItemDelegate.closeEditor(/editor/[, /hint=NoHint/])

In my understanding, this means, that the editor-parameter is needed, but the hint-parameter is optional. But the following snippet behaves the opposite way with this two versions (in my understanding, both should work everywhere, but probably i miss something, so please contact me if you think, this is not a bug...):

from PySide.QtGui import *
import PySide

delegate = QStyledItemDelegate()
try:
    print 'Trying with one parameter on', PySide.__version__
    delegate.closeEditor.emit(delegate)
    print 'Success'
except TypeError as error:
    print 'Failed', error

print

try:
    print 'Trying with two parameters on', PySide.__version__
    delegate.closeEditor.emit(delegate, QAbstractItemDelegate.NoHint)
    print 'Success'
except TypeError as error:
    print 'Failed', error

#####################################

And here is the output generated for both versions:

Trying with one parameter on 1.0.8
Failed closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint) only accepts 2 arguments, 1 given!

Trying with two parameters on 1.0.8
Success

##################################

Trying with one parameter on 1.0.6
Success

Trying with two parameters on 1.0.6
Failed closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint) only accepts 1 arguments, 2 given!

_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside

Reply via email to