[pyzo] 04/07: Add support for gui integration with PyQt5
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Sep 29 09:27:17 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/master
in repository pyzo.
commit 9bd3b13bb289f14cea7603bbd7fb4d8d55b7d6a3
Author: Almar Klein <almar.klein at gmail.com>
Date: Wed Sep 28 11:50:30 2016 +0200
Add support for gui integration with PyQt5
---
pyzo/core/shellInfoDialog.py | 3 ++-
pyzo/pyzokernel/guiintegration.py | 11 +++++++++++
pyzo/pyzokernel/interpreter.py | 5 ++++-
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/pyzo/core/shellInfoDialog.py b/pyzo/core/shellInfoDialog.py
index 3ae8274..be94cba 100644
--- a/pyzo/core/shellInfoDialog.py
+++ b/pyzo/core/shellInfoDialog.py
@@ -129,7 +129,8 @@ class ShellInfo_gui(QtWidgets.QComboBox):
# GUI names
GUIS = [ ('None', 'no GUI support'),
('Auto', 'Use what is available (recommended)'),
- ('PyQt4', 'GPL/commercial licensed wrapper to Qt (recommended)'),
+ ('PyQt5', 'GPL/commercial licensed wrapper to Qt'),
+ ('PyQt4', 'GPL/commercial licensed wrapper to Qt'),
('PySide', 'LGPL licensed wrapper to Qt'),
('Tornado', 'Tornado asynchronous networking library'),
('Tk', 'Tk widget toolkit'),
diff --git a/pyzo/pyzokernel/guiintegration.py b/pyzo/pyzokernel/guiintegration.py
index f81db72..6c6fbda 100644
--- a/pyzo/pyzokernel/guiintegration.py
+++ b/pyzo/pyzokernel/guiintegration.py
@@ -413,6 +413,17 @@ class App_qt(App_base):
+class App_pyqt5(App_qt):
+ """ Hijack the PyQt5 mainloop.
+ """
+
+ def importCoreAndGui(self):
+ # Try importing qt
+ import PyQt5
+ from PyQt5 import QtGui, QtCore, QtWidgets
+ return QtWidgets, QtCore # QApp sits on QtWidgets
+
+
class App_pyqt4(App_qt):
""" Hijack the PyQt4 mainloop.
"""
diff --git a/pyzo/pyzokernel/interpreter.py b/pyzo/pyzokernel/interpreter.py
index b81e781..e3b77d0 100644
--- a/pyzo/pyzokernel/interpreter.py
+++ b/pyzo/pyzokernel/interpreter.py
@@ -459,7 +459,8 @@ class PyzoInterpreter:
if guiName in ['', 'NONE']:
guiName = ''
elif guiName == 'AUTO':
- for tryName, tryApp in [('PYQT4', guiintegration.App_pyqt4),
+ for tryName, tryApp in [('PYQT5', guiintegration.App_pyqt5),
+ ('PYQT4', guiintegration.App_pyqt4),
('PYSIDE', guiintegration.App_pyside),
#('WX', guiintegration.App_wx),
('TK', guiintegration.App_tk),
@@ -480,6 +481,8 @@ class PyzoInterpreter:
self.guiApp = guiintegration.App_tornado()
elif guiName == 'PYSIDE':
self.guiApp = guiintegration.App_pyside()
+ elif guiName in ['PYQT5', 'QT5']:
+ self.guiApp = guiintegration.App_pyqt5()
elif guiName in ['PYQT4', 'QT4']:
self.guiApp = guiintegration.App_pyqt4()
elif guiName == 'FLTK':
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pyzo.git
More information about the debian-science-commits
mailing list