示例#1
0
    def test_backgroundColorSerialize(self):
        """Test backgroundColor serialization"""

        layer = self.createLayer()
        config = layer.editFormConfig()
        color_name = '#ff00ff'
        container = QgsAttributeEditorContainer('container name', None, QColor('#ff00ff'))
        doc = QDomDocument()
        element = container.toDomElement(doc)
        config = QgsEditFormConfig()
        container2 = config.attributeEditorElementFromDomElement(element, None, self.layer.id())
        self.assertEqual(container2.backgroundColor().name(), color_name)
示例#2
0
    def test_backgroundColorSerialize(self):
        """Test backgroundColor serialization"""

        layer = self.createLayer()
        config = layer.editFormConfig()
        color_name = '#ff00ff'
        container = QgsAttributeEditorContainer('container name', None, QColor('#ff00ff'))
        doc = QDomDocument()
        element = container.toDomElement(doc)
        config = QgsEditFormConfig()
        container2 = config.attributeEditorElementFromDomElement(element, None, self.layer.id())
        self.assertEqual(container2.backgroundColor().name(), color_name)