From b65bf73bc174183d6aec476c2fb161a4911c2351 Mon Sep 17 00:00:00 2001
From: Vasil Velichkov <vvvelichkov@gmail.com>
Date: Thu, 11 Jan 2018 00:32:37 +0000
Subject: [PATCH 27/27] Fix AttributeError: 'NoneType' object has no attribute
 'toByteArray'

Debian Bug #886807
---
 gr-uhd/apps/uhd_fft                | 6 +++---
 gr-uhd/apps/uhd_siggen_gui         | 4 ++--
 grc/blocks/options.xml             | 2 +-
 grc/core/generator/flow_graph.tmpl | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

--- a/gr-uhd/apps/uhd_fft
+++ b/gr-uhd/apps/uhd_fft
@@ -40,7 +40,7 @@
 import threading
 import time
 from distutils.version import StrictVersion
-from PyQt5 import Qt
+from PyQt5 import Qt, QtCore
 from gnuradio import eng_notation
 from gnuradio import eng_arg
 from gnuradio import gr
@@ -60,7 +60,7 @@
     """
     def __init__(self, args):
         gr.top_block.__init__(self, "UHD FFT")
-        Qt.QWidget.__init__(self)
+        Qt.QWidget.__init__(self, args=args)
         UHDApp.__init__(self, args=args, prefix="UHD FFT")
         ##################################################
         # Init QT App
@@ -82,7 +82,7 @@
         self.top_grid_layout = Qt.QGridLayout()
         self.top_layout.addLayout(self.top_grid_layout)
         self.settings = Qt.QSettings("GNU Radio", "uhd_fft")
-        self.restoreGeometry(self.settings.value("geometry").toByteArray())
+        self.restoreGeometry(self.settings.value("geometry", type=QtCore.QByteArray))
 
         ##################################################
         # Parameters
--- a/gr-uhd/apps/uhd_siggen_gui
+++ b/gr-uhd/apps/uhd_siggen_gui
@@ -39,7 +39,7 @@
 import time
 from distutils.version import StrictVersion
 from PyQt5 import Qt
-from PyQt5.QtCore import pyqtSlot
+from PyQt5.QtCore import pyqtSlot, QByteArray
 from gnuradio import analog
 from gnuradio import eng_notation
 from gnuradio import gr
@@ -85,7 +85,7 @@
         self.top_grid_layout = Qt.QGridLayout()
         self.top_layout.addLayout(self.top_grid_layout)
         self.settings = Qt.QSettings("GNU Radio", "uhd_siggen_gui")
-        self.restoreGeometry(self.settings.value("geometry").toByteArray())
+        self.restoreGeometry(self.settings.value("geometry", type=QByteArray))
 
         ##################################################
         # Widgets + Controls
--- a/grc/blocks/options.xml
+++ b/grc/blocks/options.xml
@@ -16,7 +16,7 @@
 import wx
 #end if
 #if $generate_options() == 'qt_gui'
-from PyQt5 import Qt
+from PyQt5 import Qt, QtCore
 import sys
 #end if
 #if $generate_options() == 'bokeh_gui'
--- a/grc/core/generator/flow_graph.tmpl
+++ b/grc/core/generator/flow_graph.tmpl
@@ -122,7 +122,7 @@
         self.top_layout.addLayout(self.top_grid_layout)
 
         self.settings = Qt.QSettings("GNU Radio", "$class_name")
-        self.restoreGeometry(self.settings.value("geometry"))
+        self.restoreGeometry(self.settings.value("geometry", type=QtCore.QByteArray))
 
 #elif $generate_options == 'bokeh_gui'
 
