title: How to disable default context menu of QTableView in pyqt?
body: <p>I am trying to <strong>disable</strong> a default context menu of QTableView in <strong>pyqt</strong>. </p>
  
  <p>I have re-implemented the contextMenuEvent but it works on 1st time right click. When I click on the same Item 2nd time the default context menu <strong>reappears</strong>. (Image attached below for referance.)</p>
  
  <p>I tried "<strong>QTableView.setContextMenuPolicy(<em>Qt.NoContextMenu</em>)</strong>" but it didn't work. Also referred the answers of similar type questions but still the issue is unresolved.  </p>
  
  <p>Any idea?</p>
  
  <p>Ex. showing Re-implemented context menu in QTableView.</p>
  
  <pre><code>def contextMenuEvent(self, event):
      menu = QMenu(self)
  
      CutAction = QAction(self.view)
      CutAction.setText("&amp;Cut")
      menu.addAction(CutAction)
      CutAction.setIcon(QIcon(":/{0}.png".format("Cut")))
      CutAction.setShortcut("Ctrl+X")
      self.connect(CutAction, SIGNAL("triggered()"), self.cut)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/eKgne.png" alt="enter image description here"></p>