code: def data(self):
          
          if len(self.widget_items) == 0:
              return
          data = {}
          for hazard_item in self.widget_items:
              hazard = hazard_item.data(0, Qt.UserRole)
              data[hazard] = {}
              classification_items = [
                  hazard_item.child(i) for i in range(hazard_item.childCount())
              ]
              for classification_item in classification_items:
                  classification = classification_item.data(0, Qt.UserRole)
                  data[hazard][classification] = OrderedDict()
                  class_items = [
                      classification_item.child(i) for i in range(
                          classification_item.childCount()
                      )
                  ]
                  for the_class_item in class_items:
                      the_class = the_class_item.data(0, Qt.UserRole)
                      affected_check_box = self.itemWidget(the_class_item, 1)
                      displacement_rate_spin_box = self.itemWidget(
                          the_class_item, 2)
                      data[hazard][classification][the_class] = {
                          'affected': affected_check_box.isChecked(),
                          'displacement_rate': displacement_rate_spin_box.value()
                      }
          return data
docs: Get the data from the current state of widgets.
  
          :returns: Profile data in dictionary.
          :rtype: dict