code: def setupHeaderMenu(self, menu, index):
          
          if not self.userGroupingEnabled():
              return False
          
          first_action = menu.actions()[1]
          column = self.columnOf(index)
          
          enable_action = QAction(menu)
          enable_action.setText('Enable Grouping')
          
          disable_action = QAction(menu)
          disable_action.setText('Disable Grouping')
          
          quick_action = QAction(menu)
          quick_action.setText('Group by "%s"' % column)
          
  #        adv_action = QAction(menu)
  #        adv_action.setText('More Grouping Options...')
          
          menu.insertSeparator(first_action)
          menu.insertAction(first_action, enable_action)
          menu.insertAction(first_action, disable_action)
          menu.insertSeparator(first_action)
          menu.insertAction(first_action, quick_action)
  #        menu.insertAction(first_action, adv_action)
          
          quick_action.triggered.connect(self.groupByHeaderIndex)
  #        adv_action.triggered.connect(self.showAdvancedGroupingOptions)
          enable_action.triggered.connect(self.activateGrouping)
          disable_action.triggered.connect(self.deactivateGrouping)
          return True
docs: Updates the header right-click menu to include grouping options if
          desired.
          
          :param      menu  | <QMenu>
                      index | <int>