diff --git a/README b/README index 4ce40d09d..4ab765285 100644 --- a/README +++ b/README @@ -12,8 +12,8 @@ sudo apt-get install python-qt4 mplayer lame libportaudio2 If you're on another distribution the packages may be named differently, so please consult your package manager. -Your Python version will need to be 2.6 or 2.7 (not 3+), and PyQt needs to be -4.7 or later. +Your Python version will need to be 2.6 or 2.7 (not 3+), and both Qt and PyQt +need to be 4.7 or later. Installation & Running ------------------------ diff --git a/aqt/__init__.py b/aqt/__init__.py index 30feaff8c..ca588d9be 100644 --- a/aqt/__init__.py +++ b/aqt/__init__.py @@ -201,6 +201,12 @@ No usable temporary folder found. Make sure C:\\temp exists or TEMP in your \ environment points to a valid, writable folder.""") return + # qt version must be up to date + if qtmajor <= 4 and qtminor <= 6: + QMessageBox.critical( + None, "Error", "Anki requires Qt4.7 or later.") + return + # parse args opts, args = parseArgs(sys.argv) opts.base = unicode(opts.base or "", sys.getfilesystemencoding()) diff --git a/aqt/qt.py b/aqt/qt.py index 0a4ac4891..0a5626c98 100644 --- a/aqt/qt.py +++ b/aqt/qt.py @@ -29,3 +29,8 @@ if os.environ.get("DEBUG"): from pdb import pm pm() sys.excepthook = info + +qtconf = pyqtconfig.Configuration() +qtmajor = (qtconf.qt_version & 0xff0000) >> 16 +qtminor = (qtconf.qt_version & 0x00ff00) >> 8 +