code: def rowCount(self, parent):
          
          if not parent.isValid():
              v = self._conf
          else:
              v = self.get_value(parent)
          if isinstance(v, Section):
              return len(v.keys())
          else:
              return 0
docs: Reimplemented from QtCore.QAbstractItemModel