mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Merge pull request #4776 from pblottiere/bugfix_attributetable
[bugfix] attribute table
This commit is contained in:
commit
f59d6d7962
@ -348,6 +348,7 @@ void QgsVectorLayerJoinBuffer::resolveReferences( QgsProject *project )
|
||||
if ( QgsVectorLayer *joinedLayer = qobject_cast<QgsVectorLayer *>( project->mapLayer( it->joinLayerId() ) ) )
|
||||
{
|
||||
it->setJoinLayer( joinedLayer );
|
||||
connectJoinedLayer( joinedLayer );
|
||||
resolved = true;
|
||||
}
|
||||
}
|
||||
|
@ -303,7 +303,8 @@ void QgsAttributeTableModel::attributeValueChanged( QgsFeatureId fid, int idx, c
|
||||
// No filter request: skip all possibly heavy checks
|
||||
if ( mFeatureRequest.filterType() == QgsFeatureRequest::FilterNone )
|
||||
{
|
||||
setData( index( idToRow( fid ), fieldCol( idx ) ), value, Qt::EditRole );
|
||||
if ( loadFeatureAtId( fid ) )
|
||||
setData( index( idToRow( fid ), fieldCol( idx ) ), value, Qt::EditRole );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -91,6 +91,35 @@ class TestQgsAttributeTableModel(unittest.TestCase):
|
||||
|
||||
self.assertEqual(self.am.columnCount(), 1)
|
||||
|
||||
def testEdit(self):
|
||||
fid = 2
|
||||
field_idx = 1
|
||||
new_value = 333
|
||||
|
||||
# get the same feature from model and layer
|
||||
feature = self.layer.getFeature(fid)
|
||||
model_index = self.am.idToIndex(fid)
|
||||
feature_model = self.am.feature(model_index)
|
||||
|
||||
# check that feature from layer and model are sync
|
||||
self.assertEqual(feature.attribute(field_idx), feature_model.attribute(field_idx))
|
||||
|
||||
# change attribute value for a feature and commit
|
||||
self.layer.startEditing()
|
||||
self.layer.changeAttributeValue(fid, field_idx, new_value)
|
||||
self.layer.commitChanges()
|
||||
|
||||
# check the feature in layer is good
|
||||
feature = self.layer.getFeature(fid)
|
||||
self.assertEqual(feature.attribute(field_idx), new_value)
|
||||
|
||||
# get the same feature from model and layer
|
||||
model_index = self.am.idToIndex(fid)
|
||||
feature_model = self.am.feature(model_index)
|
||||
|
||||
# check that index from layer and model are sync
|
||||
self.assertEqual(feature.attribute(field_idx), feature_model.attribute(field_idx))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -36,6 +36,7 @@ from qgis.core import (QgsWkbTypes,
|
||||
QgsSymbol,
|
||||
QgsSingleSymbolRenderer,
|
||||
QgsCoordinateReferenceSystem,
|
||||
QgsVectorLayerCache,
|
||||
QgsReadWriteContext,
|
||||
QgsProject,
|
||||
QgsUnitTypes,
|
||||
@ -54,6 +55,9 @@ from qgis.core import (QgsWkbTypes,
|
||||
QgsTextFormat,
|
||||
QgsVectorLayerSelectedFeatureSource,
|
||||
NULL)
|
||||
from qgis.gui import (QgsAttributeTableModel,
|
||||
QgsGui
|
||||
)
|
||||
from qgis.testing import start_app, unittest
|
||||
from featuresourcetestbase import FeatureSourceTestCase
|
||||
from utilities import unitTestDataPath
|
||||
@ -209,6 +213,7 @@ class TestQgsVectorLayer(unittest.TestCase, FeatureSourceTestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Run before all tests"""
|
||||
QgsGui.editorWidgetRegistry().initEditors()
|
||||
# Create test layer for FeatureSourceTestCase
|
||||
cls.source = cls.getSource()
|
||||
|
||||
@ -1321,6 +1326,65 @@ class TestQgsVectorLayer(unittest.TestCase, FeatureSourceTestCase):
|
||||
self.assertEqual(layer.maximumValue(3), 321)
|
||||
self.assertEqual(set(layer.uniqueValues(3)), set([111, 321]))
|
||||
|
||||
def test_valid_join_when_opening_project(self):
|
||||
join_field = "id"
|
||||
fid = 4
|
||||
attr_idx = 4
|
||||
join_attr_idx = 1
|
||||
new_value = 33.0
|
||||
|
||||
# read project and get layers
|
||||
myPath = os.path.join(unitTestDataPath(), 'joins.qgs')
|
||||
rc = QgsProject.instance().read(myPath)
|
||||
|
||||
layer = QgsProject.instance().mapLayersByName("polys_with_id")[0]
|
||||
join_layer = QgsProject.instance().mapLayersByName("polys_overlapping_with_id")[0]
|
||||
|
||||
# create an attribute table for the main_layer and the
|
||||
# joined layer
|
||||
cache = QgsVectorLayerCache(layer, 100)
|
||||
am = QgsAttributeTableModel(cache)
|
||||
am.loadLayer()
|
||||
|
||||
join_cache = QgsVectorLayerCache(join_layer, 100)
|
||||
join_am = QgsAttributeTableModel(join_cache)
|
||||
join_am.loadLayer()
|
||||
|
||||
# check feature value of a joined field from the attribute model
|
||||
model_index = am.idToIndex(fid)
|
||||
feature_model = am.feature(model_index)
|
||||
|
||||
join_model_index = join_am.idToIndex(fid)
|
||||
join_feature_model = join_am.feature(join_model_index)
|
||||
|
||||
self.assertEqual(feature_model.attribute(attr_idx), join_feature_model.attribute(join_attr_idx))
|
||||
|
||||
# change attribute value for a feature of the joined layer
|
||||
join_layer.startEditing()
|
||||
join_layer.changeAttributeValue(fid, join_attr_idx, new_value)
|
||||
join_layer.commitChanges()
|
||||
|
||||
# check the feature previously modified
|
||||
join_model_index = join_am.idToIndex(fid)
|
||||
join_feature_model = join_am.feature(join_model_index)
|
||||
self.assertEqual(join_feature_model.attribute(join_attr_idx), new_value)
|
||||
|
||||
# recreate a new cache and model to simulate the opening of
|
||||
# a new attribute table
|
||||
cache = QgsVectorLayerCache(layer, 100)
|
||||
am = QgsAttributeTableModel(cache)
|
||||
am.loadLayer()
|
||||
|
||||
# test that the model is up to date with the joined layer
|
||||
model_index = am.idToIndex(fid)
|
||||
feature_model = am.feature(model_index)
|
||||
self.assertEqual(feature_model.attribute(attr_idx), new_value)
|
||||
|
||||
# restore value
|
||||
join_layer.startEditing()
|
||||
join_layer.changeAttributeValue(fid, join_attr_idx, 7.0)
|
||||
join_layer.commitChanges()
|
||||
|
||||
def testUniqueValue(self):
|
||||
""" test retrieving unique values """
|
||||
layer = createLayerWithFivePoints()
|
||||
|
453
tests/testdata/joins.qgs
vendored
Normal file
453
tests/testdata/joins.qgs
vendored
Normal file
@ -0,0 +1,453 @@
|
||||
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
|
||||
<qgis projectname="" version="2.99.0-Master">
|
||||
<title></title>
|
||||
<autotransaction active="0"/>
|
||||
<evaluateDefaultValues active="0"/>
|
||||
<layer-tree-group>
|
||||
<customproperties/>
|
||||
<layer-tree-layer providerKey="ogr" id="polys_with_id_32002f94_eebe_40a5_a182_44198ba1bc5a" expanded="1" name="polys_with_id" source="/home/blottiere/devel/packages/oslandia/QGIS_pbl_bugfix_attributetable/tests/testdata/polys_with_id.shp" checked="Qt::Checked">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
<layer-tree-layer providerKey="ogr" id="polys_overlapping_with_id_3c22a7a0_06b3_4ff5_a2f8_332bafa241bd" expanded="1" name="polys_overlapping_with_id" source="/home/blottiere/devel/packages/oslandia/QGIS_pbl_bugfix_attributetable/tests/testdata/polys_overlapping_with_id.shp" checked="Qt::Checked">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
<custom-order enabled="0">
|
||||
<item>polys_with_id_32002f94_eebe_40a5_a182_44198ba1bc5a</item>
|
||||
<item>polys_overlapping_with_id_3c22a7a0_06b3_4ff5_a2f8_332bafa241bd</item>
|
||||
</custom-order>
|
||||
</layer-tree-group>
|
||||
<snapping-settings enabled="0" intersection-snapping="0" tolerance="0" mode="2" unit="2" type="1">
|
||||
<individual-layer-settings>
|
||||
<layer-setting enabled="1" units="2" id="polys_with_id_32002f94_eebe_40a5_a182_44198ba1bc5a" tolerance="0" type="1"/>
|
||||
<layer-setting enabled="1" units="2" id="polys_overlapping_with_id_3c22a7a0_06b3_4ff5_a2f8_332bafa241bd" tolerance="0" type="1"/>
|
||||
</individual-layer-settings>
|
||||
</snapping-settings>
|
||||
<relations/>
|
||||
<mapcanvas annotationsVisible="1" name="theMapCanvas">
|
||||
<units>degrees</units>
|
||||
<extent>
|
||||
<xmin>-119.80118356386469713</xmin>
|
||||
<ymin>23.95241214538275187</ymin>
|
||||
<xmax>-82.91169073314071625</xmax>
|
||||
<ymax>47.28163022407258609</ymax>
|
||||
</extent>
|
||||
<rotation>0</rotation>
|
||||
<destinationsrs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
|
||||
<srsid>3452</srsid>
|
||||
<srid>4326</srid>
|
||||
<authid>EPSG:4326</authid>
|
||||
<description>WGS 84</description>
|
||||
<projectionacronym>longlat</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</destinationsrs>
|
||||
<rendermaptile>0</rendermaptile>
|
||||
<layer_coordinate_transform_info>
|
||||
<layer_coordinate_transform layerid="polys_overlapping_with_id_3c22a7a0_06b3_4ff5_a2f8_332bafa241bd" srcDatumTransform="-1" destAuthId="EPSG:4326" destDatumTransform="-1" srcAuthId="EPSG:4326"/>
|
||||
<layer_coordinate_transform layerid="polys_overlapping_d3ad0780_28a9_490d_ac9b_200ff6dce922" srcDatumTransform="-1" destAuthId="EPSG:4326" destDatumTransform="-1" srcAuthId="EPSG:4326"/>
|
||||
<layer_coordinate_transform layerid="polys_53c6e680_4b1c_4f16_b100_cbb3af6bfac2" srcDatumTransform="-1" destAuthId="EPSG:4326" destDatumTransform="-1" srcAuthId="EPSG:4326"/>
|
||||
<layer_coordinate_transform layerid="polys_with_id_32002f94_eebe_40a5_a182_44198ba1bc5a" srcDatumTransform="-1" destAuthId="EPSG:4326" destDatumTransform="-1" srcAuthId="EPSG:4326"/>
|
||||
</layer_coordinate_transform_info>
|
||||
</mapcanvas>
|
||||
<legend updateDrawingOrder="true">
|
||||
<legendlayer open="true" showFeatureCount="0" name="polys_with_id" drawingOrder="-1" checked="Qt::Checked">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" layerid="polys_with_id_32002f94_eebe_40a5_a182_44198ba1bc5a" visible="1"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
<legendlayer open="true" showFeatureCount="0" name="polys_overlapping_with_id" drawingOrder="-1" checked="Qt::Checked">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" layerid="polys_overlapping_with_id_3c22a7a0_06b3_4ff5_a2f8_332bafa241bd" visible="1"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
</legend>
|
||||
<mapViewDocks/>
|
||||
<projectlayers>
|
||||
<maplayer geometry="Polygon" minScale="1e+8" autoRefreshEnabled="0" simplifyLocal="1" maxScale="0" readOnly="0" autoRefreshTime="0" simplifyDrawingHints="1" simplifyAlgorithm="0" hasScaleBasedVisibilityFlag="0" simplifyMaxScale="1" type="vector" simplifyDrawingTol="1">
|
||||
<extent>
|
||||
<xmin>-118.92286230599032137</xmin>
|
||||
<ymin>24.50786971868489061</ymin>
|
||||
<xmax>-83.79001199101509201</xmax>
|
||||
<ymax>46.72617265077044379</ymax>
|
||||
</extent>
|
||||
<id>polys_overlapping_with_id_3c22a7a0_06b3_4ff5_a2f8_332bafa241bd</id>
|
||||
<datasource>./polys_overlapping_with_id.shp</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>polys_overlapping_with_id</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
|
||||
<srsid>3452</srsid>
|
||||
<srid>4326</srid>
|
||||
<authid>EPSG:4326</authid>
|
||||
<description>WGS 84</description>
|
||||
<projectionacronym>longlat</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<provider encoding="UTF-8">ogr</provider>
|
||||
<vectorjoins/>
|
||||
<layerDependencies/>
|
||||
<dataDependencies/>
|
||||
<expressionfields/>
|
||||
<map-layer-style-manager current="">
|
||||
<map-layer-style name=""/>
|
||||
</map-layer-style-manager>
|
||||
<renderer-v2 symbollevels="0" enableorderby="0" type="singleSymbol" forceraster="0">
|
||||
<symbols>
|
||||
<symbol alpha="1" name="0" clip_to_extent="1" type="fill">
|
||||
<layer enabled="1" locked="0" class="SimpleFill" pass="0">
|
||||
<prop k="border_width_map_unit_scale" v="3x:0,0,0,0,0,0"/>
|
||||
<prop k="color" v="115,164,10,255"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="3x:0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,0,255"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.26"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="style" v="solid"/>
|
||||
<data_defined_properties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</data_defined_properties>
|
||||
</layer>
|
||||
</symbol>
|
||||
</symbols>
|
||||
<rotation/>
|
||||
<sizescale/>
|
||||
</renderer-v2>
|
||||
<customproperties/>
|
||||
<blendMode>0</blendMode>
|
||||
<featureBlendMode>0</featureBlendMode>
|
||||
<layerOpacity>1</layerOpacity>
|
||||
<fieldConfiguration>
|
||||
<field name="Name">
|
||||
<editWidget type="">
|
||||
<config>
|
||||
<Option/>
|
||||
</config>
|
||||
</editWidget>
|
||||
</field>
|
||||
<field name="Value">
|
||||
<editWidget type="">
|
||||
<config>
|
||||
<Option/>
|
||||
</config>
|
||||
</editWidget>
|
||||
</field>
|
||||
<field name="id">
|
||||
<editWidget type="">
|
||||
<config>
|
||||
<Option/>
|
||||
</config>
|
||||
</editWidget>
|
||||
</field>
|
||||
</fieldConfiguration>
|
||||
<aliases>
|
||||
<alias name="" index="0" field="Name"/>
|
||||
<alias name="" index="1" field="Value"/>
|
||||
<alias name="" index="2" field="id"/>
|
||||
</aliases>
|
||||
<excludeAttributesWMS/>
|
||||
<excludeAttributesWFS/>
|
||||
<defaults>
|
||||
<default expression="" field="Name"/>
|
||||
<default expression="" field="Value"/>
|
||||
<default expression="" field="id"/>
|
||||
</defaults>
|
||||
<constraints>
|
||||
<constraint constraints="0" unique_strength="0" field="Name" exp_strength="0" notnull_strength="0"/>
|
||||
<constraint constraints="0" unique_strength="0" field="Value" exp_strength="0" notnull_strength="0"/>
|
||||
<constraint constraints="0" unique_strength="0" field="id" exp_strength="0" notnull_strength="0"/>
|
||||
</constraints>
|
||||
<constraintExpressions>
|
||||
<constraint desc="" exp="" field="Name"/>
|
||||
<constraint desc="" exp="" field="Value"/>
|
||||
<constraint desc="" exp="" field="id"/>
|
||||
</constraintExpressions>
|
||||
<attributeactions>
|
||||
<defaultAction value="{00000000-0000-0000-0000-000000000000}" key="Canvas"/>
|
||||
</attributeactions>
|
||||
<attributetableconfig actionWidgetStyle="dropDown" sortExpression="" sortOrder="0">
|
||||
<columns>
|
||||
<column name="Name" width="-1" hidden="0" type="field"/>
|
||||
<column name="Value" width="271" hidden="0" type="field"/>
|
||||
<column name="id" width="-1" hidden="0" type="field"/>
|
||||
<column width="-1" hidden="1" type="actions"/>
|
||||
</columns>
|
||||
</attributetableconfig>
|
||||
<editform></editform>
|
||||
<editforminit/>
|
||||
<editforminitcodesource>0</editforminitcodesource>
|
||||
<editforminitfilepath></editforminitfilepath>
|
||||
<editforminitcode><![CDATA[]]></editforminitcode>
|
||||
<featformsuppress>0</featformsuppress>
|
||||
<editorlayout>generatedlayout</editorlayout>
|
||||
<widgets/>
|
||||
<conditionalstyles>
|
||||
<rowstyles/>
|
||||
<fieldstyles/>
|
||||
</conditionalstyles>
|
||||
<expressionfields/>
|
||||
<previewExpression>"Name"</previewExpression>
|
||||
<mapTip></mapTip>
|
||||
</maplayer>
|
||||
<maplayer geometry="Polygon" minScale="1e+8" autoRefreshEnabled="0" simplifyLocal="1" maxScale="0" readOnly="0" autoRefreshTime="0" simplifyDrawingHints="1" simplifyAlgorithm="0" hasScaleBasedVisibilityFlag="0" simplifyMaxScale="1" type="vector" simplifyDrawingTol="1">
|
||||
<extent>
|
||||
<xmin>-118.92286230599032137</xmin>
|
||||
<ymin>24.50786971868489061</ymin>
|
||||
<xmax>-83.79001199101509201</xmax>
|
||||
<ymax>46.72617265077044379</ymax>
|
||||
</extent>
|
||||
<id>polys_with_id_32002f94_eebe_40a5_a182_44198ba1bc5a</id>
|
||||
<datasource>./polys_with_id.shp</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>polys_with_id</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
|
||||
<srsid>3452</srsid>
|
||||
<srid>4326</srid>
|
||||
<authid>EPSG:4326</authid>
|
||||
<description>WGS 84</description>
|
||||
<projectionacronym>longlat</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<provider encoding="UTF-8">ogr</provider>
|
||||
<vectorjoins>
|
||||
<join joinFieldName="id" memoryCache="1" joinLayerId="polys_overlapping_with_id_3c22a7a0_06b3_4ff5_a2f8_332bafa241bd" targetFieldName="id"/>
|
||||
</vectorjoins>
|
||||
<layerDependencies/>
|
||||
<dataDependencies/>
|
||||
<expressionfields/>
|
||||
<map-layer-style-manager current="">
|
||||
<map-layer-style name=""/>
|
||||
</map-layer-style-manager>
|
||||
<renderer-v2 symbollevels="0" enableorderby="0" type="singleSymbol" forceraster="0">
|
||||
<symbols>
|
||||
<symbol alpha="1" name="0" clip_to_extent="1" type="fill">
|
||||
<layer enabled="1" locked="0" class="SimpleFill" pass="0">
|
||||
<prop k="border_width_map_unit_scale" v="3x:0,0,0,0,0,0"/>
|
||||
<prop k="color" v="100,124,232,255"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="3x:0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,0,255"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.26"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="style" v="solid"/>
|
||||
<data_defined_properties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</data_defined_properties>
|
||||
</layer>
|
||||
</symbol>
|
||||
</symbols>
|
||||
<rotation/>
|
||||
<sizescale/>
|
||||
</renderer-v2>
|
||||
<customproperties>
|
||||
<property value="0" key="embeddedWidgets/count"/>
|
||||
<property key="variableNames"/>
|
||||
<property key="variableValues"/>
|
||||
</customproperties>
|
||||
<blendMode>0</blendMode>
|
||||
<featureBlendMode>0</featureBlendMode>
|
||||
<layerOpacity>1</layerOpacity>
|
||||
<SingleCategoryDiagramRenderer attributeLegend="1" diagramType="Histogram">
|
||||
<DiagramCategory sizeType="MM" scaleBasedVisibility="0" diagramOrientation="Up" height="15" penColor="#000000" enabled="0" maxScaleDenominator="1e+8" minimumSize="0" backgroundAlpha="255" lineSizeType="MM" penAlpha="255" opacity="1" sizeScale="3x:0,0,0,0,0,0" labelPlacementMethod="XHeight" penWidth="0" minScaleDenominator="0" backgroundColor="#ffffff" rotationOffset="270" lineSizeScale="3x:0,0,0,0,0,0" scaleDependency="Area" width="15" barWidth="5">
|
||||
<fontProperties description="Sans Serif,9,-1,5,50,0,0,0,0,0" style=""/>
|
||||
</DiagramCategory>
|
||||
</SingleCategoryDiagramRenderer>
|
||||
<DiagramLayerSettings placement="0" dist="0" priority="0" zIndex="0" obstacle="0" linePlacementFlags="18" showAll="1">
|
||||
<properties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</properties>
|
||||
</DiagramLayerSettings>
|
||||
<fieldConfiguration>
|
||||
<field name="Name">
|
||||
<editWidget type="TextEdit">
|
||||
<config>
|
||||
<Option/>
|
||||
</config>
|
||||
</editWidget>
|
||||
</field>
|
||||
<field name="Value">
|
||||
<editWidget type="Range">
|
||||
<config>
|
||||
<Option/>
|
||||
</config>
|
||||
</editWidget>
|
||||
</field>
|
||||
<field name="id">
|
||||
<editWidget type="Range">
|
||||
<config>
|
||||
<Option/>
|
||||
</config>
|
||||
</editWidget>
|
||||
</field>
|
||||
<field name="polys_overlapping_with_id_Name">
|
||||
<editWidget type="TextEdit">
|
||||
<config>
|
||||
<Option/>
|
||||
</config>
|
||||
</editWidget>
|
||||
</field>
|
||||
<field name="polys_overlapping_with_id_Value">
|
||||
<editWidget type="Range">
|
||||
<config>
|
||||
<Option/>
|
||||
</config>
|
||||
</editWidget>
|
||||
</field>
|
||||
</fieldConfiguration>
|
||||
<aliases>
|
||||
<alias name="" index="0" field="Name"/>
|
||||
<alias name="" index="1" field="Value"/>
|
||||
<alias name="" index="2" field="id"/>
|
||||
<alias name="" index="3" field="polys_overlapping_with_id_Name"/>
|
||||
<alias name="" index="4" field="polys_overlapping_with_id_Value"/>
|
||||
</aliases>
|
||||
<excludeAttributesWMS/>
|
||||
<excludeAttributesWFS/>
|
||||
<defaults>
|
||||
<default expression="" field="Name"/>
|
||||
<default expression="" field="Value"/>
|
||||
<default expression="" field="id"/>
|
||||
<default expression="" field="polys_overlapping_with_id_Name"/>
|
||||
<default expression="" field="polys_overlapping_with_id_Value"/>
|
||||
</defaults>
|
||||
<constraints>
|
||||
<constraint constraints="0" unique_strength="0" field="Name" exp_strength="0" notnull_strength="0"/>
|
||||
<constraint constraints="0" unique_strength="0" field="Value" exp_strength="0" notnull_strength="0"/>
|
||||
<constraint constraints="0" unique_strength="0" field="id" exp_strength="0" notnull_strength="0"/>
|
||||
<constraint constraints="0" unique_strength="0" field="polys_overlapping_with_id_Name" exp_strength="0" notnull_strength="0"/>
|
||||
<constraint constraints="0" unique_strength="0" field="polys_overlapping_with_id_Value" exp_strength="0" notnull_strength="0"/>
|
||||
</constraints>
|
||||
<constraintExpressions>
|
||||
<constraint desc="" exp="" field="Name"/>
|
||||
<constraint desc="" exp="" field="Value"/>
|
||||
<constraint desc="" exp="" field="id"/>
|
||||
<constraint desc="" exp="" field="polys_overlapping_with_id_Name"/>
|
||||
<constraint desc="" exp="" field="polys_overlapping_with_id_Value"/>
|
||||
</constraintExpressions>
|
||||
<attributeactions>
|
||||
<defaultAction value="{00000000-0000-0000-0000-000000000000}" key="Canvas"/>
|
||||
</attributeactions>
|
||||
<attributetableconfig actionWidgetStyle="dropDown" sortExpression="" sortOrder="0">
|
||||
<columns>
|
||||
<column name="Name" width="-1" hidden="0" type="field"/>
|
||||
<column name="Value" width="-1" hidden="0" type="field"/>
|
||||
<column name="id" width="-1" hidden="0" type="field"/>
|
||||
<column width="-1" hidden="1" type="actions"/>
|
||||
<column name="polys_overlapping_with_id_Name" width="-1" hidden="0" type="field"/>
|
||||
<column name="polys_overlapping_with_id_Value" width="329" hidden="0" type="field"/>
|
||||
</columns>
|
||||
</attributetableconfig>
|
||||
<editform></editform>
|
||||
<editforminit/>
|
||||
<editforminitcodesource>0</editforminitcodesource>
|
||||
<editforminitfilepath></editforminitfilepath>
|
||||
<editforminitcode><![CDATA[# -*- coding: utf-8 -*-
|
||||
"""
|
||||
QGIS forms can have a Python function that is called when the form is
|
||||
opened.
|
||||
|
||||
Use this function to add extra logic to your forms.
|
||||
|
||||
Enter the name of the function in the "Python Init function"
|
||||
field.
|
||||
An example follows:
|
||||
"""
|
||||
from qgis.PyQt.QtWidgets import QWidget
|
||||
|
||||
def my_form_open(dialog, layer, feature):
|
||||
geom = feature.geometry()
|
||||
control = dialog.findChild(QWidget, "MyLineEdit")
|
||||
]]></editforminitcode>
|
||||
<featformsuppress>0</featformsuppress>
|
||||
<editorlayout>generatedlayout</editorlayout>
|
||||
<widgets/>
|
||||
<conditionalstyles>
|
||||
<rowstyles/>
|
||||
<fieldstyles/>
|
||||
</conditionalstyles>
|
||||
<expressionfields/>
|
||||
<previewExpression>Name</previewExpression>
|
||||
<mapTip></mapTip>
|
||||
</maplayer>
|
||||
</projectlayers>
|
||||
<layerorder>
|
||||
<layer id="polys_with_id_32002f94_eebe_40a5_a182_44198ba1bc5a"/>
|
||||
<layer id="polys_overlapping_with_id_3c22a7a0_06b3_4ff5_a2f8_332bafa241bd"/>
|
||||
</layerorder>
|
||||
<properties>
|
||||
<Gui>
|
||||
<SelectionColorAlphaPart type="int">255</SelectionColorAlphaPart>
|
||||
<CanvasColorBluePart type="int">255</CanvasColorBluePart>
|
||||
<CanvasColorGreenPart type="int">255</CanvasColorGreenPart>
|
||||
<SelectionColorBluePart type="int">0</SelectionColorBluePart>
|
||||
<SelectionColorRedPart type="int">255</SelectionColorRedPart>
|
||||
<CanvasColorRedPart type="int">255</CanvasColorRedPart>
|
||||
<SelectionColorGreenPart type="int">255</SelectionColorGreenPart>
|
||||
</Gui>
|
||||
<Paths>
|
||||
<Absolute type="bool">false</Absolute>
|
||||
</Paths>
|
||||
<PositionPrecision>
|
||||
<Automatic type="bool">true</Automatic>
|
||||
<DecimalPlaces type="int">2</DecimalPlaces>
|
||||
</PositionPrecision>
|
||||
<Measurement>
|
||||
<AreaUnits type="QString"></AreaUnits>
|
||||
<DistanceUnits type="QString"></DistanceUnits>
|
||||
</Measurement>
|
||||
<SpatialRefSys>
|
||||
<ProjectionsEnabled type="int">1</ProjectionsEnabled>
|
||||
<ProjectCRSID type="int">3452</ProjectCRSID>
|
||||
<ProjectCrs type="QString">EPSG:4326</ProjectCrs>
|
||||
<ProjectCRSProj4String type="QString">+proj=longlat +datum=WGS84 +no_defs</ProjectCRSProj4String>
|
||||
</SpatialRefSys>
|
||||
<PAL>
|
||||
<CandidatesLine type="int">50</CandidatesLine>
|
||||
<SearchMethod type="int">0</SearchMethod>
|
||||
<ShowingCandidates type="bool">false</ShowingCandidates>
|
||||
<CandidatesPoint type="int">16</CandidatesPoint>
|
||||
<ShowingPartialsLabels type="bool">true</ShowingPartialsLabels>
|
||||
<CandidatesPolygon type="int">30</CandidatesPolygon>
|
||||
<DrawOutlineLabels type="bool">true</DrawOutlineLabels>
|
||||
<DrawRectOnly type="bool">false</DrawRectOnly>
|
||||
<ShowingAllLabels type="bool">false</ShowingAllLabels>
|
||||
</PAL>
|
||||
<Legend>
|
||||
<filterByMap type="bool">false</filterByMap>
|
||||
</Legend>
|
||||
</properties>
|
||||
<visibility-presets/>
|
||||
<Annotations/>
|
||||
<Layouts/>
|
||||
</qgis>
|
BIN
tests/testdata/polys_overlapping_with_id.dbf
vendored
Normal file
BIN
tests/testdata/polys_overlapping_with_id.dbf
vendored
Normal file
Binary file not shown.
1
tests/testdata/polys_overlapping_with_id.prj
vendored
Normal file
1
tests/testdata/polys_overlapping_with_id.prj
vendored
Normal file
@ -0,0 +1 @@
|
||||
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
|
1
tests/testdata/polys_overlapping_with_id.qpj
vendored
Normal file
1
tests/testdata/polys_overlapping_with_id.qpj
vendored
Normal file
@ -0,0 +1 @@
|
||||
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
|
BIN
tests/testdata/polys_overlapping_with_id.shp
vendored
Normal file
BIN
tests/testdata/polys_overlapping_with_id.shp
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/polys_overlapping_with_id.shx
vendored
Normal file
BIN
tests/testdata/polys_overlapping_with_id.shx
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/polys_with_id.dbf
vendored
Normal file
BIN
tests/testdata/polys_with_id.dbf
vendored
Normal file
Binary file not shown.
1
tests/testdata/polys_with_id.prj
vendored
Normal file
1
tests/testdata/polys_with_id.prj
vendored
Normal file
@ -0,0 +1 @@
|
||||
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
|
1
tests/testdata/polys_with_id.qpj
vendored
Normal file
1
tests/testdata/polys_with_id.qpj
vendored
Normal file
@ -0,0 +1 @@
|
||||
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
|
BIN
tests/testdata/polys_with_id.shp
vendored
Normal file
BIN
tests/testdata/polys_with_id.shp
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/polys_with_id.shx
vendored
Normal file
BIN
tests/testdata/polys_with_id.shx
vendored
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user