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)
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)
def test_backgroundColorSerialize(self): """Test backgroundColor serialization""" layer = self.createLayer() color_name = '#ff00ff' container = QgsAttributeEditorContainer('container name', None, QColor('#ff00ff')) doc = QDomDocument() element = container.toDomElement(doc) container2 = QgsAttributeEditorElement.create(element, self.layer.id(), layer.fields(), QgsReadWriteContext(), None) self.assertEqual(container2.backgroundColor().name(), color_name)