def crsTriggered(self, action):
     self.crsButton.setDefaultAction(action)
     self.inputProjection = action.data()
     if self.inputProjection == 3:
         selector = QgsProjectionSelectionDialog()
         selector.setCrs(QgsCoordinateReferenceSystem(self.inputCustomCRS))
         if selector.exec():
             self.inputCustomCRS = selector.crs().authid()
         else:
             self.inputCustomCRS = 'EPSG:4326'
     self.saveSettings()
    def testDialogNotSetOption(self):
        """ test allowing no projection option for QgsProjectionSelectionTreeWidget """
        w = QgsProjectionSelectionDialog()
        w.show()
        w.setShowNoProjection(True)
        self.assertTrue(w.showNoProjection())
        w.setShowNoProjection(False)
        self.assertFalse(w.showNoProjection())

        w.setShowNoProjection(True)
        w.setCrs(QgsCoordinateReferenceSystem())
        self.assertFalse(w.crs().isValid())
 def testDialogGettersSetters(self):
     """ basic tests for QgsProjectionSelectionTreeWidget """
     w = QgsProjectionSelectionDialog()
     w.show()
     w.setCrs(QgsCoordinateReferenceSystem('EPSG:3111'))
     self.assertEqual(w.crs().authid(), 'EPSG:3111')
示例#4
0
 def testDialogGettersSetters(self):
     """ basic tests for QgsProjectionSelectionTreeWidget """
     w = QgsProjectionSelectionDialog()
     w.show()
     w.setCrs(QgsCoordinateReferenceSystem('EPSG:3111'))
     self.assertEqual(w.crs().authid(), 'EPSG:3111')