7
7
<x >0</x >
8
8
<y >0</y >
9
9
<width >400</width >
10
- <height >300 </height >
10
+ <height >283 </height >
11
11
</rect >
12
12
</property >
13
13
<property name =" windowTitle" >
14
14
<string >Python Init Code Configuration</string >
15
15
</property >
16
- <layout class =" QGridLayout" name =" gridLayout" >
17
- <item row =" 1" column =" 0" >
18
- <widget class =" QWidget" name =" mInitFunctionContainer" native =" true" >
19
- <property name =" sizePolicy" >
20
- <sizepolicy hsizetype =" Preferred" vsizetype =" Minimum" >
21
- <horstretch >0</horstretch >
22
- <verstretch >0</verstretch >
23
- </sizepolicy >
16
+ <layout class =" QGridLayout" name =" gridLayout_2" >
17
+ <item row =" 0" column =" 0" >
18
+ <widget class =" QLabel" name =" label_3" >
19
+ <property name =" toolTip" >
20
+ <string >The function code of the function can be loaded from the source code entered
21
+ in this dialog, from an external python file or from the environment (for example
22
+ from a plugin or from startup.py).
23
+
24
+ An example is:
25
+
26
+ from qgis.PyQt.QtWidgets import QWidget
27
+
28
+ def my_form_open(dialog, layer, feature):
29
+ geom = feature.geometry()
30
+ control = dialog.findChild(QWidget," MyLineEdit" )
31
+
32
+ Reference in function name: my_form_open
33
+
34
+ </string >
24
35
</property >
25
- <property name =" maximumSize" >
26
- <size >
27
- <width >16777215</width >
28
- <height >50</height >
29
- </size >
36
+ <property name =" text" >
37
+ <string >Python Init function</string >
30
38
</property >
31
- <layout class =" QHBoxLayout" name =" horizontalLayout_4" >
39
+ </widget >
40
+ </item >
41
+ <item row =" 0" column =" 1" colspan =" 2" >
42
+ <widget class =" QComboBox" name =" mInitCodeSourceComboBox" >
43
+ <property name =" toolTip" >
44
+ <string >The function code of the function can be loaded from the source code entered
45
+ in this dialog, from an external python file or from the environment (for example
46
+ from a plugin or from startup.py).
47
+
48
+ An example is:
49
+
50
+ rom qgis.PyQt.QtWidgets import QWidget
51
+
52
+ def my_form_open(dialog, layer, feature):
53
+ geom = feature.geometry()
54
+ control = dialog.findChild(QWidget," MyLineEdit" )
55
+
56
+ Reference in function name: my_form_open
57
+
58
+ </string >
59
+ </property >
60
+ </widget >
61
+ </item >
62
+ <item row =" 1" column =" 0" colspan =" 3" >
63
+ <widget class =" QWidget" name =" mInitFunctionContainer" native =" true" >
64
+ <layout class =" QGridLayout" name =" gridLayout" >
32
65
<property name =" leftMargin" >
33
66
<number >0</number >
34
67
</property >
35
- <property name =" topMargin" >
36
- <number >0</number >
37
- </property >
38
68
<property name =" rightMargin" >
39
69
<number >0</number >
40
70
</property >
41
- <property name =" bottomMargin" >
42
- <number >0</number >
43
- </property >
44
- <item >
45
- <widget class =" QLabel" name =" mInitFunctionLabel" >
46
- <property name =" text" >
47
- <string >Function name</string >
48
- </property >
49
- </widget >
50
- </item >
51
- <item >
52
- <widget class =" QLineEdit" name =" mInitFunctionLineEdit" >
53
- <property name =" toolTip" >
54
- <string >Enter the name of the form init function.</string >
55
- </property >
56
- </widget >
57
- </item >
58
- <item >
71
+ <item row =" 0" column =" 0" >
59
72
<widget class =" QLabel" name =" mInitFilePathLabel" >
60
73
<property name =" text" >
61
74
<string >External file</string >
62
75
</property >
63
76
</widget >
64
77
</item >
65
- <item >
66
- <widget class =" QLineEdit " name =" mInitFilePathLineEdit " />
78
+ <item row = " 0 " column = " 1 " >
79
+ <widget class =" QgsFileWidget " name =" mInitFileWidget " native = " true " />
67
80
</item >
68
- <item >
69
- <widget class =" QToolButton " name =" pbtnSelectInitFilePath " >
81
+ <item row = " 1 " column = " 0 " >
82
+ <widget class =" QLabel " name =" mInitFunctionLabel " >
70
83
<property name =" text" >
71
- <string >… </string >
84
+ <string >Function name </string >
72
85
</property >
73
86
</widget >
74
87
</item >
75
- <item >
76
- <spacer name =" horizontalSpacer_4" >
77
- <property name =" orientation" >
78
- <enum >Qt::Horizontal</enum >
79
- </property >
80
- <property name =" sizeHint" stdset =" 0" >
81
- <size >
82
- <width >0</width >
83
- <height >0</height >
84
- </size >
88
+ <item row =" 1" column =" 1" >
89
+ <widget class =" QLineEdit" name =" mInitFunctionLineEdit" >
90
+ <property name =" toolTip" >
91
+ <string >Enter the name of the form init function.</string >
85
92
</property >
86
- </spacer >
93
+ </widget >
87
94
</item >
88
95
</layout >
89
96
</widget >
90
97
</item >
91
- <item row =" 4 " column =" 0" >
98
+ <item row =" 5 " column =" 0" colspan = " 3 " >
92
99
<widget class =" QDialogButtonBox" name =" buttonBox" >
93
- <property name =" maximumSize" >
94
- <size >
95
- <width >16777215</width >
96
- <height >50</height >
97
- </size >
98
- </property >
99
100
<property name =" orientation" >
100
101
<enum >Qt::Horizontal</enum >
101
102
</property >
104
105
</property >
105
106
</widget >
106
107
</item >
107
- <item row =" 2" column =" 0" >
108
- <widget class =" QgsCodeEditorPython" name =" mInitCodeEditorPython" native =" true" />
109
- </item >
110
- <item row =" 0" column =" 0" >
111
- <widget class =" QWidget" name =" mInitCodeSourceContainter" native =" true" >
112
- <property name =" maximumSize" >
113
- <size >
114
- <width >16777215</width >
115
- <height >50</height >
116
- </size >
108
+ <item row =" 3" column =" 0" colspan =" 3" >
109
+ <widget class =" QgsCodeEditorPython" name =" mInitCodeEditorPython" native =" true" >
110
+ <property name =" sizePolicy" >
111
+ <sizepolicy hsizetype =" Expanding" vsizetype =" Expanding" >
112
+ <horstretch >0</horstretch >
113
+ <verstretch >1</verstretch >
114
+ </sizepolicy >
117
115
</property >
118
- <layout class =" QHBoxLayout" name =" horizontalLayout" >
119
- <item >
120
- <widget class =" QLabel" name =" label_3" >
121
- <property name =" toolTip" >
122
- <string >The function code of the function can be loaded from the source code entered
123
- in this dialog, from an external python file or from the environment (for example
124
- from a plugin or from startup.py).
125
-
126
- An example is:
127
-
128
- rom qgis.PyQt.QtWidgets import QWidget
129
-
130
- def my_form_open(dialog, layer, feature):
131
- geom = feature.geometry()
132
- control = dialog.findChild(QWidget," MyLineEdit" )
133
-
134
- Reference in function name: my_form_open
135
-
136
- </string >
137
- </property >
138
- <property name =" text" >
139
- <string >Python Init function</string >
140
- </property >
141
- </widget >
142
- </item >
143
- <item >
144
- <widget class =" QComboBox" name =" mInitCodeSourceComboBox" >
145
- <property name =" toolTip" >
146
- <string >The function code of the function can be loaded from the source code entered
147
- in this dialog, from an external python file or from the environment (for example
148
- from a plugin or from startup.py).
149
-
150
- An example is:
151
-
152
- rom qgis.PyQt.QtWidgets import QWidget
153
-
154
- def my_form_open(dialog, layer, feature):
155
- geom = feature.geometry()
156
- control = dialog.findChild(QWidget," MyLineEdit" )
157
-
158
- Reference in function name: my_form_open
159
-
160
- </string >
161
- </property >
162
- </widget >
163
- </item >
164
- </layout >
165
116
</widget >
166
117
</item >
167
- <item row =" 3 " column =" 0 " >
118
+ <item row =" 4 " column =" 1 " >
168
119
<spacer name =" verticalSpacer" >
169
120
<property name =" orientation" >
170
121
<enum >Qt::Vertical</enum >
171
122
</property >
172
123
<property name =" sizeHint" stdset =" 0" >
173
124
<size >
174
125
<width >20</width >
175
- <height >40 </height >
126
+ <height >0 </height >
176
127
</size >
177
128
</property >
178
129
</spacer >
@@ -186,6 +137,11 @@ Reference in function name: my_form_open
186
137
<header >qgscodeeditorpython.h</header >
187
138
<container >1</container >
188
139
</customwidget >
140
+ <customwidget >
141
+ <class >QgsFileWidget</class >
142
+ <extends >QWidget</extends >
143
+ <header >qgsfilewidget.h</header >
144
+ </customwidget >
189
145
</customwidgets >
190
146
<resources />
191
147
<connections >
@@ -196,8 +152,8 @@ Reference in function name: my_form_open
196
152
<slot >accept()</slot >
197
153
<hints >
198
154
<hint type =" sourcelabel" >
199
- <x >254 </x >
200
- <y >293 </y >
155
+ <x >248 </x >
156
+ <y >254 </y >
201
157
</hint >
202
158
<hint type =" destinationlabel" >
203
159
<x >157</x >
0 commit comments