-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform_input_choice.py
76 lines (68 loc) · 2.02 KB
/
form_input_choice.py
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
from quasargui import *
few_choices = ['blonde', 'red', 'brown', 'blue', 'pink']
many_choices = [
'blonde', 'red', 'brown', 'blue', 'pink',
'black', 'grey', 'white', 'bold', 'long',
'short', 'thin', 'thick', 'medium', 'rasta'
]
my_choice1 = Model('blonde')
my_choice2 = Model('blonde')
my_choice3 = Model('blonde')
my_choice4 = Model('blonde')
multi_choice1 = Model([])
multi_choice2 = Model([])
multi_choice3 = Model([])
gap_classes = 'q-pt-lg'
selected_tab = Model('single')
single_choice_components = [
InputChoice(
'my choice - no choice set',
my_choice1,
classes=gap_classes),
InputChoice(
'my choice', my_choice2,
choices=few_choices,
classes=gap_classes),
InputChoice(
'my choice - many choices',
my_choice3,
choices=many_choices,
classes=gap_classes),
InputChoice(
'my choice - appearance=buttons',
my_choice4,
choices=few_choices,
appearance='buttons',
classes=gap_classes)
]
multiple_choice_components = [
InputChoice(
'multiple choices - no choice set',
multi_choice1,
classes=gap_classes,
multiple=True),
InputChoice(
'my choice - a few choices set',
multi_choice2,
choices=few_choices,
classes=gap_classes,
multiple=True),
InputChoice(
'my choice - many choices set',
multi_choice3,
choices=many_choices,
classes=gap_classes,
multiple=True),
]
layout = QLayout([QPage(classes='easyread', children=[
Heading(4, 'Input choice appearances', classes='q-mb-md'),
QTabs(selected_tab, classes='text-primary', children=[
QTab('single', label='single value'),
QTab('multiple', label='multiple values')],
),
QTabPanels(selected_tab, [
QTabPanel('single', single_choice_components),
QTabPanel('multiple', multiple_choice_components),
]),
])])
run(layout, 'Form - input choice demo', size=(600, 550), _render_debug=True, debug=True)