From 2cf36532281caf6cf7ee54d92b3f22537819e012 Mon Sep 17 00:00:00 2001
From: "A. Maitland Bottoms" <bottoms@debian.org>
Date: Sun, 25 Feb 2018 13:25:55 -0500
Subject: [PATCH 19/22] qtgui fixed apps for Qt5 compatibility

---
 gr-qtgui/apps/gr_constellation_plot      |  12 +--
 gr-qtgui/apps/gr_psd_plot_b              |   7 +-
 gr-qtgui/apps/gr_psd_plot_c              |   7 +-
 gr-qtgui/apps/gr_psd_plot_f              |   7 +-
 gr-qtgui/apps/gr_psd_plot_i              |   7 +-
 gr-qtgui/apps/gr_psd_plot_s              |   7 +-
 gr-qtgui/apps/gr_spectrogram_plot        |   6 +-
 gr-qtgui/apps/gr_spectrogram_plot_b      |   7 +-
 gr-qtgui/apps/gr_spectrogram_plot_c      |   7 +-
 gr-qtgui/apps/gr_spectrogram_plot_f      |   7 +-
 gr-qtgui/apps/gr_spectrogram_plot_i      |   7 +-
 gr-qtgui/apps/gr_spectrogram_plot_s      |   7 +-
 gr-qtgui/apps/gr_time_plot_b             |   7 +-
 gr-qtgui/apps/gr_time_plot_c             |   7 +-
 gr-qtgui/apps/gr_time_plot_f             |   7 +-
 gr-qtgui/apps/gr_time_plot_i             |   7 +-
 gr-qtgui/apps/gr_time_plot_s             |   7 +-
 gr-qtgui/apps/gr_time_raster_b           |   7 +-
 gr-qtgui/apps/gr_time_raster_f           |   7 +-
 gr-qtgui/apps/plot_base.py               |   8 +-
 gr-qtgui/apps/plot_constellation_form.py |  16 +--
 gr-qtgui/apps/plot_form.py               | 160 +++++++++++++---------------
 gr-qtgui/apps/plot_psd_base.py           |  12 +--
 gr-qtgui/apps/plot_psd_form.py           |  34 +++---
 gr-qtgui/apps/plot_spectrogram_base.py   |  12 +--
 gr-qtgui/apps/plot_spectrogram_form.py   |  67 ++++++------
 gr-qtgui/apps/plot_time_base.py          |  12 +--
 gr-qtgui/apps/plot_time_form.py          |  21 ++--
 gr-qtgui/apps/plot_time_raster_base.py   |  14 +--
 gr-qtgui/apps/plot_time_raster_form.py   |  60 +++++------
 gr-qtgui/apps/qt_digital.py              |  58 +++++------
 gr-qtgui/apps/qt_digital_window.py       | 148 +++++++++++++-------------
 gr-qtgui/apps/uhd_display.py             |  58 +++++------
 gr-qtgui/apps/usrp_display_qtgui.py      | 172 +++++++++++++++----------------
 34 files changed, 473 insertions(+), 516 deletions(-)

diff --git a/gr-qtgui/apps/gr_constellation_plot b/gr-qtgui/apps/gr_constellation_plot
index 528bb97e5a..80d02d31ca 100755
--- a/gr-qtgui/apps/gr_constellation_plot
+++ b/gr-qtgui/apps/gr_constellation_plot
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012 Free Software Foundation, Inc.
+# Copyright 2012,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -28,16 +28,16 @@ import os, sys
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 try:
     import scipy
 except ImportError:
-    print "Error: Scipy required (www.scipy.org)."
+    sys.stderr.write("Error: Scipy required (www.scipy.org).\n")
     sys.exit(1)
 
 try:
@@ -66,7 +66,7 @@ class my_top_block(gr.top_block):
         self._y_value = 2
         self.gui_y_axis = None
 
-        self.qapp = QtGui.QApplication(sys.argv)
+        self.qapp = QtWidgets.QApplication(sys.argv)
 
         self.skip = blocks.skiphead(gr.sizeof_gr_complex, self._start)
         self.gui_snk = qtgui.const_sink_c(self._nsamps, "", self._nsigs)
@@ -98,7 +98,7 @@ class my_top_block(gr.top_block):
 
         # Get Python Qt references
         pyQt  = self.gui_snk.pyqwidget()
-        self.pyWin = sip.wrapinstance(pyQt, QtGui.QWidget)
+        self.pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget)
 
     def get_gui(self):
         return self.pyWin
diff --git a/gr-qtgui/apps/gr_psd_plot_b b/gr-qtgui/apps/gr_psd_plot_b
index 606311af48..70b9eabe38 100755
--- a/gr-qtgui/apps/gr_psd_plot_b
+++ b/gr-qtgui/apps/gr_psd_plot_b
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -31,10 +31,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class psd_plot_b(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_psd_plot_c b/gr-qtgui/apps/gr_psd_plot_c
index 6df9fae190..7d827ac995 100755
--- a/gr-qtgui/apps/gr_psd_plot_c
+++ b/gr-qtgui/apps/gr_psd_plot_c
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012 Free Software Foundation, Inc.
+# Copyright 2012,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -32,10 +32,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class psd_plot_c(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_psd_plot_f b/gr-qtgui/apps/gr_psd_plot_f
index f07e3e8b50..abb66f013b 100755
--- a/gr-qtgui/apps/gr_psd_plot_f
+++ b/gr-qtgui/apps/gr_psd_plot_f
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -32,10 +32,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.sterr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class psd_plot_f(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_psd_plot_i b/gr-qtgui/apps/gr_psd_plot_i
index 1852345823..17d4970ec2 100755
--- a/gr-qtgui/apps/gr_psd_plot_i
+++ b/gr-qtgui/apps/gr_psd_plot_i
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -31,10 +31,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class psd_plot_i(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_psd_plot_s b/gr-qtgui/apps/gr_psd_plot_s
index c06076f1f9..5f99c70209 100755
--- a/gr-qtgui/apps/gr_psd_plot_s
+++ b/gr-qtgui/apps/gr_psd_plot_s
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -31,10 +31,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class psd_plot_s(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_spectrogram_plot b/gr-qtgui/apps/gr_spectrogram_plot
index db79f9dbad..5f5b8ba431 100755
--- a/gr-qtgui/apps/gr_spectrogram_plot
+++ b/gr-qtgui/apps/gr_spectrogram_plot
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -36,10 +36,10 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class spectrogram_plot_c(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_spectrogram_plot_b b/gr-qtgui/apps/gr_spectrogram_plot_b
index 0d7a16ea6e..29feaa33f5 100755
--- a/gr-qtgui/apps/gr_spectrogram_plot_b
+++ b/gr-qtgui/apps/gr_spectrogram_plot_b
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -31,10 +31,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class spectrogram_plot_b(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_spectrogram_plot_c b/gr-qtgui/apps/gr_spectrogram_plot_c
index 52b0d4dff7..b5a7686da6 100755
--- a/gr-qtgui/apps/gr_spectrogram_plot_c
+++ b/gr-qtgui/apps/gr_spectrogram_plot_c
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -32,10 +32,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class spectrogram_plot_c(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_spectrogram_plot_f b/gr-qtgui/apps/gr_spectrogram_plot_f
index 6ea5afc4ef..26346945f1 100755
--- a/gr-qtgui/apps/gr_spectrogram_plot_f
+++ b/gr-qtgui/apps/gr_spectrogram_plot_f
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -32,10 +32,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class spectrogram_plot_f(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_spectrogram_plot_i b/gr-qtgui/apps/gr_spectrogram_plot_i
index 893df2a234..693d961d0d 100755
--- a/gr-qtgui/apps/gr_spectrogram_plot_i
+++ b/gr-qtgui/apps/gr_spectrogram_plot_i
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -31,10 +31,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class spectrogram_plot_i(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_spectrogram_plot_s b/gr-qtgui/apps/gr_spectrogram_plot_s
index 82a22f740d..270bacbcaf 100755
--- a/gr-qtgui/apps/gr_spectrogram_plot_s
+++ b/gr-qtgui/apps/gr_spectrogram_plot_s
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -31,10 +31,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class spectrogram_plot_s(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_time_plot_b b/gr-qtgui/apps/gr_time_plot_b
index d822557f1b..ae240561e6 100755
--- a/gr-qtgui/apps/gr_time_plot_b
+++ b/gr-qtgui/apps/gr_time_plot_b
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -30,10 +30,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class plot_time_b(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_time_plot_c b/gr-qtgui/apps/gr_time_plot_c
index 202e0f88f4..af184304d4 100755
--- a/gr-qtgui/apps/gr_time_plot_c
+++ b/gr-qtgui/apps/gr_time_plot_c
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -31,10 +31,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class plot_time_c(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_time_plot_f b/gr-qtgui/apps/gr_time_plot_f
index 8f5ad9f60d..e9892ac302 100755
--- a/gr-qtgui/apps/gr_time_plot_f
+++ b/gr-qtgui/apps/gr_time_plot_f
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -31,10 +31,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class plot_time_f(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_time_plot_i b/gr-qtgui/apps/gr_time_plot_i
index 8a7888b451..be995897c1 100755
--- a/gr-qtgui/apps/gr_time_plot_i
+++ b/gr-qtgui/apps/gr_time_plot_i
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -30,10 +30,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class plot_time_i(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_time_plot_s b/gr-qtgui/apps/gr_time_plot_s
index 7cee262379..7eff341225 100755
--- a/gr-qtgui/apps/gr_time_plot_s
+++ b/gr-qtgui/apps/gr_time_plot_s
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -30,10 +30,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class plot_time_s(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_time_raster_b b/gr-qtgui/apps/gr_time_raster_b
index ad8691489c..dc361832e6 100755
--- a/gr-qtgui/apps/gr_time_raster_b
+++ b/gr-qtgui/apps/gr_time_raster_b
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -31,10 +31,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class plot_time_raster_b(plot_base.plot_base):
diff --git a/gr-qtgui/apps/gr_time_raster_f b/gr-qtgui/apps/gr_time_raster_f
index 5d6a8389cf..ccd5a79069 100755
--- a/gr-qtgui/apps/gr_time_raster_f
+++ b/gr-qtgui/apps/gr_time_raster_f
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -31,10 +31,11 @@ except ImportError:
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 class plot_time_raster_f(plot_base.plot_base):
diff --git a/gr-qtgui/apps/plot_base.py b/gr-qtgui/apps/plot_base.py
index eaab7599c7..a08f460c9c 100644
--- a/gr-qtgui/apps/plot_base.py
+++ b/gr-qtgui/apps/plot_base.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -29,16 +29,16 @@ os.environ['GR_CONF_CONTROLPORT_ON'] = 'False'
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 try:
     import scipy
 except ImportError:
-    print "Error: Scipy required (www.scipy.org)."
+    sys.stderr.write("Error: Scipy required (www.scipy.org).\n")
     sys.exit(1)
 
 try:
diff --git a/gr-qtgui/apps/plot_constellation_form.py b/gr-qtgui/apps/plot_constellation_form.py
index 01c6ed1865..dc62e09f13 100644
--- a/gr-qtgui/apps/plot_constellation_form.py
+++ b/gr-qtgui/apps/plot_constellation_form.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -24,10 +24,11 @@ import sys
 from gnuradio import filter
 
 try:
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5.\n")
     sys.exit(1)
 
 try:
@@ -39,8 +40,8 @@ class plot_constellation_form(plot_form):
     def __init__(self, top_block, title='', scale=1):
         plot_form.__init__(self, top_block, title, scale)
 
-        self.right_col_layout = QtGui.QVBoxLayout()
-        self.right_col_form = QtGui.QFormLayout()
+        self.right_col_layout = QtWidgets.QVBoxLayout()
+        self.right_col_form = QtWidgets.QFormLayout()
         self.right_col_layout.addLayout(self.right_col_form)
         self.layout.addLayout(self.right_col_layout, 1,4,1,1)
 
@@ -51,12 +52,11 @@ class plot_constellation_form(plot_form):
         self.ybar.setSingleStep(self._pos_scale*(max(self.top_block._y_range/10, 0.010)))
         self.ybar.setPageStep(self._pos_scale*(max(self.top_block._y_range/2, 0.010)))
 
-        self.auto_scale = QtGui.QCheckBox("Auto Scale", self)
+        self.auto_scale = QtWidgets.QCheckBox("Auto Scale", self)
         if(self.top_block._auto_scale):
             self.auto_scale.setChecked(self.top_block._auto_scale)
         self.set_auto_scale(self.top_block._auto_scale)
-        self.connect(self.auto_scale, QtCore.SIGNAL("stateChanged(int)"),
-                     self.set_auto_scale)
+        self.auto_scale.stateChanged.connect(self.set_auto_scale)
         self.right_col_layout.addWidget(self.auto_scale)
 
         self.ybar.setValue(1000*self.top_block._y_value)
diff --git a/gr-qtgui/apps/plot_form.py b/gr-qtgui/apps/plot_form.py
index 931565bd3e..39e3e1a928 100644
--- a/gr-qtgui/apps/plot_form.py
+++ b/gr-qtgui/apps/plot_form.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2012 Free Software Foundation, Inc.
+# Copyright 2012,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -21,17 +21,18 @@
 #
 
 try:
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5.\n")
     sys.exit(1)
 
 import numpy
 
-class plot_form(QtGui.QWidget):
+class plot_form(QtWidgets.QWidget):
     def __init__(self, top_block, title='', scale=1):
-        QtGui.QWidget.__init__(self, None)
+        QtWidgets.QWidget.__init__(self, None)
 
         self._start = 0
         self._end = 0
@@ -44,81 +45,73 @@ class plot_form(QtGui.QWidget):
 
         self.setWindowTitle(title)
 
-        self.layout = QtGui.QGridLayout(self)
+        self.layout = QtWidgets.QGridLayout(self)
         self.layout.addWidget(top_block.get_gui(), 1,2,1,2)
 
         # Create a save action
-        self.save_act = QtGui.QAction("Save", self)
-        self.save_act.setShortcut(QtGui.QKeySequence.Save)
-        self.connect(self.save_act, QtCore.SIGNAL("triggered()"),
-                     self.save_figure)
+        self.save_act = QtWidgets.QAction("Save", self)
+        self.save_act.setShortcut(QtWidgets.QKeySequence.Save)
+        self.save_act.triggered.connect(self.save_figure)
 
         # Create an exit action
-        self.exit_act = QtGui.QAction("Exit", self)
-        self.exit_act.setShortcut(QtGui.QKeySequence.Close)
-        self.connect(self.exit_act, QtCore.SIGNAL("triggered()"),
-                     self.close)
+        self.exit_act = QtWidgets.QAction("Exit", self)
+        self.exit_act.setShortcut(QtWidgets.QKeySequence.Close)
+        self.exit_act.triggered.connect(self.close)
 
         # Create a menu for the window
-        self.menu = QtGui.QToolBar("Menu", self)
+        self.menu = QtWidgets.QToolBar("Menu", self)
         self.menu.addAction(self.save_act)
         self.menu.addAction(self.exit_act)
 
         self.layout.addWidget(self.menu, 0,0,1,4)
 
-        self.left_col_form = QtGui.QFormLayout()
+        self.left_col_form = QtWidgets.QFormLayout()
         self.layout.addLayout(self.left_col_form, 1,0,1,1)
         self.layout.setColumnStretch(0, 0)
         self.layout.setColumnStretch(2, 1)
 
         # Create Edit boxes for X-axis start/stop
-        self.size_val = QtGui.QIntValidator(0, top_block._max_nsamps, self)
+        self.size_val = QtWidgets.QIntValidator(0, top_block._max_nsamps, self)
 
-        self.start_edit = QtGui.QLineEdit(self)
+        self.start_edit = QtWidgets.QLineEdit(self)
         self.start_edit.setMinimumWidth(100)
         self.start_edit.setMaximumWidth(100)
-        self.start_edit.setText(QtCore.QString("%1").arg(top_block._start))
+        self.start_edit.setText("{0}".format(top_block._start))
         self.start_edit.setValidator(self.size_val)
         self.left_col_form.addRow("Start:", self.start_edit)
-        self.connect(self.start_edit, QtCore.SIGNAL("returnPressed()"),
-                     self.update_xaxis_pos)
+        self.start_edit.returnPressed.connect(self.update_xaxis_pos)
 
         end = top_block._start + top_block._nsamps
-        self.end_edit = QtGui.QLineEdit(self)
+        self.end_edit = QtWidgets.QLineEdit(self)
         self.end_edit.setMinimumWidth(100)
         self.end_edit.setMaximumWidth(100)
-        self.end_edit.setText(QtCore.QString("%1").arg(end))
+        self.end_edit.setText("{0}".format(end))
         self.end_edit.setValidator(self.size_val)
         self.left_col_form.addRow("End:", self.end_edit)
-        self.connect(self.end_edit, QtCore.SIGNAL("returnPressed()"),
-                     self.update_xaxis_pos)
+        self.end_edit.returnPressed.connect(self.update_xaxis_pos)
 
         # Create a slider to move the position in the file
-        self.posbar = QtGui.QSlider(QtCore.Qt.Horizontal, self)
+        self.posbar = QtWidgets.QSlider(Qt.Qt.Horizontal, self)
         self.posbar.setMaximum(self.top_block._max_nsamps)
         self.posbar.setPageStep(self.top_block._nsamps)
-        self.connect(self.posbar, QtCore.SIGNAL("valueChanged(int)"),
-                     self.update_xaxis_slider)
+        self.posbar.valueChanged.connect(self.update_xaxis_slider)
         self.layout.addWidget(self.posbar, 2,2,1,1)
 
         # Create Edit boxes for Y-axis min/max
-        self.y_max_edit = QtGui.QLineEdit(self)
+        self.y_max_edit = QtWidgets.QLineEdit(self)
         self.y_max_edit.setMinimumWidth(100)
         self.y_max_edit.setMaximumWidth(100)
         self.left_col_form.addRow("Y Max:", self.y_max_edit)
-        self.connect(self.y_max_edit, QtCore.SIGNAL("editingFinished()"),
-                     self.update_yaxis_pos)
+        self.y_max_edit.editingFinished.connect(self.update_yaxis_pos)
 
-        self.y_min_edit = QtGui.QLineEdit(self)
+        self.y_min_edit = QtWidgets.QLineEdit(self)
         self.y_min_edit.setMinimumWidth(100)
         self.y_min_edit.setMaximumWidth(100)
         self.left_col_form.addRow("Y Min:", self.y_min_edit)
-        self.connect(self.y_min_edit, QtCore.SIGNAL("editingFinished()"),
-                     self.update_yaxis_pos)
+        self.y_min_edit.editingFinished.connect(self.update_yaxis_pos)
 
-        self.grid_check = QtGui.QCheckBox("Grid", self)
-        self.connect(self.grid_check, QtCore.SIGNAL("stateChanged(int)"),
-                     self.set_grid_check)
+        self.grid_check = QtWidgets.QCheckBox("Grid", self)
+        self.grid_check.stateChanged.connect(self.set_grid_check)
         self.left_col_form.addWidget(self.grid_check)
 
         # Create a slider to move the plot's y-axis offset
@@ -126,42 +119,39 @@ class plot_form(QtGui.QWidget):
         _ymin = numpy.int32(max(numpy.iinfo(numpy.int32).min, self.top_block._y_min))
         _yrng = numpy.int32(min(numpy.iinfo(numpy.int32).max, self.top_block._y_range))
         _yval = numpy.int32(min(numpy.iinfo(numpy.int32).max, self.top_block._y_value))
-        self.ybar = QtGui.QSlider(QtCore.Qt.Vertical, self)
+        self.ybar = QtWidgets.QSlider(Qt.Qt.Vertical, self)
         self.ybar.setMinimum(self._pos_scale*_ymin)
         self.ybar.setMaximum(self._pos_scale*_ymax)
         self.ybar.setSingleStep(self._pos_scale*(_yrng/10))
         self.ybar.setPageStep(self._pos_scale*(_yrng/2))
         self.ybar.setValue(self._pos_scale*_ymax)
-        self.connect(self.ybar, QtCore.SIGNAL("valueChanged(int)"),
-                     self.update_yaxis_slider)
+        self.ybar.valueChanged.connect(self.update_yaxis_slider)
         self.layout.addWidget(self.ybar, 1,1,1,1)
 
         self.gui_y_axis(top_block._y_value-top_block._y_range, top_block._y_value)
 
         # Create an edit box for the Sample Rate
         sr = top_block._samp_rate
-        self.samp_rate_edit = QtGui.QLineEdit(self)
+        self.samp_rate_edit = QtWidgets.QLineEdit(self)
         self.samp_rate_edit.setMinimumWidth(100)
         self.samp_rate_edit.setMaximumWidth(100)
-        self.samp_rate_edit.setText(QtCore.QString("%1").arg(sr))
+        self.samp_rate_edit.setText("{0}".format(sr))
         self.left_col_form.addRow("Sample Rate:", self.samp_rate_edit)
-        self.connect(self.samp_rate_edit, QtCore.SIGNAL("returnPressed()"),
-                     self.update_samp_rate)
+        self.samp_rate_edit.returnPressed.connect(self.update_samp_rate)
 
         # Create an edit box for the center frequency
         freq = top_block._center_freq
-        self.freq_edit = QtGui.QLineEdit(self)
+        self.freq_edit = QtWidgets.QLineEdit(self)
         self.freq_edit.setMinimumWidth(100)
         self.freq_edit.setMaximumWidth(100)
-        self.freq_edit.setText(QtCore.QString("%1").arg(freq))
+        self.freq_edit.setText("{0}".format(freq))
         self.left_col_form.addRow("Frequency:", self.freq_edit)
-        self.connect(self.freq_edit, QtCore.SIGNAL("returnPressed()"),
-                     self.update_samp_rate)
+        self.freq_edit.returnPressed.connect(self.update_samp_rate)
 
         self.resize(1000, 500)
 
     def add_line_control(self, layout):
-        self._line_tabs = QtGui.QTabWidget()
+        self._line_tabs = QtWidgets.QTabWidget()
 
         self._line_pages = []
         self._line_forms = []
@@ -172,51 +162,46 @@ class plot_form(QtGui.QWidget):
         self._marker_edit = []
         self._alpha_edit = []
         for n in xrange(self.top_block._nsigs):
-            self._line_pages.append(QtGui.QDialog())
-            self._line_forms.append(QtGui.QFormLayout(self._line_pages[-1]))
+            self._line_pages.append(QtWidgets.QDialog())
+            self._line_forms.append(QtWidgets.QFormLayout(self._line_pages[-1]))
 
             label = self.top_block.gui_snk.line_label(n)
-            self._label_edit.append(QtGui.QLineEdit(self))
+            self._label_edit.append(QtWidgets.QLineEdit(self))
             self._label_edit[-1].setMinimumWidth(125)
             self._label_edit[-1].setMaximumWidth(125)
-            self._label_edit[-1].setText(QtCore.QString("%1").arg(label))
+            self._label_edit[-1].setText("{0}".format(label))
             self._line_forms[-1].addRow("Label:", self._label_edit[-1])
-            self.connect(self._label_edit[-1], QtCore.SIGNAL("returnPressed()"),
-                         self.update_line_label)
+            self._label_edit[-1].returnPressed.connect(self.update_line_label)
 
-            width_val = QtGui.QIntValidator(1, 20, self)
-            self._size_edit.append(QtGui.QLineEdit(self))
+            width_val = QtWidgets.QIntValidator(1, 20, self)
+            self._size_edit.append(QtWidgets.QLineEdit(self))
             self._size_edit[-1].setValidator(width_val)
             self._size_edit[-1].setMinimumWidth(100)
             self._size_edit[-1].setMaximumWidth(100)
-            self._size_edit[-1].setText(QtCore.QString("%1").arg(1))
+            self._size_edit[-1].setText("{0}".format(1))
             self._line_forms[-1].addRow("Width:", self._size_edit[-1])
-            self.connect(self._size_edit[-1], QtCore.SIGNAL("returnPressed()"),
-                         self.update_line_size)
+            self._size_edit[-1].returnPressed.connect(self.update_line_size)
 
             color = self.top_block.gui_snk.line_color(n)
-            self._color_edit.append(QtGui.QLineEdit(self))
+            self._color_edit.append(QtWidgets.QLineEdit(self))
             self._color_edit[-1].setMinimumWidth(100)
             self._color_edit[-1].setMaximumWidth(100)
-            self._color_edit[-1].setText(QtCore.QString("%1").arg(color))
+            self._color_edit[-1].setText("{0}".format(color))
             self._line_forms[-1].addRow("Color:", self._color_edit[-1])
-            self.connect(self._color_edit[-1], QtCore.SIGNAL("returnPressed()"),
-                         self.update_line_color)
-
-            self._qtstyles = {"None": QtCore.Qt.NoPen,
-                              "Solid": QtCore.Qt.SolidLine,
-                              "Dash": QtCore.Qt.DashLine,
-                              "Dot": QtCore.Qt.DotLine,
-                              "DashDot": QtCore.Qt.DashDotLine,
-                              "DashDotDot": QtCore.Qt.DashDotDotLine}
-            self._style_edit.append(QtGui.QComboBox(self))
+            self._color_edit[-1].returnPressed.connect(self.update_line_color)
+
+            self._qtstyles = {"None": Qt.Qt.NoPen,
+                              "Solid": Qt.Qt.SolidLine,
+                              "Dash": Qt.Qt.DashLine,
+                              "Dot": Qt.Qt.DotLine,
+                              "DashDot": Qt.Qt.DashDotLine,
+                              "DashDotDot": Qt.Qt.DashDotDotLine}
+            self._style_edit.append(QtWidgets.QComboBox(self))
             self._style_edit[-1].addItems(["None", "Solid", "Dash",
                                           "Dot", "DashDot", "DashDotDot"])
             self._style_edit[-1].setCurrentIndex(1)
             self._line_forms[-1].addRow("Style:", self._style_edit[-1])
-            self.connect(self._style_edit[-1],
-                         QtCore.SIGNAL("currentIndexChanged(int)"),
-                         self.update_line_style)
+            self._style_edit[-1].currentIndexChanged.connect(self.update_line_style)
 
             # A bit dangerous, this. If QWT ever changes the lineup,
             # we will have to adjust this, too. But we also can't
@@ -236,28 +221,25 @@ class plot_form(QtGui.QWidget):
                                 "Star 1": 12,
                                 "Star 2": 13,
                                 "Hexagon": 14}
-            self._marker_edit.append(QtGui.QComboBox(self))
+            self._marker_edit.append(QtWidgets.QComboBox(self))
             self._marker_edit[-1].addItems(["None", "Circle", "Rectangle", "Diamond",
                                             "Triangle", "Down Triangle", "Left Triangle",
                                             "Right Triangle", "Cross", "X-Cross",
                                             "Horiz. Line", "Vert. Line", "Star 1",
                                             "Star 2", "Hexagon"])
             self._line_forms[-1].addRow("Marker:", self._marker_edit[-1])
-            self.connect(self._marker_edit[-1],
-                         QtCore.SIGNAL("currentIndexChanged(int)"),
-                         self.update_line_marker)
+            self._marker_edit[-1].currentIndexChanged.connect(self.update_line_marker)
 
-            alpha_val = QtGui.QDoubleValidator(0, 1.0, 2, self)
+            alpha_val = QtWidgets.QDoubleValidator(0, 1.0, 2, self)
             alpha_val.setTop(1.0)
             alpha = self.top_block.gui_snk.line_alpha(n)
-            self._alpha_edit.append(QtGui.QLineEdit(self))
+            self._alpha_edit.append(QtWidgets.QLineEdit(self))
             self._alpha_edit[-1].setMinimumWidth(50)
             self._alpha_edit[-1].setMaximumWidth(100)
-            self._alpha_edit[-1].setText(QtCore.QString("%1").arg(alpha))
+            self._alpha_edit[-1].setText("{0]".format(alpha))
             self._alpha_edit[-1].setValidator(alpha_val)
             self._line_forms[-1].addRow("Alpha:", self._alpha_edit[-1])
-            self.connect(self._alpha_edit[-1], QtCore.SIGNAL("returnPressed()"),
-                         self.update_line_alpha)
+            self._alpha_edit[-1].returnPressed.connect(self.update_line_alpha)
 
             self._line_tabs.addTab(self._line_pages[-1], "{0}".format(label))
 
@@ -303,10 +285,10 @@ class plot_form(QtGui.QWidget):
         newend = self.end_edit.text().toUInt()[0]
         if(newstart != self._start or newend != self._end):
             if(newend < newstart):
-                QtGui.QMessageBox.information(
+                QtWidgets.QMessageBox.information(
                     self, "Warning",
                     "End sample is less than start sample.",
-                    QtGui.QMessageBox.Ok);
+                    QtWidgets.QMessageBox.Ok);
             else:
                 newnsamps = newend - newstart
                 self.top_block.reset(newstart, newnsamps)
@@ -377,13 +359,13 @@ class plot_form(QtGui.QWidget):
             self.top_block.gui_snk.enable_grid(False)
 
     def save_figure(self):
-        qpix = QtGui.QPixmap.grabWidget(self.top_block.pyWin)
+        qpix = QtWidgets.QPixmap.grabWidget(self.top_block.pyWin)
         types = "JPEG file (*.jpg);;" + \
             "Portable Network Graphics file (*.png);;" + \
             "Bitmap file (*.bmp);;" + \
             "TIFF file (*.tiff)"
-        filebox = QtGui.QFileDialog(self, "Save Image", "./", types)
-        filebox.setViewMode(QtGui.QFileDialog.Detail)
+        filebox = QtWidgets.QFileDialog(self, "Save Image", "./", types)
+        filebox.setViewMode(QtWidgets.QFileDialog.Detail)
         if(filebox.exec_()):
             filename = filebox.selectedFiles()[0]
             filetype = filebox.selectedNameFilter()
diff --git a/gr-qtgui/apps/plot_psd_base.py b/gr-qtgui/apps/plot_psd_base.py
index 46f903e1b5..bf070f2c1c 100644
--- a/gr-qtgui/apps/plot_psd_base.py
+++ b/gr-qtgui/apps/plot_psd_base.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -27,16 +27,16 @@ import os, sys
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 try:
     import scipy
 except ImportError:
-    print "Error: Scipy required (www.scipy.org)."
+    sys.stderr.write("Error: Scipy required (www.scipy.org).\n")
     sys.exit(1)
 
 try:
@@ -69,7 +69,7 @@ class plot_base(gr.top_block):
 
         self._is_setup = False
 
-        self.qapp = QtGui.QApplication(sys.argv)
+        self.qapp = QtWidgets.QApplication(sys.argv)
 
     def setup(self):
         self.skip = blocks.skiphead(self.dsize, self._start)
@@ -104,7 +104,7 @@ class plot_base(gr.top_block):
 
         # Get Python Qt references
         pyQt  = self.gui_snk.pyqwidget()
-        self.pyWin = sip.wrapinstance(pyQt, QtGui.QWidget)
+        self.pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget)
 
         self._is_setup = True
 
diff --git a/gr-qtgui/apps/plot_psd_form.py b/gr-qtgui/apps/plot_psd_form.py
index 2d1fcd10bc..3109fb2b0c 100644
--- a/gr-qtgui/apps/plot_psd_form.py
+++ b/gr-qtgui/apps/plot_psd_form.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -24,10 +24,10 @@ import sys
 from gnuradio import filter
 
 try:
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4."
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 try:
@@ -39,39 +39,35 @@ class plot_psd_form(plot_form):
     def __init__(self, top_block, title=''):
         plot_form.__init__(self, top_block, title)
 
-        self.right_col_layout = QtGui.QVBoxLayout()
-        self.right_col_form = QtGui.QFormLayout()
+        self.right_col_layout = QtWidgets.QVBoxLayout()
+        self.right_col_form = QtWidgets.QFormLayout()
         self.right_col_layout.addLayout(self.right_col_form)
         self.layout.addLayout(self.right_col_layout, 1,4,1,1)
 
-        self.psd_size_val = QtGui.QIntValidator(0, 2**18, self)
-        self.psd_size_edit = QtGui.QLineEdit(self)
+        self.psd_size_val = QtWidgets.QIntValidator(0, 2**18, self)
+        self.psd_size_edit = QtWidgets.QLineEdit(self)
         self.psd_size_edit.setMinimumWidth(50)
         self.psd_size_edit.setMaximumWidth(100)
-        self.psd_size_edit.setText(QtCore.QString("%1").arg(top_block._psd_size))
+        self.psd_size_edit.setText("{0}".format(top_block._psd_size))
         self.psd_size_edit.setValidator(self.psd_size_val)
         self.right_col_form.addRow("FFT:", self.psd_size_edit)
-        self.connect(self.psd_size_edit, QtCore.SIGNAL("returnPressed()"),
-                     self.update_psd_size)
+        self.psd_size_edit.returnPressed.connect(self.update_psd_size)
 
-        self.psd_win_combo = QtGui.QComboBox(self)
+        self.psd_win_combo = QtWidgets.QComboBox(self)
         self.psd_win_combo.addItems(["None", "Hamming", "Hann", "Blackman",
                                      "Rectangular", "Kaiser", "Blackman-harris"])
         self.psd_win_combo.setCurrentIndex(self.top_block.gui_snk.fft_window()+1)
         self.right_col_form.addRow("Window:", self.psd_win_combo)
-        self.connect(self.psd_win_combo,
-                     QtCore.SIGNAL("currentIndexChanged(int)"),
-                     self.update_psd_win)
+        self.psd_win_combo.currentIndexChanged.connect(self.update_psd_win)
 
-        self.psd_avg_val = QtGui.QDoubleValidator(0, 1.0, 4, self)
-        self.psd_avg_edit = QtGui.QLineEdit(self)
+        self.psd_avg_val = QtWidgets.QDoubleValidator(0, 1.0, 4, self)
+        self.psd_avg_edit = QtWidgets.QLineEdit(self)
         self.psd_avg_edit.setMinimumWidth(50)
         self.psd_avg_edit.setMaximumWidth(100)
-        self.psd_avg_edit.setText(QtCore.QString("%1").arg(top_block._avg))
+        self.psd_avg_edit.setText("{0}".format(top_block._avg))
         self.psd_avg_edit.setValidator(self.psd_avg_val)
         self.right_col_form.addRow("Average:", self.psd_avg_edit)
-        self.connect(self.psd_avg_edit, QtCore.SIGNAL("returnPressed()"),
-                     self.update_psd_avg)
+        self.psd_avg_edit.returnPressed.connect(self.update_psd_avg)
 
         self.add_line_control(self.right_col_layout)
 
diff --git a/gr-qtgui/apps/plot_spectrogram_base.py b/gr-qtgui/apps/plot_spectrogram_base.py
index b252bb8863..295ef4a753 100644
--- a/gr-qtgui/apps/plot_spectrogram_base.py
+++ b/gr-qtgui/apps/plot_spectrogram_base.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -27,16 +27,16 @@ import os, sys
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 try:
     import scipy
 except ImportError:
-    print "Error: Scipy required (www.scipy.org)."
+    sys.stderr.write("Error: Scipy required (www.scipy.org).\n")
     sys.exit(1)
 
 try:
@@ -69,7 +69,7 @@ class plot_base(gr.top_block):
 
         self._is_setup = False
 
-        self.qapp = QtGui.QApplication(sys.argv)
+        self.qapp = QtWidgets.QApplication(sys.argv)
 
     def setup(self):
         self.skip = blocks.skiphead(self.dsize, self._start)
@@ -106,7 +106,7 @@ class plot_base(gr.top_block):
 
         # Get Python Qt references
         pyQt = self.gui_snk.pyqwidget()
-        self.pyWin = sip.wrapinstance(pyQt, QtGui.QWidget)
+        self.pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget)
 
         self._is_setup = True
 
diff --git a/gr-qtgui/apps/plot_spectrogram_form.py b/gr-qtgui/apps/plot_spectrogram_form.py
index 17cb0335bd..ab4685106d 100644
--- a/gr-qtgui/apps/plot_spectrogram_form.py
+++ b/gr-qtgui/apps/plot_spectrogram_form.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -24,10 +24,10 @@ import sys
 from gnuradio import filter
 
 try:
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4."
+    sys.stderr.write("Error: Program requires PyQt5.\n")
     sys.exit(1)
 
 try:
@@ -39,45 +39,40 @@ class plot_spectrogram_form(plot_form):
     def __init__(self, top_block, title=''):
         plot_form.__init__(self, top_block, title)
 
-        self.right_col_layout = QtGui.QVBoxLayout()
-        self.right_col_form = QtGui.QFormLayout()
+        self.right_col_layout = QtWidgets.QVBoxLayout()
+        self.right_col_form = QtWidgets.QFormLayout()
         self.right_col_layout.addLayout(self.right_col_form)
         self.layout.addLayout(self.right_col_layout, 1,4,1,1)
 
-        self.psd_size_val = QtGui.QIntValidator(0, 2**18, self)
-        self.psd_size_edit = QtGui.QLineEdit(self)
+        self.psd_size_val = QtWidgets.QIntValidator(0, 2**18, self)
+        self.psd_size_edit = QtWidgets.QLineEdit(self)
         self.psd_size_edit.setMinimumWidth(50)
         self.psd_size_edit.setMaximumWidth(100)
-        self.psd_size_edit.setText(QtCore.QString("%1").arg(top_block._psd_size))
+        self.psd_size_edit.setText("{0}".format(top_block._psd_size))
         self.psd_size_edit.setValidator(self.psd_size_val)
         self.right_col_form.addRow("FFT Size:", self.psd_size_edit)
-        self.connect(self.psd_size_edit, QtCore.SIGNAL("returnPressed()"),
-                     self.update_psd_size)
+        self.psd_size_edit.returnPressed.connect(self.update_psd_size)
 
-        self.psd_win_combo = QtGui.QComboBox(self)
+        self.psd_win_combo = QtWidgets.QComboBox(self)
         self.psd_win_combo.addItems(["None", "Hamming", "Hann", "Blackman",
                                      "Rectangular", "Kaiser", "Blackman-harris"])
         self.psd_win_combo.setCurrentIndex(self.top_block.gui_snk.fft_window()+1)
         self.right_col_form.addRow("Window:", self.psd_win_combo)
-        self.connect(self.psd_win_combo,
-                     QtCore.SIGNAL("currentIndexChanged(int)"),
-                     self.update_psd_win)
+        self.psd_win_combo.currentIndexChanged.connect(self.update_psd_win)
 
-        self.psd_avg_val = QtGui.QDoubleValidator(0, 1.0, 4, self)
-        self.psd_avg_edit = QtGui.QLineEdit(self)
+        self.psd_avg_val = QtWidgets.QDoubleValidator(0, 1.0, 4, self)
+        self.psd_avg_edit = QtWidgets.QLineEdit(self)
         self.psd_avg_edit.setMinimumWidth(50)
         self.psd_avg_edit.setMaximumWidth(100)
-        self.psd_avg_edit.setText(QtCore.QString("%1").arg(top_block._avg))
+        self.psd_avg_edit.setText("{0}".format(top_block._avg))
         self.psd_avg_edit.setValidator(self.psd_avg_val)
         self.right_col_form.addRow("Average:", self.psd_avg_edit)
-        self.connect(self.psd_avg_edit, QtCore.SIGNAL("returnPressed()"),
-                     self.update_psd_avg)
+        self.psd_avg_edit.returnPressed.connect(self.update_psd_avg)
 
-        self.autoscale_button = QtGui.QPushButton("Auto Scale", self)
+        self.autoscale_button = QtWidgets.QPushButton("Auto Scale", self)
         self.autoscale_button.setMaximumWidth(100)
         self.right_col_layout.addWidget(self.autoscale_button)
-        self.connect(self.autoscale_button, QtCore.SIGNAL("clicked()"),
-                     self.spectrogram_auto_scale)
+        self.autoscale_button.clicked.connect(self.spectrogram_auto_scale)
 
         self.add_spectrogram_control(self.right_col_layout)
 
@@ -103,7 +98,7 @@ class plot_spectrogram_form(plot_form):
                                  self.top_block._nsamps)
 
     def add_spectrogram_control(self, layout):
-        self._line_tabs = QtGui.QTabWidget()
+        self._line_tabs = QtWidgets.QTabWidget()
 
         self._line_pages = []
         self._line_forms = []
@@ -114,38 +109,34 @@ class plot_spectrogram_form(plot_form):
         self._marker_edit = []
         self._alpha_edit = []
         for n in xrange(self.top_block._nsigs):
-            self._line_pages.append(QtGui.QDialog())
-            self._line_forms.append(QtGui.QFormLayout(self._line_pages[-1]))
+            self._line_pages.append(QtWidgets.QDialog())
+            self._line_forms.append(QtWidgets.QFormLayout(self._line_pages[-1]))
 
             label = self.top_block.gui_snk.line_label(n)
-            self._label_edit.append(QtGui.QLineEdit(self))
+            self._label_edit.append(QtWidgets.QLineEdit(self))
             self._label_edit[-1].setMinimumWidth(125)
             self._label_edit[-1].setMaximumWidth(125)
-            self._label_edit[-1].setText(QtCore.QString("%1").arg(label))
+            self._label_edit[-1].setText("{0}".format(label))
             self._line_forms[-1].addRow("Label:", self._label_edit[-1])
-            self.connect(self._label_edit[-1], QtCore.SIGNAL("returnPressed()"),
-                         self.update_line_label)
+            self._label_edit[-1].returnPressed.connect(self.update_line_label)
 
             self._qtcolormaps = ["Multi Color", "White Hot",
                                  "Black Hot", "Incandescent"]
-            self._color_edit.append(QtGui.QComboBox(self))
+            self._color_edit.append(QtWidgets.QComboBox(self))
             self._color_edit[-1].addItems(self._qtcolormaps)
             self._line_forms[-1].addRow("Color Map:", self._color_edit[-1])
-            self.connect(self._color_edit[-1],
-                         QtCore.SIGNAL("currentIndexChanged(int)"),
-                         self.update_color_map)
+            self._color_edit[-1].currentIndexChanged.connect(self.update_color_map)
 
-            alpha_val = QtGui.QDoubleValidator(0, 1.0, 2, self)
+            alpha_val = QtWidgets.QDoubleValidator(0, 1.0, 2, self)
             alpha_val.setTop(1.0)
             alpha = self.top_block.gui_snk.line_alpha(n)
-            self._alpha_edit.append(QtGui.QLineEdit(self))
+            self._alpha_edit.append(QtWidgets.QLineEdit(self))
             self._alpha_edit[-1].setMinimumWidth(50)
             self._alpha_edit[-1].setMaximumWidth(100)
-            self._alpha_edit[-1].setText(QtCore.QString("%1").arg(alpha))
+            self._alpha_edit[-1].setText("{0}".format(alpha))
             self._alpha_edit[-1].setValidator(alpha_val)
             self._line_forms[-1].addRow("Alpha:", self._alpha_edit[-1])
-            self.connect(self._alpha_edit[-1], QtCore.SIGNAL("returnPressed()"),
-                         self.update_line_alpha)
+            self._alpha_edit[-1].returnPressed.connect(self.update_line_alpha)
 
             self._line_tabs.addTab(self._line_pages[-1], "{0}".format(label))
 
diff --git a/gr-qtgui/apps/plot_time_base.py b/gr-qtgui/apps/plot_time_base.py
index 007c94d044..82e7d75cae 100644
--- a/gr-qtgui/apps/plot_time_base.py
+++ b/gr-qtgui/apps/plot_time_base.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -27,16 +27,16 @@ import os, sys
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 try:
     import scipy
 except ImportError:
-    print "Error: Scipy required (www.scipy.org)."
+    sys.stderr.write("Error: Scipy required (www.scipy.org).\n")
     sys.exit(1)
 
 try:
@@ -68,7 +68,7 @@ class plot_base(gr.top_block):
         self._y_value = 1
         self.gui_y_axis = None
 
-        self.qapp = QtGui.QApplication(sys.argv)
+        self.qapp = QtWidgets.QApplication(sys.argv)
 
     def setup(self):
         self.skip = blocks.skiphead(self.dsize, self._start)
@@ -108,7 +108,7 @@ class plot_base(gr.top_block):
 
         # Get Python Qt references
         pyQt  = self.gui_snk.pyqwidget()
-        self.pyWin = sip.wrapinstance(pyQt, QtGui.QWidget)
+        self.pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget)
 
         self._is_setup = True
 
diff --git a/gr-qtgui/apps/plot_time_form.py b/gr-qtgui/apps/plot_time_form.py
index 0ab94e6cfe..0e650813ff 100644
--- a/gr-qtgui/apps/plot_time_form.py
+++ b/gr-qtgui/apps/plot_time_form.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -24,10 +24,10 @@ import sys
 from gnuradio import filter
 
 try:
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4."
+    sys.stderr.write("Error: Program requires PyQt5.\n")
     sys.exit(1)
 
 try:
@@ -39,21 +39,19 @@ class plot_time_form(plot_form):
     def __init__(self, top_block, title='', scale=1):
         plot_form.__init__(self, top_block, title, scale)
 
-        self.right_col_layout = QtGui.QVBoxLayout()
-        self.right_col_form = QtGui.QFormLayout()
+        self.right_col_layout = QtWidgets.QVBoxLayout()
+        self.right_col_form = QtWidgets.QFormLayout()
         self.right_col_layout.addLayout(self.right_col_form)
         self.layout.addLayout(self.right_col_layout, 1,4,1,1)
 
-        self.auto_scale = QtGui.QCheckBox("Auto Scale", self)
+        self.auto_scale = QtWidgets.QCheckBox("Auto Scale", self)
         if(self.top_block._auto_scale):
             self.auto_scale.setChecked(self.top_block._auto_scale)
-        self.connect(self.auto_scale, QtCore.SIGNAL("stateChanged(int)"),
-                     self.set_auto_scale)
+        self.auto_scale.stateChanged.connect(self.set_auto_scale)
         self.right_col_layout.addWidget(self.auto_scale)
 
-        self.stem = QtGui.QCheckBox("Stem", self)
-        self.connect(self.stem, QtCore.SIGNAL("stateChanged(int)"),
-                     self.enable_stem)
+        self.stem = QtWidgets.QCheckBox("Stem", self)
+        self.stem.stateChanged.connect(self.enable_stem)
         self.right_col_layout.addWidget(self.stem)
 
         self.add_line_control(self.right_col_layout)
@@ -76,4 +74,3 @@ class plot_time_form(plot_form):
     def update_samp_rate(self):
         sr = self.samp_rate_edit.text().toDouble()[0]
         self.top_block.gui_snk.set_samp_rate(sr)
-
diff --git a/gr-qtgui/apps/plot_time_raster_base.py b/gr-qtgui/apps/plot_time_raster_base.py
index 856c8c8945..f1d4db8523 100644
--- a/gr-qtgui/apps/plot_time_raster_base.py
+++ b/gr-qtgui/apps/plot_time_raster_base.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -27,16 +27,18 @@ import os, sys
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    import sys
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 try:
     import scipy
 except ImportError:
-    print "Error: Scipy required (www.scipy.org)."
+    import sys
+    sys.stderr.write("Error: Scipy required (www.scipy.org).\n")
     sys.exit(1)
 
 try:
@@ -68,7 +70,7 @@ class plot_base(gr.top_block):
         self._y_value = 1
         self.gui_y_axis = None
 
-        self.qapp = QtGui.QApplication(sys.argv)
+        self.qapp = QtWidgets.QApplication(sys.argv)
 
     def setup(self):
         self.skip = blocks.skiphead(self.dsize, self._start)
@@ -103,7 +105,7 @@ class plot_base(gr.top_block):
 
         # Get Python Qt references
         pyQt  = self.gui_snk.pyqwidget()
-        self.pyWin = sip.wrapinstance(pyQt, QtGui.QWidget)
+        self.pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget)
 
         self._is_setup = True
 
diff --git a/gr-qtgui/apps/plot_time_raster_form.py b/gr-qtgui/apps/plot_time_raster_form.py
index 32fbba0765..ffd2975042 100644
--- a/gr-qtgui/apps/plot_time_raster_form.py
+++ b/gr-qtgui/apps/plot_time_raster_form.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -24,10 +24,10 @@ import sys, math
 from gnuradio import filter
 
 try:
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4."
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 try:
@@ -39,39 +39,35 @@ class plot_time_raster_form(plot_form):
     def __init__(self, top_block, title='', scale=1):
         plot_form.__init__(self, top_block, title, scale)
 
-        self.right_col_layout = QtGui.QVBoxLayout()
-        self.right_col_form = QtGui.QFormLayout()
+        self.right_col_layout = QtWidgets.QVBoxLayout()
+        self.right_col_form = QtWidgets.QFormLayout()
         self.right_col_layout.addLayout(self.right_col_form)
         self.layout.addLayout(self.right_col_layout, 1,4,1,1)
 
-        self.auto_scale = QtGui.QCheckBox("Auto Scale", self)
+        self.auto_scale = QtWidgets.QCheckBox("Auto Scale", self)
         if(self.top_block._auto_scale):
             self.auto_scale.setChecked(self.top_block._auto_scale)
-        self.connect(self.auto_scale, QtCore.SIGNAL("stateChanged(int)"),
-                     self.set_auto_scale)
+        self.auto_scale.stateChanged.connect(self.set_auto_scale)
         self.right_col_layout.addWidget(self.auto_scale)
 
-        self.ncols_edit = QtGui.QLineEdit(self)
+        self.ncols_edit = QtWidgets.QLineEdit(self)
         self.ncols_edit.setMinimumWidth(100)
         self.ncols_edit.setMaximumWidth(100)
-        self.ncols_edit.setText(QtCore.QString("%1").arg(top_block._ncols))
+        self.ncols_edit.setText("{0}".format(top_block._ncols))
         self.right_col_form.addRow("Num. Cols.", self.ncols_edit)
-        self.connect(self.ncols_edit, QtCore.SIGNAL("returnPressed()"),
-                     self.ncols_update)
+        self.ncols_edit.returnPressed.connect(self.ncols_update)
 
-        self.nrows_edit = QtGui.QLineEdit(self)
+        self.nrows_edit = QtWidgets.QLineEdit(self)
         self.nrows_edit.setMinimumWidth(100)
         self.nrows_edit.setMaximumWidth(100)
-        self.nrows_edit.setText(QtCore.QString("%1").arg(top_block._nrows))
+        self.nrows_edit.setText("{0}".format(top_block._nrows))
         self.right_col_form.addRow("Num. Rows.", self.nrows_edit)
-        self.connect(self.nrows_edit, QtCore.SIGNAL("returnPressed()"),
-                     self.nrows_update)
-
+        self.nrows_edit.returnPressed.connect(self.nrows_update)
 
         self.add_raster_control(self.right_col_layout)
 
     def add_raster_control(self, layout):
-        self._line_tabs = QtGui.QTabWidget()
+        self._line_tabs = QtWidgets.QTabWidget()
 
         self._line_pages = []
         self._line_forms = []
@@ -82,39 +78,35 @@ class plot_time_raster_form(plot_form):
         self._marker_edit = []
         self._alpha_edit = []
         for n in xrange(self.top_block._nsigs):
-            self._line_pages.append(QtGui.QDialog())
-            self._line_forms.append(QtGui.QFormLayout(self._line_pages[-1]))
+            self._line_pages.append(QtWidgets.QDialog())
+            self._line_forms.append(QtWidgets.QFormLayout(self._line_pages[-1]))
 
             label = self.top_block.gui_snk.line_label(n)
-            self._label_edit.append(QtGui.QLineEdit(self))
+            self._label_edit.append(QtWidgets.QLineEdit(self))
             self._label_edit[-1].setMinimumWidth(125)
             self._label_edit[-1].setMaximumWidth(125)
-            self._label_edit[-1].setText(QtCore.QString("%1").arg(label))
+            self._label_edit[-1].setText("{0}".format(label))
             self._line_forms[-1].addRow("Label:", self._label_edit[-1])
-            self.connect(self._label_edit[-1], QtCore.SIGNAL("returnPressed()"),
-                         self.update_line_label)
+            self._label_edit[-1].returnPressed.connect(self.update_line_label)
 
             self._qtcolormaps = ["Multi Color", "White Hot",
                                  "Black Hot", "Incandescent"]
-            self._color_edit.append(QtGui.QComboBox(self))
+            self._color_edit.append(QtWidgets.QComboBox(self))
             self._color_edit[-1].addItems(self._qtcolormaps)
             self._color_edit[-1].setCurrentIndex(1)
             self._line_forms[-1].addRow("Color Map:", self._color_edit[-1])
-            self.connect(self._color_edit[-1],
-                         QtCore.SIGNAL("currentIndexChanged(int)"),
-                         self.update_color_map)
+            self._color_edit[-1].currentIndexChanged.connect(self.update_color_map)
 
-            alpha_val = QtGui.QDoubleValidator(0, 1.0, 2, self)
+            alpha_val = QtWidgets.QDoubleValidator(0, 1.0, 2, self)
             alpha_val.setTop(1.0)
             alpha = self.top_block.gui_snk.line_alpha(n)
-            self._alpha_edit.append(QtGui.QLineEdit(self))
+            self._alpha_edit.append(QtWidgets.QLineEdit(self))
             self._alpha_edit[-1].setMinimumWidth(50)
             self._alpha_edit[-1].setMaximumWidth(100)
-            self._alpha_edit[-1].setText(QtCore.QString("%1").arg(alpha))
+            self._alpha_edit[-1].setText("{0}".format(alpha))
             self._alpha_edit[-1].setValidator(alpha_val)
             self._line_forms[-1].addRow("Alpha:", self._alpha_edit[-1])
-            self.connect(self._alpha_edit[-1], QtCore.SIGNAL("returnPressed()"),
-                         self.update_line_alpha)
+            self._alpha_edit[-1].returnPressed.connect(self.update_line_alpha)
 
             self._line_tabs.addTab(self._line_pages[-1], "{0}".format(label))
 
@@ -153,5 +145,3 @@ class plot_time_raster_form(plot_form):
 
         nsamps = int(math.ceil(self.top_block._ncols*(n+1)))
         self.top_block.reset(self._start, nsamps)
-
-
diff --git a/gr-qtgui/apps/qt_digital.py b/gr-qtgui/apps/qt_digital.py
index fef4f448b4..fbaeacd462 100755
--- a/gr-qtgui/apps/qt_digital.py
+++ b/gr-qtgui/apps/qt_digital.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2011 Free Software Foundation, Inc.
+# Copyright 2011,2018 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -29,28 +29,28 @@ import sys
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 try:
     import scipy
 except ImportError:
-    print "Error: Program requires scipy (see: www.scipy.org)."
+    sys.stderr.write("Error: Program requires scipy (see: www.scipy.org).\n")
     sys.exit(1)
 
 try:
     from qt_digital_window import Ui_DigitalWindow
 except ImportError:
-    print "Error: could not find qt_digital_window.py:"
-    print "\t\"Please run: pyuic4 qt_digital_window.ui -o qt_digital_window.py\""
+    sys.stderr.write("Error: could not find qt_digital_window.py:\n")
+    sys.stderr.write("\t\"Please run: pyuic5 qt_digital_window.ui -o qt_digital_window.py\"\n")
     sys.exit(1)
 
-class dialog_box(QtGui.QMainWindow):
+class dialog_box(QtWidgets.QMainWindow):
     def __init__(self, snkTx, snkRx, fg, parent=None):
-        QtGui.QWidget.__init__(self, parent)
+        QtWidgets.QWidget.__init__(self, parent)
         self.gui = Ui_DigitalWindow()
         self.gui.setupUi(self)
 
@@ -71,23 +71,13 @@ class dialog_box(QtGui.QMainWindow):
 
 
         # Connect up some signals
-        self.connect(self.gui.pauseButton, QtCore.SIGNAL("clicked()"),
-                     self.pauseFg)
-
-        self.connect(self.gui.sampleRateEdit, QtCore.SIGNAL("editingFinished()"),
-                     self.sampleRateEditText)
-
-        self.connect(self.gui.snrEdit, QtCore.SIGNAL("editingFinished()"),
-                     self.snrEditText)
-        self.connect(self.gui.freqEdit, QtCore.SIGNAL("editingFinished()"),
-                     self.freqEditText)
-        self.connect(self.gui.timeEdit, QtCore.SIGNAL("editingFinished()"),
-                     self.timeEditText)
-
-        self.connect(self.gui.gainMuEdit, QtCore.SIGNAL("editingFinished()"),
-                     self.gainMuEditText)
-        self.connect(self.gui.alphaEdit, QtCore.SIGNAL("editingFinished()"),
-                     self.alphaEditText)
+        self.gui.pauseButton.clicked.connect(self.pauseFg)
+        self.gui.sampleRateEdit.editingFinished.connect(self.sampleRateEditText)
+        self.gui.snrEdit.editingFinished.connect(self.snrEditText)
+        self.gui.freqEdit.editingFinished.connect(self.freqEditText)
+        self.gui.timeEdit.editingFinished.connect(self.timeEditText)
+        self.gui.gainMuEdit.editingFinished.connect(self.gainMuEditText)
+        self.gui.alphaEdit.editingFinished.connect(self.alphaEditText)
 
 
     def pauseFg(self):
@@ -102,7 +92,7 @@ class dialog_box(QtGui.QMainWindow):
     # Accessor functions for Gui to manipulate system parameters
     def set_sample_rate(self, sr):
         ssr = eng_notation.num_to_str(sr)
-        self.gui.sampleRateEdit.setText(QtCore.QString("%1").arg(ssr))
+        self.gui.sampleRateEdit.setText("{0}".format(ssr))
 
     def sampleRateEditText(self):
         try:
@@ -115,13 +105,13 @@ class dialog_box(QtGui.QMainWindow):
 
     # Accessor functions for Gui to manipulate channel model
     def set_snr(self, snr):
-        self.gui.snrEdit.setText(QtCore.QString("%1").arg(snr))
+        self.gui.snrEdit.setText("{0}".format(snr))
 
     def set_frequency(self, fo):
-        self.gui.freqEdit.setText(QtCore.QString("%1").arg(fo))
+        self.gui.freqEdit.setText("{0}".format(fo))
 
     def set_time_offset(self, to):
-        self.gui.timeEdit.setText(QtCore.QString("%1").arg(to))
+        self.gui.timeEdit.setText("{0}".format(to))
 
     def snrEditText(self):
         try:
@@ -147,10 +137,10 @@ class dialog_box(QtGui.QMainWindow):
 
     # Accessor functions for Gui to manipulate receiver parameters
     def set_gain_mu(self, gain):
-        self.gui.gainMuEdit.setText(QtCore.QString("%1").arg(gain))
+        self.gui.gainMuEdit.setText("{0}".format(gain))
 
     def set_loop_bw(self, bw):
-        self.gui.alphaEdit.setText(QtCore.QString("%1").arg(bw))
+        self.gui.alphaEdit.setText("{0}".format(bw))
 
     def alphaEditText(self):
         try:
@@ -171,7 +161,7 @@ class my_top_block(gr.top_block):
     def __init__(self):
         gr.top_block.__init__(self)
 
-        self.qapp = QtGui.QApplication(sys.argv)
+        self.qapp = QtWidgets.QApplication(sys.argv)
 
         self._sample_rate = 2000e3
 
@@ -231,10 +221,10 @@ class my_top_block(gr.top_block):
         self.connect(self.channel, self.rx_rrc, self.receiver, self.snk_rx)
         
         pyTxQt  = self.snk_tx.pyqwidget()
-        pyTx = sip.wrapinstance(pyTxQt, QtGui.QWidget)
+        pyTx = sip.wrapinstance(pyTxQt, QtWidgets.QWidget)
 
         pyRxQt  = self.snk_rx.pyqwidget()
-        pyRx = sip.wrapinstance(pyRxQt, QtGui.QWidget)
+        pyRx = sip.wrapinstance(pyRxQt, QtWidgets.QWidget)
 
         self.main_box = dialog_box(pyTx, pyRx, self);
         self.main_box.show()
diff --git a/gr-qtgui/apps/qt_digital_window.py b/gr-qtgui/apps/qt_digital_window.py
index 50dd53a923..90c0f29e09 100644
--- a/gr-qtgui/apps/qt_digital_window.py
+++ b/gr-qtgui/apps/qt_digital_window.py
@@ -3,159 +3,159 @@
 # Form implementation generated from reading ui file 'qt_digital_window.ui'
 #
 # Created: Sat May  1 20:14:02 2010
-#      by: PyQt4 UI code generator 4.6.1
+#      by: PyQt5 UI code generator 4.6.1
 #
 # WARNING! All changes made in this file will be lost!
 
-from PyQt4 import QtCore, QtGui
+from PyQt5 import QtWidgets, Qt
 
 class Ui_DigitalWindow(object):
     def setupUi(self, DigitalWindow):
         DigitalWindow.setObjectName("DigitalWindow")
         DigitalWindow.resize(1236, 741)
-        self.centralwidget = QtGui.QWidget(DigitalWindow)
+        self.centralwidget = QtWidgets.QWidget(DigitalWindow)
         self.centralwidget.setObjectName("centralwidget")
-        self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget)
+        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
         self.verticalLayout.setObjectName("verticalLayout")
-        self.sinkFrame = QtGui.QFrame(self.centralwidget)
-        self.sinkFrame.setMinimumSize(QtCore.QSize(0, 550))
-        self.sinkFrame.setFrameShape(QtGui.QFrame.StyledPanel)
-        self.sinkFrame.setFrameShadow(QtGui.QFrame.Raised)
+        self.sinkFrame = QtWidgets.QFrame(self.centralwidget)
+        self.sinkFrame.setMinimumSize(Qt.QSize(0, 550))
+        self.sinkFrame.setFrameShape(QtWidgets.QFrame.StyledPanel)
+        self.sinkFrame.setFrameShadow(QtWidgets.QFrame.Raised)
         self.sinkFrame.setObjectName("sinkFrame")
-        self.horizontalLayout_2 = QtGui.QHBoxLayout(self.sinkFrame)
+        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.sinkFrame)
         self.horizontalLayout_2.setObjectName("horizontalLayout_2")
-        self.sinkLayout = QtGui.QHBoxLayout()
+        self.sinkLayout = QtWidgets.QHBoxLayout()
         self.sinkLayout.setObjectName("sinkLayout")
         self.horizontalLayout_2.addLayout(self.sinkLayout)
         self.verticalLayout.addWidget(self.sinkFrame)
-        self.horizontalLayout = QtGui.QHBoxLayout()
+        self.horizontalLayout = QtWidgets.QHBoxLayout()
         self.horizontalLayout.setObjectName("horizontalLayout")
-        self.sysBox = QtGui.QGroupBox(self.centralwidget)
-        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
+        self.sysBox = QtWidgets.QGroupBox(self.centralwidget)
+        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
         sizePolicy.setHorizontalStretch(0)
         sizePolicy.setVerticalStretch(0)
         sizePolicy.setHeightForWidth(self.sysBox.sizePolicy().hasHeightForWidth())
         self.sysBox.setSizePolicy(sizePolicy)
-        self.sysBox.setMinimumSize(QtCore.QSize(0, 0))
-        self.sysBox.setMaximumSize(QtCore.QSize(16777215, 120))
-        self.sysBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
+        self.sysBox.setMinimumSize(Qt.QSize(0, 0))
+        self.sysBox.setMaximumSize(Qt.QSize(16777215, 120))
+        self.sysBox.setAlignment(Qt.Qt.AlignLeading|Qt.Qt.AlignLeft|Qt.Qt.AlignTop)
         self.sysBox.setObjectName("sysBox")
-        self.gridLayout_2 = QtGui.QGridLayout(self.sysBox)
+        self.gridLayout_2 = QtWidgets.QGridLayout(self.sysBox)
         self.gridLayout_2.setObjectName("gridLayout_2")
-        self.sampleRateEdit = QtGui.QLineEdit(self.sysBox)
-        self.sampleRateEdit.setMaximumSize(QtCore.QSize(100, 16777215))
+        self.sampleRateEdit = QtWidgets.QLineEdit(self.sysBox)
+        self.sampleRateEdit.setMaximumSize(Qt.QSize(100, 16777215))
         self.sampleRateEdit.setObjectName("sampleRateEdit")
         self.gridLayout_2.addWidget(self.sampleRateEdit, 0, 3, 1, 1)
-        self.sampleRateLabel = QtGui.QLabel(self.sysBox)
+        self.sampleRateLabel = QtWidgets.QLabel(self.sysBox)
         self.sampleRateLabel.setObjectName("sampleRateLabel")
         self.gridLayout_2.addWidget(self.sampleRateLabel, 0, 2, 1, 1)
         self.horizontalLayout.addWidget(self.sysBox)
-        self.rxBox = QtGui.QGroupBox(self.centralwidget)
-        self.rxBox.setMaximumSize(QtCore.QSize(16777215, 120))
-        self.rxBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
+        self.rxBox = QtWidgets.QGroupBox(self.centralwidget)
+        self.rxBox.setMaximumSize(Qt.QSize(16777215, 120))
+        self.rxBox.setAlignment(Qt.Qt.AlignLeading|Qt.Qt.AlignLeft|Qt.Qt.AlignTop)
         self.rxBox.setObjectName("rxBox")
-        self.gridLayout_3 = QtGui.QGridLayout(self.rxBox)
+        self.gridLayout_3 = QtWidgets.QGridLayout(self.rxBox)
         self.gridLayout_3.setObjectName("gridLayout_3")
-        self.alphaLabel = QtGui.QLabel(self.rxBox)
+        self.alphaLabel = QtWidgets.QLabel(self.rxBox)
         self.alphaLabel.setObjectName("alphaLabel")
         self.gridLayout_3.addWidget(self.alphaLabel, 1, 0, 1, 1)
-        self.alphaEdit = QtGui.QLineEdit(self.rxBox)
-        self.alphaEdit.setMaximumSize(QtCore.QSize(100, 16777215))
+        self.alphaEdit = QtWidgets.QLineEdit(self.rxBox)
+        self.alphaEdit.setMaximumSize(Qt.QSize(100, 16777215))
         self.alphaEdit.setObjectName("alphaEdit")
         self.gridLayout_3.addWidget(self.alphaEdit, 1, 1, 1, 1)
-        self.gainMuLabel = QtGui.QLabel(self.rxBox)
+        self.gainMuLabel = QtWidgets.QLabel(self.rxBox)
         self.gainMuLabel.setObjectName("gainMuLabel")
         self.gridLayout_3.addWidget(self.gainMuLabel, 0, 0, 1, 1)
-        self.gainMuEdit = QtGui.QLineEdit(self.rxBox)
-        self.gainMuEdit.setMaximumSize(QtCore.QSize(100, 16777215))
+        self.gainMuEdit = QtWidgets.QLineEdit(self.rxBox)
+        self.gainMuEdit.setMaximumSize(Qt.QSize(100, 16777215))
         self.gainMuEdit.setObjectName("gainMuEdit")
         self.gridLayout_3.addWidget(self.gainMuEdit, 0, 1, 1, 1)
         self.horizontalLayout.addWidget(self.rxBox)
-        self.channelModeBox = QtGui.QGroupBox(self.centralwidget)
-        self.channelModeBox.setMaximumSize(QtCore.QSize(16777215, 120))
-        self.channelModeBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
+        self.channelModeBox = QtWidgets.QGroupBox(self.centralwidget)
+        self.channelModeBox.setMaximumSize(Qt.QSize(16777215, 120))
+        self.channelModeBox.setAlignment(Qt.Qt.AlignLeading|Qt.Qt.AlignLeft|Qt.Qt.AlignTop)
         self.channelModeBox.setObjectName("channelModeBox")
-        self.gridLayout = QtGui.QGridLayout(self.channelModeBox)
-        self.gridLayout.setSizeConstraint(QtGui.QLayout.SetMinimumSize)
+        self.gridLayout = QtWidgets.QGridLayout(self.channelModeBox)
+        self.gridLayout.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize)
         self.gridLayout.setObjectName("gridLayout")
-        self.snrLabel = QtGui.QLabel(self.channelModeBox)
+        self.snrLabel = QtWidgets.QLabel(self.channelModeBox)
         self.snrLabel.setObjectName("snrLabel")
         self.gridLayout.addWidget(self.snrLabel, 0, 1, 1, 1)
-        self.snrEdit = QtGui.QLineEdit(self.channelModeBox)
-        self.snrEdit.setMaximumSize(QtCore.QSize(100, 16777215))
+        self.snrEdit = QtWidgets.QLineEdit(self.channelModeBox)
+        self.snrEdit.setMaximumSize(Qt.QSize(100, 16777215))
         self.snrEdit.setObjectName("snrEdit")
         self.gridLayout.addWidget(self.snrEdit, 0, 2, 1, 1)
-        self.freqLabel = QtGui.QLabel(self.channelModeBox)
+        self.freqLabel = QtWidgets.QLabel(self.channelModeBox)
         self.freqLabel.setObjectName("freqLabel")
         self.gridLayout.addWidget(self.freqLabel, 1, 1, 1, 1)
-        self.freqEdit = QtGui.QLineEdit(self.channelModeBox)
-        self.freqEdit.setMaximumSize(QtCore.QSize(100, 16777215))
+        self.freqEdit = QtWidgets.QLineEdit(self.channelModeBox)
+        self.freqEdit.setMaximumSize(Qt.QSize(100, 16777215))
         self.freqEdit.setObjectName("freqEdit")
         self.gridLayout.addWidget(self.freqEdit, 1, 2, 1, 1)
-        self.timeLabel = QtGui.QLabel(self.channelModeBox)
+        self.timeLabel = QtWidgets.QLabel(self.channelModeBox)
         self.timeLabel.setObjectName("timeLabel")
         self.gridLayout.addWidget(self.timeLabel, 2, 1, 1, 1)
-        self.timeEdit = QtGui.QLineEdit(self.channelModeBox)
-        self.timeEdit.setMaximumSize(QtCore.QSize(100, 16777215))
+        self.timeEdit = QtWidgets.QLineEdit(self.channelModeBox)
+        self.timeEdit.setMaximumSize(Qt.QSize(100, 16777215))
         self.timeEdit.setObjectName("timeEdit")
         self.gridLayout.addWidget(self.timeEdit, 2, 2, 1, 1)
         self.horizontalLayout.addWidget(self.channelModeBox)
-        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
         self.horizontalLayout.addItem(spacerItem)
-        self.verticalLayout_2 = QtGui.QVBoxLayout()
+        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
         self.verticalLayout_2.setObjectName("verticalLayout_2")
-        spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
+        spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
         self.verticalLayout_2.addItem(spacerItem1)
-        self.pauseButton = QtGui.QPushButton(self.centralwidget)
-        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
+        self.pauseButton = QtWidgets.QPushButton(self.centralwidget)
+        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
         sizePolicy.setHorizontalStretch(0)
         sizePolicy.setVerticalStretch(0)
         sizePolicy.setHeightForWidth(self.pauseButton.sizePolicy().hasHeightForWidth())
         self.pauseButton.setSizePolicy(sizePolicy)
-        self.pauseButton.setMaximumSize(QtCore.QSize(80, 16777215))
+        self.pauseButton.setMaximumSize(Qt.QSize(80, 16777215))
         self.pauseButton.setObjectName("pauseButton")
         self.verticalLayout_2.addWidget(self.pauseButton)
-        self.closeButton = QtGui.QPushButton(self.centralwidget)
-        self.closeButton.setMaximumSize(QtCore.QSize(80, 16777215))
+        self.closeButton = QtWidgets.QPushButton(self.centralwidget)
+        self.closeButton.setMaximumSize(Qt.QSize(80, 16777215))
         self.closeButton.setObjectName("closeButton")
         self.verticalLayout_2.addWidget(self.closeButton)
         self.horizontalLayout.addLayout(self.verticalLayout_2)
         self.verticalLayout.addLayout(self.horizontalLayout)
         DigitalWindow.setCentralWidget(self.centralwidget)
-        self.menubar = QtGui.QMenuBar(DigitalWindow)
-        self.menubar.setGeometry(QtCore.QRect(0, 0, 1236, 23))
+        self.menubar = QtWidgets.QMenuBar(DigitalWindow)
+        self.menubar.setGeometry(Qt.QRect(0, 0, 1236, 23))
         self.menubar.setObjectName("menubar")
-        self.menuFile = QtGui.QMenu(self.menubar)
+        self.menuFile = QtWidgets.QMenu(self.menubar)
         self.menuFile.setObjectName("menuFile")
         DigitalWindow.setMenuBar(self.menubar)
-        self.statusbar = QtGui.QStatusBar(DigitalWindow)
+        self.statusbar = QtWidgets.QStatusBar(DigitalWindow)
         self.statusbar.setObjectName("statusbar")
         DigitalWindow.setStatusBar(self.statusbar)
-        self.actionExit = QtGui.QAction(DigitalWindow)
+        self.actionExit = QtWidgets.QAction(DigitalWindow)
         self.actionExit.setObjectName("actionExit")
         self.menuFile.addAction(self.actionExit)
         self.menubar.addAction(self.menuFile.menuAction())
 
         self.retranslateUi(DigitalWindow)
-        QtCore.QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), DigitalWindow.close)
-        QtCore.QObject.connect(self.actionExit, QtCore.SIGNAL("triggered()"), DigitalWindow.close)
-        QtCore.QMetaObject.connectSlotsByName(DigitalWindow)
+        Qt.QObject.connect(self.closeButton, Qt.SIGNAL("clicked()"), DigitalWindow.close)
+        Qt.QObject.connect(self.actionExit, Qt.SIGNAL("triggered()"), DigitalWindow.close)
+        Qt.QMetaObject.connectSlotsByName(DigitalWindow)
         DigitalWindow.setTabOrder(self.snrEdit, self.freqEdit)
         DigitalWindow.setTabOrder(self.freqEdit, self.timeEdit)
 
     def retranslateUi(self, DigitalWindow):
-        DigitalWindow.setWindowTitle(QtGui.QApplication.translate("DigitalWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8))
-        self.sysBox.setTitle(QtGui.QApplication.translate("DigitalWindow", "System Parameters", None, QtGui.QApplication.UnicodeUTF8))
-        self.sampleRateLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Sample Rate (sps)", None, QtGui.QApplication.UnicodeUTF8))
-        self.rxBox.setTitle(QtGui.QApplication.translate("DigitalWindow", "Receiver Parameters", None, QtGui.QApplication.UnicodeUTF8))
-        self.alphaLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Alpha", None, QtGui.QApplication.UnicodeUTF8))
-        self.gainMuLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Gain mu", None, QtGui.QApplication.UnicodeUTF8))
-        self.channelModeBox.setTitle(QtGui.QApplication.translate("DigitalWindow", "Channel Model Parameters", None, QtGui.QApplication.UnicodeUTF8))
-        self.snrLabel.setText(QtGui.QApplication.translate("DigitalWindow", "SNR (dB)", None, QtGui.QApplication.UnicodeUTF8))
-        self.freqLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Frequency Offset (Hz)", None, QtGui.QApplication.UnicodeUTF8))
-        self.timeLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Timing Offset", None, QtGui.QApplication.UnicodeUTF8))
-        self.pauseButton.setText(QtGui.QApplication.translate("DigitalWindow", "Pause", None, QtGui.QApplication.UnicodeUTF8))
-        self.closeButton.setText(QtGui.QApplication.translate("DigitalWindow", "Close", None, QtGui.QApplication.UnicodeUTF8))
-        self.menuFile.setTitle(QtGui.QApplication.translate("DigitalWindow", "&File", None, QtGui.QApplication.UnicodeUTF8))
-        self.actionExit.setText(QtGui.QApplication.translate("DigitalWindow", "E&xit", None, QtGui.QApplication.UnicodeUTF8))
+        DigitalWindow.setWindowTitle(QtWidgets.QApplication.translate("DigitalWindow", "MainWindow", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.sysBox.setTitle(QtWidgets.QApplication.translate("DigitalWindow", "System Parameters", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.sampleRateLabel.setText(QtWidgets.QApplication.translate("DigitalWindow", "Sample Rate (sps)", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.rxBox.setTitle(QtWidgets.QApplication.translate("DigitalWindow", "Receiver Parameters", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.alphaLabel.setText(QtWidgets.QApplication.translate("DigitalWindow", "Alpha", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.gainMuLabel.setText(QtWidgets.QApplication.translate("DigitalWindow", "Gain mu", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.channelModeBox.setTitle(QtWidgets.QApplication.translate("DigitalWindow", "Channel Model Parameters", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.snrLabel.setText(QtWidgets.QApplication.translate("DigitalWindow", "SNR (dB)", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.freqLabel.setText(QtWidgets.QApplication.translate("DigitalWindow", "Frequency Offset (Hz)", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.timeLabel.setText(QtWidgets.QApplication.translate("DigitalWindow", "Timing Offset", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.pauseButton.setText(QtWidgets.QApplication.translate("DigitalWindow", "Pause", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.closeButton.setText(QtWidgets.QApplication.translate("DigitalWindow", "Close", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.menuFile.setTitle(QtWidgets.QApplication.translate("DigitalWindow", "&File", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.actionExit.setText(QtWidgets.QApplication.translate("DigitalWindow", "E&xit", None, QtWidgets.QApplication.UnicodeUTF8))
 
diff --git a/gr-qtgui/apps/uhd_display.py b/gr-qtgui/apps/uhd_display.py
index 0e0c8a177d..e564e58c76 100755
--- a/gr-qtgui/apps/uhd_display.py
+++ b/gr-qtgui/apps/uhd_display.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2009,2011 Free Software Foundation, Inc.
+# Copyright 2009,2011,2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -31,10 +31,10 @@ import sys
 
 try:
     from gnuradio import qtgui
-    from PyQt4 import QtGui, QtCore
+    from PyQt5 import QtWidgets, Qt
     import sip
 except ImportError:
-    print "Error: Program requires PyQt4 and gr-qtgui."
+    sys.stderr.write("Error: Program requires PyQt5 and gr-qtgui.\n")
     sys.exit(1)
 
 try:
@@ -50,10 +50,10 @@ except ImportError:
 # ////////////////////////////////////////////////////////////////////
 
 
-class main_window(QtGui.QMainWindow):
+class main_window(QtWidgets.QMainWindow):
     def __init__(self, snk, fg, parent=None):
 
-        QtGui.QWidget.__init__(self, parent)
+        QtWidgets.QWidget.__init__(self, parent)
         self.gui = Ui_MainWindow()
         self.gui.setupUi(self)
 
@@ -62,28 +62,20 @@ class main_window(QtGui.QMainWindow):
         # Add the qtsnk widgets to the layout box
         self.gui.sinkLayout.addWidget(snk)
 
-        self.gui.dcGainEdit.setText(QtCore.QString("%1").arg(0.001))
+        self.gui.dcGainEdit.setText("{0}".format(0.001))
 
         # Connect up some signals
-        self.connect(self.gui.pauseButton, QtCore.SIGNAL("clicked()"),
-                     self.pauseFg)
-        self.connect(self.gui.frequencyEdit, QtCore.SIGNAL("editingFinished()"),
-                     self.frequencyEditText)
-        self.connect(self.gui.gainEdit, QtCore.SIGNAL("editingFinished()"),
-                     self.gainEditText)
-        self.connect(self.gui.bandwidthEdit, QtCore.SIGNAL("editingFinished()"),
-                     self.bandwidthEditText)
-        self.connect(self.gui.amplifierEdit, QtCore.SIGNAL("editingFinished()"),
-                     self.amplifierEditText)
-
-        self.connect(self.gui.actionSaveData, QtCore.SIGNAL("activated()"),
-                     self.saveData)
-        self.gui.actionSaveData.setShortcut(QtGui.QKeySequence.Save)
-
-        self.connect(self.gui.dcGainEdit, QtCore.SIGNAL("editingFinished()"),
-                     self.dcGainEditText)
-        self.connect(self.gui.dcCancelCheckBox, QtCore.SIGNAL("clicked(bool)"),
-                     self.dcCancelClicked)
+        self.gui.pauseButton.clicked.connect(self.pauseFg)
+        self.gui.frequencyEdit.editingFinished.connect(self.frequencyEditText)
+        self.gui.gainEdit.editingFinished.connect(self.gainEditText)
+        self.gui.bandwidthEdit.editingFinished.connect(self.bandwidthEditText)
+        self.gui.amplifierEdit.editingFinished.connect(self.amplifierEditText)
+
+        self.gui.actionSaveData.activated.connect(self.saveData)
+        self.gui.actionSaveData.setShortcut(QtWidgets.QKeySequence.Save)
+
+        self.gui.dcGainEdit.editingFinished.connect(self.dcGainEditText)
+        self.gui.dcCancelCheckBox.clicked.connect(self.dcCancelClicked)
 
     def pauseFg(self):
         if(self.gui.pauseButton.text() == "Pause"):
@@ -99,20 +91,20 @@ class main_window(QtGui.QMainWindow):
     def set_frequency(self, freq):
         self.freq = freq
         sfreq = eng_notation.num_to_str(self.freq)
-        self.gui.frequencyEdit.setText(QtCore.QString("%1").arg(sfreq))
+        self.gui.frequencyEdit.setText("{0}".format(sfreq))
 
     def set_gain(self, gain):
         self.gain = gain
-        self.gui.gainEdit.setText(QtCore.QString("%1").arg(self.gain))
+        self.gui.gainEdit.setText("{0}".format(self.gain))
 
     def set_bandwidth(self, bw):
         self.bw = bw
         sbw = eng_notation.num_to_str(self.bw)
-        self.gui.bandwidthEdit.setText(QtCore.QString("%1").arg(sbw))
+        self.gui.bandwidthEdit.setText("{0}".format(sbw))
 
     def set_amplifier(self, amp):
         self.amp = amp
-        self.gui.amplifierEdit.setText(QtCore.QString("%1").arg(self.amp))
+        self.gui.amplifierEdit.setText("{0}".format(self.amp))
 
 
     # Functions called when signals are triggered in the GUI
@@ -149,7 +141,7 @@ class main_window(QtGui.QMainWindow):
             pass
 
     def saveData(self):
-        fileName = QtGui.QFileDialog.getSaveFileName(self, "Save data to file", ".");
+        fileName = QtWidgets.QFileDialog.getSaveFileName(self, "Save data to file", ".");
         if(len(fileName)):
             self.fg.save_to_file(str(fileName))
 
@@ -170,7 +162,7 @@ class my_top_block(gr.top_block):
         self.options = options
         self.show_debug_info = True
 
-        self.qapp = QtGui.QApplication(sys.argv)
+        self.qapp = QtWidgets.QApplication(sys.argv)
 
         self.u = uhd.usrp_source(device_addr=options.address, stream_args=uhd.stream_args('fc32'))
 
@@ -218,8 +210,8 @@ 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
-        self.pysink = sip.wrapinstance(self.snk.pyqwidget(), QtGui.QWidget)
+        #     This can now be manipulated as a PyQt5.QtWidgets.QWidget
+        self.pysink = sip.wrapinstance(self.snk.pyqwidget(), QtWidgets.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 4c9de3a53c..89591af5fc 100644
--- a/gr-qtgui/apps/usrp_display_qtgui.py
+++ b/gr-qtgui/apps/usrp_display_qtgui.py
@@ -3,189 +3,189 @@
 # Form implementation generated from reading ui file 'usrp_display_qtgui.ui'
 #
 # Created: Thu Jul 16 22:06:24 2009
-#      by: PyQt4 UI code generator 4.4.3
+#      by: PyQt5 UI code generator 4.4.3
 #
 # WARNING! All changes made in this file will be lost!
 
-from PyQt4 import QtCore, QtGui
+from PyQt5 import Qt, QtWidgets
 
 class Ui_MainWindow(object):
     def setupUi(self, MainWindow):
         MainWindow.setObjectName("MainWindow")
         MainWindow.resize(820, 774)
-        self.centralwidget = QtGui.QWidget(MainWindow)
+        self.centralwidget = QtWidgets.QWidget(MainWindow)
         self.centralwidget.setObjectName("centralwidget")
-        self.gridLayout_2 = QtGui.QGridLayout(self.centralwidget)
+        self.gridLayout_2 = QtWidgets.QGridLayout(self.centralwidget)
         self.gridLayout_2.setObjectName("gridLayout_2")
-        self.horizontalLayout_2 = QtGui.QHBoxLayout()
+        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
         self.horizontalLayout_2.setObjectName("horizontalLayout_2")
-        self.groupBox = QtGui.QGroupBox(self.centralwidget)
-        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+        self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
+        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
         sizePolicy.setHorizontalStretch(0)
         sizePolicy.setVerticalStretch(0)
         sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth())
         self.groupBox.setSizePolicy(sizePolicy)
-        self.groupBox.setMinimumSize(QtCore.QSize(240, 150))
-        self.groupBox.setMaximumSize(QtCore.QSize(240, 16777215))
+        self.groupBox.setMinimumSize(Qt.QSize(240, 150))
+        self.groupBox.setMaximumSize(Qt.QSize(240, 16777215))
         self.groupBox.setObjectName("groupBox")
-        self.formLayoutWidget = QtGui.QWidget(self.groupBox)
-        self.formLayoutWidget.setGeometry(QtCore.QRect(10, 20, 221, 124))
+        self.formLayoutWidget = QtWidgets.QWidget(self.groupBox)
+        self.formLayoutWidget.setGeometry(Qt.QRect(10, 20, 221, 124))
         self.formLayoutWidget.setObjectName("formLayoutWidget")
-        self.formLayout = QtGui.QFormLayout(self.formLayoutWidget)
+        self.formLayout = QtWidgets.QFormLayout(self.formLayoutWidget)
         self.formLayout.setObjectName("formLayout")
-        self.frequencyLabel = QtGui.QLabel(self.formLayoutWidget)
+        self.frequencyLabel = QtWidgets.QLabel(self.formLayoutWidget)
         self.frequencyLabel.setObjectName("frequencyLabel")
-        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.frequencyLabel)
-        self.gainLabel = QtGui.QLabel(self.formLayoutWidget)
+        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.frequencyLabel)
+        self.gainLabel = QtWidgets.QLabel(self.formLayoutWidget)
         self.gainLabel.setObjectName("gainLabel")
-        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.gainLabel)
-        self.bandwidthLabel = QtGui.QLabel(self.formLayoutWidget)
+        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.gainLabel)
+        self.bandwidthLabel = QtWidgets.QLabel(self.formLayoutWidget)
         self.bandwidthLabel.setObjectName("bandwidthLabel")
-        self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.bandwidthLabel)
-        self.frequencyEdit = QtGui.QLineEdit(self.formLayoutWidget)
-        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+        self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.bandwidthLabel)
+        self.frequencyEdit = QtWidgets.QLineEdit(self.formLayoutWidget)
+        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
         sizePolicy.setHorizontalStretch(0)
         sizePolicy.setVerticalStretch(0)
         sizePolicy.setHeightForWidth(self.frequencyEdit.sizePolicy().hasHeightForWidth())
         self.frequencyEdit.setSizePolicy(sizePolicy)
-        self.frequencyEdit.setMinimumSize(QtCore.QSize(120, 26))
+        self.frequencyEdit.setMinimumSize(Qt.QSize(120, 26))
         self.frequencyEdit.setObjectName("frequencyEdit")
-        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.frequencyEdit)
-        self.gainEdit = QtGui.QLineEdit(self.formLayoutWidget)
-        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.frequencyEdit)
+        self.gainEdit = QtWidgets.QLineEdit(self.formLayoutWidget)
+        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
         sizePolicy.setHorizontalStretch(0)
         sizePolicy.setVerticalStretch(0)
         sizePolicy.setHeightForWidth(self.gainEdit.sizePolicy().hasHeightForWidth())
         self.gainEdit.setSizePolicy(sizePolicy)
-        self.gainEdit.setMinimumSize(QtCore.QSize(120, 26))
+        self.gainEdit.setMinimumSize(Qt.QSize(120, 26))
         self.gainEdit.setObjectName("gainEdit")
-        self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.gainEdit)
-        self.bandwidthEdit = QtGui.QLineEdit(self.formLayoutWidget)
-        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.gainEdit)
+        self.bandwidthEdit = QtWidgets.QLineEdit(self.formLayoutWidget)
+        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
         sizePolicy.setHorizontalStretch(0)
         sizePolicy.setVerticalStretch(0)
         sizePolicy.setHeightForWidth(self.bandwidthEdit.sizePolicy().hasHeightForWidth())
         self.bandwidthEdit.setSizePolicy(sizePolicy)
-        self.bandwidthEdit.setMinimumSize(QtCore.QSize(120, 26))
+        self.bandwidthEdit.setMinimumSize(Qt.QSize(120, 26))
         self.bandwidthEdit.setObjectName("bandwidthEdit")
-        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.bandwidthEdit)
-        self.amplifierLabel = QtGui.QLabel(self.formLayoutWidget)
+        self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.bandwidthEdit)
+        self.amplifierLabel = QtWidgets.QLabel(self.formLayoutWidget)
         self.amplifierLabel.setObjectName("amplifierLabel")
-        self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.amplifierLabel)
-        self.amplifierEdit = QtGui.QLineEdit(self.formLayoutWidget)
-        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+        self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.amplifierLabel)
+        self.amplifierEdit = QtWidgets.QLineEdit(self.formLayoutWidget)
+        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
         sizePolicy.setHorizontalStretch(0)
         sizePolicy.setVerticalStretch(0)
         sizePolicy.setHeightForWidth(self.amplifierEdit.sizePolicy().hasHeightForWidth())
         self.amplifierEdit.setSizePolicy(sizePolicy)
-        self.amplifierEdit.setMinimumSize(QtCore.QSize(120, 26))
+        self.amplifierEdit.setMinimumSize(Qt.QSize(120, 26))
         self.amplifierEdit.setObjectName("amplifierEdit")
-        self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.amplifierEdit)
+        self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.amplifierEdit)
         self.horizontalLayout_2.addWidget(self.groupBox)
-        self.frame_2 = QtGui.QFrame(self.centralwidget)
-        self.frame_2.setMinimumSize(QtCore.QSize(200, 0))
-        self.frame_2.setFrameShape(QtGui.QFrame.StyledPanel)
-        self.frame_2.setFrameShadow(QtGui.QFrame.Raised)
+        self.frame_2 = QtWidgets.QFrame(self.centralwidget)
+        self.frame_2.setMinimumSize(Qt.QSize(200, 0))
+        self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
+        self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised)
         self.frame_2.setObjectName("frame_2")
-        self.verticalLayoutWidget = QtGui.QWidget(self.frame_2)
-        self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, -1, 191, 151))
+        self.verticalLayoutWidget = QtWidgets.QWidget(self.frame_2)
+        self.verticalLayoutWidget.setGeometry(Qt.QRect(10, -1, 191, 151))
         self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
-        self.verticalLayout_3 = QtGui.QVBoxLayout(self.verticalLayoutWidget)
+        self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
         self.verticalLayout_3.setObjectName("verticalLayout_3")
-        self.dcCancelCheckBox = QtGui.QCheckBox(self.verticalLayoutWidget)
+        self.dcCancelCheckBox = QtWidgets.QCheckBox(self.verticalLayoutWidget)
         self.dcCancelCheckBox.setObjectName("dcCancelCheckBox")
         self.verticalLayout_3.addWidget(self.dcCancelCheckBox)
-        self.horizontalLayout = QtGui.QHBoxLayout()
+        self.horizontalLayout = QtWidgets.QHBoxLayout()
         self.horizontalLayout.setObjectName("horizontalLayout")
-        self.dcGainLabel = QtGui.QLabel(self.verticalLayoutWidget)
+        self.dcGainLabel = QtWidgets.QLabel(self.verticalLayoutWidget)
         self.dcGainLabel.setObjectName("dcGainLabel")
         self.horizontalLayout.addWidget(self.dcGainLabel)
-        self.dcGainEdit = QtGui.QLineEdit(self.verticalLayoutWidget)
+        self.dcGainEdit = QtWidgets.QLineEdit(self.verticalLayoutWidget)
         self.dcGainEdit.setObjectName("dcGainEdit")
         self.horizontalLayout.addWidget(self.dcGainEdit)
         self.verticalLayout_3.addLayout(self.horizontalLayout)
-        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
+        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
         self.verticalLayout_3.addItem(spacerItem)
         self.horizontalLayout_2.addWidget(self.frame_2)
-        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
         self.horizontalLayout_2.addItem(spacerItem1)
-        self.verticalLayout = QtGui.QVBoxLayout()
+        self.verticalLayout = QtWidgets.QVBoxLayout()
         self.verticalLayout.setObjectName("verticalLayout")
-        spacerItem2 = QtGui.QSpacerItem(20, 80, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
+        spacerItem2 = QtWidgets.QSpacerItem(20, 80, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
         self.verticalLayout.addItem(spacerItem2)
-        self.pauseButton = QtGui.QPushButton(self.centralwidget)
-        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+        self.pauseButton = QtWidgets.QPushButton(self.centralwidget)
+        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
         sizePolicy.setHorizontalStretch(0)
         sizePolicy.setVerticalStretch(0)
         sizePolicy.setHeightForWidth(self.pauseButton.sizePolicy().hasHeightForWidth())
         self.pauseButton.setSizePolicy(sizePolicy)
         self.pauseButton.setObjectName("pauseButton")
         self.verticalLayout.addWidget(self.pauseButton)
-        self.closeButton = QtGui.QPushButton(self.centralwidget)
-        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+        self.closeButton = QtWidgets.QPushButton(self.centralwidget)
+        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
         sizePolicy.setHorizontalStretch(0)
         sizePolicy.setVerticalStretch(0)
         sizePolicy.setHeightForWidth(self.closeButton.sizePolicy().hasHeightForWidth())
         self.closeButton.setSizePolicy(sizePolicy)
-        self.closeButton.setMinimumSize(QtCore.QSize(75, 0))
+        self.closeButton.setMinimumSize(Qt.QSize(75, 0))
         self.closeButton.setObjectName("closeButton")
         self.verticalLayout.addWidget(self.closeButton)
         self.horizontalLayout_2.addLayout(self.verticalLayout)
         self.gridLayout_2.addLayout(self.horizontalLayout_2, 1, 0, 1, 1)
-        self.verticalLayout_2 = QtGui.QVBoxLayout()
+        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
         self.verticalLayout_2.setObjectName("verticalLayout_2")
-        self.frame = QtGui.QFrame(self.centralwidget)
-        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
+        self.frame = QtWidgets.QFrame(self.centralwidget)
+        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
         sizePolicy.setHorizontalStretch(0)
         sizePolicy.setVerticalStretch(1)
         sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
         self.frame.setSizePolicy(sizePolicy)
-        self.frame.setMinimumSize(QtCore.QSize(800, 550))
-        self.frame.setFrameShape(QtGui.QFrame.StyledPanel)
-        self.frame.setFrameShadow(QtGui.QFrame.Raised)
+        self.frame.setMinimumSize(Qt.QSize(800, 550))
+        self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
+        self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
         self.frame.setObjectName("frame")
-        self.gridLayout = QtGui.QGridLayout(self.frame)
+        self.gridLayout = QtWidgets.QGridLayout(self.frame)
         self.gridLayout.setObjectName("gridLayout")
-        self.sinkLayout = QtGui.QHBoxLayout()
+        self.sinkLayout = QtWidgets.QHBoxLayout()
         self.sinkLayout.setObjectName("sinkLayout")
         self.gridLayout.addLayout(self.sinkLayout, 0, 0, 1, 1)
         self.verticalLayout_2.addWidget(self.frame)
         self.gridLayout_2.addLayout(self.verticalLayout_2, 0, 0, 1, 1)
         MainWindow.setCentralWidget(self.centralwidget)
-        self.menubar = QtGui.QMenuBar(MainWindow)
-        self.menubar.setGeometry(QtCore.QRect(0, 0, 820, 24))
+        self.menubar = QtWidgets.QMenuBar(MainWindow)
+        self.menubar.setGeometry(Qt.QRect(0, 0, 820, 24))
         self.menubar.setObjectName("menubar")
-        self.menuFile = QtGui.QMenu(self.menubar)
+        self.menuFile = QtWidgets.QMenu(self.menubar)
         self.menuFile.setObjectName("menuFile")
         MainWindow.setMenuBar(self.menubar)
-        self.statusbar = QtGui.QStatusBar(MainWindow)
+        self.statusbar = QtWidgets.QStatusBar(MainWindow)
         self.statusbar.setObjectName("statusbar")
         MainWindow.setStatusBar(self.statusbar)
-        self.actionExit = QtGui.QAction(MainWindow)
+        self.actionExit = QtWidgets.QAction(MainWindow)
         self.actionExit.setObjectName("actionExit")
-        self.actionSaveData = QtGui.QAction(MainWindow)
+        self.actionSaveData = QtWidgets.QAction(MainWindow)
         self.actionSaveData.setObjectName("actionSaveData")
         self.menuFile.addAction(self.actionSaveData)
         self.menuFile.addAction(self.actionExit)
         self.menubar.addAction(self.menuFile.menuAction())
 
         self.retranslateUi(MainWindow)
-        QtCore.QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), MainWindow.close)
-        QtCore.QObject.connect(self.actionExit, QtCore.SIGNAL("triggered()"), MainWindow.close)
-        QtCore.QMetaObject.connectSlotsByName(MainWindow)
+        Qt.QObject.connect(self.closeButton, Qt.SIGNAL("clicked()"), MainWindow.close)
+        Qt.QObject.connect(self.actionExit, Qt.SIGNAL("triggered()"), MainWindow.close)
+        Qt.QMetaObject.connectSlotsByName(MainWindow)
 
     def retranslateUi(self, MainWindow):
-        MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "USRP Display", None, QtGui.QApplication.UnicodeUTF8))
-        self.groupBox.setTitle(QtGui.QApplication.translate("MainWindow", "Receiver Parameters", None, QtGui.QApplication.UnicodeUTF8))
-        self.frequencyLabel.setText(QtGui.QApplication.translate("MainWindow", "Frequency (Hz)", None, QtGui.QApplication.UnicodeUTF8))
-        self.gainLabel.setText(QtGui.QApplication.translate("MainWindow", "RF Gain", None, QtGui.QApplication.UnicodeUTF8))
-        self.bandwidthLabel.setText(QtGui.QApplication.translate("MainWindow", "Bandwidth", None, QtGui.QApplication.UnicodeUTF8))
-        self.amplifierLabel.setText(QtGui.QApplication.translate("MainWindow", "Amplifier", None, QtGui.QApplication.UnicodeUTF8))
-        self.dcCancelCheckBox.setText(QtGui.QApplication.translate("MainWindow", "Cancel DC", None, QtGui.QApplication.UnicodeUTF8))
-        self.dcGainLabel.setText(QtGui.QApplication.translate("MainWindow", "DC Canceller Gain", None, QtGui.QApplication.UnicodeUTF8))
-        self.pauseButton.setText(QtGui.QApplication.translate("MainWindow", "Pause", None, QtGui.QApplication.UnicodeUTF8))
-        self.closeButton.setText(QtGui.QApplication.translate("MainWindow", "Close", None, QtGui.QApplication.UnicodeUTF8))
-        self.menuFile.setTitle(QtGui.QApplication.translate("MainWindow", "&File", None, QtGui.QApplication.UnicodeUTF8))
-        self.actionExit.setText(QtGui.QApplication.translate("MainWindow", "E&xit", None, QtGui.QApplication.UnicodeUTF8))
-        self.actionSaveData.setText(QtGui.QApplication.translate("MainWindow", "&Save Data", None, QtGui.QApplication.UnicodeUTF8))
+        MainWindow.setWindowTitle(QtWidgets.QApplication.translate("MainWindow", "USRP Display", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.groupBox.setTitle(QtWidgets.QApplication.translate("MainWindow", "Receiver Parameters", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.frequencyLabel.setText(QtWidgets.QApplication.translate("MainWindow", "Frequency (Hz)", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.gainLabel.setText(QtWidgets.QApplication.translate("MainWindow", "RF Gain", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.bandwidthLabel.setText(QtWidgets.QApplication.translate("MainWindow", "Bandwidth", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.amplifierLabel.setText(QtWidgets.QApplication.translate("MainWindow", "Amplifier", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.dcCancelCheckBox.setText(QtWidgets.QApplication.translate("MainWindow", "Cancel DC", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.dcGainLabel.setText(QtWidgets.QApplication.translate("MainWindow", "DC Canceller Gain", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.pauseButton.setText(QtWidgets.QApplication.translate("MainWindow", "Pause", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.closeButton.setText(QtWidgets.QApplication.translate("MainWindow", "Close", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.menuFile.setTitle(QtWidgets.QApplication.translate("MainWindow", "&File", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.actionExit.setText(QtWidgets.QApplication.translate("MainWindow", "E&xit", None, QtWidgets.QApplication.UnicodeUTF8))
+        self.actionSaveData.setText(QtWidgets.QApplication.translate("MainWindow", "&Save Data", None, QtWidgets.QApplication.UnicodeUTF8))
 
-- 
2.11.0

