diff options
author | Josh Blum | 2010-12-06 22:46:39 -0500 |
---|---|---|
committer | Josh Blum | 2011-03-01 17:02:06 -0800 |
commit | 9ae8997e5f682bc16e58c0a0bba21794dbd705c5 (patch) | |
tree | 8ffd4f98e92a1e9261f88574d0c2679b11cabaec /grc/python/flow_graph.tmpl | |
parent | 0e076c5835ea624c25e7be964e946d9f6425f414 (diff) | |
download | gnuradio-9ae8997e5f682bc16e58c0a0bba21794dbd705c5.tar.gz gnuradio-9ae8997e5f682bc16e58c0a0bba21794dbd705c5.tar.bz2 gnuradio-9ae8997e5f682bc16e58c0a0bba21794dbd705c5.zip |
qtgui: created a forms module with a slider and text box, implemented in grc
Diffstat (limited to 'grc/python/flow_graph.tmpl')
-rw-r--r-- | grc/python/flow_graph.tmpl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index 676da33b4..108e15ca0 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -60,11 +60,12 @@ 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' -class $(class_name)(gr.top_block): +class $(class_name)(gr.top_block, QtGui.QWidget): def __init__($param_str): gr.top_block.__init__(self, "$title") - self.qapp = QtGui.QApplication(sys.argv) + QtGui.QWidget.__init__(self) + self.layout = QtGui.QBoxLayout(QtGui.QBoxLayout.TopToBottom, self) #elif $generate_options == 'no_gui' class $(class_name)(gr.top_block): @@ -245,15 +246,19 @@ if __name__ == '__main__': if gr.enable_realtime_scheduling() != gr.RT_OK: print "Error: failed to enable realtime scheduling." #end if - tb = $(class_name)($(', '.join($params_eq_list))) #if $generate_options == 'wx_gui' + tb = $(class_name)($(', '.join($params_eq_list))) tb.Run($flow_graph.get_option('run')) #elif $generate_options == 'qt_gui' + qapp = QtGui.QApplication(sys.argv) + tb = $(class_name)($(', '.join($params_eq_list))) tb.start() - tb.qapp.exec_() + tb.show() + qapp.exec_() #elif $generate_options == 'no_gui' #set $run_options = $flow_graph.get_option('run_options') #if $run_options == 'prompt' + tb = $(class_name)($(', '.join($params_eq_list))) tb.start() raw_input('Press Enter to quit: ') tb.stop() |