本文整理汇总了Python中qgis.core.QgsApplication.pluginLayerRegistry方法的典型用法代码示例。如果您正苦于以下问题:Python QgsApplication.pluginLayerRegistry方法的具体用法?Python QgsApplication.pluginLayerRegistry怎么用?Python QgsApplication.pluginLayerRegistry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qgis.core.QgsApplication
的用法示例。
在下文中一共展示了QgsApplication.pluginLayerRegistry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: unload
# 需要导入模块: from qgis.core import QgsApplication [as 别名]
# 或者: from qgis.core.QgsApplication import pluginLayerRegistry [as 别名]
def unload(self):
# Remove the plugin menu item and icon
self.iface.layerToolBar().removeAction(self.actionAddLayer)
self.iface.removeAddLayerAction(self.actionAddLayer)
self.iface.removePluginRasterMenu(
FreehandRasterGeoreferencer.PLUGIN_MENU, self.actionAddLayer)
# Unregister plugin layer type
QgsApplication.pluginLayerRegistry().removePluginLayerType(
FreehandRasterGeoreferencerLayer.LAYER_TYPE)
QgsProject.instance().layerRemoved.disconnect(self.layerRemoved)
self.iface.currentLayerChanged.disconnect(
self.currentLayerChanged)
del self.toolbar
示例2: testMembers
# 需要导入模块: from qgis.core import QgsApplication [as 别名]
# 或者: from qgis.core.QgsApplication import pluginLayerRegistry [as 别名]
def testMembers(self):
self.assertTrue(QgsApplication.actionScopeRegistry())
# self.assertTrue(QgsApplication.annotationRegistry()) NOT AVAILABLE IN BINDINGS
self.assertTrue(QgsApplication.colorSchemeRegistry())
self.assertTrue(QgsApplication.fieldFormatterRegistry())
self.assertTrue(QgsApplication.gpsConnectionRegistry())
self.assertTrue(QgsApplication.messageLog())
self.assertTrue(QgsApplication.paintEffectRegistry())
self.assertTrue(QgsApplication.pluginLayerRegistry())
self.assertTrue(QgsApplication.processingRegistry())
self.assertTrue(QgsApplication.profiler())
# self.assertTrue(QgsApplication.rasterRendererRegistry()) NOT AVAILABLE IN BINDINGS
self.assertTrue(QgsApplication.rendererRegistry())
self.assertTrue(QgsApplication.svgCache())
self.assertTrue(QgsApplication.symbolLayerRegistry())
self.assertTrue(QgsApplication.taskManager())
示例3: initGui
# 需要导入模块: from qgis.core import QgsApplication [as 别名]
# 或者: from qgis.core.QgsApplication import pluginLayerRegistry [as 别名]
#.........这里部分代码省略.........
self.actionScaleRaster.setObjectName(
"FreehandRasterGeoreferencingLayerPlugin_ScaleRaster")
self.actionScaleRaster.triggered.connect(self.scaleRaster)
self.actionScaleRaster.setCheckable(True)
self.actionAdjustRaster = QAction(
QIcon(":/plugins/freehandrastergeoreferencer/iconAdjust.png"),
"Adjust sides of raster", self.iface.mainWindow())
self.actionAdjustRaster.setObjectName(
"FreehandRasterGeoreferencingLayerPlugin_AdjustRaster")
self.actionAdjustRaster.triggered.connect(self.adjustRaster)
self.actionAdjustRaster.setCheckable(True)
self.actionGeoref2PRaster = QAction(
QIcon(":/plugins/freehandrastergeoreferencer/icon2Points.png"),
"Georeference raster with 2 points", self.iface.mainWindow())
self.actionGeoref2PRaster.setObjectName(
"FreehandRasterGeoreferencingLayerPlugin_Georef2PRaster")
self.actionGeoref2PRaster.triggered.connect(self.georef2PRaster)
self.actionGeoref2PRaster.setCheckable(True)
self.actionIncreaseTransparency = QAction(
QIcon(":/plugins/freehandrastergeoreferencer/"
"iconTransparencyIncrease.png"),
"Increase transparency", self.iface.mainWindow())
self.actionIncreaseTransparency.triggered.connect(
self.increaseTransparency)
self.actionIncreaseTransparency.setShortcut("Alt+Ctrl+N")
self.actionDecreaseTransparency = QAction(
QIcon(":/plugins/freehandrastergeoreferencer/"
"iconTransparencyDecrease.png"),
"Decrease transparency", self.iface.mainWindow())
self.actionDecreaseTransparency.triggered.connect(
self.decreaseTransparency)
self.actionDecreaseTransparency.setShortcut("Alt+Ctrl+B")
self.actionExport = QAction(
QIcon(":/plugins/freehandrastergeoreferencer/iconExport.png"),
"Export raster with world file", self.iface.mainWindow())
self.actionExport.triggered.connect(self.exportGeorefRaster)
self.actionUndo = QAction(QIcon(":/plugins/freehandrastergeoreferencer/iconUndo.png"),
u"Undo", self.iface.mainWindow())
self.actionUndo.triggered.connect(self.undo)
# Add toolbar button and menu item for AddLayer
self.iface.layerToolBar().addAction(self.actionAddLayer)
self.iface.insertAddLayerAction(self.actionAddLayer)
self.iface.addPluginToRasterMenu(
FreehandRasterGeoreferencer.PLUGIN_MENU, self.actionAddLayer)
self.spinBoxRotate = QDoubleSpinBox(self.iface.mainWindow())
self.spinBoxRotate.setDecimals(1)
self.spinBoxRotate.setMinimum(-180)
self.spinBoxRotate.setMaximum(180)
self.spinBoxRotate.setSingleStep(0.1)
self.spinBoxRotate.setValue(0.0)
self.spinBoxRotate.setToolTip("Rotation value (-180 to 180)")
self.spinBoxRotate.setObjectName("FreehandRasterGeoreferencer_spinbox")
self.spinBoxRotate.setKeyboardTracking(False)
self.spinBoxRotate.valueChanged.connect(self.spinBoxRotateValueChangeEvent)
self.spinBoxRotate.setFocusPolicy(Qt.ClickFocus)
self.spinBoxRotate.focusInEvent = self.spinBoxRotateFocusInEvent
# create toolbar for this plugin
self.toolbar = self.iface.addToolBar("Freehand raster georeferencing")
self.toolbar.addAction(self.actionAddLayer)
self.toolbar.addAction(self.actionMoveRaster)
self.toolbar.addAction(self.actionRotateRaster)
self.toolbar.addWidget(self.spinBoxRotate)
self.toolbar.addAction(self.actionScaleRaster)
self.toolbar.addAction(self.actionAdjustRaster)
self.toolbar.addAction(self.actionGeoref2PRaster)
self.toolbar.addAction(self.actionDecreaseTransparency)
self.toolbar.addAction(self.actionIncreaseTransparency)
self.toolbar.addAction(self.actionExport)
self.toolbar.addAction(self.actionUndo)
# Register plugin layer type
self.layerType = FreehandRasterGeoreferencerLayerType(self)
QgsApplication.pluginLayerRegistry().addPluginLayerType(self.layerType)
self.dialogAddLayer = FreehandRasterGeoreferencerDialog()
self.dialogExportGeorefRaster = ExportGeorefRasterDialog()
self.moveTool = MoveRasterMapTool(self.iface)
self.moveTool.setAction(self.actionMoveRaster)
self.rotateTool = RotateRasterMapTool(self.iface)
self.rotateTool.setAction(self.actionRotateRaster)
self.scaleTool = ScaleRasterMapTool(self.iface)
self.scaleTool.setAction(self.actionScaleRaster)
self.adjustTool = AdjustRasterMapTool(self.iface)
self.adjustTool.setAction(self.actionAdjustRaster)
self.georef2PTool = GeorefRasterBy2PointsMapTool(self.iface)
self.georef2PTool.setAction(self.actionGeoref2PRaster)
self.currentTool = None
# default state for toolbar
self.checkCurrentLayerIsPluginLayer()