<font face="georgia,serif">I have a function to check if the selected type of children of a widget have been filled or not. Here is the code:<br><br> def fillCompleted(self, parent, combo=True, spin=True, dspin=True, line=True):<br>
'''Checks if all fields in a parent widget have been filled'''<br> filledCompletely = True<br> if combo:<br> for x in parent.findChildren(QComboBox):<br> if x.currentIndex() == 0:<br>
filledCompletely = False<br> print 'combo'<br> if spin:<br> for x in parent.findChildren(QSpinBox):<br> if x.cleanText() == "":<br>
filledCompletely = False<br> print 'spin'<br> if dspin:<br> for x in parent.findChildren(QDoubleSpinBox):<br> if x.cleanText() == "":<br>
filledCompletely = False<br> print 'dspin'<br> if line:<br> for x in parent.findChildren(QLineEdit):<br> if x.text() == "":<br> filledCompletely = False<br>
if not filledCompletely:<br> QMessageBox.warning(self,<br> "Data Incomplete",<br> "Please fill all the fields!")<br> return 0<br>
return 1<br clear="all"></font><br>I called this function with<br> if self.fillCompleted(self.purItmSel.currentWidget(),<br> spin=False,<br> dspin=False):<br>
As you can see, I told it to exclude spinboxes and doublespinboxes from checking.<br><br>However, while checking, it considers the lineedits in these spin/double spin boxes as lineedit, and validate them too.<br><br>How do I classify between the acual lineedits, and lineedits of the spin/double spinboxes?<br>
<br>Thanks!<br>-- <br>by,<br>Yours Sincerely <br>The One and Only<br>Manikandan<br>