From 1fa94d7a10089b3907ffe428e9d374f442f0f596 Mon Sep 17 00:00:00 2001
From: Tom Rondeau <tom@trondeau.com>
Date: Fri, 25 Jul 2014 17:59:31 -0400
Subject: qtgui: bringing in line with required Qt 4.4.

setGraphicsSystem was introduced in 4.5; doing a version check before its use.
---
 grc/python/flow_graph.tmpl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'grc/python')

diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl
index 52582384aa..ace217c967 100644
--- a/grc/python/flow_graph.tmpl
+++ b/grc/python/flow_graph.tmpl
@@ -58,6 +58,7 @@ class $(class_name)(grc_wxgui.top_block_gui):
         self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))
     #end if
 #elif $generate_options == 'qt_gui'
+from distutils.version import StrictVersion
 class $(class_name)(gr.top_block, Qt.QWidget):
 
     def __init__($param_str):
@@ -316,7 +317,8 @@ if __name__ == '__main__':
     tb.Wait()
         #end if
     #elif $generate_options == 'qt_gui'
-    Qt.QApplication.setGraphicsSystem(gr.prefs().get_string('qtgui','style','raster'))
+    if(StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0")):
+        Qt.QApplication.setGraphicsSystem(gr.prefs().get_string('qtgui','style','raster'))
     qapp = Qt.QApplication(sys.argv)
     tb = $(class_name)($(', '.join($params_eq_list)))
     #if $flow_graph.get_option('run')
-- 
cgit v1.2.3