Hi Justin
i'm using standard Maya 2014 Pyside. guess is Qt4.8
and i get another error now:
# TypeError: commitData(QWidget*) only accepts 1 arguments, 3 given!
this is my full method in case something else is messing it:
def createEditor(self, parent , option, index):
self.container = QtGui.QWidget(parent)
layout = QtGui.QHBoxLayout()
layout.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignCenter)
layout.setContentsMargins(0, 0, 0, 0)
self.container.setLayout(layout)
self.checkBox = QtGui.QCheckBox(parent)
self.checkBox.toggled.connect(partial(self.commitData.emit, self))
layout.addWidget(self.checkBox)
On Friday, February 21, 2014 12:48:24 AM UTC, Justin Israel wrote:
>
> Sorry, I completely overlooked my mistake because of my food coma from
> lunch...
>
> It should really be more like:
>
> checkbox.toggled.connect(partial(self.commitData.emit, self))
>
> Normally when you connect a signal to another signal, Qt will see it and
> automatically hook them up properly. But because I was using partial() here
> as a wrapper, it was literally trying to call the signal like a function.
> It needed the explicit emit() to be wrapped.
>
>
> On Fri, Feb 21, 2014 at 1:31 PM, Justin Israel
> <[email protected]<javascript:>
> > wrote:
>
>> What version of Qt are you using? I typed that from my phone :-)
>> On Feb 21, 2014 8:09 AM, "Ricardo Viana" <[email protected]<javascript:>>
>> wrote:
>>
>>> Its strange because i thought that could be a pyside thing but in the
>>> docs
>>>
>>> they document it as a method which takes the editor widget.
>>>
>>> PySide.QtGui.QAbstractItemDelegate.commitData(*editor*) Parameters:
>>> *editor* –
>>> PySide.QtGui.QWidget<http://srinikom.github.io/pyside-docs/PySide/QtGui/QWidget.html#PySide.QtGui.QWidget>
>>>
>>>
>>>
>>>
>>> pyside
>>> docs<http://srinikom.github.io/pyside-docs/PySide/QtGui/QAbstractItemDelegate.html>
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Python Programming for Autodesk Maya" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected]<javascript:>
>>> .
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/python_inside_maya/a0983908-8bdf-4039-9259-05555f1e78fc%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/861c015d-e439-4f53-ab7c-1d0edec06c79%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.