Skip to content

Commit df798e5

Browse files
committed
Rename qt4.py to qt.py, as it now supports Qt 5 as well (cztomczak#325).
Update docs and tools.
1 parent 9930aa8 commit df798e5

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

examples/Examples-README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ maintained:
3030
library (GTK 2)
3131
- [gtk3.py](gtk3.py): example for [PyGObject/PyGI](https://wiki.gnome.org/Projects/PyGObject)
3232
library (GTK 3). Currently broken on Linux/Mac, see top comments in sources.
33-
- [qt4.py](qt4.py): example for [PyQt4](https://wiki.python.org/moin/PyQt4)
34-
and [PySide](https://wiki.qt.io/PySide) libraries (Qt 4)
33+
- [qt.py](qt.py): example for [PyQt4](https://wiki.python.org/moin/PyQt4),
34+
[PyQt5](https://pypi.python.org/pypi/PyQt5)
35+
and [PySide](https://wiki.qt.io/PySide) libraries
3536
- [tkinter_.py](tkinter_.py): example for [Tkinter](https://wiki.python.org/moin/TkInter).
3637
Currently broken on Mac.
3738
- [wxpython.py](wxpython.py): example for [wxPython](https://wxpython.org/)

examples/qt4.py renamed to examples/qt.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
from PySide.QtCore import *
4444
else:
4545
print("USAGE:")
46-
print(" qt4.py pyqt4")
47-
print(" qt4.py pyqt5")
48-
print(" qt4.py pyside")
46+
print(" qt.py pyqt4")
47+
print(" qt.py pyqt5")
48+
print(" qt.py pyside")
4949
sys.exit(1)
5050

5151
# Fix for PyCharm hints warnings when using static methods
@@ -83,14 +83,14 @@ def main():
8383

8484

8585
def check_versions():
86-
print("[qt4.py] CEF Python {ver}".format(ver=cef.__version__))
87-
print("[qt4.py] Python {ver} {arch}".format(
86+
print("[qt.py] CEF Python {ver}".format(ver=cef.__version__))
87+
print("[qt.py] Python {ver} {arch}".format(
8888
ver=platform.python_version(), arch=platform.architecture()[0]))
8989
if PYQT4 or PYQT5:
90-
print("[qt4.py] PyQt {v1} (qt {v2})".format(
90+
print("[qt.py] PyQt {v1} (qt {v2})".format(
9191
v1=PYQT_VERSION_STR, v2=qVersion()))
9292
elif PYSIDE:
93-
print("[qt4.py] PySide {v1} (qt {v2})".format(
93+
print("[qt.py] PySide {v1} (qt {v2})".format(
9494
v1=PySide.__version__, v2=QtCore.__version__))
9595
# CEF Python version requirement
9696
assert cef.__version__ >= "55.4", "CEF Python v55.4+ required to run this"
@@ -265,7 +265,7 @@ def OnLoadStart(self, browser, **_):
265265
self.navigation_bar.cef_widget.setFocus()
266266
# Temporary fix no. 2 for focus issue on Linux (Issue #284)
267267
if LINUX:
268-
print("[qt4.py] LoadHandler.OnLoadStart:"
268+
print("[qt.py] LoadHandler.OnLoadStart:"
269269
" keyboard focus fix no. 2 (Issue #284)")
270270
browser.SetFocus(True)
271271
self.initial_app_loading = False
@@ -281,7 +281,7 @@ def OnSetFocus(self, **_):
281281
def OnGotFocus(self, browser, **_):
282282
# Temporary fix no. 1 for focus issues on Linux (Issue #284)
283283
if LINUX:
284-
print("[qt4.py] FocusHandler.OnGotFocus:"
284+
print("[qt.py] FocusHandler.OnGotFocus:"
285285
" keyboard focus fix no. 1 (Issue #284)")
286286
browser.SetFocus(True)
287287

tools/run_examples.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,26 @@ def main():
7272
print("[run_examples.py] PASS: gtk3.py (Gtk 3 not installed)")
7373
passed.append("gtk3.py")
7474

75-
# pyqt
75+
# pyqt4
7676
if packages["PyQt4"]:
77-
examples.append("qt4.py pyqt")
77+
examples.append("qt.py pyqt4")
7878
else:
79-
print("[run_examples.py] PASS: qt4.py pyqt (PyQt4 not installed)")
80-
passed.append("qt4.py pyqt")
79+
print("[run_examples.py] PASS: qt.py pyqt4 (PyQt4 not installed)")
80+
passed.append("qt.py pyqt4")
81+
82+
# pyqt5
83+
if packages["PyQt5"]:
84+
examples.append("qt.py pyqt5")
85+
else:
86+
print("[run_examples.py] PASS: qt.py pyqt5 (PyQt5 not installed)")
87+
passed.append("qt.py pyqt5")
8188

8289
# pyside
8390
if packages["PySide"]:
84-
examples.append("qt4.py pyside")
91+
examples.append("qt.py pyside")
8592
else:
86-
print("[run_examples.py] PASS: qt4.py pyside (PySide not installed)")
87-
passed.append("qt4.py pyside")
93+
print("[run_examples.py] PASS: qt.py pyside (PySide not installed)")
94+
passed.append("qt.py pyside")
8895

8996
# tkinter
9097
if MAC:
@@ -160,6 +167,7 @@ def check_installed_packages():
160167
"gi": False,
161168
"kivy": False,
162169
"PyQt4": False,
170+
"PyQt5": False,
163171
"PySide": False,
164172
"tkinter": False,
165173
"Tkinter": False,

0 commit comments

Comments
 (0)