diff --git a/ankiqt/ui/cardlist.py b/ankiqt/ui/cardlist.py index eebf3ec50..8bf3aca3c 100644 --- a/ankiqt/ui/cardlist.py +++ b/ankiqt/ui/cardlist.py @@ -185,10 +185,10 @@ interval, factor, noCount, priority, (select tags from facts where facts.id = cards.factId), (select created from facts where facts.id = cards.factId) from cards where id = :id""", id=self.cards[index.row()][0]) - # storing this in a local var first avoids a segfault - end = self.index(idx, 1) + if ankiqt.ui.utils.pyQtBroken: + raise self.emit(SIGNAL("dataChanged(QModelIndex,QModelIndex)"), - index, end) + index, self.index(index.row(), 1)) except: # called after search changed pass diff --git a/ankiqt/ui/main.py b/ankiqt/ui/main.py index f216d1729..fdfb2bcd1 100755 --- a/ankiqt/ui/main.py +++ b/ankiqt/ui/main.py @@ -1654,6 +1654,11 @@ learnt today") removeHook("showQuestion", self.onCardStats) def onShowGraph(self): + if ui.utils.pyQtBroken: + ui.utils.showInfo( + "Your PyQt installation is broken. " + "Please upgrade or downgrade PyQt.") + return self.setStatus(_("Loading graphs (may take time)...")) self.app.processEvents() import anki.graphs diff --git a/ankiqt/ui/utils.py b/ankiqt/ui/utils.py index a01b680d5..c8e31f6b1 100644 --- a/ankiqt/ui/utils.py +++ b/ankiqt/ui/utils.py @@ -264,3 +264,6 @@ class ProgressWin(object): self.app.processEvents() time.sleep(0.1) self.diag.cancel() + +import PyQt4.pyqtconfig as PyConf; +pyQtBroken = PyConf.Configuration().pyqt_version_str.startswith("4.6")