code: def selected_purpose(self):
          
          item = self.lstCategories.currentItem()
          try:
              return definition(item.data(QtCore.Qt.UserRole))
          except (AttributeError, NameError):
              return None
docs: Obtain the layer purpose selected by user.
  
          :returns: Metadata of the selected layer purpose.
          :rtype: dict, None