File: qtgui_push_button.xml

package info (click to toggle)
gnuradio 3.7.13.4-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 45,992 kB
  • sloc: cpp: 155,723; python: 88,934; xml: 42,165; ansic: 41,036; fortran: 927; asm: 803; sh: 224; lisp: 31; makefile: 17
file content (81 lines) | stat: -rw-r--r-- 2,370 bytes parent folder | download | duplicates (2)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?xml version="1.0"?>
<!--
###################################################
##Variable Push Button:
##	a gui push button form
###################################################
 -->
<block>
	<name>QT GUI Push Button</name>
	<key>variable_qtgui_push_button</key>
	<import>from PyQt5 import Qt</import>
	<var_make>self.$(id) = $(id) = $value</var_make>
	<make>#set $win = '_%s_push_button'%$id
#if not $label()
	#set $label = '"%s"'%$id
#end if
$win = Qt.QPushButton($label)
self._$(id)_choices = {'Pressed': $pressed, 'Released': $released}
$(win).pressed.connect(lambda: self.set_$(id)(self._$(id)_choices['Pressed']))
$(win).released.connect(lambda: self.set_$(id)(self._$(id)_choices['Released']))
$(gui_hint() % $win)</make>

	<callback>self.set_$(id)($value)</callback>

	<param>
		<name>Label</name>
		<key>label</key>
		<value></value>
		<type>string</type>
		<hide>#if $label() then 'none' else 'part'#</hide>
	</param>
	<param>
		<name>Type</name>
		<key>type</key>
		<value>int</value>
		<type>enum</type>
		<hide>part</hide>
		<option><name>Float</name><key>real</key><opt>conv:float</opt></option>
		<option><name>Integer</name><key>int</key><opt>conv:int</opt></option>
		<option><name>String</name><key>string</key><opt>conv:str</opt></option>
		<option><name>Boolean</name><key>bool</key><opt>conv:bool</opt></option>
		<option><name>Any</name><key>raw</key><opt>conv:eval</opt></option>
	</param>
	<param>
		<name>Default Value</name>
		<key>value</key>
		<value>0</value>
		<type>$type</type>
	</param>
	<param>
		<name>Pressed</name>
		<key>pressed</key>
		<value>1</value>
		<type>$type</type>
	</param>
	<param>
		<name>Released</name>
		<key>released</key>
		<value>0</value>
		<type>$type</type>
	</param>
	<param>
		<name>GUI Hint</name>
		<key>gui_hint</key>
		<value></value>
		<type>gui_hint</type>
		<hide>part</hide>
	</param>
	<doc>
This block creates a variable push button. \
Leave the label blank to use the variable id as the label.

A push button selects between two values of similar type. \
The variable will take on one value or the other depending \
on whether the button is pressed or released.

The GUI hint can be used to position the widget within the application. \
The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \
Both the tab specification and the grid position are optional.
	</doc>
</block>