title: Wrong directory being accessed upon right click for context menu
body: <p>When I right click a file in tree view, context menu and it's underlying methods work.</p>
  
  <p>However, when I right click on empty space and context menu opens, delete and archive methods apply on my working folder itself (i.e. where the test_gui.py file is stored). </p>
  
  <p>I'm fine with the context menu popping up on empty space, I just don't want it to be able to do anything in that case.</p>
  
  <pre><code>from PyQt5 import QtCore, QtGui, QtWidgets
  import sys
  import os
  import send2trash
  import shutil
  
  class Ui_MainWindow(QtWidgets.QWidget):
      def setupUi(self, MainWindow):
          MainWindow.resize(800, 600)
          self.centralwidget = QtWidgets.QWidget(MainWindow)
  
          # Treeview model, path should contain files for test purpose
          path = r"C:\Test_gui"
          self.fileModel = QtWidgets.QFileSystemModel()
          self.fileModel.setReadOnly(False)
  
          # Treeview functionality
          self.treeView = QtWidgets.QTreeView(self.centralwidget)
          self.treeView.setModel(self.fileModel)
          self.treeView.setRootIndex(self.fileModel.setRootPath(path))
          self.treeView.setGeometry(QtCore.QRect(190, 130, 541, 381))
          self.treeView.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
          self.treeView.customContextMenuRequested.connect(self.openMenu)
  
          MainWindow.setCentralWidget(self.centralwidget)
          self.retranslateUi(MainWindow)
          QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
      def retranslateUi(self, MainWindow):
          _translate = QtCore.QCoreApplication.translate
  
  
      def delete(self, index):
          """ Send the selected file to the recycle bin"""
          path = self.fileModel.fileInfo(index).absoluteFilePath()
          # When context menu is opened (right click) on a file, send2trash 
          # sends file to the bin. However, if context menu is open on empty 
          # space, delete method sends my working directory to the bin. 
          print(os.path.abspath(path))
          # send2trash.send2trash(os.path.abspath(path))
  
  
      def archive(self, index):
          """Move selected file to archive"""
          source = self.fileModel.fileInfo(index).absoluteFilePath()
          destination = r"C:\Test_gui_archive"
          # Same as above, but the archive method sends the working directory 
          # to archive.
          print(os.path.abspath(source))
          # shutil.move(os.path.abspath(source), os.path.abspath(destination))
  
  
      def openMenu(self, position):
          """Setup a context menu to open upon right click."""
          index = self.treeView.indexAt(position)
          menu = QtWidgets.QMenu(self)
          delete_action = menu.addAction("Send to trashbin")
          archive_action = menu.addAction("Move to archive")
          action = menu.exec_(self.treeView.viewport().mapToGlobal(position))
          if action == delete_action:
              self.delete(index)
          if action == archive_action:
              self.archive(index)
  
  
  if __name__ == "__main__":
      app = QtWidgets.QApplication(sys.argv)
      MainWindow = QtWidgets.QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(MainWindow)
      MainWindow.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>Tried to apply the logic from <a href="https://stackoverflow.com/questions/59174609/qlistview-indexat-in-pyqt5-returning-wrong-index">this</a> thread, but was not successful. Advice would be highly appreciated! </p>