Skip to content

Commit 7d9f444

Browse files
committed
Move Init function line edit so visible all the time
1 parent 5660bc5 commit 7d9f444

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

src/ui/qgsfieldspropertiesbase.ui

+26-12
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
</property>
9797
</widget>
9898
</item>
99-
<item row="1" column="0" colspan="7">
99+
<item row="3" column="0" colspan="7">
100100
<layout class="QHBoxLayout" name="horizontalLayout_15">
101101
<item>
102102
<widget class="QWidget" name="mAttributesListFrame" native="true"/>
@@ -110,7 +110,7 @@
110110
<item row="1" column="0" colspan="3">
111111
<widget class="QStackedWidget" name="mAttributeEditorOptionsWidget">
112112
<property name="currentIndex">
113-
<number>0</number>
113+
<number>1</number>
114114
</property>
115115
<widget class="QWidget" name="page">
116116
<layout class="QGridLayout" name="gridLayout_2">
@@ -128,16 +128,6 @@
128128
</item>
129129
</layout>
130130
</item>
131-
<item row="1" column="0">
132-
<widget class="QLabel" name="label_3">
133-
<property name="text">
134-
<string>Init function</string>
135-
</property>
136-
</widget>
137-
</item>
138-
<item row="1" column="1">
139-
<widget class="QLineEdit" name="leEditFormInit"/>
140-
</item>
141131
<item row="0" column="0">
142132
<widget class="QLabel" name="label">
143133
<property name="text">
@@ -321,6 +311,30 @@
321311
</property>
322312
</widget>
323313
</item>
314+
<item row="1" column="6">
315+
<widget class="QLineEdit" name="leEditFormInit"/>
316+
</item>
317+
<item row="1" column="5">
318+
<widget class="QLabel" name="label_3">
319+
<property name="toolTip">
320+
<string>QGIS forms can have a Python function that is called when the form is opened.
321+
Use this function to add extra logic to your forms.
322+
323+
An example is (in module MyForms.py):
324+
325+
def open(dialog, layer, feature):
326+
geom = feature.geometry()
327+
control = dialog.findChild(QWidget,&quot;MyLineEdit&quot;)
328+
329+
Reference in Python Init Function like so: MyForms.open
330+
331+
MyForms.py must live on PYTHONPATH, .qgis/python, or inside the project folder.</string>
332+
</property>
333+
<property name="text">
334+
<string>Python Init function</string>
335+
</property>
336+
</widget>
337+
</item>
324338
</layout>
325339
</widget>
326340
<resources>

0 commit comments

Comments
 (0)