From e58eb487c4119866f8c820658c8cda173bc96370 Mon Sep 17 00:00:00 2001
From: Paul Cercueil <paul.cercueil@analog.com>
Date: Tue, 29 Sep 2015 13:22:46 +0200
Subject: [PATCH 04/22] grc: Generate Python scripts that use PyQt5

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
---
 grc/blocks/options.xml             | 2 +-
 grc/core/generator/flow_graph.tmpl | 8 ++------
 2 files changed, 3 insertions(+), 7 deletions(-)

--- a/grc/blocks/options.xml
+++ b/grc/blocks/options.xml
@@ -16,7 +16,7 @@
 import wx
 #end if
 #if $generate_options() == 'qt_gui'
-from PyQt4 import Qt
+from PyQt5 import Qt
 import sys
 #end if
 #if $generate_options() == 'bokeh_gui'
--- a/grc/core/generator/flow_graph.tmpl
+++ b/grc/core/generator/flow_graph.tmpl
@@ -118,7 +118,7 @@
         self.top_layout.addLayout(self.top_grid_layout)
 
         self.settings = Qt.QSettings("GNU Radio", "$class_name")
-        self.restoreGeometry(self.settings.value("geometry").toByteArray())
+        self.restoreGeometry(self.settings.value("geometry"))
 
 #elif $generate_options == 'bokeh_gui'
 
@@ -435,10 +435,6 @@
         serverProc.terminate()
         serverProc.kill()
     #elif $generate_options == 'qt_gui'
-    from distutils.version import StrictVersion
-    if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
-        style = gr.prefs().get_string('qtgui', 'style', 'raster')
-        Qt.QApplication.setGraphicsSystem(style)
     qapp = Qt.QApplication(sys.argv)
 
     tb = top_block_cls($(', '.join($params_eq_list)))
@@ -457,7 +453,7 @@
     def quitting():
         tb.stop()
         tb.wait()
-    qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
+    qapp.aboutToQuit.connect(quitting)
         #for $m in $monitors
     if $m.has_param('en'):
         if $m.get_param('en').get_value():
