Answers:
您将需要一些python来执行此操作。
您可以在这里阅读这篇非常不错的博客文章
创建类似于以下脚本的脚本FillForm.py并将其放置在项目旁边
from PyQt4.QtCore import *
from PyQt4.QtGui import *
aField = None
bField = None
def formOpen(dialog,layerid,featureid):
global aField
aField = dialog.findChild(QComboBox,"fieldA")
global bField
bField = dialog.findChild(QLineEdit,"fieldB")
aField.currentIndexChanged.connect( aChanged )
def aChanged( value ):
if ( aField.currentText() == 'A' )
bField.setText( '1' )
elif ( aField.currentText() == 'B' )
bField.setText( '2' )
转到矢量层属性 => 常规,然后在Init函数行编辑中输入FormFill.formOpen 。