title: How to drop a file into a QTableWidget in PyQt5
body: <p>I am trying to create a table-widget where I can drop an audio file and populate the table with filename, size of file etc. My code is as follows. I haven't implemented  the part for reading the metadata on dragEnterEvent as the table isn't even accepting drops of any kind. </p>
  
  <pre><code>from PyQt5 import QtCore, QtWidgets
  
  
  class Ui_MainWindow(object):
      def setupUi(self, MainWindow):
          MainWindow.setObjectName("MainWindow")
          MainWindow.resize(982, 615)
          MainWindow.setAcceptDrops(True)
          MainWindow.setStyleSheet("background-color: rgb(255, 255, 255);")
          self.centralwidget = QtWidgets.QWidget(MainWindow)
          self.centralwidget.setObjectName("centralwidget")
          self.label = QtWidgets.QLabel(self.centralwidget)
          self.label.setGeometry(QtCore.QRect(360, 0, 271, 181))
          self.label.setText("")
          self.label.setObjectName("label")
          self.tableWidget = QtWidgets.QTableWidget(self.centralwidget)
          self.tableWidget.setGeometry(QtCore.QRect(10, 200, 701, 331))
          self.tableWidget.setAcceptDrops(True)
          self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
          self.tableWidget.setDragDropMode(QtWidgets.QAbstractItemView.DragDrop)
          self.tableWidget.setDefaultDropAction(QtCore.Qt.CopyAction)
          self.tableWidget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
          self.tableWidget.setShowGrid(False)
          self.tableWidget.setSortingEnabled(True)
          self.tableWidget.setObjectName("tableWidget")
          self.tableWidget.horizontalHeader().setVisible(True)
          self.tableWidget.verticalHeader().setVisible(False)
          self.tableWidget.setRowCount(6)
          self.tableWidget.setColumnCount(6)
          MainWindow.setCentralWidget(self.centralwidget)
          self.menubar = QtWidgets.QMenuBar(MainWindow)
          self.menubar.setGeometry(QtCore.QRect(0, 0, 982, 21))
          self.menubar.setObjectName("menubar")
          MainWindow.setMenuBar(self.menubar)
          self.statusbar = QtWidgets.QStatusBar(MainWindow)
          self.statusbar.setObjectName("statusbar")
          MainWindow.setStatusBar(self.statusbar)
  
          self.titleUi(MainWindow)
          QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
      def dragEnterEvent(self, event):
          event.accept()
  
      def dropEvent(self, event):
          event.accept()
  
      def titleUi(self, MainWindow):
          MainWindow.setWindowTitle("tableWidget")
  
  
  
  if __name__ == "__main__":
      import sys
      app = QtWidgets.QApplication(sys.argv)
      MainWindow = QtWidgets.QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(MainWindow)
      MainWindow.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>How can I get the table to accept drops?</p>