title: QT context menu only over QTreeView Selection
body: <p>I have a context menu which I want to appear only when is on top of an item from the QTreeView. When is on top of the blank space I want to do nothing.
  This is what I have until now</p>
  
  <pre><code>void MainTreeViewController::showContextMenu(const QPoint&amp; pos)
  {
  
      QPoint globalPos = mtreeView-&gt;mapToGlobal(pos);
      QMenu rightClickMenu;
      for(int i = 0; i &lt; kCharModelRightClickOptionsCount; ++i){
          rightClickMenu.addAction("Menu option");
      }
  
      QAction* selectedItem = rightClickMenu.exec(globalPos);
      if (selectedItem){
  
      }
  }
  </code></pre>
  
  <p>Thanks!</p>