Package: gnuradio / 3.7.13.4-4

qt5-maint-0004-grc-Generate-Python-scripts-that-use-PyQt5.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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():