code: def set_widgets(self):
          
          self.clear_further_steps()
          # Set widgets
          self.lstCategories.clear()
          self.lblDescribeCategory.setText('')
          self.lblIconCategory.setPixmap(QPixmap())
          self.lblSelectCategory.setText(
              category_question % self.parent.layer.name())
          purposes = self.purposes_for_layer()
          for purpose in purposes:
              if not isinstance(purpose, dict):
                  purpose = definition(purpose)
              item = QListWidgetItem(purpose['name'], self.lstCategories)
              item.setData(QtCore.Qt.UserRole, purpose['key'])
              self.lstCategories.addItem(item)
  
          # Check if layer keywords are already assigned
          purpose_keyword = self.parent.get_existing_keyword('layer_purpose')
  
          # Overwrite the purpose_keyword if it's KW mode embedded in IFCW mode
          if self.parent.parent_step:
              purpose_keyword = self.parent.\
                  get_parent_mode_constraints()[0]['key']
  
          # Set values based on existing keywords or parent mode
          if purpose_keyword:
              purposes = []
              for index in range(self.lstCategories.count()):
                  item = self.lstCategories.item(index)
                  purposes.append(item.data(QtCore.Qt.UserRole))
              if purpose_keyword in purposes:
                  self.lstCategories.setCurrentRow(
                      purposes.index(purpose_keyword))
  
          self.auto_select_one_item(self.lstCategories)
docs: Set widgets on the layer purpose tab.