summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-qtgui/grc/qtgui_chooser.xml4
-rw-r--r--gr-qtgui/grc/qtgui_entry.xml2
-rw-r--r--gr-qtgui/grc/qtgui_label.xml2
-rw-r--r--gr-qtgui/grc/qtgui_range.xml29
-rw-r--r--gr-qtgui/grc/qtgui_tab_widget.xml2
-rw-r--r--grc/blocks/variable_function_probe.xml7
-rw-r--r--grc/python/flow_graph.tmpl1
7 files changed, 31 insertions, 16 deletions
diff --git a/gr-qtgui/grc/qtgui_chooser.xml b/gr-qtgui/grc/qtgui_chooser.xml
index 6f405d99d3..cb50902897 100644
--- a/gr-qtgui/grc/qtgui_chooser.xml
+++ b/gr-qtgui/grc/qtgui_chooser.xml
@@ -53,8 +53,8 @@ self._$(id)_labels = map(str, self._$(id)_options)
#if $widget() == 'combo_box'
#set $win = 'self._%s_tool_bar'%$id
$win = Qt.QToolBar(self)
-$(win).addWidget(Qt.QLabel($label+": ", None))
-self._$(id)_combo_box = Qt.QComboBox(None)
+$(win).addWidget(Qt.QLabel($label+": "))
+self._$(id)_combo_box = Qt.QComboBox()
$(win).addWidget(self._$(id)_combo_box)
for label in self._$(id)_labels: self._$(id)_combo_box.addItem(label)
self._$(id)_callback = lambda i: self._$(id)_combo_box.setCurrentIndex(self._$(id)_options.index(i))
diff --git a/gr-qtgui/grc/qtgui_entry.xml b/gr-qtgui/grc/qtgui_entry.xml
index 32c879420d..1a98402a0f 100644
--- a/gr-qtgui/grc/qtgui_entry.xml
+++ b/gr-qtgui/grc/qtgui_entry.xml
@@ -17,7 +17,7 @@ $win = Qt.QToolBar(self)
#if not $label()
#set $label = '"%s"'%$id
#end if
-$(win).addWidget(Qt.QLabel($label+": ", None))
+$(win).addWidget(Qt.QLabel($label+": "))
self._$(id)_line_edit = Qt.QLineEdit(str(self.$id))
self._$(id)_tool_bar.addWidget(self._$(id)_line_edit)
self._$(id)_line_edit.returnPressed.connect(
diff --git a/gr-qtgui/grc/qtgui_label.xml b/gr-qtgui/grc/qtgui_label.xml
index 96354688e9..5049118c47 100644
--- a/gr-qtgui/grc/qtgui_label.xml
+++ b/gr-qtgui/grc/qtgui_label.xml
@@ -17,7 +17,7 @@ $win = Qt.QToolBar(self)
#if not $label()
#set $label = '"%s"'%$id
#end if
-$(win).addWidget(Qt.QLabel($label+": ", None))
+$(win).addWidget(Qt.QLabel($label+": "))
self._$(id)_label = Qt.QLabel(str(self.$id))
self._$(id)_tool_bar.addWidget(self._$(id)_label)
$(gui_hint()($win))</make>
diff --git a/gr-qtgui/grc/qtgui_range.xml b/gr-qtgui/grc/qtgui_range.xml
index 4d28de223f..6b0555f98e 100644
--- a/gr-qtgui/grc/qtgui_range.xml
+++ b/gr-qtgui/grc/qtgui_range.xml
@@ -11,7 +11,6 @@
<category>QT GUI Widgets</category>
<import>from PyQt4 import Qt</import>
<import>import PyQt4.Qwt5 as Qwt</import>
- <import>from gnuradio import eng_notation</import>
<var_make>self.$(id) = $(id) = $value</var_make>
<make>#set $win = 'self._%s_layout'%$id
#if not $label()
@@ -33,14 +32,22 @@ $(win).addWidget(self._$(id)_label)
########################################################################
#if $widget() == "thermo"
########################################################################
-$win = $(orient.layout)()
-$(win).addWidget(Qt.QLabel($label))
+$win = Qt.QVBoxLayout()
+self._$(id)_label = Qt.QLabel($label)
self._$(id)_thermo = Qwt.QwtThermo()
self._$(id)_thermo.setScalePosition(Qwt.QwtThermo.$orient.scalepos)
self._$(id)_thermo.setRange($start, $stop)
self._$(id)_thermo.setValue(self.$id)
self._$(id)_thermo.$(orient.minfcn)($min_len)
+#if 'horizontal' in $orient().lower()
+self._$(id)_label.setAlignment(Qt.Qt.AlignBottom | Qt.Qt.AlignHCenter)
+$(win).addWidget(self._$(id)_label)
$(win).addWidget(self._$(id)_thermo)
+#elif 'vertical' in $orient().lower()
+self._$(id)_label.setAlignment(Qt.Qt.AlignTop)
+$(win).addWidget(self._$(id)_thermo)
+$(win).addWidget(self._$(id)_label)
+#end if
#end if
########################################################################
#if $widget() == "counter"
@@ -58,15 +65,22 @@ self._$(id)_counter.valueChanged.connect(self.set_$(id))
########################################################################
#if $widget() == "slider"
########################################################################
-$win = $(orient.layout)()
+$win = Qt.QVBoxLayout()
+self._$(id)_label = Qt.QLabel($label)
self._$(id)_slider = Qwt.QwtSlider(None, Qt.$orient, Qwt.QwtSlider.$orient.scalepos, Qwt.QwtSlider.BgSlot)
self._$(id)_slider.setRange($start, $stop, $step)
self._$(id)_slider.setValue(self.$id)
self._$(id)_slider.$(orient.minfcn)($min_len)
self._$(id)_slider.valueChanged.connect(self.set_$(id))
+#if 'horizontal' in $orient().lower()
+self._$(id)_label.setAlignment(Qt.Qt.AlignBottom | Qt.Qt.AlignHCenter)
+$(win).addWidget(self._$(id)_label)
$(win).addWidget(self._$(id)_slider)
-self._$(id)_num = Qt.QLabel(eng_notation.num_to_str($id))
-$(win).addWidget(self._$(id)_num)
+#elif 'vertical' in $orient().lower()
+self._$(id)_label.setAlignment(Qt.Qt.AlignTop)
+$(win).addWidget(self._$(id)_slider)
+$(win).addWidget(self._$(id)_label)
+#end if
#end if
########################################################################
#if $widget() == "counter_slider"
@@ -101,7 +115,6 @@ self._$(id)_counter.setValue($id)
#end if
#if $widget() == "slider"
self._$(id)_slider.setValue($id)
-self._$(id)_num.setText(eng_notation.num_to_str($id))
#end if
#if $widget() == "counter_slider"
self._$(id)_counter.setValue($id)
@@ -161,14 +174,12 @@ self._$(id)_slider.setValue($id)
<key>Qt.Horizontal</key>
<opt>scalepos:BottomScale</opt>
<opt>minfcn:setMinimumWidth</opt>
- <opt>layout:Qt.QHBoxLayout</opt>
</option>
<option>
<name>Vertical</name>
<key>Qt.Vertical</key>
<opt>scalepos:LeftScale</opt>
<opt>minfcn:setMinimumHeight</opt>
- <opt>layout:Qt.QVBoxLayout</opt>
</option>
</param>
<param>
diff --git a/gr-qtgui/grc/qtgui_tab_widget.xml b/gr-qtgui/grc/qtgui_tab_widget.xml
index efdeaa19a1..f900541093 100644
--- a/gr-qtgui/grc/qtgui_tab_widget.xml
+++ b/gr-qtgui/grc/qtgui_tab_widget.xml
@@ -10,7 +10,7 @@
<category>QT GUI Widgets</category>
<import>from PyQt4 import Qt</import>
<make>#set $win = 'self.%s'%$id
-Qt.QTabWidget(None)
+Qt.QTabWidget()
#set $all_labels = [$label0, $label1, $label2, $label3, $label4][:int($num_tabs())]
#for i, label in enumerate($all_labels)
self.$(id)_widget_$(i) = Qt.QWidget()
diff --git a/grc/blocks/variable_function_probe.xml b/grc/blocks/variable_function_probe.xml
index 49f48fc896..269966c70d 100644
--- a/grc/blocks/variable_function_probe.xml
+++ b/grc/blocks/variable_function_probe.xml
@@ -13,7 +13,9 @@
<make>#slurp
def _$(id)_probe():
while True:
- self.set_$(id)(self.$(block_id()).$(function_name())($(function_args())))
+ val = self.$(block_id()).$(function_name())($(function_args()))
+ try: self.set_$(id)(val)
+ except AttributeError, e: pass
time.sleep(1.0/($poll_rate))
_$(id)_thread = threading.Thread(target=_$(id)_probe)
_$(id)_thread.daemon = True
@@ -57,7 +59,8 @@ Set the values for block ID, function name, and function args appropriately: \
Block ID should be the ID of another block in this flow graph. \
Function name should be the name of a class method on that block. \
Function args are the parameters passed into that function. \
-For a function with no arguments, leave function args blank.
+For a function with no arguments, leave function args blank. \
+When passing a string for the function arguments, quote the string literal: '"arg"'.
The values will used literally, and generated into the following form:
self.block_id.function_name(function_args)
diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl
index 070ad7ed19..1aea588384 100644
--- a/grc/python/flow_graph.tmpl
+++ b/grc/python/flow_graph.tmpl
@@ -235,6 +235,7 @@ if __name__ == '__main__':
#elif $generate_options == 'qt_gui'
qapp = Qt.QApplication(sys.argv)
tb = $(class_name)($(', '.join($params_eq_list)))
+ tb.setWindowTitle("$title")
#if $flow_graph.get_option('run')
tb.start()
#end if