本文整理匯總了Python中qgis.gui.QgsProjectionSelectionTreeWidget.show方法的典型用法代碼示例。如果您正苦於以下問題:Python QgsProjectionSelectionTreeWidget.show方法的具體用法?Python QgsProjectionSelectionTreeWidget.show怎麽用?Python QgsProjectionSelectionTreeWidget.show使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qgis.gui.QgsProjectionSelectionTreeWidget
的用法示例。
在下文中一共展示了QgsProjectionSelectionTreeWidget.show方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testTreeWidgetGettersSetters
# 需要導入模塊: from qgis.gui import QgsProjectionSelectionTreeWidget [as 別名]
# 或者: from qgis.gui.QgsProjectionSelectionTreeWidget import show [as 別名]
def testTreeWidgetGettersSetters(self):
""" basic tests for QgsProjectionSelectionTreeWidget """
w = QgsProjectionSelectionTreeWidget()
w.show()
self.assertFalse(w.hasValidSelection())
w.setCrs(QgsCoordinateReferenceSystem('EPSG:3111'))
self.assertEqual(w.crs().authid(), 'EPSG:3111')
self.assertTrue(w.hasValidSelection())
示例2: testTreeWidgetNotSetOption
# 需要導入模塊: from qgis.gui import QgsProjectionSelectionTreeWidget [as 別名]
# 或者: from qgis.gui.QgsProjectionSelectionTreeWidget import show [as 別名]
def testTreeWidgetNotSetOption(self):
""" test allowing no projection option for QgsProjectionSelectionTreeWidget """
w = QgsProjectionSelectionTreeWidget()
w.show()
w.setShowNoProjection(True)
self.assertTrue(w.showNoProjection())
w.setShowNoProjection(False)
self.assertFalse(w.showNoProjection())
w.setShowNoProjection(True)
# no projection should be a valid selection
w.setCrs(QgsCoordinateReferenceSystem())
self.assertTrue(w.hasValidSelection())
self.assertFalse(w.crs().isValid())