hello<br><br>i need to know how to update a combobox linked to a datawidgetmapper<br>when the table in relation with the mapper model is modified by en external application.<br><br>code:<br><br>    def setupModels(self):<br>



        &quot;&quot;&quot;<br>            Initialize all the application models<br>        &quot;&quot;&quot;<br>        # setup masterModel<br>        self.mModel = QSqlRelationalTableModel(self)<br>        self.mModel.setTable(QString(&quot;<div>


fattmaster&quot;))<br>
        self.mModel.setSort(MDATA, Qt.AscendingOrder)<br>        self.mModel.setRelation(MIDCLI, QSqlRelation(&quot;clienti&quot;,<br>                                            &quot;id&quot;, &quot;ragsoc&quot;))<br>        self.mModel.setRelation(MIDTDOC, QSqlRelation(&quot;tipofatt&quot;,<br>



                                            &quot;id&quot;, &quot;tfatt&quot;))<br>        self.mModel.select()<br><br clear="all">    def setupMappers(self):<br>        &#39;&#39;&#39;<br>            Initialize all the application mappers<br>



        &#39;&#39;&#39;<br>        self.mapper = QDataWidgetMapper(self)<br>        self.mapper.setSubmitPolicy(QDataWidgetMapper.ManualSubmit)<br>        self.mapper.setModel(self.mModel)<br>        self.mapper.setItemDelegate(QSqlRelationalDelegate(self))<br>



        self.mapper.addMapping(self.dateEdit, MDATA)<br>        self.mapper.addMapping(self.fattLineEdit, MDOC)<br><br>        relationModel = self.mModel.relationModel(MIDTDOC)<br>        relationModel.setSort(1, Qt.AscendingOrder)<br>



        relationModel.select()<br>        self.tipoFattComboBox.setModel(relationModel)<br>        self.tipoFattComboBox.setModelColumn(relationModel.fieldIndex(&quot;tfatt&quot;))<br>        self.mapper.addMapping(self.tipoFattComboBox, MIDTDOC)<br>



<br>        relationModel = self.mModel.relationModel(MIDCLI)<br>        relationModel.setSort(CRAGSOC, Qt.AscendingOrder)<br>        relationModel.select()<br>        self.cliComboBox.setModel(relationModel)<br>        self.cliComboBox.setModelColumn(relationModel.fieldIndex(&quot;ragsoc&quot;))<br>



        self.mapper.addMapping(self.cliComboBox, MIDCLI)<br><br>        self.mapper.addMapping(self.tipoPagLineEdit, MPAG)<br>        self.mapper.addMapping(self.cauLineEdit, MCAU)<br>        self.mapper.addMapping(self.noteLineEdit, MNOTE)<br>



        self.mapper.toFirst()<br><br>    def editCustomers(self):<br>        # call the &#39;clienti&#39; table editor<br>        subprocess.call([&#39;python&#39;,os.path.join(os.path.dirname(__file__),<br>                        &quot;clienti.py&quot;)])<br>


        # update all controls<br>        self.setupModels()<br>
        self.setupMappers()<br>        self.setupTables()<br>-------------------------<br><br>now, if an external application change (eg add a new record on &#39;clienti&#39; table) the &#39;clienti&#39; table,<br>how to update the self.cliComboBox control ?<br>



<br>actually i&#39;m &#39;rebuilding&#39; all controls as you can see on the editCustomers method, is this the only wahy to update the combobox control ?<br><br>thanks.<br><font color="#888888"><br></font></div><br clear="all">


<br>-- <br>&quot;Io oso fare tutto cio&#39; che puo&#39; essere degno di un uomo, chi osa di piu&#39; non lo e&#39;&quot;<br><a href="http://blog.zamprogno.it" target="_blank">http://blog.zamprogno.it</a><br><a href="http://riparazioni.zamprogno.it" target="_blank">http://riparazioni.zamprogno.it</a><br>


<a href="http://www.archlinux.it" target="_blank">http://www.archlinux.it</a><br><br>