<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check(self):

 """check whether all attributes are setted and have the right dtype"""

        for name, valItem, dtype in self.values:
            val = valItem.text()
            if dtype:
                try:
                    val = dtype(val)
                except:
                    msgBox = QtWidgets.QMessageBox()
                    msgBox.setText(
                        'attribute %s has not the right dtype(%s)' %
                        (name, str(dtype)))
                    msgBox.exec_()
            self.args[name] = val
        self.accept()