<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div style="font-family:verdana,sans-serif">Hello all</div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">
I have a trouble undestanding the way to implement this QRadioButton with QDataWidgetMapper. </div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">
I have some radiobuttons gruped into a MyButtonGroup (custom QButtonGroup).</div><div style="font-family:verdana,sans-serif">The MyButtonGroup is this:</div><div style="font-family:verdana,sans-serif">
<br></div><div><div><font color="#0000ff" face="courier new, monospace"><b><div>from PyQt4.QtCore import pyqtProperty</div><div>
from PyQt4 import QtGui,Qt</div><div><br></div></b></font></div><div><font color="#0000ff" face="courier new, monospace"><b>class MyButtonGroup(QtGui.QWidget):</b></font></div><div>
<font color="#0000ff" face="courier new, monospace"><b> __chequedvalue = None</b></font></div><div><font color="#0000ff" face="courier new, monospace"><b><br></b></font></div><div>
<font color="#0000ff" face="courier new, monospace"><b> @pyqtProperty(int)</b></font></div><div><font color="#0000ff" face="courier new, monospace"><b> def checkedValue(self):</b></font></div>
<div><font color="#0000ff"><b><span style="font-family:'courier new',monospace"> return self.__chequedvalue</span><br></b></font></div><div><font color="#0000ff" face="courier new, monospace"><b><br>
</b></font></div><div><font color="#0000ff" face="courier new, monospace"><b> @checkedValue.setter</b></font></div><div><font color="#0000ff" face="courier new, monospace"><b> def setCheckedValue(self, value):</b></font></div>
<div><font color="#0000ff" face="courier new, monospace"><b> #... here will implement the rbutton.setChecked(True)</b></font></div><div><span style="font-family:'courier new',monospace"><font color="#0000ff"><b> self.__chequedvalue = value</b></font></span><br>
</div></div><div><div dir="ltr"><font color="#888888"><font style="color:rgb(0,0,153)" face="verdana, sans-serif"><br></font></font></div><div dir="ltr"><font color="#888888"><font style="color:rgb(0,0,153)" face="verdana, sans-serif"><div style="color:rgb(0,0,0);display:inline">
I created this because the radiobuttons can not be connected directly with a QDataWidgetMapper, then the property checkedValue is going to manage the checked state of the radiobuttons. </div></font></font></div><div dir="ltr">
<font color="#888888"><font style="color:rgb(0,0,153)" face="verdana, sans-serif"><div style="color:rgb(0,0,0);display:inline"><br></div></font></font></div><div dir="ltr"><font color="#888888"><font style="color:rgb(0,0,153)" face="verdana, sans-serif"><div style="color:rgb(0,0,0);display:inline">
My doubt is when I link the Object and addMapping pass the thirth parameter, like this. </div><br></font></font></div><div dir="ltr"><font style="font-family:verdana,sans-serif" color="#888888"><font style="color:rgb(0,0,153)" size="4"><b><div style="font-family:verdana,sans-serif;color:rgb(0,0,0);display:inline">
<br></div></b></font></font></div><div dir="ltr"><font color="#0000ff" face="courier new, monospace"><b><font><div style="display:inline">mapper = QData</div></font><div style="display:inline">
Widget</div><div style="display:inline">Mapper()</div></b></font></div><div dir="ltr"><div style="display:inline"><font color="#0000ff" face="courier new, monospace"><b>...</b></font></div>
</div><div dir="ltr"><font color="#0000ff" face="courier new, monospace"><div style="display:inline"><b>editor = MyButtonGroup()</b></div></font></div><div dir="ltr"><font color="#0000ff" face="courier new, monospace"><div style="display:inline">
<b>...</b></div></font></div><div dir="ltr"><font color="#0000ff"><div style="display:inline"><b><font face="courier new, monospace">mapper.addMapping(editor,colnr,"checkedValue")</font><br>
</b></div></font></div><div dir="ltr"><font><font size="4"><b><div style="display:inline"><font color="#000000" face="verdana, sans-serif"><br></font></div></b></font></font></div><div dir="ltr">
<font style="font-family:verdana,sans-serif" color="#888888"><font style="color:rgb(0,0,153)"><div style="font-family:verdana,sans-serif;color:rgb(0,0,0);display:inline">When the interface and objects are loaded, the values changed the to objects is not reflected to the mapper. </div>
</font></font></div><div dir="ltr"><br></div><div dir="ltr"><div style="font-family:verdana,sans-serif;color:rgb(0,0,0)">Do you have examples?</div></div><div dir="ltr"><font style="font-family:verdana,sans-serif" color="#888888"><font style="color:rgb(0,0,153)"><div style="font-family:verdana,sans-serif;color:rgb(0,0,0);display:inline">
<br></div></font></font></div><div dir="ltr"><font style="font-family:verdana,sans-serif" color="#888888"><font style="color:rgb(0,0,153)"><div style="font-family:verdana,sans-serif;color:rgb(0,0,0);display:inline">
Best Regards, </div></font></font></div><span><font color="#888888"><div dir="ltr"><font style="font-family:verdana,sans-serif" color="#888888"><font style="color:rgb(0,0,153)"><div style="font-family:verdana,sans-serif;color:rgb(0,0,0);display:inline">
<br></div></font></font></div><div dir="ltr"><br></div><div dir="ltr"><font style="font-family:verdana,sans-serif" color="#888888"><font style="color:rgb(0,0,153)" size="4"><b><br><span style="color:rgb(11,83,148)">Martin Salcedo</span></b></font><br style="color:rgb(0,0,153)">
</font></div></font></span></div>
</div>
</div><br></div>