From b256e6f2986c0f037a7a9423e8b3045426f86918 Mon Sep 17 00:00:00 2001
From: "A. Maitland Bottoms" <bottoms@debian.org>
Date: Sat, 26 Sep 2020 21:44:53 -0400
Subject: [PATCH] more qt4 qt5 updates

---
 docs/usage-manual/(exported from wiki) QT GUI.txt | 14 +++++++-------
 gr-filter/examples/gr_filtdes_callback.py         |  4 ++--
 gr-filter/examples/gr_filtdes_live_upd.py         |  8 ++++----
 gr-filter/examples/gr_filtdes_restrict.py         |  4 ++--
 gr-qtgui/apps/uhd_display.py                      |  6 +++---
 gr-qtgui/apps/usrp_display_qtgui.py               |  2 +-
 gr-qtgui/docs/qtgui.dox                           | 10 +++++-----
 gr-qtgui/examples/pyqt_waterfall_c.py             |  2 +-
 gr-qtgui/python/qtgui/range.py.cmakein            |  2 +-
 gr-utils/python/utils/gr_plot_qt                  |  6 +++---
 gr-utils/python/utils/pyqt_filter.py              |  4 ++--
 gr-utils/python/utils/pyqt_plot.py                |  4 ++--
 gr-zeromq/examples/python/fixui4py.sh             |  2 +-
 gr-zeromq/examples/python/gui.py                  |  4 ++--
 gr-zeromq/examples/python/main_window.ui          |  2 +-
 grc/tests/resources/file3.block.yml               |  2 +-
 16 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/docs/usage-manual/(exported from wiki) QT GUI.txt b/docs/usage-manual/(exported from wiki) QT GUI.txt
index fab784567..b46cdf32b 100644
--- a/docs/usage-manual/(exported from wiki) QT GUI.txt	
+++ b/docs/usage-manual/(exported from wiki) QT GUI.txt	
@@ -122,11 +122,11 @@ when asking for the delay outside of the available range.
 
 The QT GUI blocks require the following dependencies.
 
-# QtCore (version >= 4.4)
-# QtGui (version >= 4.4)
-# QtOpenGL (version >= 4.4)
-# PyQt4 for Qt4 (version >= 4.4)
-# Qwt (version >= 5.2)
+# QtCore (version >= 5.0)
+# QtGui (version >= 5.0)
+# QtOpenGL (version >= 5.0)
+# PyQt5 for Qt5 (version >= 5.0)
+# Qwt (version >= 6.1)
 
 == Usage ==
 
@@ -143,7 +143,7 @@ non-blocking call to launch the main thread of the flowgraph), the
 qapp's "exec_()" function is called. This function is a blocking call
 while the GUI is alive.
 
-from PyQt4 import Qt
+from PyQt5 import Qt
 from gnuradio import qtgui
 import sys, sip
  
@@ -279,4 +279,4 @@ share/gnuradio/examples/qt-gui/dark.qss.</text>
       <sha1>6p0evs1odganpw5pf993ifhtdncao90</sha1>
     </revision>
   </page>
-</mediawiki>
\ No newline at end of file
+</mediawiki>
diff --git a/gr-filter/examples/gr_filtdes_callback.py b/gr-filter/examples/gr_filtdes_callback.py
index d99edffc4..a6ac37c8c 100644
--- a/gr-filter/examples/gr_filtdes_callback.py
+++ b/gr-filter/examples/gr_filtdes_callback.py
@@ -25,9 +25,9 @@ from __future__ import unicode_literals
 from gnuradio.filter import filter_design
 import sys
 try:
-    from PyQt4 import Qt, QtCore, QtGui
+    from PyQt5 import Qt, QtCore, QtGui
 except ImportError:
-    print("Please install PyQt4 to run this script (http://www.riverbankcomputing.co.uk/software/pyqt/download)")
+    print("Please install PyQt5 to run this script (http://www.riverbankcomputing.co.uk/software/pyqt/download)")
     raise SystemExit(1)
 
 '''
diff --git a/gr-filter/examples/gr_filtdes_live_upd.py b/gr-filter/examples/gr_filtdes_live_upd.py
index ca925eb9b..b03a7e881 100644
--- a/gr-filter/examples/gr_filtdes_live_upd.py
+++ b/gr-filter/examples/gr_filtdes_live_upd.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012 Free Software Foundation, Inc.
+# Copyright 2012,2020 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -29,10 +29,10 @@ import sys
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtGui, QtCore
     import sip
 except ImportError:
-    sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n")
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 
@@ -86,7 +86,7 @@ class my_top_block(gr.top_block):
         pyQt  = self.snk1.pyqwidget()
 
         # Wrap the pointer as a PyQt SIP object
-        # This can now be manipulated as a PyQt4.QtGui.QWidget
+        # This can now be manipulated as a PyQt5.QtGui.QWidget
         pyWin = sip.wrapinstance(pyQt, QtGui.QWidget)
         pyWin.show()
 
diff --git a/gr-filter/examples/gr_filtdes_restrict.py b/gr-filter/examples/gr_filtdes_restrict.py
index c18d4c1f0..2040fbdbb 100644
--- a/gr-filter/examples/gr_filtdes_restrict.py
+++ b/gr-filter/examples/gr_filtdes_restrict.py
@@ -25,9 +25,9 @@ from __future__ import unicode_literals
 from gnuradio.filter import filter_design
 import sys
 try:
-    from PyQt4 import Qt, QtCore, QtGui
+    from PyQt5 import Qt, QtCore, QtGui
 except ImportError:
-    print("Please install PyQt4 to run this script (http://www.riverbankcomputing.co.uk/software/pyqt/download)")
+    print("Please install PyQt5 to run this script (http://www.riverbankcomputing.co.uk/software/pyqt/download)")
     raise SystemExit(1)
 
 
diff --git a/gr-qtgui/apps/uhd_display.py b/gr-qtgui/apps/uhd_display.py
index bb9abfc1b..a97f30ce9 100644
--- a/gr-qtgui/apps/uhd_display.py
+++ b/gr-qtgui/apps/uhd_display.py
@@ -34,10 +34,10 @@ import sys
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtGui, QtCore
     import sip
 except ImportError:
-    print("Error: Program requires PyQt4 and gr-qtgui.")
+    print("Error: Program requires PyQt5 and gr-qtgui.")
     sys.exit(1)
 
 try:
@@ -221,7 +221,7 @@ class my_top_block(gr.top_block):
 
         # Get the reference pointer to the SpectrumDisplayForm QWidget
         # Wrap the pointer as a PyQt SIP object
-        #     This can now be manipulated as a PyQt4.QtGui.QWidget
+        #     This can now be manipulated as a PyQt5.QtGui.QWidget
         self.pysink = sip.wrapinstance(self.snk.pyqwidget(), QtGui.QWidget)
 
         self.main_win = main_window(self.pysink, self)
diff --git a/gr-qtgui/apps/usrp_display_qtgui.py b/gr-qtgui/apps/usrp_display_qtgui.py
index 68c5d6cfb..aafb63237 100644
--- a/gr-qtgui/apps/usrp_display_qtgui.py
+++ b/gr-qtgui/apps/usrp_display_qtgui.py
@@ -8,7 +8,7 @@
 # WARNING! All changes made in this file will be lost!
 
 from __future__ import unicode_literals
-from PyQt4 import QtCore, QtGui
+from PyQt5 import QtCore, QtGui
 
 class Ui_MainWindow(object):
     def setupUi(self, MainWindow):
diff --git a/gr-qtgui/docs/qtgui.dox b/gr-qtgui/docs/qtgui.dox
index a430c5a60..6a80cb5ef 100644
--- a/gr-qtgui/docs/qtgui.dox
+++ b/gr-qtgui/docs/qtgui.dox
@@ -126,11 +126,11 @@ when asking for the delay outside of the available range.
 
 The QT GUI blocks require the following dependencies.
 
-\li QtCore (version >= 4.4)
-\li QtGui (version >= 4.4)
-\li QtOpenGL (version >= 4.4)
+\li QtCore (version >= 5.6)
+\li QtGui (version >= 5.6)
+\li QtOpenGL (version >= 5.6)
 \li PyQt5 for Qt5 (version >= 5.0)
-\li Qwt (version >= 5.2)
+\li Qwt (version >= 6.1)
 
 \section qtgui_usage Usage
 
@@ -148,7 +148,7 @@ qapp's "exec_()" function is called. This function is a blocking call
 while the GUI is alive.
 
 \code
-from PyQt4 import Qt
+from PyQt5 import Qt
 from gnuradio import qtgui
 import sys, sip
 
diff --git a/gr-qtgui/examples/pyqt_waterfall_c.py b/gr-qtgui/examples/pyqt_waterfall_c.py
index 2c183a99a..89458b7c4 100644
--- a/gr-qtgui/examples/pyqt_waterfall_c.py
+++ b/gr-qtgui/examples/pyqt_waterfall_c.py
@@ -31,7 +31,7 @@ try:
     from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n")
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 try:
diff --git a/gr-qtgui/python/qtgui/range.py.cmakein b/gr-qtgui/python/qtgui/range.py.cmakein
index 9e7fffecf..39f17a238 100755
--- a/gr-qtgui/python/qtgui/range.py.cmakein
+++ b/gr-qtgui/python/qtgui/range.py.cmakein
@@ -244,7 +244,7 @@ class RangeWidget(QtWidgets.QWidget):
 
 
 if __name__ == "__main__":
-    from PyQt4 import Qt
+    from PyQt5 import Qt
     import sys
 
     def valueChanged(frequency):
diff --git a/gr-utils/python/utils/gr_plot_qt b/gr-utils/python/utils/gr_plot_qt
index 5b9f9cf90..a5b33eed4 100755
--- a/gr-utils/python/utils/gr_plot_qt
+++ b/gr-utils/python/utils/gr_plot_qt
@@ -9,13 +9,13 @@ except ImportError:
     raise SystemExit(1)
 
 try:
-    from PyQt4 import Qt, QtCore, QtGui
+    from PyQt5 import Qt, QtCore, QtGui
 except ImportError:
-    print("Please install PyQt4 to run this script (http://www.riverbankcomputing.co.uk/software/pyqt/download)")
+    print("Please install PyQt5 to run this script (http://www.riverbankcomputing.co.uk/software/pyqt/download)")
     raise SystemExit(1)
 
 try:
-    import PyQt4.Qwt5 as Qwt
+    import PyQt5.Qwt5 as Qwt
 except ImportError:
     print("Please install PyQwt5 to run this script (http://pyqwt.sourceforge.net/)")
     raise SystemExit(1)
diff --git a/gr-utils/python/utils/pyqt_filter.py b/gr-utils/python/utils/pyqt_filter.py
index fac17644d..d2ece7baa 100644
--- a/gr-utils/python/utils/pyqt_filter.py
+++ b/gr-utils/python/utils/pyqt_filter.py
@@ -8,7 +8,7 @@
 # WARNING! All changes made in this file will be lost!
 
 from __future__ import unicode_literals
-from PyQt4 import QtCore, QtGui
+from PyQt5 import QtCore, QtGui
 
 class Ui_MainWindow(object):
     def setupUi(self, MainWindow):
@@ -432,5 +432,5 @@ class Ui_MainWindow(object):
         self.action_open.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+O", None, QtGui.QApplication.UnicodeUTF8))
 
 #from qwt_plot import QwtPlot
-from PyQt4.Qwt5 import QwtPlot
+from PyQt5.Qwt5 import QwtPlot
 
diff --git a/gr-utils/python/utils/pyqt_plot.py b/gr-utils/python/utils/pyqt_plot.py
index bec30c32a..3fc783470 100644
--- a/gr-utils/python/utils/pyqt_plot.py
+++ b/gr-utils/python/utils/pyqt_plot.py
@@ -6,7 +6,7 @@
 #
 # WARNING! All changes made in this file will be lost!
 
-from PyQt4 import QtCore, QtGui
+from PyQt5 import QtCore, QtGui
 
 try:
     _fromUtf8 = QtCore.QString.fromUtf8
@@ -268,4 +268,4 @@ class Ui_MainWindow(object):
         self.action_exit.setText(_translate("MainWindow", "E&xit", None))
         self.action_reload.setText(_translate("MainWindow", "&Reload", None))
 
-from PyQt4 import Qwt5
+from PyQt5 import Qwt5
diff --git a/gr-zeromq/examples/python/fixui4py.sh b/gr-zeromq/examples/python/fixui4py.sh
index d2978000b..a66e52e3a 100755
--- a/gr-zeromq/examples/python/fixui4py.sh
+++ b/gr-zeromq/examples/python/fixui4py.sh
@@ -1,2 +1,2 @@
 #!/bin/bash
-sed -i 's/qwt_plot.h/PyQt4.Qwt5.Qwt/' $1
+sed -i 's/qwt_plot.h/PyQt5.Qwt5.Qwt/' $1
diff --git a/gr-zeromq/examples/python/gui.py b/gr-zeromq/examples/python/gui.py
index 832392f0a..baa8e743c 100644
--- a/gr-zeromq/examples/python/gui.py
+++ b/gr-zeromq/examples/python/gui.py
@@ -28,8 +28,8 @@ from gnuradio.eng_arg import eng_float, intx
 import gui
 import sys
 import os
-from PyQt4 import Qt, QtGui, QtCore, uic
-import PyQt4.Qwt5 as Qwt
+from PyQt5 import Qt, QtGui, QtCore, uic
+import PyQt5.Qwt5 as Qwt
 from gnuradio import zeromq
 import signal
 
diff --git a/gr-zeromq/examples/python/main_window.ui b/gr-zeromq/examples/python/main_window.ui
index 14f810e67..02233f95b 100644
--- a/gr-zeromq/examples/python/main_window.ui
+++ b/gr-zeromq/examples/python/main_window.ui
@@ -191,7 +191,7 @@
   <customwidget>
    <class>QwtPlot</class>
    <extends>QFrame</extends>
-   <header>PyQt4.Qwt5.Qwt</header>
+   <header>PyQt5.Qwt5.Qwt</header>
   </customwidget>
  </customwidgets>
  <resources/>
diff --git a/grc/tests/resources/file3.block.yml b/grc/tests/resources/file3.block.yml
index 592ad94f6..42712c5eb 100644
--- a/grc/tests/resources/file3.block.yml
+++ b/grc/tests/resources/file3.block.yml
@@ -37,7 +37,7 @@ asserts:
 - ${value in (true, false)}
 
 templates:
-    imports: from PyQt4 import Qt
+    imports: from PyQt5 import Qt
     var_make: self.${id} = ${id} = ${value}
     callbacks:
     - self.set_${id}(${value})
-- 
2.20.1

