As I have mentioned here before, it is tricky for me to upgrade the scripts written by the author in PyQt4 to PyQt5, the version I am using (PyQt 5.5.1)
I’ve come up with new problems with chapter 8. The first was what I though was another problem with signals.
I’ve snipped the segment of code with the original being commented (preceded with and *), and my solution below it. In this case I spent a week or two trying to resolve this error:
# self.connect(self.table, SIGNAL("itemDoubleClicked(QTableWidgetItem*)"), # self.editEdit) self.table.itemDoubleClicked.connect(self.editEdit()) QShortcut(QKeySequence("Return"), self.table, self.editEdit)
def fileOpen(self): if not self.okToContinue(): return path = (QFileInfo(self.movies.filename()).path() if not self.movies.filename() else ".") # QFileDialog(QWidget, Qt.WindowFlags) QFileDialog(QWidget parent=None, str caption='', str directory='', str filter='') options = QFileDialog.Options() options |= QFileDialog.DontUseNativeDialog options |= QFileDialog.List fname, _ = QFileDialog.getOpenFileName(self, "My Movies - Load Movie Data", path, "My Movies data files ({})".format(self.movies.formats()), options=options) if fname: ok, msg = self.movies.load(fname[0]) self.statusBar().showMessage(msg, 5000) self.updateTable()