28 #include <QPainterPath>
30 #include <QProgressDialog>
82 #include "diagram/qgsdiagram.h"
84 #ifdef TESTPROVIDERLIB
90 const QString& qmlStyle,
91 const QString& sldStyle,
92 const QString& styleName,
93 const QString& styleDescription,
94 const QString& uiFileContent,
108 QStringList &descriptions,
121 bool loadDefaultStyleFlag )
122 :
QgsMapLayer( VectorLayer, baseName, vectorLayerPath )
123 , mDataProvider( NULL )
124 , mProviderKey( providerKey )
126 , mRendererV2( NULL )
129 , mLabelFontNotFoundNotified( false )
130 , mFeatureBlendMode( QPainter::CompositionMode_SourceOver )
131 , mLayerTransparency( 0 )
132 , mVertexMarkerOnlyForSelection( false )
133 , mEditorLayout( GeneratedLayout )
134 , mFeatureFormSuppress( SuppressDefault )
138 , mDiagramRenderer( 0 )
139 , mDiagramLayerSettings( 0 )
140 , mValidExtent( false )
141 , mLazyExtent( true )
142 , mSymbolFeatureCounted( false )
159 bool defaultLoadedFlag =
false;
160 if ( loadDefaultStyleFlag )
259 QString idxName =
"";
262 if ( !fldName.isEmpty() )
269 int fieldsSize = fields.
size();
271 for (
int idx = 0; idx < fields.
count(); ++idx )
273 QString fldName = fields[idx].name();
274 QgsDebugMsg(
"Checking field " + fldName +
" of " + QString::number( fieldsSize ) +
" total" );
280 if ( fldName.indexOf(
"name", 0, Qt::CaseInsensitive ) > -1 )
282 if ( idxName.isEmpty() )
287 if ( fldName.indexOf(
"descrip", 0, Qt::CaseInsensitive ) > -1 )
289 if ( idxName.isEmpty() )
294 if ( fldName.indexOf(
"id", 0, Qt::CaseInsensitive ) > -1 )
296 if ( idxId.isEmpty() )
304 if ( fieldsSize == 0 )
307 if ( idxName.length() > 0 )
313 if ( idxId.length() > 0 )
345 attributes.append( attrNum );
353 QgsDebugMsg(
"Selecting features based on view extent" );
362 .setFilterRect( rendererContext.
extent() )
363 .setSubsetOfAttributes( attributes ) );
387 QgsDebugMsg( QString(
"Total features processed %1" ).arg( featureCount ) );
414 p.setPen( QColor( 50, 100, 120, 200 ) );
415 p.setBrush( QColor( 200, 200, 210, 120 ) );
416 p.drawEllipse( x - m, y - m, m * 2 + 1, m * 2 + 1 );
420 p.setPen( QColor( 255, 0, 0 ) );
421 p.drawLine( x - m, y + m, x + m, y - m );
422 p.drawLine( x - m, y - m, x + m, y + m );
461 .setFilterRect( rect )
473 if ( !addToSelection )
486 if ( intersectingIds.count() > 0 )
488 QgsDebugMsg(
"Trying to select and deselect the same item at the same time. Unsure what to do. Selecting dubious items." );
532 .setFilterRect( rect )
544 deselectIds << fet.
id();
548 selectIds << fet.
id();
627 QgsDebugMsg( QString(
"Data Provider Geometry type is not recognised, is %1" ).arg( type ) );
639 QgsDebugMsg(
"WARNING: This code should never be reached. Problems may occur..." );
699 if ( retval.
width() == 0.0 || retval.
height() == 0.0 )
708 retval.
set( -1.0, -1.0, 1.0, 1.0 );
749 QgsLegendSymbolList::const_iterator symbolIt = symbolList.constBegin();
751 for ( ; symbolIt != symbolList.constEnd(); ++symbolIt )
757 QProgressDialog progressDialog(
tr(
"Updating feature count for layer %1" ).arg(
name() ),
tr(
"Abort" ), 0, nFeatures );
758 progressDialog.setWindowModality( Qt::WindowModal );
759 int featuresCounted = 0;
772 for ( QgsSymbolV2List::iterator symbolIt = featureSymbolList.begin(); symbolIt != featureSymbolList.end(); ++symbolIt )
780 if ( featuresCounted % 50 == 0 )
782 if ( featuresCounted > nFeatures )
784 progressDialog.setMaximum( 0 );
786 progressDialog.setValue( featuresCounted );
787 if ( progressDialog.wasCanceled() )
797 progressDialog.setValue( nFeatures );
858 if ( it->geometry() )
932 if ( maximumSimplificationScale > 1 && renderContext.
rendererScale() <= maximumSimplificationScale )
951 Q_UNUSED( alsoUpdateExtent );
975 QgsDebugMsg( QString(
"feature %1 could not be retrieved" ).arg( f.
id() ) );
983 QgsDebugMsg( QString(
"geometry of feature %1 could not be changed." ).arg( f.
id() ) );
991 for (
int attr = 0; attr < fa.count(); ++attr )
993 if ( fa[attr] != ca[attr] )
997 QgsDebugMsg( QString(
"attribute %1 of feature %2 could not be changed." ).arg( attr ).arg( f.
id() ) );
1013 return utils.
insertVertex( x, y, atFeatureId, beforeVertex );
1023 return utils.
moveVertex( x, y, atFeatureId, atVertex );
1111 return utils.
splitParts( splitLine, topologicalEditing );
1120 return utils.
splitFeatures( splitLine, topologicalEditing );
1128 int returnValue = 0;
1141 .setFilterRect( geomBBox )
1148 if ( ignoreFeatures.contains( f.
id() ) )
1255 QDomNode pkeyNode = layer_node.namedItem(
"provider" );
1257 if ( pkeyNode.isNull() )
1263 QDomElement pkeyElt = pkeyNode.toElement();
1287 QDomElement pkeyElem = pkeyNode.toElement();
1288 if ( !pkeyElem.isNull() )
1290 QString encodingString = pkeyElem.attribute(
"encoding" );
1291 if ( !encodingString.isEmpty() )
1307 QDomNode prevExpNode = layer_node.namedItem(
"previewExpression" );
1309 if ( prevExpNode.isNull() )
1315 QDomElement prevExpElem = prevExpNode.toElement();
1345 QgsDebugMsg(
"Instantiated the data provider plugin" );
1369 QRegExp reg(
"\"[^\"]+\"\\.\"([^\"]+)\"( \\([^)]+\\))?" );
1370 if ( reg.indexIn(
name() ) >= 0 )
1372 QStringList stuff = reg.capturedTexts();
1373 QString lName = stuff[1];
1377 QMap<QString, QgsMapLayer*>::const_iterator it;
1378 for ( it = layers.constBegin(); it != layers.constEnd() && ( *it )->name() != lName; ++it )
1381 if ( it != layers.constEnd() && stuff.size() > 2 )
1383 lName +=
"." + stuff[2].mid( 2, stuff[2].length() - 3 );
1386 if ( !lName.isEmpty() )
1400 else if ( provider ==
"ogr" )
1433 QDomDocument & document )
1437 QDomElement mapLayerNode = layer_node.toElement();
1439 if ( mapLayerNode.isNull() || (
"maplayer" != mapLayerNode.nodeName() ) )
1445 mapLayerNode.setAttribute(
"type",
"vector" );
1453 QDomElement provider = document.createElement(
"provider" );
1455 QDomText providerText = document.createTextNode(
providerType() );
1456 provider.appendChild( providerText );
1457 layer_node.appendChild( provider );
1461 QDomElement prevExpElem = document.createElement(
"previewExpression" );
1463 prevExpElem.appendChild( prevExpText );
1464 layer_node.appendChild( prevExpElem );
1476 Q_UNUSED( errorMessage );
1481 if ( !rendererElement.isNull() )
1499 QDomNode displayFieldNode = node.namedItem(
"displayfield" );
1500 if ( !displayFieldNode.isNull() )
1502 QDomElement e = displayFieldNode.toElement();
1507 QDomNode blendModeNode = node.namedItem(
"blendMode" );
1508 if ( !blendModeNode.isNull() )
1510 QDomElement e = blendModeNode.toElement();
1515 QDomNode featureBlendModeNode = node.namedItem(
"featureBlendMode" );
1516 if ( !featureBlendModeNode.isNull() )
1518 QDomElement e = featureBlendModeNode.toElement();
1523 QDomNode layerTransparencyNode = node.namedItem(
"layerTransparency" );
1524 if ( !layerTransparencyNode.isNull() )
1526 QDomElement e = layerTransparencyNode.toElement();
1531 QDomElement e = node.toElement();
1549 QDomNode labelnode = node.namedItem(
"label" );
1550 QDomElement element = labelnode.toElement();
1552 if ( hasLabelsEnabled < 1 )
1561 QDomNode labelattributesnode = node.namedItem(
"labelattributes" );
1563 if ( !labelattributesnode.isNull() &&
mLabel )
1571 QDomElement singleCatDiagramElem = node.firstChildElement(
"SingleCategoryDiagramRenderer" );
1572 if ( !singleCatDiagramElem.isNull() )
1577 QDomElement linearDiagramElem = node.firstChildElement(
"LinearlyInterpolatedDiagramRenderer" );
1578 if ( !linearDiagramElem.isNull() )
1586 QDomElement diagramSettingsElem = node.firstChildElement(
"DiagramLayerSettings" );
1587 if ( !diagramSettingsElem.isNull() )
1599 QDomNode editFormNode = node.namedItem(
"editform" );
1600 if ( !editFormNode.isNull() )
1602 QDomElement e = editFormNode.toElement();
1606 QDomNode editFormInitNode = node.namedItem(
"editforminit" );
1607 if ( !editFormInitNode.isNull() )
1612 QDomNode fFSuppNode = node.namedItem(
"featformsuppress" );
1613 if ( fFSuppNode.isNull() )
1619 QDomElement e = fFSuppNode.toElement();
1623 QDomNode annotationFormNode = node.namedItem(
"annotationform" );
1624 if ( !annotationFormNode.isNull() )
1626 QDomElement e = annotationFormNode.toElement();
1631 QDomNode aliasesNode = node.namedItem(
"aliases" );
1632 if ( !aliasesNode.isNull() )
1634 QDomElement aliasElem;
1637 QDomNodeList aliasNodeList = aliasesNode.toElement().elementsByTagName(
"alias" );
1638 for (
int i = 0; i < aliasNodeList.size(); ++i )
1640 aliasElem = aliasNodeList.at( i ).toElement();
1643 if ( aliasElem.hasAttribute(
"field" ) )
1645 field = aliasElem.attribute(
"field" );
1649 int index = aliasElem.attribute(
"index" ).toInt();
1660 QDomNode editorLayoutNode = node.namedItem(
"editorlayout" );
1661 if ( editorLayoutNode.isNull() )
1667 if ( editorLayoutNode.toElement().text() ==
"uifilelayout" )
1671 else if ( editorLayoutNode.toElement().text() ==
"tablayout" )
1683 QDomNode excludeWMSNode = node.namedItem(
"excludeAttributesWMS" );
1684 if ( !excludeWMSNode.isNull() )
1686 QDomNodeList attributeNodeList = excludeWMSNode.toElement().elementsByTagName(
"attribute" );
1687 for (
int i = 0; i < attributeNodeList.size(); ++i )
1694 QDomNode excludeWFSNode = node.namedItem(
"excludeAttributesWFS" );
1695 if ( !excludeWFSNode.isNull() )
1697 QDomNodeList attributeNodeList = excludeWFSNode.toElement().elementsByTagName(
"attribute" );
1698 for (
int i = 0; i < attributeNodeList.size(); ++i )
1706 QDomNode attributeEditorFormNode = node.namedItem(
"attributeEditorForm" );
1707 QDomNodeList attributeEditorFormNodeList = attributeEditorFormNode.toElement().childNodes();
1709 for (
int i = 0; i < attributeEditorFormNodeList.size(); i++ )
1711 QDomElement elem = attributeEditorFormNodeList.at( i ).toElement();
1724 if ( elem.tagName() ==
"attributeEditorContainer" )
1728 QDomNodeList childNodeList = elem.childNodes();
1730 for (
int i = 0; i < childNodeList.size(); i++ )
1732 QDomElement childElem = childNodeList.at( i ).toElement();
1738 newElement = container;
1740 else if ( elem.tagName() ==
"attributeEditorField" )
1742 QString
name = elem.attribute(
"name" );
1746 else if ( elem.tagName() ==
"attributeEditorRelation" )
1750 QString
name = elem.attribute(
"name" );
1758 Q_UNUSED( errorMessage );
1759 QDomElement mapLayerNode = node.toElement();
1764 node.appendChild( rendererElement );
1770 mapLayerNode.setAttribute(
"minLabelScale", QString::number(
mLabel->
minScale() ) );
1771 mapLayerNode.setAttribute(
"maxLabelScale", QString::number(
mLabel->
maxScale() ) );
1784 QDomElement blendModeElem = doc.createElement(
"blendMode" );
1786 blendModeElem.appendChild( blendModeText );
1787 node.appendChild( blendModeElem );
1790 QDomElement featureBlendModeElem = doc.createElement(
"featureBlendMode" );
1792 featureBlendModeElem.appendChild( featureBlendModeText );
1793 node.appendChild( featureBlendModeElem );
1796 QDomElement layerTransparencyElem = doc.createElement(
"layerTransparency" );
1797 QDomText layerTransparencyText = doc.createTextNode( QString::number(
layerTransparency() ) );
1798 layerTransparencyElem.appendChild( layerTransparencyText );
1799 node.appendChild( layerTransparencyElem );
1802 QDomElement dField = doc.createElement(
"displayfield" );
1803 QDomText dFieldText = doc.createTextNode(
displayField() );
1804 dField.appendChild( dFieldText );
1805 node.appendChild( dField );
1808 QDomElement labelElem = doc.createElement(
"label" );
1809 QDomText labelText = doc.createTextNode(
"" );
1813 labelText.setData(
"1" );
1817 labelText.setData(
"0" );
1819 labelElem.appendChild( labelText );
1821 node.appendChild( labelElem );
1828 if ( fieldname !=
"" )
1830 dField = doc.createElement(
"labelfield" );
1831 dFieldText = doc.createTextNode( fieldname );
1832 dField.appendChild( dFieldText );
1833 node.appendChild( dField );
1848 QDomElement editTypesElement = doc.createElement(
"edittypes" );
1852 QDomElement editTypeElement = doc.createElement(
"edittype" );
1853 editTypeElement.setAttribute(
"name", field.
name() );
1855 editTypeElement.setAttribute(
"labelontop",
mLabelOnTop[field.
name()] ? 1 : 0 );
1858 editTypesElement.appendChild( editTypeElement );
1861 node.appendChild( editTypesElement );
1863 QDomElement efField = doc.createElement(
"editform" );
1865 efField.appendChild( efText );
1866 node.appendChild( efField );
1868 QDomElement efiField = doc.createElement(
"editforminit" );
1870 efiField.appendChild( efiText );
1871 node.appendChild( efiField );
1873 QDomElement fFSuppElem = doc.createElement(
"featformsuppress" );
1875 fFSuppElem.appendChild( fFSuppText );
1876 node.appendChild( fFSuppElem );
1878 QDomElement afField = doc.createElement(
"annotationform" );
1880 afField.appendChild( afText );
1881 node.appendChild( afField );
1884 QDomElement editorLayoutElem = doc.createElement(
"editorlayout" );
1888 editorLayoutElem.appendChild( doc.createTextNode(
"uifilelayout" ) );
1892 editorLayoutElem.appendChild( doc.createTextNode(
"tablayout" ) );
1897 editorLayoutElem.appendChild( doc.createTextNode(
"generatedlayout" ) );
1901 node.appendChild( editorLayoutElem );
1906 QDomElement aliasElem = doc.createElement(
"aliases" );
1914 QDomElement aliasEntryElem = doc.createElement(
"alias" );
1915 aliasEntryElem.setAttribute(
"field", a_it.key() );
1916 aliasEntryElem.setAttribute(
"index", idx );
1917 aliasEntryElem.setAttribute(
"name", a_it.value() );
1918 aliasElem.appendChild( aliasEntryElem );
1920 node.appendChild( aliasElem );
1924 QDomElement excludeWMSElem = doc.createElement(
"excludeAttributesWMS" );
1928 QDomElement attrElem = doc.createElement(
"attribute" );
1929 QDomText attrText = doc.createTextNode( *attWMSIt );
1930 attrElem.appendChild( attrText );
1931 excludeWMSElem.appendChild( attrElem );
1933 node.appendChild( excludeWMSElem );
1936 QDomElement excludeWFSElem = doc.createElement(
"excludeAttributesWFS" );
1940 QDomElement attrElem = doc.createElement(
"attribute" );
1941 QDomText attrText = doc.createTextNode( *attWFSIt );
1942 attrElem.appendChild( attrText );
1943 excludeWFSElem.appendChild( attrElem );
1945 node.appendChild( excludeWFSElem );
1950 QDomElement tabsElem = doc.createElement(
"attributeEditorForm" );
1954 QDomElement attributeEditorWidgetElem = ( *it )->toDomElement( doc );
1955 tabsElem.appendChild( attributeEditorWidgetElem );
1958 node.appendChild( tabsElem );
1970 QDomElement nameElem = node.firstChildElement(
"Name" );
1971 if ( nameElem.isNull() )
1973 errorMessage =
"Warning: Name element not found within NamedLayer while it's required.";
1993 Q_UNUSED( errorMessage );
1996 QDomElement nameNode = doc.createElement(
"se:Name" );
1997 nameNode.appendChild( doc.createTextNode(
name() ) );
1998 node.appendChild( nameNode );
2023 Q_UNUSED( emitSignal );
2081 if ( attributeIndex < 0 || attributeIndex >=
pendingFields().count() )
2092 if ( displayName.isEmpty() )
2095 if ( attributeIndex >= 0 && attributeIndex < fields.
count() )
2097 displayName = fields[attributeIndex].name();
2113 bool deleted =
false;
2116 attrs = attrs.toSet().toList();
2118 qSort( attrs.begin(), attrs.end(), qGreater<int>() );
2120 foreach (
int attr, attrs )
2164 pkAttributesList << i;
2167 return pkAttributesList;
2311 for ( QgsFeatureList::iterator iter = features.begin(); iter != features.end(); ++iter )
2328 QMultiMap<double, QgsSnappingResult> snapResults;
2336 if ( snapResults.size() < 1 )
2341 QMultiMap<double, QgsSnappingResult>::const_iterator snap_it = snapResults.constBegin();
2342 point.
setX( snap_it.value().snappedVertex.x() );
2343 point.
setY( snap_it.value().snappedVertex.y() );
2349 QMultiMap<double, QgsSnappingResult>& snappingResults,
2360 QList<QgsFeature> featureList;
2361 QgsRectangle searchRect( startPoint.
x() - snappingTolerance, startPoint.
y() - snappingTolerance,
2362 startPoint.
x() + snappingTolerance, startPoint.
y() + snappingTolerance );
2363 double sqrSnappingTolerance = snappingTolerance * snappingTolerance;
2371 for ( QgsGeometryMap::iterator it = cachedGeometries.begin(); it != cachedGeometries.end() ; ++it )
2376 snapToGeometry( startPoint, it.key(), g, sqrSnappingTolerance, snappingResults, snap_to );
2386 .setFilterRect( searchRect )
2397 return n == 0 ? 2 : 0;
2403 double sqrSnappingTolerance,
2404 QMultiMap<double, QgsSnappingResult>& snappingResults,
2412 int atVertex, beforeVertex, afterVertex;
2413 double sqrDistVertexSnap, sqrDistSegmentSnap;
2420 snappedPoint = geom->
closestVertex( startPoint, atVertex, beforeVertex, afterVertex, sqrDistVertexSnap );
2421 if ( sqrDistVertexSnap < sqrSnappingTolerance )
2426 if ( beforeVertex != -1 )
2431 if ( afterVertex != -1 )
2436 snappingResultVertex.
layer =
this;
2437 snappingResults.insert( sqrt( sqrDistVertexSnap ), snappingResultVertex );
2445 sqrDistSegmentSnap = geom->
closestSegmentWithContext( startPoint, snappedPoint, afterVertex, NULL,
crs().geographicFlag() ? 1e-12 : 1e-8 );
2447 if ( sqrDistSegmentSnap < sqrSnappingTolerance )
2456 snappingResultSegment.
layer =
this;
2457 snappingResults.insert( sqrt( sqrDistSegmentSnap ), snappingResultSegment );
2472 QgsDebugMsg(
"----- Computing Coordinate System" );
2619 return QSize( cfg.value(
"Width" ).toInt(), cfg.value(
"Height" ).toInt() );
2625 if ( idx >= 0 && idx < fields.
count() )
2638 if ( idx >= 0 && idx < fields.
count() )
2639 return mLabelOnTop.value( fields[idx].name(), false );
2647 if ( idx >= 0 && idx < fields.
count() )
2654 if ( idx >= 0 && idx < fields.
count() )
2704 cfg[
"CheckedState"] = checked;
2705 cfg[
"UncheckedState"] = unchecked;
2765 uniqueValues.clear();
2779 int sourceLayerIndex;
2802 .setSubsetOfAttributes( attList ) );
2805 QVariant currentValue;
2806 QHash<QString, QVariant> val;
2810 val.insert( currentValue.toString(), currentValue );
2811 if ( limit >= 0 && val.size() >= limit )
2817 uniqueValues = val.values();
2821 Q_ASSERT_X(
false,
"QgsVectorLayer::uniqueValues()",
"Unknown source of the field!" );
2839 int sourceLayerIndex;
2862 .setSubsetOfAttributes( attList ) );
2866 double currentValue = 0;
2869 currentValue = f.
attribute( index ).toDouble();
2870 if ( currentValue < minimumValue )
2872 minimumValue = currentValue;
2875 return QVariant( minimumValue );
2878 Q_ASSERT_X(
false,
"QgsVectorLayer::minimumValue()",
"Unknown source of the field!" );
2897 int sourceLayerIndex;
2923 .setSubsetOfAttributes( attList ) );
2927 double currentValue = 0;
2930 currentValue = f.
attribute( index ).toDouble();
2931 if ( currentValue > maximumValue )
2933 maximumValue = currentValue;
2936 return QVariant( maximumValue );
2939 Q_ASSERT_X(
false,
"QgsVectorLayer::maximumValue()",
"Unknown source of the field!" );
2973 QDomElement element = node.toElement();
2974 if ( element.isNull() )
2977 QDomElement userStyleElem = element.firstChildElement(
"UserStyle" );
2978 if ( userStyleElem.isNull() )
2980 QgsDebugMsg(
"Info: UserStyle element not found." );
2984 QDomElement featureTypeStyleElem = userStyleElem.firstChildElement(
"FeatureTypeStyle" );
2985 if ( featureTypeStyleElem.isNull() )
2987 QgsDebugMsg(
"Info: FeatureTypeStyle element not found." );
2992 QDomElement ruleElem = featureTypeStyleElem.lastChildElement(
"Rule" );
2993 if ( ruleElem.isNull() )
3000 QDomElement textSymbolizerElem = ruleElem.lastChildElement(
"TextSymbolizer" );
3001 if ( textSymbolizerElem.isNull() )
3003 QgsDebugMsg(
"Info: TextSymbolizer element not found." );
3009 QDomElement labelElem = textSymbolizerElem.firstChildElement(
"Label" );
3010 if ( !labelElem.isNull() )
3012 QDomElement propertyNameElem = labelElem.firstChildElement(
"PropertyName" );
3013 if ( !propertyNameElem.isNull() )
3044 QString labelAttribute = propertyNameElem.text();
3049 if ( fieldIndex == -1 )
3065 QgsDebugMsg(
"Info: PropertyName element not found." );
3076 QDomElement fontElem = textSymbolizerElem.firstChildElement(
"Font" );
3077 if ( !fontElem.isNull() )
3081 QDomElement cssElem = fontElem.firstChildElement(
"CssParameter" );
3082 while ( !cssElem.isNull() )
3084 cssName = cssElem.attribute(
"name",
"not_found" );
3085 if ( cssName !=
"not_found" )
3087 elemText = cssElem.text();
3088 if ( cssName ==
"font-family" )
3092 else if ( cssName ==
"font-style" )
3094 setCustomProperty(
"labeling/fontItalic", ( elemText ==
"italic" ) || ( elemText ==
"Italic" ) );
3096 else if ( cssName ==
"font-size" )
3099 int fontSize = elemText.toInt( &ok );
3105 else if ( cssName ==
"font-weight" )
3107 setCustomProperty(
"labeling/fontBold", ( elemText ==
"bold" ) || ( elemText ==
"Bold" ) );
3109 else if ( cssName ==
"font-underline" )
3111 setCustomProperty(
"labeling/fontUnderline", ( elemText ==
"underline" ) || ( elemText ==
"Underline" ) );
3115 cssElem = cssElem.nextSiblingElement(
"CssParameter" );
3121 if ( textColor.isValid() )
3126 setCustomProperty(
"labeling/textTransp", 100 - (
int )( 100 * textColor.alphaF() ) );
3130 QDomElement haloElem = textSymbolizerElem.firstChildElement(
"Halo" );
3131 if ( !haloElem.isNull() )
3136 QDomElement radiusElem = haloElem.firstChildElement(
"Radius" );
3137 if ( !radiusElem.isNull() )
3140 double bufferSize = radiusElem.text().toDouble( &ok );
3148 if ( bufferColor.isValid() )
3153 setCustomProperty(
"labeling/bufferTransp", 100 - (
int )( 100 * bufferColor.alphaF() ) );
3158 QDomElement labelPlacementElem = textSymbolizerElem.firstChildElement(
"LabelPlacement" );
3159 if ( !labelPlacementElem.isNull() )
3162 QDomElement pointPlacementElem = labelPlacementElem.firstChildElement(
"PointPlacement" );
3163 if ( !pointPlacementElem.isNull() )
3167 QDomElement displacementElem = pointPlacementElem.firstChildElement(
"Displacement" );
3168 if ( !displacementElem.isNull() )
3170 QDomElement displacementXElem = displacementElem.firstChildElement(
"DisplacementX" );
3171 if ( !displacementXElem.isNull() )
3174 double xOffset = displacementXElem.text().toDouble( &ok );
3180 QDomElement displacementYElem = displacementElem.firstChildElement(
"DisplacementY" );
3181 if ( !displacementYElem.isNull() )
3184 double yOffset = displacementYElem.text().toDouble( &ok );
3192 QDomElement rotationElem = pointPlacementElem.firstChildElement(
"Rotation" );
3193 if ( !rotationElem.isNull() )
3196 double rotation = rotationElem.text().toDouble( &ok );
3215 QString myMetadata =
"<html><body>";
3219 myMetadata +=
"<p class=\"subheaderglossy\">";
3220 myMetadata +=
tr(
"General" );
3221 myMetadata +=
"</p>\n";
3226 myMetadata +=
"<p class=\"glossy\">" +
tr(
"Layer comment" ) +
"</p>\n";
3227 myMetadata +=
"<p>";
3229 myMetadata +=
"</p>\n";
3233 myMetadata +=
"<p class=\"glossy\">" +
tr(
"Storage type of this layer" ) +
"</p>\n";
3234 myMetadata +=
"<p>";
3236 myMetadata +=
"</p>\n";
3241 myMetadata +=
"<p class=\"glossy\">" +
tr(
"Description of this provider" ) +
"</p>\n";
3242 myMetadata +=
"<p>";
3244 myMetadata +=
"</p>\n";
3248 myMetadata +=
"<p class=\"glossy\">" +
tr(
"Source for this layer" ) +
"</p>\n";
3249 myMetadata +=
"<p>";
3251 myMetadata +=
"</p>\n";
3265 myMetadata +=
"<p class=\"glossy\">" +
tr(
"Geometry type of the features in this layer" ) +
"</p>\n";
3266 myMetadata +=
"<p>";
3267 myMetadata += typeString;
3268 myMetadata +=
"</p>\n";
3272 if ( !pkAttrList.isEmpty() )
3274 myMetadata +=
"<p class=\"glossy\">" +
tr(
"Primary key attributes" ) +
"</p>\n";
3275 myMetadata +=
"<p>";
3276 foreach (
int idx, pkAttrList )
3280 myMetadata +=
"</p>\n";
3285 myMetadata +=
"<p class=\"glossy\">" +
tr(
"The number of features in this layer" ) +
"</p>\n";
3286 myMetadata +=
"<p>";
3288 myMetadata +=
"</p>\n";
3290 myMetadata +=
"<p class=\"glossy\">" +
tr(
"Editing capabilities of this layer" ) +
"</p>\n";
3291 myMetadata +=
"<p>";
3293 myMetadata +=
"</p>\n";
3298 myMetadata +=
"<p class=\"subheaderglossy\">";
3299 myMetadata +=
tr(
"Extents" );
3300 myMetadata +=
"</p>\n";
3303 myMetadata +=
"<p class=\"glossy\">" +
tr(
"In layer spatial reference system units" ) +
"</p>\n";
3304 myMetadata +=
"<p>";
3317 QString xMin, yMin, xMax, yMax;
3318 double changeoverValue = 99999;
3319 if ( qAbs( myExtent.
xMinimum() ) > changeoverValue )
3321 xMin = QString(
"%1" ).arg( myExtent.
xMinimum(), 0,
'f', 2 );
3325 xMin = QString(
"%1" ).arg( myExtent.
xMinimum() );
3327 if ( qAbs( myExtent.
yMinimum() ) > changeoverValue )
3329 yMin = QString(
"%1" ).arg( myExtent.
yMinimum(), 0,
'f', 2 );
3333 yMin = QString(
"%1" ).arg( myExtent.
yMinimum() );
3335 if ( qAbs( myExtent.
xMaximum() ) > changeoverValue )
3337 xMax = QString(
"%1" ).arg( myExtent.
xMaximum(), 0,
'f', 2 );
3341 xMax = QString(
"%1" ).arg( myExtent.
xMaximum() );
3343 if ( qAbs( myExtent.
yMaximum() ) > changeoverValue )
3345 yMax = QString(
"%1" ).arg( myExtent.
yMaximum(), 0,
'f', 2 );
3349 yMax = QString(
"%1" ).arg( myExtent.
yMaximum() );
3352 myMetadata +=
tr(
"xMin,yMin %1,%2 : xMax,yMax %3,%4" )
3353 .arg( xMin ).arg( yMin ).arg( xMax ).arg( yMax );
3357 myMetadata +=
tr(
"unknown extent" );
3360 myMetadata +=
"</p>\n";
3368 QgsRectangle myProjectedExtent = coordinateTransform->transformBoundingBox(
extent() );
3369 myMetadata +=
"<p class=\"glossy\">" +
tr(
"In project spatial reference system units" ) +
"</p>\n";
3370 myMetadata +=
"<p>";
3371 myMetadata +=
tr(
"xMin,yMin %1,%2 : xMax,yMax %3,%4" )
3372 .arg( myProjectedExtent.
xMinimum() )
3373 .arg( myProjectedExtent.
yMinimum() )
3374 .arg( myProjectedExtent.
xMaximum() )
3375 .arg( myProjectedExtent.
yMaximum() );
3376 myMetadata +=
"</p>\n";
3382 myMetadata +=
"<p class=\"glossy\">" +
tr(
"Layer Spatial Reference System" ) +
"</p>\n";
3383 myMetadata +=
"<p>";
3384 myMetadata +=
crs().
toProj4().replace( QRegExp(
"\"" ),
" \"" );
3385 myMetadata +=
"</p>\n";
3393 myMetadata +=
"<p class=\"glossy\">" +
tr(
"Project (Output) Spatial Reference System" ) +
"</p>\n";
3394 myMetadata +=
"<p>";
3395 myMetadata += coordinateTransform->destCRS().toProj4().replace( QRegExp(
"\"" ),
" \"" );
3396 myMetadata +=
"</p>\n";
3404 myMetadata +=
"<p class=\"glossy\">" +
tr(
"In project spatial reference system units" ) +
"</p>\n";
3405 myMetadata +=
"<p>";
3406 myMetadata +=
tr(
"(Invalid transformation of layer extents)" );
3407 myMetadata +=
"</p>\n";
3415 myMetadata +=
"<p class=\"glossy\">" +
tr(
"Attribute field info" ) +
"</p>\n";
3416 myMetadata +=
"<p>";
3419 myMetadata +=
"<table width=\"100%\">";
3420 myMetadata +=
"<tr><th>";
3421 myMetadata +=
tr(
"Field" );
3422 myMetadata +=
"</th>";
3423 myMetadata +=
"<th>";
3424 myMetadata +=
tr(
"Type" );
3425 myMetadata +=
"</th>";
3426 myMetadata +=
"<th>";
3427 myMetadata +=
tr(
"Length" );
3428 myMetadata +=
"</th>";
3429 myMetadata +=
"<th>";
3430 myMetadata +=
tr(
"Precision" );
3431 myMetadata +=
"</th>";
3432 myMetadata +=
"<th>";
3433 myMetadata +=
tr(
"Comment" );
3434 myMetadata +=
"</th>";
3438 for (
int i = 0, n = myFields.
size(); i < n; ++i )
3440 const QgsField& myField = fields[i];
3442 myMetadata +=
"<tr><td>";
3443 myMetadata += myField.
name();
3444 myMetadata +=
"</td>";
3445 myMetadata +=
"<td>";
3447 myMetadata +=
"</td>";
3448 myMetadata +=
"<td>";
3449 myMetadata += QString(
"%1" ).arg( myField.
length() );
3450 myMetadata +=
"</td>";
3451 myMetadata +=
"<td>";
3452 myMetadata += QString(
"%1" ).arg( myField.
precision() );
3453 myMetadata +=
"</td>";
3454 myMetadata +=
"<td>";
3455 myMetadata += QString(
"%1" ).arg( myField.
comment() );
3456 myMetadata +=
"</td></tr>";
3460 myMetadata +=
"</table>";
3463 myMetadata +=
"</body></html>";
3496 cfg.value(
"Key" ).toString(),
3497 cfg.value(
"Value" ).toString(),
3498 cfg.value(
"AllowNull" ).toBool(),
3499 cfg.value(
"OrderByValue" ).toBool(),
3500 cfg.value(
"AllowMulti" ).toBool(),
3501 cfg.value(
"FilterExpression" ).toString()
3527 QDomElement elem = doc.createElement(
"attributeEditorContainer" );
3528 elem.setAttribute(
"name",
mName );
3544 QList<QgsAttributeEditorElement*> results;
3550 results.append( elem );
3565 QDomElement elem = doc.createElement(
"attributeEditorField" );
3566 elem.setAttribute(
"name",
mName );
3567 elem.setAttribute(
"index",
mIdx );
3582 if ( !listStylesExternalMethod )
3589 return listStylesExternalMethod(
mDataSource, ids, names, descriptions, msgError );
3603 if ( !getStyleByIdMethod )
3610 return getStyleByIdMethod(
mDataSource, styleId, msgError );
3615 bool useAsDefault, QString uiFileContent, QString &msgError )
3618 QString sldStyle, qmlStyle;
3628 if ( !saveStyleExternalMethod )
3635 QDomDocument qmlDocument, sldDocument;
3637 if ( !msgError.isNull() )
3641 qmlStyle = qmlDocument.toString();
3644 if ( !msgError.isNull() )
3648 sldStyle = sldDocument.toString();
3650 saveStyleExternalMethod(
mDataSource, qmlStyle, sldStyle, name,
3651 description, uiFileContent, useAsDefault, msgError );
3664 if ( !loadFromLocalDB && !dsUri.
database().isEmpty() )
3671 if ( loadStyleExternalMethod )
3673 QString qml, errorMsg;
3674 qml = loadStyleExternalMethod(
mDataSource, errorMsg );
3675 if ( !qml.isEmpty() )
3689 QDomDocument myDocument(
"qgis" );
3690 myDocument.setContent( namedStyle );
3692 QDomElement myRoot = myDocument.firstChildElement(
"qgis" );
3694 if ( myRoot.isNull() )
3696 errorMsg =
tr(
"Error: qgis element could not be found" );
3705 QDomNode transparencyNode = myRoot.namedItem(
"transparencyLevelInt" );
3706 if ( ! transparencyNode.isNull() )
3710 QDomElement myElement = transparencyNode.toElement();
3711 setTransparency( myElement.text().toInt() );
3721 QDomElement elem = doc.createElement(
"attributeEditorRelation" );
3722 elem.setAttribute(
"name",
mName );
QgsFeatureId id() const
Get the feature id for this feature.
bool deleteVertex(QgsFeatureId atFeatureId, int atVertex)
Deletes a vertex from a feature.
virtual QString subsetString()
Get the string (typically sql) used to define a subset of the layer.
virtual QDomElement toDomElement(QDomDocument &doc) const
const QgsEditorWidgetConfig editorWidgetV2Config(int fieldIdx) const
Get the configuration for the editor widget used to represent the field at the given index...
Class for parsing and evaluation of expressions (formerly called "search strings").
void updateFields()
Assembles mUpdatedFields considering provider fields, joined fields and added fields.
const QString & name() const
Gets the name of the field.
EditorLayout mEditorLayout
Defines the default layout to use for the attribute editor (Drag and drop, UI File, Generated)
bool hasEvalError() const
Returns true if an error occurred when evaluating last input.
const QList< QgsVectorJoinInfo > & vectorJoins() const
int mWkbType
Geometry type as defined in enum WkbType (qgis.h)
Wrapper for iterator of features from vector data provider or vector layer.
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
bool isValid() const
Returns the validity of this relation.
void selectAll()
Select all the features.
bool intersects(const QgsRectangle &rect) const
returns true when rectangle intersects with other rectangle
QgsFeatureRendererV2 * rendererV2()
Return renderer V2.
#define RENDERER_TAG_NAME
virtual QString subsetString()
Returns the subset definition string (typically sql) currently in use by the layer and used by the pr...
bool fieldEditable(int idx)
is edit widget editable
virtual QString getStyleFromDatabase(QString styleId, QString &msgError)
Will return the named style corresponding to style id provided.
virtual bool willRenderFeature(QgsFeature &feat)
return whether the renderer will render a feature or not.
A rectangle specified with double values.
Base class for all map layer types.
QSet< QString > mExcludeAttributesWFS
Attributes which are not published in WFS.
QgsVectorLayer::FeatureFormSuppress mFeatureFormSuppress
Type of feature form suppression after feature creation.
bool init(QgsRelationManager *relManager)
Initializes the relation from the id.
void setDiagramLayerSettings(const QgsDiagramLayerSettings &s)
bool isEmpty() const
test if rectangle is empty.
int insertSegmentVerticesForSnap(const QList< QgsSnappingResult > &snapResults)
Inserts vertices to the snapped segments.
field comes from a joined layer (originIndex / 1000 = index of the join, originIndex % 1000 = index w...
float threshold() const
Gets the simplification threshold of the vector layer managed.
void clearAttributeEditorWidgets()
Clears all the tabs for the attribute editor form.
QgsFeatureList selectedFeatures()
Get a copy of the user-selected features.
QgsVectorDataProvider * mDataProvider
Pointer to data provider derived from the abastract base class QgsDataProvider.
QgsMapLayer::LayerType type() const
Get the type of the layer.
bool addAttribute(const QgsField &field)
add an attribute field (but does not commit it) returns true if the field was added ...
void setMinimal()
Set a rectangle so that min corner is at max and max corner is at min.
int makeDifference(QgsGeometry *other)
Changes this geometry such that it does not intersect the other geometry.
EditorLayout editorLayout()
get the active layout for the attribute editor for this layer (added in 1.9)
virtual void saveStyleToDatabase(QString name, QString description, bool useAsDefault, QString uiFileContent, QString &msgError)
Save named and sld style of the layer to the style table in the db.
void createJoinCaches()
Calls cacheJoinLayer() for all vector joins.
virtual void updateExtents()
Update the extents of the layer.
void readCustomProperties(const QDomNode &layerNode, const QString &keyStartsWith="")
Read custom properties from project file.
QList< QgsSymbolV2 * > QgsSymbolV2List
void removeJoin(const QString &joinLayerId)
Removes a vector layer join.
QString publicSource() const
void beforeRollBack()
Is emitted, before changes are rolled back.
bool addFeatures(QgsFeatureList &features)
Insert a copy of the given features into the layer (but does not commit it)
EditorLayout
The different types to layout the attribute editor.
Use exact geometry intersection (slower) instead of bounding boxes.
static QgsFeatureRendererV2 * loadSld(const QDomNode &node, QGis::GeometryType geomType, QString &errorMessage)
create a new renderer according to the information contained in the UserStyle element of a SLD style ...
void setEditFormInit(QString function)
set python function for edit form initialization (added in 1.4)
int translateFeature(QgsFeatureId featureId, double dx, double dy)
Translates feature by dx, dy.
QVariant maximumValue(int index)
Returns maximum value for an attribute column or invalid variant in case of error.
Renders the diagrams for all features with the same settings.
QString capabilitiesString() const
Returns the above in friendly format.
QMap< QString, QgsEditorWidgetConfig > mEditorWidgetV2Configs
Q_DECL_DEPRECATED int removePolygonIntersections(QgsGeometry *geom, QgsFeatureIds ignoreFeatures=QgsFeatureIds())
Changes the specified geometry such that it has no intersections with other polygon (or multipolygon)...
bool addFeature(QgsFeature &f)
Adds a feature.
static QgsProviderRegistry * instance(QString pluginPath=QString::null)
means of accessing canonical single instance
field has been temporarily added in editing mode (originIndex = index in the list of added attributes...
void layerTransparencyChanged(int layerTransparency)
Signal emitted when setLayerTransparency() is called.
double yMaximum() const
Get the y maximum value (top side of rectangle)
bool deleteFeature(QgsFeatureId fid)
delete a feature from the layer (but does not commit it)
virtual QgsCoordinateReferenceSystem crs()=0
QSet< QgsFeatureId > QgsFeatureIds
void uniqueValues(int index, QList< QVariant > &uniqueValues, int limit=-1)
Returns unique values for column.
QList< QgsFeature > QgsFeatureList
void drawLabels(QgsRenderContext &rendererContext)
Draws the layer labels using coordinate transformation.
void beginEditCommand(QString text)
Create edit command for undo/redo operations.
QList< QgsAttributeEditorElement * > mAttributeEditorElements
Stores a list of attribute editor elements (Each holding a tree structure for a tab in the attribute ...
int fieldNameIndex(const QString &fieldName) const
Look up field's index from name - case insensitive TODO: sort out case sensitive (indexFromName()) vs...
double rendererScale() const
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())
Query the provider for features specified in request.
virtual QDomElement save(QDomDocument &doc)
store renderer info to XML element
friend class QgsVectorLayerFeatureSource
void setForceLocalOptimization(bool localOptimization)
Sets where the simplification executes, after fetch the geometries from provider, or when supported...
QgsFeatureRendererV2 * mRendererV2
Renderer object which holds the information about how to display the features.
void invertSelectionInRectangle(QgsRectangle &rect)
Invert selection of features found within the search rectangle (in layer's coordinates) ...
bool commitChanges()
Attempts to commit any changes to disk.
void setRendererV2(QgsFeatureRendererV2 *r)
Set renderer V2.
void deleteCachedGeometries()
Deletes the geometries in mCachedGeometries.
Storage and management of actions associated with Qgis layer attributes.
QgsGeometry * geometry() const
Get the geometry object associated with this feature.
virtual void setEncoding(const QString &e)
Set encoding used for accessing data from layer.
bool startEditing()
Make layer editable.
void setSimplifyHints(SimplifyHints simplifyHints)
Sets the simplification hints of the vector layer managed.
bool contains(const QgsRectangle &rect) const
return true when rectangle contains other rectangle
void setRendererScale(double scale)
void setCustomProperty(const QString &key, const QVariant &value)
Set a custom property for layer.
VertexMarkerType
Editing vertex markers.
double closestSegmentWithContext(const QgsPoint &point, QgsPoint &minDistPoint, int &afterVertex, double *leftOf=0, double epsilon=DEFAULT_SEGMENT_EPSILON)
Searches for the closest segment of geometry to the given point.
void select(QgsRectangle &rect, bool addToSelection)
Select features found within the search rectangle (in layer's coordinates)
QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const
Type of feature form pop-up suppression after feature creation (overrides app setting) ...
#define Q_NOWARN_DEPRECATED_PUSH
int precision() const
Gets the precision of the field.
void renderLabel(QgsRenderContext &renderContext, QgsFeature &feature, bool selected, QgsLabelAttributes *classAttributes=0)
render label
QgsFeatureRequest & setSubsetOfAttributes(const QgsAttributeList &attrs)
Set a subset of attributes that will be fetched.
virtual QgsLegendSymbolList legendSymbolItems(double scaleDenominator=-1, QString rule="")
return a list of item text / symbol
Q_DECL_DEPRECATED QString dateFormat(int idx)
Access date format.
SimplifyHint
Simplification flags for fast rendering of features.
bool deleteAttributes(QList< int > attrs)
Deletes a list of attribute fields (but does not commit it)
void addAttributeAlias(int attIndex, QString aliasString)
Sets an alias (a display name) for attributes to display in dialogs.
static const char * vectorGeometryType(GeometryType type)
description strings for geometry types
QString mDisplayExpression
the preview expression used to generate a human readable preview string for features ...
QGis::GeometryType type()
Returns type of the vector.
int insertSegmentVerticesForSnap(const QList< QgsSnappingResult > &snapResults)
Inserts vertices to the snapped segments.
Q_DECL_DEPRECATED QMap< QString, QVariant > valueMap(int idx)
Access value map.
void readXml(const QDomNode &layer_node)
Reads joins from project file.
virtual void uniqueValues(int index, QList< QVariant > &uniqueValues, int limit=-1)
Return unique values of an attribute.
virtual bool writeXml(QDomNode &layer_node, QDomDocument &doc)
write vector layer specific state to project file Dom node.
Container of fields for a vector layer.
void rollBack()
Stop editing and discard the edits.
const QgsRectangle & cachedGeometriesRect()
void setDiagramRenderer(QgsDiagramRendererV2 *r)
Sets diagram rendering object (takes ownership)
void setLayerTransparency(int layerTransparency)
Write transparency for layer.
ValueRelationData valueRelation(int idx)
Access value relation widget data.
bool readSld(const QDomNode &node, QString &errorMessage)
QgsChangedAttributesMap mChangedAttributeValues
Changed attributes values which are not commited.
WkbType
Used for symbology operations.
QMap< QString, bool > mFieldEditables
const QgsRectangle & extent() const
void setDisplayExpression(const QString &displayExpression)
Set the preview expression, used to create a human readable preview string.
bool addFeature(QgsFeature &f, bool alsoUpdateExtent=true)
Adds a feature.
virtual QList< QString > usedAttributes()=0
field comes from the underlying data provider of the vector layer (originIndex = index in provider's ...
int addPart(const QList< QgsPoint > &ring, QgsFeatureId featureId)
Adds a new part polygon to a multipart feature.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QList< QgsRelation > referencingRelations(int idx)
Get relations, where the foreign key is on this layer.
static const int EditingCapabilities
bitmask of all provider's editing capabilities
virtual ~QgsVectorLayer()
Destructor.
virtual QgsAttributeList pkAttributeIndexes()
Return list of indexes of fields that make up the primary key.
const QString displayExpression()
Get the preview expression, used to create a human readable preview string.
bool deleteVertex(QgsFeatureId atFeatureId, int atVertex)
Deletes a vertex from a feature.
void beforeCommitChanges()
Is emitted, before changes are commited to the data provider.
QStringList mCommitErrors
QgsPoint closestVertex(const QgsPoint &point, int &atVertex, int &beforeVertex, int &afterVertex, double &sqrDist)
Returns the vertex closest to the given point, the corresponding vertex index, squared distance snap ...
QgsPoint vertexAt(int atVertex)
Returns coordinates of a vertex.
void committedFeaturesRemoved(const QString &layerId, const QgsFeatureIds &deletedFeatureIds)
QVariant minimumValue(int index)
Returns minimum value for an attribute column or invalid variant in case of error.
bool insertVertex(double x, double y, QgsFeatureId atFeatureId, int beforeVertex)
Insert a new vertex before the given vertex number, in the given ring, item (first number is index 0)...
void featureDeleted(QgsFeatureId fid)
QString readPath(QString filename) const
turn filename read from the project file to an absolute path
void editCommandEnded()
Signal emitted, when an edit command successfully ended.
void setBlendMode(const QPainter::CompositionMode &blendMode)
Write blend mode for layer.
bool setDataProvider(QString const &provider)
bind layer to a specific data provider
void setMaximumScale(float theMaxScale)
Accessor and mutator for the maximum scale denominator member.
BlendMode
Blending modes enum defining the available composition modes that can be used when rendering a layer...
void invertSelection()
Select not selected features and deselect selected ones.
int splitFeatures(const QList< QgsPoint > &splitLine, bool topologicalEditing=false)
Splits features cut by the given line.
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)=0
static void logMessage(QString message, QString tag=QString::null, MessageLevel level=WARNING)
add a message to the instance (and create it if necessary)
virtual void updateExtents()
Update the extents for the layer.
Returns diagram settings for a feature.
QGis::WkbType wkbType() const
Returns the WKBType or WKBUnknown in case of error.
void removeSelection()
Clear selection.
Manages joined fields for a vector layer.
const QgsVectorJoinInfo * joinForFieldIndex(int index, const QgsFields &fields, int &sourceFieldIndex) const
Finds the vector join for a layer field index.
QString editForm()
get edit form (added in 1.4)
void set(const QgsPoint &p1, const QgsPoint &p2)
Set the rectangle from two QgsPoints.
virtual void stopRender(QgsRenderContext &context)=0
void setEditorLayout(EditorLayout editorLayout)
set the active layout for the attribute editor for this layer (added in 1.9)
bool writeXML(QDomNode &layer_node, QDomDocument &doc) const
Writes the actions out in XML format.
QgsGeometryMap & cachedGeometries()
double ANALYSIS_EXPORT max(double x, double y)
returns the maximum of two doubles or the first argument if both are equal
bool containsJoins() const
Quick way to test if there is any join at all.
const QString & name() const
Get the display name of the layer.
void checkJoinLayerRemove(QString theLayerId)
Check if there is a join with a layer that will be removed.
QgsRectangle extent()
Return the extent of the layer as a QRect.
virtual int listStylesInDatabase(QStringList &ids, QStringList &names, QStringList &descriptions, QString &msgError)
Lists all the style in db split into related to the layer and not related to.
SnappingType
Snap to vertex, to segment or both.
QString encoding() const
Get encoding which is used for accessing data.
virtual void writeXML(QDomElement &layerElem, QDomDocument &doc, const QgsVectorLayer *layer) const =0
virtual QVariant maximumValue(int index)
Returns the maximum value of an attribute.
virtual QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext)
Return new instance of QgsMapLayerRenderer that will be used for rendering of given context...
QgsFeatureRequest & setFilterFid(QgsFeatureId fid)
Set feature ID that should be fetched.
QList< QgsAttributeEditorElement * > mChildren
void geometryChanged(QgsFeatureId fid, QgsGeometry &geom)
void combineExtentWith(QgsRectangle *rect)
expand the rectangle so that covers both the original rectangle and the given rectangle ...
QPainter::CompositionMode blendMode() const
Read blend mode for layer.
bool simplifyDrawingCanbeApplied(const QgsRenderContext &renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint) const
Returns whether the VectorLayer can apply the specified simplification hint.
virtual void reload()
Synchronises with changes in the datasource.
void deselect(const QgsFeatureId featureId)
Deselect feature by its ID.
QPainter::CompositionMode featureBlendMode() const
Read blend mode for layer.
bool writeSld(QDomNode &node, QDomDocument &doc, QString &errorMessage) const
bool rollBack(bool deleteBuffer=true)
Stop editing and discard the edits.
QgsGeometryCache * mCache
cache for some vector layer data - currently only geometries for faster editing
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
virtual bool setSubsetString(QString subset, bool updateFeatureCount=true)
Set the subset string used to create a subset of features in the layer.
QgsDataProvider * provider(const QString &providerKey, const QString &dataSource)
Create an instance of the provider.
double xMaximum() const
Get the x maximum value (right side of rectangle)
QString attributeDisplayName(int attributeIndex) const
Convenience function that returns the attribute alias if defined or the field name else...
const QgsFeatureIds & selectedFeaturesIds() const
Return reference to identifiers of selected features.
QString capabilitiesString() const
Capabilities for this layer in a friendly format.
QgsRelation relation(const QString &id) const
virtual QString dataComment() const
Return a short comment for the data that this provider is providing access to (e.g.
Represents the result of a snapping operation.
void readXML(const QDomElement &elem, const QgsVectorLayer *layer)
void setCrs(const QgsCoordinateReferenceSystem &srs, bool emitSignal=true)
Sets layer's spatial reference system.
Q_DECL_DEPRECATED EditType editType(int idx)
Get edit type.
virtual int capabilities() const
Returns a bitmask containing the supported capabilities Note, some capabilities may change depending ...
int snapWithContext(const QgsPoint &startPoint, double snappingTolerance, QMultiMap< double, QgsSnappingResult > &snappingResults, QgsSnapper::SnappingType snap_to)
Snaps to segment or vertex within given tolerance.
const QString & id() const
The id.
const QString editorWidgetV2(int fieldIdx) const
Get the id for the editor widget used to represent the field at the given index.
virtual void setExtent(const QgsRectangle &rect)
Set the extent.
int addTopologicalPoints(QgsGeometry *geom)
Adds topological points for every vertex of the geometry.
void setScaleBasedVisibility(bool theVisibilityFlag)
Accessor and mutator for the scale based visilibility flag.
void committedFeaturesAdded(const QString &layerId, const QgsFeatureList &addedFeatures)
virtual QDomElement toDomElement(QDomDocument &doc) const
int addPart(const QList< QgsPoint > &ring)
Adds a new part polygon to a multipart feature.
int fieldOriginIndex(int fieldIdx) const
Get field's origin index (its meaning is specific to each type of origin)
bool deleteAttribute(int attr)
delete an attribute field (but does not commit it)
void editingStopped()
Is emitted, when edited changes successfully have been written to the data provider.
QgsGeometryMap mChangedGeometries
Changed geometries which are not commited.
int translateFeature(QgsFeatureId featureId, double dx, double dy)
Translates feature by dx, dy.
bool moveVertex(double x, double y, QgsFeatureId atFeatureId, int atVertex)
Moves the vertex at the given position number, ring and item (first number is index 0)...
virtual QString storageType() const
Returns the permanent storage type for this layer as a friendly name.
virtual long featureCount() const =0
Number of features in the layer.
QgsVectorLayer(QString path=QString::null, QString baseName=QString::null, QString providerLib=QString::null, bool loadDefaultStyleFlag=true)
Constructor - creates a vector layer.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
int pendingFeatureCount()
returns feature count after commit
QList< int > QgsAttributeList
void readSldLabeling(const QDomNode &node)
Add joined attributes to a feature.
AttributeEditorType type() const
void destroyEditCommand()
Destroy active command and reverts all changes in it.
Q_DECL_DEPRECATED bool changeAttributeValue(QgsFeatureId fid, int field, QVariant value, bool emitSignal)
Changes an attribute value (but does not commit it)
const QgsAttributes & attributes() const
bool scaleBasedVisibility() const
bool mSymbolFeatureCounted
void writeCustomProperties(QDomNode &layerNode, QDomDocument &doc) const
Write custom properties to project file.
const QString displayField() const
Returns the primary display field name used in the identify results dialog.
int count() const
Return number of items.
bool setReadOnly(bool readonly=true)
Make layer read-only (editing disabled) or not.
bool changeGeometry(QgsFeatureId fid, QgsGeometry *geom)
change feature's geometry
virtual bool isModified() const
Returns true if the provider has been modified since the last commit.
QGis::GeometryType geometryType() const
Returns point, line or polygon.
QString labelField(int attr) const
label field
QgsFeatureIds mDeletedFeatureIds
Deleted feature IDs which are not commited.
int afterVertexNr
The index of the vertex after snappedVertex or -1 if no such vertex.
QgsVectorSimplifyMethod mSimplifyMethod
Simplification object which holds the information about how to simplify the features for fast renderi...
QgsDiagramLayerSettings * mDiagramLayerSettings
Encapsulate a field in an attribute table or data source.
void featureAdded(QgsFeatureId fid)
static QgsFeatureRendererV2 * defaultRenderer(QGis::GeometryType geomType)
return a new renderer - used by default in vector layers
void setFeatureBlendMode(const QPainter::CompositionMode &blendMode)
Write blend mode for features.
QMap< QgsSymbolV2 *, long > mSymbolFeatureCountMap
void rendererChanged()
Signal emitted when renderer is changed.
virtual QGis::WkbType geometryType() const =0
Get feature type.
QString attributeAlias(int attributeIndex) const
Returns the alias of an attribute name or an empty string if there is no alias.
fast access to features using their ID
void readXML(const QDomNode &node)
Reads the renderer configuration from an XML file.
QgsFeatureId snappedAtGeometry
Index of the snapped geometry.
bool mValid
Indicates if the layer is valid and can be drawn.
bool useRenderingOptimization() const
Returns true if the rendering optimization (geometry simplification) can be executed.
virtual bool readXml(const QDomNode &layer_node)
reads vector layer specific state from project file Dom node.
QMap< QString, int > fieldNameMap() const
Return a map where the key is the name of the field and the value is its index.
const QList< QgsVectorJoinInfo > & vectorJoins() const
void editingStarted()
Is emitted, when editing on this layer has started.
static void drawVertexMarker(double x, double y, QPainter &p, QgsVectorLayer::VertexMarkerType type, int vertexSize)
Draws a vertex symbol at (screen) coordinates x, y.
bool addFeatures(QgsFeatureList features, bool makeSelected=true)
Insert a copy of the given features into the layer (but does not commit it)
A class to represent a point geometry.
QList< QgsRelation > referencingRelations(QgsVectorLayer *layer=0, int fieldIdx=-2) const
void writeXML(QDomNode &label_node, QDomDocument &document) const
Writes the contents of the renderer to a configuration file.
void removeJoin(const QString &joinLayerId)
Removes a vector layer join.
void endEditCommand()
Finish edit command and add it to undo/redo stack.
bool commitChanges(QStringList &commitErrors)
Attempts to commit any changes to disk.
int addRing(const QList< QgsPoint > &ring)
Adds a ring to polygon/multipolygon features.
QMap< QString, QString > mAttributeAliasMap
Map that stores the aliases for attributes.
bool deleteAttribute(int attr)
delete an attribute field (but does not commit it)
const QStringList & commitErrors()
bool labelOnTop(int idx)
label widget on top
void invalidateSymbolCountedFlag()
bool readSymbology(const QDomNode &node, QString &errorMessage)
Read the symbology for the current layer from the Dom node supplied.
QgsPoint beforeVertex
The layer coordinates of the vertex before snappedVertex.
bool forceLocalOptimization() const
Gets where the simplification executes, after fetch the geometries from provider, or when supported...
QgsVectorLayerEditBuffer * mEditBuffer
stores information about uncommitted changes to layer
Class for storing the component parts of a PostgreSQL/RDBMS datasource URI.
QgsPoint afterVertex
The layer coordinates of the vertex after snappedVertex.
virtual QDomElement toDomElement(QDomDocument &doc) const
int addTopologicalPoints(QgsGeometry *geom)
Adds topological points for every vertex of the geometry.
void editCommandDestroyed()
Signal emitted, whan an edit command is destroyed.
bool isGeosEqual(QgsGeometry &)
compare geometries using GEOS
void setMaximumScale(float maximumScale)
Sets the maximum scale at which the layer should be simplified.
void setEditorWidgetV2Config(int attrIdx, const QgsEditorWidgetConfig &config)
Set the editor widget config for a field.
bool countSymbolFeatures(bool showProgress=true)
Count features for symbols.
A class to render labels.
A registry / canonical manager of data providers.
void setProviderEncoding(const QString &encoding)
Sets the textencoding of the data provider.
virtual bool isReadOnly() const
Returns true if the provider is in read-only mode.
virtual QString loadNamedStyle(const QString &theURI, bool &theResultFlag, bool loadFromLocalDb)
Load a named style from file/local db/datasource db.
QgsAttributeEditorElement * attributeEditorElementFromDomElement(QDomElement &elem, QObject *parent)
convert a saved attribute editor element into a AttributeEditor structure as it's used internally...
Implementation of threaded rendering for vector layers.
int layerTransparency() const
Read transparency for layer.
static Q_DECL_DEPRECATED const QString convertEditType(QgsVectorLayer::EditType editType, QgsEditorWidgetConfig &cfg, QgsVectorLayer *vl, const QString &name, const QDomElement editTypeElement=QDomElement())
static QPainter::CompositionMode getCompositionMode(const QgsMapRenderer::BlendMode &blendMode)
Returns a QPainter::CompositionMode corresponding to a BlendMode Added in 1.9.
QLibrary * providerLibrary(const QString &providerKey) const
int snappedVertexNr
The vertex index of snappedVertex or -1 if no such vertex number (e.g.
#define Q_NOWARN_DEPRECATED_POP
bool snapPoint(QgsPoint &point, double tolerance)
Snaps a point to the closest vertex if there is one within the snapping tolerance.
void setEditorWidgetV2(int attrIdx, const QString &widgetType)
Set the editor widget type for a field.
void addRequiredFields(QgsAttributeList &fields) const
add vector of required fields to existing list of fields
Q_DECL_DEPRECATED void setEditType(int idx, EditType edit)
Get edit type.
virtual void exportNamedStyle(QDomDocument &doc, QString &errorMsg)
Export the properties of this layer as named style in a QDomDocument.
bool updateFeature(QgsFeature &f)
Updates an existing feature.
void selectionChanged()
This signal is emitted when selection was changed.
bool insertVertex(double x, double y, QgsFeatureId atFeatureId, int beforeVertex)
Insert a new vertex before the given vertex number, in the given ring, item (first number is index 0)...
QString providerType() const
Return the provider type for this layer.
void featureBlendModeChanged(const QPainter::CompositionMode &blendMode)
Signal emitted when setFeatureBlendMode() is called.
QgsRectangle boundingBox()
Returns the bounding box of this feature.
QgsDiagramRendererV2 * mDiagramRenderer
bool hasGeometryType() const
Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeome...
void attributeAdded(int idx)
Will be emitted, when a new attribute has been added to this vector layer.
virtual long featureCount() const
Number of features in the layer.
Q_DECL_DEPRECATED QSize widgetSize(int idx)
Access widget size for photo and webview widget.
Contains information about the context of a rendering operation.
void setMaxScale(float theMaxScale)
Accessor and mutator for the maximum scale member.
int addRing(const QList< QgsPoint > &ring)
Adds a ring to polygon/multipolygon features.
QString mDisplayField
index of the primary label field
QString getStyleById_t(const QString &uri, QString styleID, QString &errCause)
virtual QDomElement toDomElement(QDomDocument &doc) const =0
virtual const QgsFields & fields() const =0
Return a map of indexes with field names for this layer.
QSet< QString > mExcludeAttributesWMS
Attributes which are not published in WMS.
void editCommandStarted(const QString &text)
Signal emitted when a new edit command has been started.
QString loadStyle_t(const QString &uri, QString &errCause)
static QgsMapLayerRegistry * instance()
Returns the instance pointer, creating the object on the first call.
QVariant attribute(const QString &name) const
Lookup attribute value from attribute name.
QgsAttributeList pendingAllAttributesList()
returns list of attributes
virtual QgsRectangle extent()=0
Get the extent of the layer.
void setAnnotationForm(const QString &ui)
set annotation form for layer (added in 1.5)
QMap< QString, QString > mEditorWidgetV2Types
void setExtent(const QgsRectangle &rect)
Set the extent.
QString mDataSource
data source description string, varies by layer type
virtual QString loadDefaultStyle(bool &theResultFlag)
Retrieve the default style for this layer if one exists (either as a .qml file on disk or as a record...
bool mLabelOn
Display labels.
QgsVectorLayerJoinBuffer * mJoinBuffer
bool draw(QgsRenderContext &rendererContext)
Draws the layer.
QVector< QVariant > QgsAttributes
void setSelectedFeatures(const QgsFeatureIds &ids)
Change selection to the new set of features.
virtual QgsSymbolV2List symbolsForFeature(QgsFeature &feat)
return list of symbols used for rendering the feature.
void writeXml(QDomNode &layer_node, QDomDocument &document) const
Saves mVectorJoins to xml under the layer node.
FieldOrigin fieldOrigin(int fieldIdx) const
Get field's origin (value from an enumeration)
This class manages a set of relations between layers.
static QgsFeatureRendererV2 * load(QDomElement &symbologyElem)
create a renderer from XML element
const QString & typeName() const
Gets the field type.
virtual bool setSubsetString(QString subset)
Set the string (typically sql) used to define a subset of the layer.
virtual void reloadData()
Reloads the data from the source.
void beforeModifiedCheck() const
Is emitted, when layer is checked for modifications.
virtual QVariant minimumValue(int index)
Returns the minimum value of an attribute.
void setEditForm(QString ui)
set edit form (added in 1.4)
Q_DECL_DEPRECATED RangeData range(int idx)
Access range widget config data.
virtual bool isValid()=0
Returns true if this is a valid layer.
void snapToGeometry(const QgsPoint &startPoint, QgsFeatureId featureId, QgsGeometry *geom, double sqrSnappingTolerance, QMultiMap< double, QgsSnappingResult > &snappingResults, QgsSnapper::SnappingType snap_to) const
Snaps to a geometry and adds the result to the multimap if it is within the snapping result...
bool moveVertex(double x, double y, QgsFeatureId atFeatureId, int atVertex)
Moves the vertex at the given position number, ring and item (first number is index 0)...
void updateFields(QgsFields &fields)
Updates field map with joined attributes.
void repaintRequested()
By emitting this signal the layer tells that either appearance or content have been changed and any v...
void attributeValueChanged(QgsFeatureId fid, int idx, const QVariant &)
static QgsProject * instance()
access to canonical QgsProject instance
QgsPoint snappedVertex
The coordinates of the snapping result.
Q_DECL_DEPRECATED void setCheckedState(int idx, QString checked, QString notChecked)
Set string representing 'true' for a checkbox (added in 1.4)
Class for storing a coordinate reference system (CRS)
void writeXML(QDomElement &layerElem, QDomDocument &doc, const QgsVectorLayer *layer) const
int length() const
Gets the length of the field.
friend class QgsVectorLayerEditBuffer
QgsLabel * label()
Get the label object associated with this layer.
int size() const
Return number of items.
virtual QString description() const =0
return description
bool hasLabelsEnabled() const
Label is on.
QList< QgsAttributeEditorElement * > & attributeEditorElements()
Returns a list of tabs holding groups and fields.
virtual QDomElement writeSld(QDomDocument &doc, const QgsVectorLayer &layer) const
create the SLD UserStyle element following the SLD v1.1 specs
SimplifyHints simplifyHints() const
Gets the simplification hints of the vector layer managed.
virtual void readXML(const QDomElement &elem, const QgsVectorLayer *layer)=0
const QMap< QString, QgsMapLayer * > & mapLayers()
Retrieve the mapLayers collection (mainly intended for use by projection)
void recalculateExtents()
This is used to send a request that any mapcanvas using this layer update its extents.
QMap< QString, bool > mLabelOnTop
const QString & comment() const
Returns the field comment.
void setFieldEditable(int idx, bool editable)
set edit widget editable
bool deleteFeature(QgsFeatureId fid)
delete a feature from the layer (but does not commit it)
static QColor colorFromOgcFill(const QDomElement &fillElement)
Parse XML with OGC fill into QColor.
bool changeAttributeValue(QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue=QVariant())
changed an attribute value (but does not commit it)
Base class for utility classes that encapsulate information necessary for rendering of map layers...
void setLayerName(const QString &name)
Set the display name of the layer.
const QgsCoordinateReferenceSystem & crs() const
Returns layer's spatial reference system.
allows deletion of features
int mLayerTransparency
Layer transparency.
QgsMapLayer * mapLayer(QString theLayerId)
Retrieve a pointer to a loaded layer by id.
virtual QString loadNamedStyle(const QString &theURI, bool &theResultFlag)
Retrieve a named style for this layer if one exists (either as a .qml file on disk or as a record in ...
void(*)() cast_to_fptr(void *p)
static QgsMapRenderer::BlendMode getBlendModeEnum(const QPainter::CompositionMode &blendMode)
Returns a BlendMode corresponding to a QPainter::CompositionMode Added in 1.9.
QString dataComment() const
Returns a comment for the data in the layer.
void setMinScale(float theMinScale)
Accessor and mutator for the minimum scale member.
Custom exception class for Coordinate Reference System related exceptions.
QUndoStack * undoStack()
Return pointer to layer's undo stack.
const QgsFields & pendingFields() const
returns field list in the to-be-committed state
void setLabelOnTop(int idx, bool onTop)
label widget on top
QgsVectorDataProvider * dataProvider()
Returns the data provider.
virtual void addChildElement(QgsAttributeEditorElement *widget)
int splitParts(const QList< QgsPoint > &splitLine, bool topologicalEditing=false)
Splits parts cut by the given line.
void normalize()
Normalize the rectangle so it has non-negative width/height.
QString editFormInit()
get python function for edit form initialization (added in 1.4)
float maximumScale() const
Gets the maximum scale at which the layer should be simplified.
bool nextFeature(QgsFeature &f)
FeatureFormSuppress
Types of feature form suppression after feature creation.
void setCoordinateSystem()
Setup the coordinate system tranformation for the layer.
This is the base class for vector data providers.
void attributeDeleted(int idx)
Will be emitted, when an attribute has been deleted from this vector layer.
Geometry is not required. It may still be returned if e.g. required for a filter condition.
QgsFields mUpdatedFields
field map to commit
QgsFeatureMap mAddedFeatures
New features which are not commited.
double width() const
Width of the rectangle.
QgsFeatureIds allFeatureIds()
Get all feature Ids.
QgsAttributeList pendingPkAttributesList()
returns list of attribute making up the primary key
virtual bool isEditable() const
Returns true if the provider is in editing mode.
QPainter::CompositionMode mFeatureBlendMode
Blend mode for features.
QString metadata()
Obtain Metadata for this layer.
static QgsFeatureRendererV2 * readOldRenderer(const QDomNode &layerNode, QGis::GeometryType geomType)
Read old renderer definition from XML and create matching new renderer.
bool writeSymbology(QDomNode &node, QDomDocument &doc, QString &errorMessage) const
Write the symbology for the layer into the docment provided.
void updateFields(QgsFields &fields)
virtual QgsRectangle extent()
Return the extent of the layer.
Represents a vector layer which manages a vector based data sets.
int fieldNameIndex(const QString &fieldName) const
Returns the index of a field name or -1 if the field does not exist.
bool addAttribute(const QgsField &field)
add an attribute field (but does not commit it) returns true if the field was added ...
bool isModified() const
Returns true if the provider has been modified since the last commit.
bool deleteSelectedFeatures()
Deletes the selected features.
QString toString(bool automaticPrecision=false) const
returns string representation of form xmin,ymin xmax,ymax
QList< QPair< QString, QgsSymbolV2 * > > QgsLegendSymbolList
int splitParts(const QList< QgsPoint > &splitLine, bool topologicalEditing=false)
Splits parts cut by the given line.
void modifySelection(QgsFeatureIds selectIds, QgsFeatureIds deselectIds)
Modifies the current selection on this layer.
int selectedFeatureCount()
The number of features that are selected in this layer.
void updatedFields()
Is emitted, whenever the fields available from this layer have been changed.
QgsFeatureRequest & setFlags(Flags flags)
Set flags that affect how features will be fetched.
QgsRelationManager * relationManager() const
double xMinimum() const
Get the x minimum value (left side of rectangle)
bool mReadOnly
Flag indicating whether the layer is in read-only mode (editing disabled) or not. ...
QgsFeatureIds mSelectedFeatureIds
Set holding the feature IDs that are activated.
const QgsVectorLayer * layer
Layer where the snap occured.
QString joinLayerId
Source layer.
void layerModified()
This signal is emitted when modifications has been done on layer.
QgsAttributeList mDeletedAttributeIds
deleted attributes fields which are not commited.
QString evalErrorString() const
Returns evaluation error.
QgsAttributeList allAttributesList() const
Utility function to get list of attribute indexes.
virtual bool applyNamedStyle(QString namedStyle, QString errorMsg)
bool readXML(const QDomNode &layer_node)
Reads the actions in in XML format.
bool changeGeometry(QgsFeatureId fid, QgsGeometry *geom)
change feature's geometry
int beforeVertexNr
The index of the vertex before snappedVertex or -1 if no such vertex.
void createJoinCaches()
Caches joined attributes if required (and not already done)
virtual void exportSldStyle(QDomDocument &doc, QString &errorMsg)
Export the properties of this layer as SLD style in a QDomDocument.
virtual QString dataSourceUri() const
Get the data source specification.
int splitFeatures(const QList< QgsPoint > &splitLine, bool topologicalEditing=false)
Splits features cut by the given line.
void setDisplayField(QString fldName="")
Set the primary display field to be used in the identify results dialog.
const CORE_EXPORT QString GEO_EPSG_CRS_AUTHID
Geographic coord sys from EPSG authority.
QString mProviderKey
Data provider key.
void addJoin(const QgsVectorJoinInfo &joinInfo)
Joins another vector layer to this layer.
virtual QList< QgsAttributeEditorElement * > findElements(AttributeEditorType type) const
void toggleScaleBasedVisibility(bool theVisibilityFlag)
Accessor and mutator for the scale based visilibility flag.
double height() const
Height of the rectangle.
QString toProj4() const
Get the Proj Proj4 string representation of this srs.
void enableLabels(bool on)
Set labels on.
void setMinimumScale(float theMinScale)
Accessor and mutator for the minimum scale denominator member.
void setThreshold(float threshold)
Sets the simplification threshold of the vector layer managed.
void addAttributeEditorWidget(QgsAttributeEditorElement *data)
Adds a tab (for the attribute editor form) holding groups and fields.
QgsRectangle boundingBoxOfSelected()
Returns the bounding box of the selected features.
bool saveStyle_t(const QString &uri, const QString &qmlStyle, const QString &sldStyle, const QString &styleName, const QString &styleDescription, const QString &uiFileContent, bool useAsDefault, QString &errCause)
QgsAttributeAction * mActions
The user-defined actions that are accessed from the Identify Results dialog box.
virtual bool render()
Do the rendering (based on data stored in the class)
QString storageType() const
Returns the permanent storage type for this layer as a friendly name.
int listStyles_t(const QString &uri, QStringList &ids, QStringList &names, QStringList &descriptions, QString &errCause)
void addJoin(const QgsVectorJoinInfo &joinInfo)
Joins another vector layer to this layer.