summaryrefslogtreecommitdiff
path: root/gr-qtgui/examples/pyqt_time_raster_f.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-qtgui/examples/pyqt_time_raster_f.py')
-rwxr-xr-xgr-qtgui/examples/pyqt_time_raster_f.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/gr-qtgui/examples/pyqt_time_raster_f.py b/gr-qtgui/examples/pyqt_time_raster_f.py
index c5261520db..0f9de94bcb 100755
--- a/gr-qtgui/examples/pyqt_time_raster_f.py
+++ b/gr-qtgui/examples/pyqt_time_raster_f.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2012,2013 Free Software Foundation, Inc.
+# Copyright 2012,2013,2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -26,18 +26,18 @@ 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."
+ print "Error: Program requires PyQt5 and gr-qtgui."
sys.exit(1)
-class dialog_box(QtGui.QWidget):
+class dialog_box(QtWidgets.QWidget):
def __init__(self, display):
- QtGui.QWidget.__init__(self, None)
+ QtWidgets.QWidget.__init__(self, None)
self.setWindowTitle('PyQt Test GUI')
- self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, self)
+ self.boxlayout = QtWidgets.QBoxLayout(QtWidgets.QBoxLayout.LeftToRight, self)
self.boxlayout.addWidget(display, 1)
self.resize(800, 500)
@@ -46,7 +46,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)
data0 = 10*[0,] + 40*[1,0] + 10*[0,]
data0 += 10*[0,] + 40*[0,1] + 10*[0,]
@@ -72,8 +72,8 @@ class my_top_block(gr.top_block):
pyQt = self.snk1.pyqwidget()
# Wrap the pointer as a PyQt SIP object
- # This can now be manipulated as a PyQt4.QtGui.QWidget
- pyWin = sip.wrapinstance(pyQt, QtGui.QWidget)
+ # This can now be manipulated as a PyQt5.QtWidgets.QWidget
+ pyWin = sip.wrapinstance(pyQt, QtWidgets.QWidget)
self.main_box = dialog_box(pyWin)
self.main_box.show()
@@ -83,4 +83,3 @@ if __name__ == "__main__":
tb.start()
tb.qapp.exec_()
tb.stop()
-