本文整理匯總了Python中qgis.gui.QgsMapLayerComboBox類的典型用法代碼示例。如果您正苦於以下問題:Python QgsMapLayerComboBox類的具體用法?Python QgsMapLayerComboBox怎麽用?Python QgsMapLayerComboBox使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了QgsMapLayerComboBox類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
def __init__(self, curPointLayerName, curPolygonLayerName, curFiledName, parent=None):
QtGui.QDialog.__init__(self, parent)
self.resize(300, 100)
Plugin().plPrint("curPointLayerName:: %s" % curPointLayerName)
Plugin().plPrint("curPolygonLayerName:: %s" % curPolygonLayerName)
Plugin().plPrint("curFiledName:: %s" % curFiledName)
self.setWindowTitle(Plugin().getPluginName())
self.__mainLayout = QtGui.QVBoxLayout(self)
self.__layout = QtGui.QGridLayout(self)
# self.__layout.addWidget(QtGui.QLabel(self.tr("Point layer name") + ":"), 0, 0)
l1 = QtGui.QLabel(u"Имя точечного слоя" + ":")
l1.setSizePolicy(
QtGui.QSizePolicy.Preferred,
QtGui.QSizePolicy.Fixed
)
self.__layout.addWidget(l1, 0, 0)
self.pointsLayersComboBox = QgsMapLayerComboBox()
self.pointsLayersComboBox.setSizePolicy(
QtGui.QSizePolicy.Expanding,
QtGui.QSizePolicy.Fixed
)
self.pointsLayersComboBox.setFilters(QgsMapLayerProxyModel.PointLayer)
self.pointsLayersComboBox.setEditable(True)
self.pointsLayersComboBox.setEditText(curPointLayerName)
self.pointsLayersComboBox.layerChanged.connect(self.layerChooze1)
self.__layout.addWidget(self.pointsLayersComboBox, 0, 1)
# self.__layout.addWidget(QtGui.QLabel(self.tr("Field name") + ":"), 2, 0)
self.__layout.addWidget(QtGui.QLabel(u"Имя поля" + ":"), 2, 0)
self.fieldName = QgsFieldComboBox()
self.fieldName.setFilters(QgsFieldProxyModel.Int)
self.fieldName.setEditable(True)
self.fieldName.setEditText(curFiledName)
self.fieldName.fieldChanged.connect(self.filedChooze)
self.__layout.addWidget(self.fieldName, 2, 1)
# self.__layout.addWidget(QtGui.QLabel(self.tr("Polypon layer name") + ":"), 1, 0)
self.__layout.addWidget(QtGui.QLabel(u"Имя полигонального слоя" + ":"), 1, 0)
self.polygonsLayersComboBox = QgsMapLayerComboBox()
self.polygonsLayersComboBox.setFilters(QgsMapLayerProxyModel.PolygonLayer)
self.polygonsLayersComboBox.setEditable(True)
self.polygonsLayersComboBox.setEditText(curPolygonLayerName)
self.polygonsLayersComboBox.layerChanged.connect(self.layerChooze2)
self.polygonsLayersComboBox.layerChanged.connect(self.fieldName.setLayer)
self.__layout.addWidget(self.polygonsLayersComboBox, 1, 1)
# self.startButton = QtGui.QPushButton(self.tr("Start"))
# self.startButton.clicked.connect(self.startCalculation)
# self.__layout.addWidget(self.startButton, 3, 1)
self.__mainLayout.addLayout(self.__layout)
# self.progress = QtGui.QLabel()
# self.__mainLayout.addWidget(self.progress)
self.__bbox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok)
self.__bbox.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
self.__bbox.accepted.connect(self.accept)
self.__mainLayout.addWidget(self.__bbox)
示例2: Ui_selectLayer_dlg
class Ui_selectLayer_dlg(object):
def setupUi(self, selectLayer_dlg):
selectLayer_dlg.setObjectName(_fromUtf8("selectLayer_dlg"))
selectLayer_dlg.resize(400, 101)
self.verticalLayout = QtGui.QVBoxLayout(selectLayer_dlg)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.label = QtGui.QLabel(selectLayer_dlg)
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setObjectName(_fromUtf8("label"))
self.verticalLayout.addWidget(self.label)
self.selectLayer_CBox = QgsMapLayerComboBox(selectLayer_dlg)
self.selectLayer_CBox.setObjectName(_fromUtf8("selectLayer_CBox"))
self.verticalLayout.addWidget(self.selectLayer_CBox)
self.buttonBox = QtGui.QDialogButtonBox(selectLayer_dlg)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.verticalLayout.addWidget(self.buttonBox)
self.retranslateUi(selectLayer_dlg)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), selectLayer_dlg.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), selectLayer_dlg.reject)
QtCore.QMetaObject.connectSlotsByName(selectLayer_dlg)
def retranslateUi(self, selectLayer_dlg):
selectLayer_dlg.setWindowTitle(_translate("selectLayer_dlg", "Dialog", None))
self.label.setText(_translate("selectLayer_dlg", "Select Roads vectotr layer", None))
示例3: add_layer
def add_layer(self):
i = self.dlg.table.rowCount()
self.dlg.table.insertRow(i)
layer = QgsMapLayerComboBox()
layer.setFilters(QgsMapLayerProxyModel.RasterLayer)
band = QTableWidgetItem('1')
band.setFlags(Qt.ItemIsEnabled)
mean = QDoubleSpinBox()
mean.setRange(-10000.00,10000.00)
self.dlg.table.setCellWidget(i, 0, layer)
self.dlg.table.setItem(i, 1, band)
self.dlg.table.setCellWidget(i, 2, mean)
示例4: __init__
def __init__(self, parent=None):
QDialog.__init__(self, parent)
self.resize(500, 100)
self.setWindowTitle("Settings")
layout = QGridLayout(self)
csTargetLayerName = getCSLayerName()
bufferTargetLayerName = getRZLayerName()
csLable = QLabel("Compressor staitions layer:")
csLable.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
layout.addWidget(csLable, 0, 0)
self.__csLayerName = QgsMapLayerComboBox()
self.__csLayerName.setEditable(True)
self.__csLayerName.setFilters(QgsMapLayerProxyModel.PointLayer)
self.__csLayerName.setEditText(csTargetLayerName)
self.__csLayerName.layerChanged.connect(self.csLayerChooze)
self.__csLayerName.editTextChanged.connect(self.csLayernameSave)
self.__csLayerName.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed)
layout.addWidget(self.__csLayerName, 0, 1)
self.__csIdField = QgsFieldComboBox()
self.__csIdField.setEditable(True)
self.__csIdField.fieldChanged.connect(self.csIdFiledChooze)
self.__csIdField.editTextChanged.connect(self.csIdFieldSave)
self.__csIdField.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
self.csIdFieldFill()
layout.addWidget(self.__csIdField, 0, 2)
bufferLable = QLabel("Buffer layer:")
bufferLable.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
layout.addWidget(bufferLable, 1, 0)
# self.__bufferLayerName = QLineEdit(bufferTargetLayerName, self)
# self.__bufferLayerName.editingFinished.connect(self.bufferTargetLayernameSave)
self.__bufferLayerName = QgsMapLayerComboBox()
self.__bufferLayerName.setEditable(True)
self.__bufferLayerName.setFilters(QgsMapLayerProxyModel.PolygonLayer)
self.__bufferLayerName.setEditText(bufferTargetLayerName)
self.__bufferLayerName.layerChanged.connect(self.bufferLayerChooze)
self.__bufferLayerName.editTextChanged.connect(self.bufferLayernameSave)
layout.addWidget(self.__bufferLayerName, 1, 1)
示例5: LayerSelectionDialog
class LayerSelectionDialog(QDialog):
def __init__(self, parent=None):
super().__init__(parent)
self.setWindowTitle(self.tr('Select Extent'))
vl = QVBoxLayout()
vl.addWidget(QLabel(self.tr('Use extent from')))
self.combo = QgsMapLayerComboBox()
self.combo.setFilters(
QgsMapLayerProxyModel.HasGeometry | QgsMapLayerProxyModel.RasterLayer | QgsMapLayerProxyModel.MeshLayer)
self.combo.setShowCrs(ProcessingConfig.getSetting(ProcessingConfig.SHOW_CRS_DEF))
vl.addWidget(self.combo)
self.button_box = QDialogButtonBox()
self.button_box.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok)
self.button_box.accepted.connect(self.accept)
self.button_box.rejected.connect(self.reject)
vl.addWidget(self.button_box)
self.setLayout(vl)
def selected_layer(self):
return self.combo.currentLayer()
示例6: __init__
def __init__(self, parent=None, iface=None, setting=None):
"""Constructor."""
QDialog.__init__(self, parent)
self.setupUi(self)
self.setWindowTitle(self.tr('InaSAFE Field Mapping Tool'))
icon = resources_path('img', 'icons', 'show-mapping-tool.svg')
self.setWindowIcon(QIcon(icon))
self.parent = parent
self.iface = iface
if setting is None:
setting = QSettings()
self.setting = setting
self.keyword_io = KeywordIO()
self.layer = None
self.metadata = {}
self.layer_input_layout = QHBoxLayout()
self.layer_label = QLabel(tr('Layer'))
self.layer_combo_box = QgsMapLayerComboBox()
# Filter only for Polygon and Point
self.layer_combo_box.setFilters(
QgsMapLayerProxyModel.PolygonLayer
| QgsMapLayerProxyModel.PointLayer)
# Filter out a layer that don't have layer groups
excepted_layers = []
for i in range(self.layer_combo_box.count()):
layer = self.layer_combo_box.layer(i)
try:
keywords = self.keyword_io.read_keywords(layer)
except (KeywordNotFoundError, NoKeywordsFoundError):
excepted_layers.append(layer)
continue
layer_purpose = keywords.get('layer_purpose')
if not layer_purpose:
excepted_layers.append(layer)
continue
if layer_purpose == layer_purpose_exposure['key']:
layer_subcategory = keywords.get('exposure')
elif layer_purpose == layer_purpose_hazard['key']:
layer_subcategory = keywords.get('hazard')
else:
layer_subcategory = None
field_groups = get_field_groups(layer_purpose, layer_subcategory)
if len(field_groups) == 0:
excepted_layers.append(layer)
continue
self.layer_combo_box.setExceptedLayerList(excepted_layers)
# Select the active layer.
if self.iface.activeLayer():
found = self.layer_combo_box.findText(
self.iface.activeLayer().name())
if found > -1:
self.layer_combo_box.setLayer(self.iface.activeLayer())
self.field_mapping_widget = None
self.main_stacked_widget.setCurrentIndex(1)
# Input
self.layer_input_layout.addWidget(self.layer_label)
self.layer_input_layout.addWidget(self.layer_combo_box)
self.header_label = QLabel()
self.header_label.setWordWrap(True)
self.main_layout.addWidget(self.header_label)
self.main_layout.addLayout(self.layer_input_layout)
# Signal
self.layer_combo_box.layerChanged.connect(self.set_layer)
if self.layer_combo_box.currentLayer():
self.set_layer(self.layer_combo_box.currentLayer())
# Set up things for context help
self.help_button = self.button_box.button(QDialogButtonBox.Help)
# Allow toggling the help button
self.help_button.setCheckable(True)
self.help_button.toggled.connect(self.help_toggled)
# Set up things for ok button
self.ok_button = self.button_box.button(QDialogButtonBox.Ok)
self.ok_button.clicked.connect(self.accept)
# Set up things for cancel button
self.cancel_button = self.button_box.button(QDialogButtonBox.Cancel)
self.cancel_button.clicked.connect(self.reject)
示例7: FieldMappingDialog
class FieldMappingDialog(QDialog, FORM_CLASS):
"""Dialog implementation class for the InaSAFE field mapping tool."""
def __init__(self, parent=None, iface=None, setting=None):
"""Constructor."""
QDialog.__init__(self, parent)
self.setupUi(self)
self.setWindowTitle(self.tr('InaSAFE Field Mapping Tool'))
icon = resources_path('img', 'icons', 'show-mapping-tool.svg')
self.setWindowIcon(QIcon(icon))
self.parent = parent
self.iface = iface
if setting is None:
setting = QSettings()
self.setting = setting
self.keyword_io = KeywordIO()
self.layer = None
self.metadata = {}
self.layer_input_layout = QHBoxLayout()
self.layer_label = QLabel(tr('Layer'))
self.layer_combo_box = QgsMapLayerComboBox()
# Filter only for Polygon and Point
self.layer_combo_box.setFilters(
QgsMapLayerProxyModel.PolygonLayer
| QgsMapLayerProxyModel.PointLayer)
# Filter out a layer that don't have layer groups
excepted_layers = []
for i in range(self.layer_combo_box.count()):
layer = self.layer_combo_box.layer(i)
try:
keywords = self.keyword_io.read_keywords(layer)
except (KeywordNotFoundError, NoKeywordsFoundError):
excepted_layers.append(layer)
continue
layer_purpose = keywords.get('layer_purpose')
if not layer_purpose:
excepted_layers.append(layer)
continue
if layer_purpose == layer_purpose_exposure['key']:
layer_subcategory = keywords.get('exposure')
elif layer_purpose == layer_purpose_hazard['key']:
layer_subcategory = keywords.get('hazard')
else:
layer_subcategory = None
field_groups = get_field_groups(layer_purpose, layer_subcategory)
if len(field_groups) == 0:
excepted_layers.append(layer)
continue
self.layer_combo_box.setExceptedLayerList(excepted_layers)
# Select the active layer.
if self.iface.activeLayer():
found = self.layer_combo_box.findText(
self.iface.activeLayer().name())
if found > -1:
self.layer_combo_box.setLayer(self.iface.activeLayer())
self.field_mapping_widget = None
self.main_stacked_widget.setCurrentIndex(1)
# Input
self.layer_input_layout.addWidget(self.layer_label)
self.layer_input_layout.addWidget(self.layer_combo_box)
self.header_label = QLabel()
self.header_label.setWordWrap(True)
self.main_layout.addWidget(self.header_label)
self.main_layout.addLayout(self.layer_input_layout)
# Signal
self.layer_combo_box.layerChanged.connect(self.set_layer)
if self.layer_combo_box.currentLayer():
self.set_layer(self.layer_combo_box.currentLayer())
# Set up things for context help
self.help_button = self.button_box.button(QDialogButtonBox.Help)
# Allow toggling the help button
self.help_button.setCheckable(True)
self.help_button.toggled.connect(self.help_toggled)
# Set up things for ok button
self.ok_button = self.button_box.button(QDialogButtonBox.Ok)
self.ok_button.clicked.connect(self.accept)
# Set up things for cancel button
self.cancel_button = self.button_box.button(QDialogButtonBox.Cancel)
self.cancel_button.clicked.connect(self.reject)
def set_layer(self, layer=None, keywords=None):
"""Set layer and update UI accordingly.
:param layer: A QgsVectorLayer.
:type layer: QgsVectorLayer
#.........這裏部分代碼省略.........
示例8: setupUi
#.........這裏部分代碼省略.........
self.horizontalLayout_7 = QtGui.QHBoxLayout()
self.horizontalLayout_7.setObjectName(_fromUtf8("horizontalLayout_7"))
self.checkBox_multilinestrings = QtGui.QCheckBox(self.groupBox)
self.checkBox_multilinestrings.setText(_fromUtf8(""))
self.checkBox_multilinestrings.setChecked(True)
self.checkBox_multilinestrings.setObjectName(_fromUtf8("checkBox_multilinestrings"))
self.horizontalLayout_7.addWidget(self.checkBox_multilinestrings)
self.lineEdit_csv_multilinestrings = QtGui.QLineEdit(self.groupBox)
self.lineEdit_csv_multilinestrings.setPlaceholderText(_fromUtf8(""))
self.lineEdit_csv_multilinestrings.setObjectName(_fromUtf8("lineEdit_csv_multilinestrings"))
self.horizontalLayout_7.addWidget(self.lineEdit_csv_multilinestrings)
self.formLayout_4.setLayout(7, QtGui.QFormLayout.FieldRole, self.horizontalLayout_7)
self.label_12 = QtGui.QLabel(self.groupBox)
self.label_12.setText(_fromUtf8("Multipolygons"))
self.label_12.setObjectName(_fromUtf8("label_12"))
self.formLayout_4.setWidget(8, QtGui.QFormLayout.LabelRole, self.label_12)
self.horizontalLayout_8 = QtGui.QHBoxLayout()
self.horizontalLayout_8.setObjectName(_fromUtf8("horizontalLayout_8"))
self.checkBox_multipolygons = QtGui.QCheckBox(self.groupBox)
self.checkBox_multipolygons.setText(_fromUtf8(""))
self.checkBox_multipolygons.setChecked(True)
self.checkBox_multipolygons.setObjectName(_fromUtf8("checkBox_multipolygons"))
self.horizontalLayout_8.addWidget(self.checkBox_multipolygons)
self.lineEdit_csv_multipolygons = QtGui.QLineEdit(self.groupBox)
self.lineEdit_csv_multipolygons.setPlaceholderText(_fromUtf8(""))
self.lineEdit_csv_multipolygons.setObjectName(_fromUtf8("lineEdit_csv_multipolygons"))
self.horizontalLayout_8.addWidget(self.lineEdit_csv_multipolygons)
self.formLayout_4.setLayout(8, QtGui.QFormLayout.FieldRole, self.horizontalLayout_8)
self.horizontalLayout_3 = QtGui.QHBoxLayout()
self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
self.radioButton_extentLayer = QtGui.QRadioButton(self.groupBox)
self.radioButton_extentLayer.setObjectName(_fromUtf8("radioButton_extentLayer"))
self.horizontalLayout_3.addWidget(self.radioButton_extentLayer)
self.comboBox_extentLayer = QgsMapLayerComboBox(self.groupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.comboBox_extentLayer.sizePolicy().hasHeightForWidth())
self.comboBox_extentLayer.setSizePolicy(sizePolicy)
self.comboBox_extentLayer.setObjectName(_fromUtf8("comboBox_extentLayer"))
self.horizontalLayout_3.addWidget(self.comboBox_extentLayer)
self.formLayout_4.setLayout(3, QtGui.QFormLayout.FieldRole, self.horizontalLayout_3)
self.verticalLayout_2.addLayout(self.formLayout_4)
self.formLayout_2 = QtGui.QFormLayout()
self.formLayout_2.setFieldGrowthPolicy(QtGui.QFormLayout.ExpandingFieldsGrow)
self.formLayout_2.setObjectName(_fromUtf8("formLayout_2"))
self.label_4 = QtGui.QLabel(self.groupBox)
self.label_4.setObjectName(_fromUtf8("label_4"))
self.formLayout_2.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_4)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.lineEdit_browseDir = QtGui.QLineEdit(self.groupBox)
self.lineEdit_browseDir.setObjectName(_fromUtf8("lineEdit_browseDir"))
self.horizontalLayout.addWidget(self.lineEdit_browseDir)
self.pushButton_browse_output_file = QtGui.QPushButton(self.groupBox)
self.pushButton_browse_output_file.setObjectName(_fromUtf8("pushButton_browse_output_file"))
self.horizontalLayout.addWidget(self.pushButton_browse_output_file)
self.formLayout_2.setLayout(0, QtGui.QFormLayout.FieldRole, self.horizontalLayout)
self.label_6 = QtGui.QLabel(self.groupBox)
self.label_6.setObjectName(_fromUtf8("label_6"))
self.formLayout_2.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_6)
self.lineEdit_filePrefix = QtGui.QLineEdit(self.groupBox)
self.lineEdit_filePrefix.setObjectName(_fromUtf8("lineEdit_filePrefix"))
self.formLayout_2.setWidget(1, QtGui.QFormLayout.FieldRole, self.lineEdit_filePrefix)
self.verticalLayout_2.addLayout(self.formLayout_2)
self.verticalLayout.addWidget(self.groupBox)
示例9: Ui_DockWidget
class Ui_DockWidget(object):
def setupUi(self, DockWidget):
DockWidget.setObjectName("DockWidget")
DockWidget.resize(350, 300)
DockWidget.setMinimumSize(QtCore.QSize(366, 353))
DockWidget.setMaximumSize(QtCore.QSize(600, 600))
self.dockWidgetContents = QtWidgets.QWidget()
self.dockWidgetContents.setObjectName("dockWidgetContents")
self.gridLayout_2 = QtWidgets.QGridLayout(self.dockWidgetContents)
self.gridLayout_2.setObjectName("gridLayout_2")
self.label_8 = QtWidgets.QLabel(self.dockWidgetContents)
self.label_8.setMinimumSize(QtCore.QSize(250, 0))
self.label_8.setText("")
self.label_8.setPixmap(QtGui.QPixmap(":/plugins/dzetsaka/img/parcguyane.jpg"))
self.label_8.setObjectName("label_8")
self.gridLayout_2.addWidget(self.label_8, 0, 0, 1, 1)
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setObjectName("gridLayout")
self.label_2 = QtWidgets.QLabel(self.dockWidgetContents)
self.label_2.setMinimumSize(QtCore.QSize(15, 15))
self.label_2.setMaximumSize(QtCore.QSize(15, 15))
self.label_2.setText("")
self.label_2.setPixmap(QtGui.QPixmap(":/plugins/dzetsaka/img/raster.svg"))
self.label_2.setScaledContents(True)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1)
self.inRaster = QgsMapLayerComboBox(self.dockWidgetContents)
self.inRaster.setMinimumSize(QtCore.QSize(200, 0))
self.inRaster.setMaximumSize(QtCore.QSize(16777215, 30))
self.inRaster.setShowCrs(True)
self.inRaster.setObjectName("inRaster")
self.gridLayout.addWidget(self.inRaster, 0, 1, 1, 3)
self.label_3 = QtWidgets.QLabel(self.dockWidgetContents)
self.label_3.setMaximumSize(QtCore.QSize(15, 15))
self.label_3.setText("")
self.label_3.setPixmap(QtGui.QPixmap(":/plugins/dzetsaka/img/vector.svg"))
self.label_3.setScaledContents(True)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 1, 0, 1, 1)
self.inShape = QgsMapLayerComboBox(self.dockWidgetContents)
self.inShape.setMinimumSize(QtCore.QSize(90, 0))
self.inShape.setMaximumSize(QtCore.QSize(16777215, 30))
self.inShape.setShowCrs(True)
self.inShape.setObjectName("inShape")
self.gridLayout.addWidget(self.inShape, 1, 1, 1, 1)
self.label = QtWidgets.QLabel(self.dockWidgetContents)
self.label.setMaximumSize(QtCore.QSize(20, 25))
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 1, 2, 1, 1)
self.checkInModel = QtWidgets.QCheckBox(self.dockWidgetContents)
self.checkInModel.setMinimumSize(QtCore.QSize(110, 0))
self.checkInModel.setMaximumSize(QtCore.QSize(110, 16777215))
self.checkInModel.setObjectName("checkInModel")
self.gridLayout.addWidget(self.checkInModel, 1, 3, 1, 1)
self.label_4 = QtWidgets.QLabel(self.dockWidgetContents)
self.label_4.setMaximumSize(QtCore.QSize(15, 15))
self.label_4.setText("")
self.label_4.setPixmap(QtGui.QPixmap(":/plugins/dzetsaka/img/column.svg"))
self.label_4.setScaledContents(True)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 2, 0, 1, 1)
self.inField = QtWidgets.QComboBox(self.dockWidgetContents)
self.inField.setMinimumSize(QtCore.QSize(90, 0))
self.inField.setMaximumSize(QtCore.QSize(16777215, 30))
self.inField.setObjectName("inField")
self.gridLayout.addWidget(self.inField, 2, 1, 1, 1)
self.inModel = QtWidgets.QLineEdit(self.dockWidgetContents)
self.inModel.setEnabled(False)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.inModel.sizePolicy().hasHeightForWidth())
self.inModel.setSizePolicy(sizePolicy)
self.inModel.setMinimumSize(QtCore.QSize(110, 0))
self.inModel.setMaximumSize(QtCore.QSize(160, 16777215))
self.inModel.setInputMask("")
self.inModel.setText("")
self.inModel.setObjectName("inModel")
self.gridLayout.addWidget(self.inModel, 2, 2, 1, 2)
self.gridLayout_5 = QtWidgets.QGridLayout()
self.gridLayout_5.setObjectName("gridLayout_5")
self.outRaster = QtWidgets.QLineEdit(self.dockWidgetContents)
self.outRaster.setMaximumSize(QtCore.QSize(16777215, 30))
self.outRaster.setObjectName("outRaster")
self.gridLayout_5.addWidget(self.outRaster, 0, 0, 1, 3)
spacerItem = QtWidgets.QSpacerItem(15, 17, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_5.addItem(spacerItem, 1, 0, 1, 1)
self.performMagic = QtWidgets.QToolButton(self.dockWidgetContents)
self.performMagic.setMinimumSize(QtCore.QSize(175, 0))
self.performMagic.setObjectName("performMagic")
self.gridLayout_5.addWidget(self.performMagic, 1, 1, 1, 1)
spacerItem1 = QtWidgets.QSpacerItem(15, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_5.addItem(spacerItem1, 1, 2, 1, 1)
self.settingsButton = QtWidgets.QToolButton(self.dockWidgetContents)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/plugins/dzetsaka/img/settings.png"), QtGui.QIcon.Normal, QtGui.QIcon.On)
self.settingsButton.setIcon(icon)
self.settingsButton.setObjectName("settingsButton")
self.gridLayout_5.addWidget(self.settingsButton, 1, 3, 1, 1)
self.outRasterButton = QtWidgets.QToolButton(self.dockWidgetContents)
#.........這裏部分代碼省略.........
示例10: Ui_apisSearchDialog
class Ui_apisSearchDialog(object):
def setupUi(self, apisSearchDialog):
apisSearchDialog.setObjectName(_fromUtf8("apisSearchDialog"))
apisSearchDialog.resize(314, 557)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/APIS/icons/apis.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
apisSearchDialog.setWindowIcon(icon)
self.dockWidgetContents = QtGui.QWidget()
self.dockWidgetContents.setObjectName(_fromUtf8("dockWidgetContents"))
self.verticalLayout = QtGui.QVBoxLayout(self.dockWidgetContents)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.uiSearchTab = QtGui.QTabWidget(self.dockWidgetContents)
self.uiSearchTab.setEnabled(True)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.uiSearchTab.sizePolicy().hasHeightForWidth())
self.uiSearchTab.setSizePolicy(sizePolicy)
self.uiSearchTab.setObjectName(_fromUtf8("uiSearchTab"))
self.tab_9 = QtGui.QWidget()
self.tab_9.setObjectName(_fromUtf8("tab_9"))
self.verticalLayout_8 = QtGui.QVBoxLayout(self.tab_9)
self.verticalLayout_8.setObjectName(_fromUtf8("verticalLayout_8"))
self.uiSearchImageRBtn = QtGui.QRadioButton(self.tab_9)
self.uiSearchImageRBtn.setChecked(True)
self.uiSearchImageRBtn.setObjectName(_fromUtf8("uiSearchImageRBtn"))
self.verticalLayout_8.addWidget(self.uiSearchImageRBtn)
self.uiSearchSiteRBtn = QtGui.QRadioButton(self.tab_9)
self.uiSearchSiteRBtn.setObjectName(_fromUtf8("uiSearchSiteRBtn"))
self.verticalLayout_8.addWidget(self.uiSearchSiteRBtn)
self.uiSearchFindspotRBtn = QtGui.QRadioButton(self.tab_9)
self.uiSearchFindspotRBtn.setObjectName(_fromUtf8("uiSearchFindspotRBtn"))
self.verticalLayout_8.addWidget(self.uiSearchFindspotRBtn)
self.line_8 = QtGui.QFrame(self.tab_9)
self.line_8.setFrameShape(QtGui.QFrame.HLine)
self.line_8.setFrameShadow(QtGui.QFrame.Sunken)
self.line_8.setObjectName(_fromUtf8("line_8"))
self.verticalLayout_8.addWidget(self.line_8)
self.horizontalLayout_8 = QtGui.QHBoxLayout()
self.horizontalLayout_8.setObjectName(_fromUtf8("horizontalLayout_8"))
self.uiSpatialSearchBtn = QtGui.QPushButton(self.tab_9)
self.uiSpatialSearchBtn.setText(_fromUtf8(""))
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/APIS/icons/search.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.uiSpatialSearchBtn.setIcon(icon1)
self.uiSpatialSearchBtn.setIconSize(QtCore.QSize(24, 24))
self.uiSpatialSearchBtn.setObjectName(_fromUtf8("uiSpatialSearchBtn"))
self.horizontalLayout_8.addWidget(self.uiSpatialSearchBtn)
self.label_13 = QtGui.QLabel(self.tab_9)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_13.sizePolicy().hasHeightForWidth())
self.label_13.setSizePolicy(sizePolicy)
self.label_13.setObjectName(_fromUtf8("label_13"))
self.horizontalLayout_8.addWidget(self.label_13)
self.verticalLayout_8.addLayout(self.horizontalLayout_8)
self.line_9 = QtGui.QFrame(self.tab_9)
self.line_9.setFrameShape(QtGui.QFrame.HLine)
self.line_9.setFrameShadow(QtGui.QFrame.Sunken)
self.line_9.setObjectName(_fromUtf8("line_9"))
self.verticalLayout_8.addWidget(self.line_9)
self.label = QtGui.QLabel(self.tab_9)
self.label.setObjectName(_fromUtf8("label"))
self.verticalLayout_8.addWidget(self.label)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.uiSearchByMapLayerCombo = QgsMapLayerComboBox(self.tab_9)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.uiSearchByMapLayerCombo.sizePolicy().hasHeightForWidth())
self.uiSearchByMapLayerCombo.setSizePolicy(sizePolicy)
self.uiSearchByMapLayerCombo.setObjectName(_fromUtf8("uiSearchByMapLayerCombo"))
self.horizontalLayout.addWidget(self.uiSearchByMapLayerCombo)
self.uiSearchByMapLayerBtn = QtGui.QPushButton(self.tab_9)
self.uiSearchByMapLayerBtn.setEnabled(True)
self.uiSearchByMapLayerBtn.setText(_fromUtf8(""))
self.uiSearchByMapLayerBtn.setIcon(icon1)
self.uiSearchByMapLayerBtn.setObjectName(_fromUtf8("uiSearchByMapLayerBtn"))
self.horizontalLayout.addWidget(self.uiSearchByMapLayerBtn)
self.verticalLayout_8.addLayout(self.horizontalLayout)
self.line_10 = QtGui.QFrame(self.tab_9)
self.line_10.setFrameShape(QtGui.QFrame.HLine)
self.line_10.setFrameShadow(QtGui.QFrame.Sunken)
self.line_10.setObjectName(_fromUtf8("line_10"))
self.verticalLayout_8.addWidget(self.line_10)
self.label_7 = QtGui.QLabel(self.tab_9)
self.label_7.setObjectName(_fromUtf8("label_7"))
self.verticalLayout_8.addWidget(self.label_7)
self.horizontalLayout_10 = QtGui.QHBoxLayout()
self.horizontalLayout_10.setObjectName(_fromUtf8("horizontalLayout_10"))
self.uiSearchByCadastralCommunityCombo = QtGui.QComboBox(self.tab_9)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.uiSearchByCadastralCommunityCombo.sizePolicy().hasHeightForWidth())
self.uiSearchByCadastralCommunityCombo.setSizePolicy(sizePolicy)
self.uiSearchByCadastralCommunityCombo.setEditable(True)
self.uiSearchByCadastralCommunityCombo.setObjectName(_fromUtf8("uiSearchByCadastralCommunityCombo"))
#.........這裏部分代碼省略.........
示例11: setupUi
def setupUi(self, ui_my_queries):
ui_my_queries.setObjectName(_fromUtf8("ui_my_queries"))
ui_my_queries.resize(727, 794)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(ui_my_queries.sizePolicy().hasHeightForWidth())
ui_my_queries.setSizePolicy(sizePolicy)
ui_my_queries.setMinimumSize(QtCore.QSize(225, 262))
self.verticalLayout_3 = QtGui.QVBoxLayout(ui_my_queries)
self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
self.scrollArea = QtGui.QScrollArea(ui_my_queries)
self.scrollArea.setFrameShape(QtGui.QFrame.NoFrame)
self.scrollArea.setFrameShadow(QtGui.QFrame.Plain)
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setObjectName(_fromUtf8("scrollArea"))
self.scrollAreaWidgetContents = QtGui.QWidget()
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 719, 786))
self.scrollAreaWidgetContents.setObjectName(_fromUtf8("scrollAreaWidgetContents"))
self.verticalLayout = QtGui.QVBoxLayout(self.scrollAreaWidgetContents)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.lineEdit_search = QtGui.QLineEdit(self.scrollAreaWidgetContents)
self.lineEdit_search.setObjectName(_fromUtf8("lineEdit_search"))
self.verticalLayout.addWidget(self.lineEdit_search)
self.treeQueries = QtGui.QTreeWidget(self.scrollAreaWidgetContents)
self.treeQueries.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.treeQueries.setColumnCount(1)
self.treeQueries.setObjectName(_fromUtf8("treeQueries"))
self.treeQueries.header().setVisible(False)
self.verticalLayout.addWidget(self.treeQueries)
self.formLayout = QtGui.QFormLayout()
self.formLayout.setObjectName(_fromUtf8("formLayout"))
self.label_2 = QtGui.QLabel(self.scrollAreaWidgetContents)
self.label_2.setText(_fromUtf8("{{geocodeArea:}}"))
self.label_2.setObjectName(_fromUtf8("label_2"))
self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_2)
self.lineEdit_nominatim = QtGui.QLineEdit(self.scrollAreaWidgetContents)
self.lineEdit_nominatim.setObjectName(_fromUtf8("lineEdit_nominatim"))
self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.lineEdit_nominatim)
self.label_5 = QtGui.QLabel(self.scrollAreaWidgetContents)
self.label_5.setText(_fromUtf8("{{bbox}}"))
self.label_5.setObjectName(_fromUtf8("label_5"))
self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_5)
self.radioButton_extentMapCanvas = QtGui.QRadioButton(self.scrollAreaWidgetContents)
self.radioButton_extentMapCanvas.setChecked(True)
self.radioButton_extentMapCanvas.setObjectName(_fromUtf8("radioButton_extentMapCanvas"))
self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.radioButton_extentMapCanvas)
self.horizontalLayout_5 = QtGui.QHBoxLayout()
self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5"))
self.radioButton_extentLayer = QtGui.QRadioButton(self.scrollAreaWidgetContents)
self.radioButton_extentLayer.setObjectName(_fromUtf8("radioButton_extentLayer"))
self.horizontalLayout_5.addWidget(self.radioButton_extentLayer)
self.comboBox_extentLayer = QgsMapLayerComboBox(self.scrollAreaWidgetContents)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.comboBox_extentLayer.sizePolicy().hasHeightForWidth())
self.comboBox_extentLayer.setSizePolicy(sizePolicy)
self.comboBox_extentLayer.setObjectName(_fromUtf8("comboBox_extentLayer"))
self.horizontalLayout_5.addWidget(self.comboBox_extentLayer)
self.formLayout.setLayout(2, QtGui.QFormLayout.FieldRole, self.horizontalLayout_5)
self.verticalLayout.addLayout(self.formLayout)
self.groupBox = QgsCollapsibleGroupBox(self.scrollAreaWidgetContents)
self.groupBox.setChecked(False)
self.groupBox.setObjectName(_fromUtf8("groupBox"))
self.verticalLayout_2 = QtGui.QVBoxLayout(self.groupBox)
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
self.formLayout_4 = QtGui.QFormLayout()
self.formLayout_4.setFieldGrowthPolicy(QtGui.QFormLayout.ExpandingFieldsGrow)
self.formLayout_4.setObjectName(_fromUtf8("formLayout_4"))
self.label_7 = QtGui.QLabel(self.groupBox)
self.label_7.setText(_fromUtf8(""))
self.label_7.setObjectName(_fromUtf8("label_7"))
self.formLayout_4.setWidget(6, QtGui.QFormLayout.FieldRole, self.label_7)
self.label_3 = QtGui.QLabel(self.groupBox)
self.label_3.setObjectName(_fromUtf8("label_3"))
self.formLayout_4.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_3)
self.label_10 = QtGui.QLabel(self.groupBox)
self.label_10.setText(_fromUtf8("Points"))
self.label_10.setObjectName(_fromUtf8("label_10"))
self.formLayout_4.setWidget(2, QtGui.QFormLayout.LabelRole, self.label_10)
self.horizontalLayout_4 = QtGui.QHBoxLayout()
self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
self.checkBox_points = QtGui.QCheckBox(self.groupBox)
self.checkBox_points.setText(_fromUtf8(""))
self.checkBox_points.setChecked(True)
self.checkBox_points.setObjectName(_fromUtf8("checkBox_points"))
self.horizontalLayout_4.addWidget(self.checkBox_points)
self.lineEdit_csv_points = QtGui.QLineEdit(self.groupBox)
self.lineEdit_csv_points.setInputMask(_fromUtf8(""))
self.lineEdit_csv_points.setText(_fromUtf8(""))
self.lineEdit_csv_points.setPlaceholderText(_fromUtf8("col1,col2,col3"))
self.lineEdit_csv_points.setObjectName(_fromUtf8("lineEdit_csv_points"))
self.horizontalLayout_4.addWidget(self.lineEdit_csv_points)
self.formLayout_4.setLayout(2, QtGui.QFormLayout.FieldRole, self.horizontalLayout_4)
self.horizontalLayout_6 = QtGui.QHBoxLayout()
self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6"))
self.checkBox_lines = QtGui.QCheckBox(self.groupBox)
self.checkBox_lines.setText(_fromUtf8(""))
self.checkBox_lines.setChecked(True)
#.........這裏部分代碼省略.........
示例12: Viewer
class Viewer(ViewerBase, ViewerClass):
trackingChanged = pyqtSignal(bool)
setLocationTriggered = pyqtSignal()
updateFeatures = pyqtSignal(bool)
layerChanged = pyqtSignal(QgsMapLayer)
clearLine = pyqtSignal()
closed = pyqtSignal()
def __init__(self, callbackobject, parent=None):
"""Constructor."""
super(Viewer, self).__init__(parent)
self.setupUi(self)
self.callbackobject = callbackobject
self.frame = self.webview.page().mainFrame()
self.actiongroup = QActionGroup(self)
self.actiongroup.setExclusive(True)
self.actiongroup.triggered.connect(self.action_triggered)
self.measuredialog = MeasureDialog(self)
self.toolbar = QToolBar()
self.qgisTrackButton = self.toolbar.addAction("QGIS Track")
self.qgisTrackButton.setIcon(QIcon(":/icons/track"))
self.qgisTrackButton.setCheckable(True)
self.qgisTrackButton.setChecked(True)
self.qgisTrackButton.toggled.connect(self.trackingChanged.emit)
self.setlocationaction = self.toolbar.addAction("Set location")
self.setlocationaction.setIcon(QIcon(":/icons/location"))
self.setlocationaction.triggered.connect(self.setLocationTriggered.emit)
self.setlocationaction.setCheckable(True)
self.viewfeatures = self.toolbar.addAction("Load QGIS Features")
self.viewfeatures.setIcon(QIcon(":/icons/features"))
self.viewfeatures.setCheckable(True)
self.viewfeatures.setChecked(True)
self.viewfeatures.toggled.connect(self.updateFeatures.emit)
spacer = QWidget()
spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self.toolbar.addWidget(spacer)
self.measureaction = self.toolbar.addAction("measure")
self.measureaction.setObjectName("Measure")
self.measureaction.setIcon(QIcon(":/icons/measure"))
self.measureaction.setCheckable(True)
self.infoaction = self.toolbar.addAction("Info")
self.infoaction.setObjectName("Info")
self.infoaction.setIcon(QIcon(":/icons/info"))
self.infoaction.setCheckable(True)
self.selectaction = self.toolbar.addAction("Select")
self.selectaction.setObjectName("Select")
self.selectaction.setIcon(QIcon(":/icons/select"))
self.selectaction.setCheckable(True)
self.toolbar.addSeparator()
self.deleteaction = self.toolbar.addAction("Delete")
self.deleteaction.setIcon(QIcon(":/icons/delete"))
self.deleteaction.triggered.connect(self.delete_selected)
self.deleteaction.setEnabled(False)
self.addaction = self.toolbar.addAction("Add")
self.addaction.setObjectName("Add")
self.addaction.setIcon(QIcon(":/icons/add"))
self.addaction.setCheckable(True)
self.moveaction = self.toolbar.addAction("Move")
self.moveaction.setObjectName("Move")
self.moveaction.setIcon(QIcon(":/icons/move"))
self.moveaction.setCheckable(True)
self.actiongroup.addAction(self.moveaction)
self.actiongroup.addAction(self.addaction)
self.actiongroup.addAction(self.infoaction)
self.actiongroup.addAction(self.measureaction)
self.actiongroup.addAction(self.selectaction)
self.activelayercombo = QgsMapLayerComboBox()
self.activelayercombo.layerChanged.connect(self.layer_changed)
self.activelayeraction = self.toolbar.addWidget(self.activelayercombo)
self.activelayercombo.setSizeAdjustPolicy(QComboBox.AdjustToContents)
self.activelayercombo.currentIndexChanged.connect(self.index_changed)
self.zvaluecheck = QCheckBox()
self.zvaluecheck.setChecked(True)
self.zvaluecheck.setText("Copy Z value")
self.zvaluecheck.setToolTip("Copy Z value from viewer to new features in QGIS. Must have a field named Z to enable")
self.zvalueaction = self.toolbar.addWidget(self.zvaluecheck)
self.dockWidgetContents.layout().insertWidget(0, self.toolbar)
self.webview.settings().setAttribute(QWebSettings.PluginsEnabled, True)
self.webview.settings().setAttribute(QWebSettings.JavascriptEnabled, True)
self.webview.settings().setAttribute(QWebSettings.DeveloperExtrasEnabled, True)
self.frame.setScrollBarPolicy(Qt.Horizontal, Qt.ScrollBarAlwaysOff)
self.frame.setScrollBarPolicy(Qt.Vertical, Qt.ScrollBarAlwaysOff)
self.frame.javaScriptWindowObjectCleared.connect(self.addcallbackobject)
#.........這裏部分代碼省略.........
示例13: __init__
def __init__(
self,
curPointsLayerFrom,
curPointsLayerTo,
curFNIdFrom,
curFNLink,
curFNIdTo,
curResultLayerName,
parent=None):
QtGui.QDialog.__init__(self, parent)
self.resize(500, 200)
self.setWindowTitle(QgisPlugin().pluginName)
self.__mainLayout = QtGui.QVBoxLayout(self)
self.__layout = QtGui.QGridLayout(self)
l1 = QtGui.QLabel(self.tr(u"Point layer 'FROM'") + ":")
l1.setSizePolicy(
QtGui.QSizePolicy.Preferred,
QtGui.QSizePolicy.Fixed
)
self.__layout.addWidget(l1, 0, 0)
self.pointsLayerFrom = QgsMapLayerComboBox()
self.pointsLayerFrom.setSizePolicy(
QtGui.QSizePolicy.Expanding,
QtGui.QSizePolicy.Fixed
)
self.pointsLayerFrom.setFilters(QgsMapLayerProxyModel.PointLayer)
self.pointsLayerFrom.setEditable(True)
# self.pointsLayerFrom.setEditText(curPointsLayerFrom)
self.pointsLayerFrom.layerChanged.connect(self.choozeLayerFrom)
self.__layout.addWidget(self.pointsLayerFrom, 0, 1)
l2 = QtGui.QLabel(self.tr(u"Point layer 'TO'") + ":")
l2.setSizePolicy(
QtGui.QSizePolicy.Preferred,
QtGui.QSizePolicy.Fixed
)
self.__layout.addWidget(l2, 1, 0)
self.pointsLayerTo = QgsMapLayerComboBox()
self.pointsLayerTo.setSizePolicy(
QtGui.QSizePolicy.Expanding,
QtGui.QSizePolicy.Fixed
)
self.pointsLayerTo.setFilters(QgsMapLayerProxyModel.PointLayer)
self.pointsLayerTo.setEditable(True)
# self.pointsLayerTo.setEditText(curPointsLayerTo)
self.pointsLayerTo.layerChanged.connect(self.choozeLayerTo)
self.__layout.addWidget(self.pointsLayerTo, 1, 1)
self.__layout.addWidget(
QtGui.QLabel(self.tr(u"Point 'FROM' id field") + ":"),
2, 0
)
self.fnIdFrom = QgsFieldComboBox()
self.fnIdFrom.setFilters(QgsFieldProxyModel.Int | QgsFieldProxyModel.LongLong)
self.fnIdFrom.setEditable(True)
# self.fnIdFrom.setEditText(curFNIdFrom)
self.fnIdFrom.fieldChanged.connect(self.filedChooze)
self.__layout.addWidget(self.fnIdFrom, 2, 1)
self.__layout.addWidget(
QtGui.QLabel(self.tr(u"Link field") + ":"),
3, 0
)
self.fnLink = QgsFieldComboBox()
self.fnLink.setFilters(QgsFieldProxyModel.Int | QgsFieldProxyModel.LongLong)
self.fnLink.setEditable(True)
# self.fnLink.setEditText(curFNLink)
self.fnLink.fieldChanged.connect(self.filedChooze)
self.__layout.addWidget(self.fnLink, 3, 1)
self.__layout.addWidget(
QtGui.QLabel(self.tr(u"Point 'TO' id field") + ":"), 4, 0)
self.fnIdTo = QgsFieldComboBox()
self.fnIdTo.setFilters(QgsFieldProxyModel.Int | QgsFieldProxyModel.LongLong)
self.fnIdTo.setEditable(True)
# self.fnIdTo.setEditText(curFNIdTo)
self.fnIdTo.fieldChanged.connect(self.filedChooze)
self.__layout.addWidget(self.fnIdTo, 4, 1)
self.__layout.addWidget(
QtGui.QLabel(self.tr(u"Save result in layer") + ":"),
5, 0
)
self.linesLayer = QgsMapLayerComboBox()
self.linesLayer.setSizePolicy(
QtGui.QSizePolicy.Expanding,
QtGui.QSizePolicy.Fixed
)
self.linesLayer.setFilters(QgsMapLayerProxyModel.LineLayer)
self.linesLayer.setEditable(True)
self.linesLayer.layerChanged.connect(self.choozeResultLayer)
self.__layout.addWidget(self.linesLayer, 5, 1)
# self.__layout4resultFileChoose = QtGui.QHBoxLayout()
# self.leResultFilename = QtGui.QLineEdit(curResultFilename)
# self.__layout4resultFileChoose.addWidget(self.leResultFilename)
# self.pbChooseResultFilename = QtGui.QPushButton(u"Выбрать")
#.........這裏部分代碼省略.........
示例14: Dialog
class Dialog(QtGui.QDialog):
def __init__(
self,
curPointsLayerFrom,
curPointsLayerTo,
curFNIdFrom,
curFNLink,
curFNIdTo,
curResultLayerName,
parent=None):
QtGui.QDialog.__init__(self, parent)
self.resize(500, 200)
self.setWindowTitle(QgisPlugin().pluginName)
self.__mainLayout = QtGui.QVBoxLayout(self)
self.__layout = QtGui.QGridLayout(self)
l1 = QtGui.QLabel(self.tr(u"Point layer 'FROM'") + ":")
l1.setSizePolicy(
QtGui.QSizePolicy.Preferred,
QtGui.QSizePolicy.Fixed
)
self.__layout.addWidget(l1, 0, 0)
self.pointsLayerFrom = QgsMapLayerComboBox()
self.pointsLayerFrom.setSizePolicy(
QtGui.QSizePolicy.Expanding,
QtGui.QSizePolicy.Fixed
)
self.pointsLayerFrom.setFilters(QgsMapLayerProxyModel.PointLayer)
self.pointsLayerFrom.setEditable(True)
# self.pointsLayerFrom.setEditText(curPointsLayerFrom)
self.pointsLayerFrom.layerChanged.connect(self.choozeLayerFrom)
self.__layout.addWidget(self.pointsLayerFrom, 0, 1)
l2 = QtGui.QLabel(self.tr(u"Point layer 'TO'") + ":")
l2.setSizePolicy(
QtGui.QSizePolicy.Preferred,
QtGui.QSizePolicy.Fixed
)
self.__layout.addWidget(l2, 1, 0)
self.pointsLayerTo = QgsMapLayerComboBox()
self.pointsLayerTo.setSizePolicy(
QtGui.QSizePolicy.Expanding,
QtGui.QSizePolicy.Fixed
)
self.pointsLayerTo.setFilters(QgsMapLayerProxyModel.PointLayer)
self.pointsLayerTo.setEditable(True)
# self.pointsLayerTo.setEditText(curPointsLayerTo)
self.pointsLayerTo.layerChanged.connect(self.choozeLayerTo)
self.__layout.addWidget(self.pointsLayerTo, 1, 1)
self.__layout.addWidget(
QtGui.QLabel(self.tr(u"Point 'FROM' id field") + ":"),
2, 0
)
self.fnIdFrom = QgsFieldComboBox()
self.fnIdFrom.setFilters(QgsFieldProxyModel.Int | QgsFieldProxyModel.LongLong)
self.fnIdFrom.setEditable(True)
# self.fnIdFrom.setEditText(curFNIdFrom)
self.fnIdFrom.fieldChanged.connect(self.filedChooze)
self.__layout.addWidget(self.fnIdFrom, 2, 1)
self.__layout.addWidget(
QtGui.QLabel(self.tr(u"Link field") + ":"),
3, 0
)
self.fnLink = QgsFieldComboBox()
self.fnLink.setFilters(QgsFieldProxyModel.Int | QgsFieldProxyModel.LongLong)
self.fnLink.setEditable(True)
# self.fnLink.setEditText(curFNLink)
self.fnLink.fieldChanged.connect(self.filedChooze)
self.__layout.addWidget(self.fnLink, 3, 1)
self.__layout.addWidget(
QtGui.QLabel(self.tr(u"Point 'TO' id field") + ":"), 4, 0)
self.fnIdTo = QgsFieldComboBox()
self.fnIdTo.setFilters(QgsFieldProxyModel.Int | QgsFieldProxyModel.LongLong)
self.fnIdTo.setEditable(True)
# self.fnIdTo.setEditText(curFNIdTo)
self.fnIdTo.fieldChanged.connect(self.filedChooze)
self.__layout.addWidget(self.fnIdTo, 4, 1)
self.__layout.addWidget(
QtGui.QLabel(self.tr(u"Save result in layer") + ":"),
5, 0
)
self.linesLayer = QgsMapLayerComboBox()
self.linesLayer.setSizePolicy(
QtGui.QSizePolicy.Expanding,
QtGui.QSizePolicy.Fixed
)
self.linesLayer.setFilters(QgsMapLayerProxyModel.LineLayer)
self.linesLayer.setEditable(True)
self.linesLayer.layerChanged.connect(self.choozeResultLayer)
self.__layout.addWidget(self.linesLayer, 5, 1)
# self.__layout4resultFileChoose = QtGui.QHBoxLayout()
# self.leResultFilename = QtGui.QLineEdit(curResultFilename)
# self.__layout4resultFileChoose.addWidget(self.leResultFilename)
#.........這裏部分代碼省略.........
示例15: setupUi
def setupUi(self, ContourDialog):
ContourDialog.setObjectName("ContourDialog")
ContourDialog.setWindowModality(QtCore.Qt.NonModal)
ContourDialog.resize(655, 742)
ContourDialog.setSizeGripEnabled(True)
self.verticalLayout = QtWidgets.QVBoxLayout(ContourDialog)
self.verticalLayout.setObjectName("verticalLayout")
self.scrollArea_2 = QtWidgets.QScrollArea(ContourDialog)
self.scrollArea_2.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.scrollArea_2.setWidgetResizable(True)
self.scrollArea_2.setObjectName("scrollArea_2")
self.scrollAreaWidgetContents_2 = QtWidgets.QWidget()
self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 641, 654))
self.scrollAreaWidgetContents_2.setObjectName("scrollAreaWidgetContents_2")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents_2)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.groupBox_2 = QtWidgets.QGroupBox(self.scrollAreaWidgetContents_2)
self.groupBox_2.setObjectName("groupBox_2")
self.gridLayout = QtWidgets.QGridLayout(self.groupBox_2)
self.gridLayout.setObjectName("gridLayout")
self.formLayout_2 = QtWidgets.QFormLayout()
self.formLayout_2.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
self.formLayout_2.setContentsMargins(-1, 0, -1, -1)
self.formLayout_2.setObjectName("formLayout_2")
self.label_3 = QtWidgets.QLabel(self.groupBox_2)
self.label_3.setObjectName("label_3")
self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_3)
self.uSourceLayer = QgsMapLayerComboBox(self.groupBox_2)
self.uSourceLayer.setObjectName("uSourceLayer")
self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.uSourceLayer)
self.label_4 = QtWidgets.QLabel(self.groupBox_2)
self.label_4.setObjectName("label_4")
self.formLayout_2.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.label_4)
self.uDataField = QgsFieldExpressionWidget(self.groupBox_2)
self.uDataField.setObjectName("uDataField")
self.formLayout_2.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.uDataField)
self.uSelectedOnly = QtWidgets.QCheckBox(self.groupBox_2)
self.uSelectedOnly.setObjectName("uSelectedOnly")
self.formLayout_2.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.uSelectedOnly)
self.gridLayout.addLayout(self.formLayout_2, 1, 0, 1, 1)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.label_2 = QtWidgets.QLabel(self.groupBox_2)
self.label_2.setObjectName("label_2")
self.horizontalLayout.addWidget(self.label_2)
self.uRemoveDuplicates = QtWidgets.QCheckBox(self.groupBox_2)
self.uRemoveDuplicates.setText("")
self.uRemoveDuplicates.setObjectName("uRemoveDuplicates")
self.horizontalLayout.addWidget(self.uRemoveDuplicates)
self.label_11 = QtWidgets.QLabel(self.groupBox_2)
self.label_11.setObjectName("label_11")
self.horizontalLayout.addWidget(self.label_11)
self.uDuplicateTolerance = QtWidgets.QDoubleSpinBox(self.groupBox_2)
self.uDuplicateTolerance.setDecimals(3)
self.uDuplicateTolerance.setMinimum(0.001)
self.uDuplicateTolerance.setMaximum(99999.999)
self.uDuplicateTolerance.setSingleStep(0.001)
self.uDuplicateTolerance.setProperty("value", 0.001)
self.uDuplicateTolerance.setObjectName("uDuplicateTolerance")
self.horizontalLayout.addWidget(self.uDuplicateTolerance)
self.uUseGridLabel = QtWidgets.QLabel(self.groupBox_2)
self.uUseGridLabel.setEnabled(True)
self.uUseGridLabel.setObjectName("uUseGridLabel")
self.horizontalLayout.addWidget(self.uUseGridLabel)
self.uUseGrid = QtWidgets.QCheckBox(self.groupBox_2)
self.uUseGrid.setText("")
self.uUseGrid.setObjectName("uUseGrid")
self.horizontalLayout.addWidget(self.uUseGrid)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.gridLayout.addLayout(self.horizontalLayout, 3, 0, 1, 1)
self.uLayerDescription = QtWidgets.QLabel(self.groupBox_2)
self.uLayerDescription.setText("")
self.uLayerDescription.setObjectName("uLayerDescription")
self.gridLayout.addWidget(self.uLayerDescription, 4, 0, 1, 1)
self.verticalLayout_2.addWidget(self.groupBox_2)
self.groupBox = QtWidgets.QGroupBox(self.scrollAreaWidgetContents_2)
self.groupBox.setObjectName("groupBox")
self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox)
self.gridLayout_2.setObjectName("gridLayout_2")
self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
self.uLinesContours = QtWidgets.QRadioButton(self.groupBox)
self.uLinesContours.setObjectName("uLinesContours")
self.horizontalLayout_7.addWidget(self.uLinesContours)
self.uFilledContours = QtWidgets.QRadioButton(self.groupBox)
self.uFilledContours.setObjectName("uFilledContours")
self.horizontalLayout_7.addWidget(self.uFilledContours)
self.uBoth = QtWidgets.QRadioButton(self.groupBox)
self.uBoth.setObjectName("uBoth")
self.horizontalLayout_7.addWidget(self.uBoth)
self.uLayerContours = QtWidgets.QRadioButton(self.groupBox)
self.uLayerContours.setObjectName("uLayerContours")
self.horizontalLayout_7.addWidget(self.uLayerContours)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(spacerItem1)
self.gridLayout_2.addLayout(self.horizontalLayout_7, 0, 0, 1, 3)
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem2, 10, 1, 1, 1)
self.label_5 = QtWidgets.QLabel(self.groupBox)
#.........這裏部分代碼省略.........