code: def set_widgets(self):
          
          self.clear_further_steps()
          # Set widgets
          self.lstHazardCategories.clear()
          self.lblDescribeHazardCategory.setText('')
          self.lblSelectHazardCategory.setText(
              hazard_category_question)
          hazard_categories = self.hazard_categories_for_layer()
          for hazard_category in hazard_categories:
              if not isinstance(hazard_category, dict):
                  # noinspection PyTypeChecker
                  hazard_category = definition(hazard_category)
              # noinspection PyTypeChecker
              item = QListWidgetItem(
                  hazard_category['name'],
                  self.lstHazardCategories)
              # noinspection PyTypeChecker
              item.setData(QtCore.Qt.UserRole, hazard_category['key'])
              self.lstHazardCategories.addItem(item)
  
          # Set values based on existing keywords (if already assigned)
          category_keyword = self.parent.get_existing_keyword('hazard_category')
          if category_keyword:
              categories = []
              for index in range(self.lstHazardCategories.count()):
                  item = self.lstHazardCategories.item(index)
                  categories.append(item.data(QtCore.Qt.UserRole))
              if category_keyword in categories:
                  self.lstHazardCategories.setCurrentRow(
                      categories.index(category_keyword))
  
          self.auto_select_one_item(self.lstHazardCategories)
docs: Set widgets on the Hazard Category tab.