--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/045c727c-ac97-4fbf-8ceb-a89d240d6f86%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/045c727c-ac97-4fbf-8ceb-a89d240d6f86%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/96c133e4-5cce-4d78-93d2-3854dad6c7ca%40googlegroups.com.
if role == QtCore.Qt.DisplayRole:
row = index.row()
column = index.column()
value = self.__lights[row][column]
return str(value)
-------------------------------------------------------------To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/045c727c-ac97-4fbf-8ceb-a89d240d6f86%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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/96c133e4-5cce-4d78-93d2-3854dad6c7ca%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/131b9998-c464-43be-9d49-ad28de22bc8e%40googlegroups.com.To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/96c133e4-5cce-4d78-93d2-3854dad6c7ca%40googlegroups.com.
--
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/0b4e7ac6-6528-4735-8e66-f7784b22efc5%40googlegroups.com.To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBaTSV-fraRq2Xn9pH8hezSksJ9YvfRg%3D_LUnMkenQoSQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/131b9998-c464-43be-9d49-ad28de22bc8e%40googlegroups.com.
--
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/0b4e7ac6-6528-4735-8e66-f7784b22efc5%40googlegroups.com.
--
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 python_inside_maya+unsub...@googlegroups.com.
-> is there an alignment method to use on the cells of the QtableView?
-> Why the result of QCheckBox.checkState() is returning 0 or 2 instead of 0(unchecked) and 1(checked)?
-> How to get the selected row in the QTableView ?
--
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 python_inside_m...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOD%3D7nqvQDg8Zcf2SxgLiMqJSLi-QgvLQS3dJEooG79u%2BQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2NTWk2HEf6QJMAQLwVSzouutDU9tua3SfKUTMH8FnhHg%40mail.gmail.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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/4df653a3-fb21-405a-b329-681e74a8692e%40googlegroups.com.
model.setData(index,self.checkBox.isChecked())
getValue = index.model().data(index,QtCore.Qt.EditRole)
if getValue == True:
self.checkBox.setCheckState(QtCore.Qt.Checked)
self.container.setStyleSheet("background-color:#347545")
else:
self.checkBox.setCheckState(QtCore.Qt.Unchecked)
self.container.setStyleSheet("background-color:#7F2627")
It is probably because when its not a persistent editor, the view triggers the completion of the edit as each cell loses focus and the editor goes away. But when you are using persistent editors, the widget is always there. The delegate/model never see any interaction. Only the check box is seeing it.
You should see if it fixes the problem by connecting a signal from the check box to commitData() on the delegate.
http://qt-project.org/doc/qt-4.8/qabstractitemdelegate.html#commitData
In your createEditor() after you make a new check box...
from functools import partial
...
checkbox.toggled.connect(partial(self.commitData, self))
That will tell the delegate that the checkbox has changed and the state should be committed to the model.
I used a partial because we needed to wrap the editor attribute into the callback. The toggle value from the signal will just get ignored.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/9b5e7e16-19bd-476a-9f4f-b71957b2693b%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
Parameters: | editor – PySide.QtGui.QWidget |
---|
What version of Qt are you using? I typed that from my phone :-)
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/a0983908-8bdf-4039-9259-05555f1e78fc%40googlegroups.com.
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)
def createEditor(self, parent , option, index):
container = QtGui.QWidget(parent)layout = QtGui.QHBoxLayout()layout.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignCenter)layout.setContentsMargins(0, 0, 0, 0)
container.setLayout(layout)checkBox = QtGui.QCheckBox(parent)checkBox.toggled.connect(partial(self._checkBoxToggled, checkBox))layout.addWidget(checkBox)container.checkBox = checkBoxreturn containerdef _checkBoxToggled(self, cbeckBox, *args, **kwargs):self.commitData.emit(checkBox)
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/a614dba8-300e-4e95-9aae-17f5f2d43cd2%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3wn-t0Ckt306v8mwTxsPbrJUi84LPHJFmBYhVjcxm9Fg%40mail.gmail.com.
Marcus makes a good point. Depending on how big your data set is, it can be easier to just use a TableWidget
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBxOsoco5u6uT6Ma-4JVRqoVNE%3DCdqgp3q%2BgqRYuHPUxg%40mail.gmail.com.