本文整理匯總了Python中qgis.gui.QgsMapLayerComboBox.setShowCrs方法的典型用法代碼示例。如果您正苦於以下問題:Python QgsMapLayerComboBox.setShowCrs方法的具體用法?Python QgsMapLayerComboBox.setShowCrs怎麽用?Python QgsMapLayerComboBox.setShowCrs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qgis.gui.QgsMapLayerComboBox
的用法示例。
在下文中一共展示了QgsMapLayerComboBox.setShowCrs方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: LayerSelectionDialog
# 需要導入模塊: from qgis.gui import QgsMapLayerComboBox [as 別名]
# 或者: from qgis.gui.QgsMapLayerComboBox import setShowCrs [as 別名]
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()
示例2: Ui_DockWidget
# 需要導入模塊: from qgis.gui import QgsMapLayerComboBox [as 別名]
# 或者: from qgis.gui.QgsMapLayerComboBox import setShowCrs [as 別名]
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)
#.........這裏部分代碼省略.........