QGIS-Documentation
QGIS-Documentation copied to clipboard
Custom properties added to the Information tab - "working with..." chapters
fixes #8691
Custom properties are not only that geeky feature Richard mentions in his message. Looking around a bit, I found out that they include layer notes (available for all layer types afaik), legend widgets (for rasters and vectors), layer variables (for vectors) and a few more, depending on the layer type, that you can enable in QGIS, without coding. I think it is worth mentioning these easier-to-config (and default) custom properties.
@DelazJ thanks for the review. I spent some time trying to figure out custom properties and I have few questions:
- I noticed that in the Information tab for a raster layer, there are already custom properties without me setting any. I tried several raster files in different projects, and these custom properties were always there. I don't know where they come from?
- Where or how can I find these 'few more' properties for other types of layers (point cloud, mesh, vector tiles, and 3D tiles)?
Maybe @rduivenvoorde or @jadsilva can help with this. Thanks
I'm not aware of other uses then via Python... so this is new to me too :-)
But as it is an easy way to 'save something' for a layer in the project file, I reckon it is used on all kind of different places.
Doing a grep on setCustomProperty in src (cpp) dir reveals a lot of other uses:
$ grep -ir setCustomProperty
server/services/wms/qgswmsgetlegendgraphics.cpp: lt->setCustomProperty( property, showFeatureCount );
server/services/wms/qgswmsrenderer.cpp: layer->setCustomProperty( "sldStyleName", sldStyleName );
gui/layertree/qgslayertreeembeddedconfigwidget.cpp: mLayer->setCustomProperty( QStringLiteral( "embeddedWidgets/count" ), newCount );
gui/layertree/qgslayertreeembeddedconfigwidget.cpp: mLayer->setCustomProperty( QStringLiteral( "embeddedWidgets/%1/id" ).arg( i ), providerId );
gui/layertree/qgslayertreeview.cpp: node->layerNode()->setCustomProperty( QStringLiteral( "expandedLegendNodes" ), lst );
gui/layertree/qgslayertreeview.cpp: node->layerNode()->setCustomProperty( QStringLiteral( "expandedLegendNodes" ), lst );
gui/layertree/qgslayertreeview.cpp: nodeLayer->setCustomProperty( QStringLiteral( "expandedLegendNodes" ), lst );
gui/layertree/qgslayertreeviewdefaultactions.cpp: l->setCustomProperty( QStringLiteral( "overview" ), newValue ? 0 : 1 );
gui/layertree/qgslayertreeviewdefaultactions.cpp: l->setCustomProperty( QStringLiteral( "showFeatureCount" ), newValue ? 0 : 1 );
gui/elevation/qgselevationprofilelayertreeview.cpp: layer->setCustomProperty( QStringLiteral( "_include_in_elevation_profiles" ), checked );
gui/layout/qgslayoutlegendwidget.cpp: currentNode->setCustomProperty( QStringLiteral( "showFeatureCount" ), checked ? 1 : 0 );
gui/layout/qgslayoutlegendwidget.cpp: mLayer->setCustomProperty( QStringLiteral( "legend/title-label" ), label );
gui/layout/qgslayoutlegendwidget.cpp: mLayer->setCustomProperty( QStringLiteral( "legend/column-break" ), QString( checked ? '1' : '0' ) );
gui/layout/qgslayoutlegendwidget.cpp: mNode->setCustomProperty( QStringLiteral( "legend/column-break" ), QString( checked ? '1' : '0' ) );
gui/layout/qgslayoutatlaswidget.cpp: mLayout->setCustomProperty( QStringLiteral( "singleFile" ), state == Qt::Checked );
gui/layout/qgslayoutatlaswidget.cpp: mLayout->setCustomProperty( QStringLiteral( "atlasRasterFormat" ), mAtlasFileFormat->currentText() );
gui/layout/qgslayoutpropertieswidget.cpp: mLayout->setCustomProperty( QStringLiteral( "resizeToContentsLeftMargin" ), mLeftMarginSpinBox->value() );
gui/layout/qgslayoutpropertieswidget.cpp: mLayout->setCustomProperty( QStringLiteral( "resizeToContentsTopMargin" ), mTopMarginSpinBox->value() );
gui/layout/qgslayoutpropertieswidget.cpp: mLayout->setCustomProperty( QStringLiteral( "resizeToContentsBottomMargin" ), mBottomMarginSpinBox->value() );
gui/layout/qgslayoutpropertieswidget.cpp: mLayout->setCustomProperty( QStringLiteral( "resizeToContentsRightMargin" ), mRightMarginSpinBox->value() );
gui/layout/qgslayoutpropertieswidget.cpp: mLayout->setCustomProperty( QStringLiteral( "imageCropMarginUnit" ), static_cast< int >( mMarginUnitsComboBox->unit() ) );
gui/layout/qgslayoutpropertieswidget.cpp: mLayout->setCustomProperty( QStringLiteral( "exportWorldFile" ), mGenerateWorldFileCheckBox->isChecked() );
gui/layout/qgslayoutpropertieswidget.cpp: mLayout->setCustomProperty( QStringLiteral( "rasterize" ), mRasterizeCheckBox->isChecked() );
gui/layout/qgslayoutpropertieswidget.cpp: mLayout->setCustomProperty( QStringLiteral( "forceVector" ), mForceVectorCheckBox->isChecked() );
gui/layout/qgsgeopdflayertreemodel.cpp: vl->setCustomProperty( QStringLiteral( "geopdf/includeFeatures" ), value.toInt() == Qt::Checked );
gui/layout/qgsgeopdflayertreemodel.cpp: ml->setCustomProperty( QStringLiteral( "geopdf/groupName" ), value.toString() );
gui/layout/qgsgeopdflayertreemodel.cpp: ml->setCustomProperty( QStringLiteral( "geopdf/initiallyVisible" ), value.toInt() == Qt::Checked );
gui/attributetable/qgsdualview.cpp: mLayer->setCustomProperty( QStringLiteral( "dualview/previewExpressions" ), previewExpressions );
gui/raster/qgsrasterlayerproperties.cpp: mRasterLayer->setCustomProperty( QStringLiteral( "WMSPrintLayer" ), mWMSPrintLayerLineEdit->text() );
gui/raster/qgsrasterlayerproperties.cpp: mRasterLayer->setCustomProperty( "WMSPublishDataSourceUrl", mPublishDataSourceUrlCheckBox->isChecked() );
gui/raster/qgsrasterlayerproperties.cpp: mRasterLayer->setCustomProperty( "WMSBackgroundLayer", mBackgroundLayerCheckBox->isChecked() );
app/qgsdxfexportdialog.cpp: vl->setCustomProperty( QStringLiteral( "lastDxfOutputAttribute" ), fields.at( attributeIndex ).name() );
app/qgsdxfexportdialog.cpp: vl->setCustomProperty( QStringLiteral( "lastAllowDataDefinedBlocks" ), allowDataDefinedBlocks );
app/qgsdxfexportdialog.cpp: vl->setCustomProperty( QStringLiteral( "lastMaximumNumberOfBlocks" ), maximumNumberOfBlocks );
app/qgisapp.cpp: subLayer->setCustomProperty( QStringLiteral( "_legend_added" ), true );
app/qgisapp.cpp: layer->setCustomProperty( QStringLiteral( "_legend_added" ), true );
app/qgisapp.cpp: nodeL->setCustomProperty( QStringLiteral( "overview" ), 1 );
app/qgisapp.cpp: nodeL->setCustomProperty( QStringLiteral( "overview" ), 0 );
app/qgisapp.cpp: currentGroup->setCustomProperty( QStringLiteral( "wmsShortName" ), dlg->groupShortName() );
app/qgisapp.cpp: currentGroup->setCustomProperty( QStringLiteral( "wmsTitle" ), dlg->groupTitle() );
app/qgisapp.cpp: currentGroup->setCustomProperty( QStringLiteral( "wmsAbstract" ), dlg->groupAbstract() );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "rasterize" ), m.checkBoxState() == Qt::Checked );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "imageCropToContents" ), cropToContents );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "imageCropMarginTop" ), marginTop );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "imageCropMarginRight" ), marginRight );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "imageCropMarginBottom" ), marginBottom );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "imageCropMarginLeft" ), marginLeft );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "imageAntialias" ), imageDlg.antialiasing() );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "svgGroupLayers" ), groupLayers );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "svgCropToContents" ), clipToContent );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "svgCropMarginTop" ), marginTop );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "svgCropMarginRight" ), marginRight );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "svgCropMarginBottom" ), marginBottom );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "svgCropMarginLeft" ), marginLeft );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "svgIncludeMetadata" ), includeMetadata ? 1 : 0 );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "forceVector" ), forceVector ? 1 : 0 );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "svgTextFormat" ), static_cast< int >( textRenderFormat ) );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "svgDisableRasterTiles" ), disableRasterTiles ? 1 : 0 );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "svgSimplify" ), simplify ? 1 : 0 );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "forceVector" ), forceVector ? 1 : 0 );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "pdfAppendGeoreference" ), appendGeoreference ? 1 : 0 );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "pdfIncludeMetadata" ), includeMetadata ? 1 : 0 );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "pdfDisableRasterTiles" ), disableRasterTiles ? 1 : 0 );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "pdfTextFormat" ), static_cast< int >( textRenderFormat ) );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "pdfSimplify" ), simplify ? 1 : 0 );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "pdfCreateGeoPdf" ), geoPdf ? 1 : 0 );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "pdfOgcBestPracticeFormat" ), useOgcBestPracticeFormat ? 1 : 0 );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "pdfExportThemes" ), exportThemes.join( QLatin1String( "~~~" ) ) );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "pdfLayerOrder" ), geoPdfLayerOrder.join( QLatin1String( "~~~" ) ) );
app/layout/qgslayoutdesignerdialog.cpp: mLayout->setCustomProperty( QStringLiteral( "pdfLosslessImages" ), losslessImages ? 1 : 0 );
app/layers/qgsapplayerhandling.cpp: ml->setCustomProperty( QStringLiteral( "_legend_added" ), true );
app/qgsidentifyresultsdialog.cpp: layer->setCustomProperty( QStringLiteral( "identify/format" ), QgsRasterDataProvider::identifyFormatName( format ) );
core/qgsmapthemecollection.cpp: nodeLayer->setCustomProperty( QStringLiteral( "expandedLegendNodes" ), QStringList( layerRec.expandedLegendItems.constBegin(), layerRec.expandedLegendItems.constEnd() ) );
core/layertree/qgslayertreenode.h: void setCustomProperty( const QString &key, const QVariant &value );
core/layertree/qgslayertreemodel.cpp: nodeLayer->setCustomProperty( QStringLiteral( "showFeatureCount" ), true );
core/layertree/qgslayertreenode.cpp:void QgsLayerTreeNode::setCustomProperty( const QString &key, const QVariant &value )
core/layertree/qgslayertreeutils.cpp: groupNode->setCustomProperty( QStringLiteral( "embedded" ), 1 );
core/layertree/qgslayertreeutils.cpp: groupNode->setCustomProperty( QStringLiteral( "embedded_project" ), groupElem.attribute( QStringLiteral( "project" ) ) );
core/layertree/qgslayertreeutils.cpp: layerNode->setCustomProperty( QStringLiteral( "overview" ), 1 );
core/layertree/qgslayertreeutils.cpp: layerNode->setCustomProperty( QStringLiteral( "embedded" ), 1 );
core/layertree/qgslayertreeutils.cpp: layerNode->setCustomProperty( QStringLiteral( "showFeatureCount" ), 1 );
core/layertree/qgslayertreeutils.cpp: child->setCustomProperty( QStringLiteral( "embedded-invisible-layers" ), invisibleLayerList( child ) );
core/layertree/qgslayertreeutils.cpp: node->setCustomProperty( QStringLiteral( "embedded_project" ), newPath );
core/layertree/qgslayertreeutils.cpp: layer.setCustomProperty( QStringLiteral( "legend/expressionFilter" ), expr );
core/layertree/qgslayertreeutils.cpp: layer.setCustomProperty( QStringLiteral( "legend/expressionFilterEnabled" ), enabled && !expr.isEmpty() );
core/layertree/qgslayertreeregistrybridge.cpp: nodeLayer->setCustomProperty( QStringLiteral( "embedded" ), 1 );
core/layertree/qgslayertreeregistrybridge.cpp: nodeLayer->setCustomProperty( QStringLiteral( "embedded_project" ), projectFile );
core/expression/qgsexpressioncontextutils.cpp: layer->setCustomProperty( QStringLiteral( "variableNames" ), variableNames );
core/expression/qgsexpressioncontextutils.cpp: layer->setCustomProperty( QStringLiteral( "variableValues" ), variableValues );
core/expression/qgsexpressioncontextutils.cpp: layer->setCustomProperty( QStringLiteral( "variableNames" ), variableNames );
core/expression/qgsexpressioncontextutils.cpp: layer->setCustomProperty( QStringLiteral( "variableValues" ), variableValues );
core/expression/qgsexpressioncontextutils.cpp: layout->setCustomProperty( QStringLiteral( "variableNames" ), variableNames );
core/expression/qgsexpressioncontextutils.cpp: layout->setCustomProperty( QStringLiteral( "variableValues" ), variableValues );
core/expression/qgsexpressioncontextutils.cpp: layout->setCustomProperty( QStringLiteral( "variableNames" ), variableNames );
core/expression/qgsexpressioncontextutils.cpp: layout->setCustomProperty( QStringLiteral( "variableValues" ), variableValues );
core/expression/qgsexpressioncontextutils.cpp: item->setCustomProperty( QStringLiteral( "variableNames" ), variableNames );
core/expression/qgsexpressioncontextutils.cpp: item->setCustomProperty( QStringLiteral( "variableValues" ), variableValues );
core/expression/qgsexpressioncontextutils.cpp: item->setCustomProperty( QStringLiteral( "variableNames" ), variableNames );
core/expression/qgsexpressioncontextutils.cpp: item->setCustomProperty( QStringLiteral( "variableValues" ), variableValues );
core/expression/qgsexpressioncontextutils.cpp: frame->setCustomProperty( QStringLiteral( "variableNames" ), variableNames );
core/expression/qgsexpressioncontextutils.cpp: frame->setCustomProperty( QStringLiteral( "variableValues" ), variableValues );
core/expression/qgsexpressioncontextutils.cpp: frame->setCustomProperty( QStringLiteral( "variableNames" ), variableNames );
core/expression/qgsexpressioncontextutils.cpp: frame->setCustomProperty( QStringLiteral( "variableValues" ), variableValues );
core/metadata/qgslayermetadata.h: * Saves the metadata to a \a layer's custom properties (see QgsMapLayer::setCustomProperty() ).
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/identifier" ), mIdentifier );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/parentIdentifier" ), mParentIdentifier );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/language" ), mLanguage );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/type" ), mType );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/title" ), mTitle );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/extent" ), QVariant::fromValue( mExtent ) );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/abstract" ), mAbstract );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/fees" ), mFees );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/rights" ), mRights );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/licenses" ), mLicenses );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/history" ), mHistory );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/encoding" ), mEncoding );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/crs" ), mCrs.authid() );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/constraints" ), QVariant::fromValue( mConstraints ) );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/keywords" ), QVariant::fromValue( mKeywords ) );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/contacts" ), QVariant::fromValue( mContacts ) );
core/metadata/qgslayermetadata.cpp: layer->setCustomProperty( QStringLiteral( "metadata/links" ), QVariant::fromValue( mLinks ) );
core/vector/qgsvectorlayer.h: * layer.setCustomProperty("skipMemoryLayersCheck", 1)
core/vector/qgsvectorlayer.cpp: setCustomProperty( QStringLiteral( "storedSubsetString" ), subset );
core/qgsmaplayerlegend.cpp: nodeLayer->setCustomProperty( QStringLiteral( "legend/node-order" ), str );
core/qgsmaplayerlegend.cpp: nodeLayer->setCustomProperty( "legend/label-" + QString::number( originalIndex ), newLabel );
core/qgsmaplayerlegend.cpp: nodeLayer->setCustomProperty( "legend/patch-shape-" + QString::number( originalIndex ), patchDoc.toString() );
core/qgsmaplayerlegend.cpp: nodeLayer->setCustomProperty( "legend/symbol-size-" + QString::number( originalIndex ), QgsSymbolLayerUtils::encodeSize( size ) );
core/qgsmaplayerlegend.cpp: nodeLayer->setCustomProperty( "legend/custom-symbol-" + QString::number( originalIndex ), doc.toString() );
core/qgsmaplayerlegend.cpp: nodeLayer->setCustomProperty( "legend/custom-ramp-settings-" + QString::number( originalIndex ), doc.toString() );
core/qgsmaplayerlegend.cpp: nodeLayer->setCustomProperty( "legend/column-break-" + QString::number( originalIndex ), QStringLiteral( "1" ) );
core/qgslegendrenderer.cpp: node->setCustomProperty( QStringLiteral( "legend/title-style" ), str );
core/qgsmaplayer.h: Q_INVOKABLE void setCustomProperty( const QString &key, const QVariant &value );
core/qgsmaplayer.h: * \see setCustomProperty()
core/qgsmaplayer.h: setCustomProperty( key, metaEnum.valueToKey( static_cast<int>( value ) ) );
core/qgsmaplayer.h: setCustomProperty( key, metaEnum.valueToKeys( value ) );
core/qgsmaplayer.h: * \see setCustomProperty()
core/processing/qgsprocessingutils.cpp: layer->setCustomProperty( QStringLiteral( "OnConvertFormatRegeneratePrimaryKey" ), static_cast< bool >( sinkFlags & QgsFeatureSink::RegeneratePrimaryKey ) );
core/qgsofflineediting.cpp: layer->setCustomProperty( CUSTOM_PROPERTY_IS_OFFLINE_EDITABLE, true );
core/qgsofflineediting.cpp: layer->setCustomProperty( CUSTOM_PROPERTY_REMOTE_SOURCE, layer->source() );
core/qgsofflineediting.cpp: layer->setCustomProperty( CUSTOM_PROPERTY_REMOTE_PROVIDER, layer->providerType() );
core/qgsofflineediting.cpp: layer->setCustomProperty( CUSTOM_PROPERTY_ORIGINAL_LAYERID, layer->id() );
core/qgsofflineediting.cpp: layer->setCustomProperty( CUSTOM_PROPERTY_LAYERNAME_SUFFIX, layerNameSuffix );
core/pointcloud/qgspointcloudlayer.cpp: setCustomProperty( QStringLiteral( "storedSubsetString" ), subset );
core/qgslayernotesutils.cpp: layer->setCustomProperty( QStringLiteral( "userNotes" ), notes );
core/layout/qgslayoutitemmapoverview.cpp: l->setCustomProperty( QStringLiteral( "_noset_layer_expression_context" ), true );
core/layout/qgslayout.cpp:void QgsLayout::setCustomProperty( const QString &key, const QVariant &value )
core/layout/qgslayoutatlas.cpp: mLayout->setCustomProperty( QStringLiteral( "singleFile" ), true );
core/layout/qgslayoutobject.cpp:void QgsLayoutObject::setCustomProperty( const QString &key, const QVariant &value )
core/layout/qgslayout.h: void setCustomProperty( const QString &key, const QVariant &value );
core/layout/qgslayout.h: * \see setCustomProperty()
core/layout/qgslayout.h: * \see setCustomProperty()
core/layout/qgslayout.h: * \see setCustomProperty()
core/layout/qgslayoutitemlegend.cpp: node->setCustomProperty( QStringLiteral( "cached_name" ), name );
core/layout/qgslayoutitemlegend.cpp: node->setCustomProperty( QStringLiteral( "cached_name" ), name );
core/layout/qgslayoutobject.h: void setCustomProperty( const QString &key, const QVariant &value );
core/layout/qgslayoutobject.h: * \see setCustomProperty()
core/layout/qgslayoutobject.h: * \see setCustomProperty()
core/layout/qgslayoutobject.h: * \see setCustomProperty()
core/qgsgrouplayer.cpp: layer->setCustomProperty( QStringLiteral( "_prevGroupBlendMode" ), static_cast< int >( groupBlendMode ) );
core/project/qgsproject.cpp: mapLayer->setCustomProperty( QStringLiteral( "_layer_was_editable" ), true );
core/project/qgsproject.cpp: mRootGroup->setCustomProperty( QStringLiteral( "loading" ), 1 );
core/project/qgsproject.cpp: childGroup->setCustomProperty( QStringLiteral( "embedded_project" ), projectPath );
core/project/qgsproject.cpp: newGroup->setCustomProperty( QStringLiteral( "embedded" ), 1 );
core/project/qgsproject.cpp: newGroup->setCustomProperty( QStringLiteral( "embedded_project" ), projectFilePath );
core/project/qgsproject.cpp: child->setCustomProperty( QStringLiteral( "embedded" ), 1 );
core/qgsmaplayer.cpp:void QgsMapLayer::setCustomProperty( const QString &key, const QVariant &value )
core/raster/qgsrasterlayer.cpp: setCustomProperty( QStringLiteral( "identify/format" ), QgsRasterDataProvider::identifyFormatName( identifyFormat ) );
core/raster/qgsrasterlayer.cpp: setCustomProperty( QStringLiteral( "storedSubsetString" ), subset );
Hi Selma. A late reply, sorry. Here we are in one of the situations where the writer becomes a code investigator 🔍 . You'll need to browse the code repo and try to understand/guess what can be (devs can be pinged also, never forget and do NOT hesitate). Back to @rduivenvoorde code output, the lines that would be of interest to us is the ones involving maplayer class or a specific layer type. Applying that to "identify/format" for rasters, this line can be of interest
core/raster/qgsrasterlayer.cpp: setCustomProperty( QStringLiteral( "identify/format" ), QgsRasterDataProvider::identifyFormatName( identifyFormat ) );
which refers to https://github.com/qgis/QGIS/blob/master/src/core/raster/qgsrasterlayer.cpp#L1006 but what actually is interesting is the whole block above, i.e. https://github.com/qgis/QGIS/blob/master/src/core/raster/qgsrasterlayer.cpp#L986-L1006 showing the different types of identify/format
// Set default identify format - use the richest format available
const int capabilities = mDataProvider->capabilities();
Qgis::RasterIdentifyFormat identifyFormat = Qgis::RasterIdentifyFormat::Undefined;
if ( capabilities & QgsRasterInterface::IdentifyHtml )
{
// HTML is usually richest
identifyFormat = Qgis::RasterIdentifyFormat::Html;
}
else if ( capabilities & QgsRasterInterface::IdentifyFeature )
{
identifyFormat = Qgis::RasterIdentifyFormat::Feature;
}
else if ( capabilities & QgsRasterInterface::IdentifyText )
{
identifyFormat = Qgis::RasterIdentifyFormat::Text;
}
else if ( capabilities & QgsRasterInterface::IdentifyValue )
{
identifyFormat = Qgis::RasterIdentifyFormat::Value;
}
setCustomProperty( QStringLiteral( "identify/format" ), QgsRasterDataProvider::identifyFormatName( identifyFormat ) );
and if we then then look for RasterIdentifyFormat which seems to store those types, one of the results would be
https://github.com/qgis/QGIS/blob/dd01d113e3369cc3e659caa4a89bf45e27a6a82f/src/core/raster/qgsrasteridentifyresult.h#L58-L67
//! Returns the results format.
Qgis::RasterIdentifyFormat format() const { return mFormat; }
/**
* Returns the identify results. Results are different for each format:
*
* - Qgis::RasterIdentifyFormat::Value: a map of values for each band, where keys are band numbers (from 1).
* - Qgis::RasterIdentifyFormat::Feature: a map of WMS sublayer keys and lists of QgsFeatureStore values.
* - Qgis::RasterIdentifyFormat::Html: a map of WMS sublayer keys and HTML strings.
*/
QMap<int, QVariant> results() const { return mResults; }
So if I'm correct identify/format refers to how the results from using the identify tool over a raster layer would be formatted. Add xyz or wms layers and you'll find the identify/format value is different (and can be modified in the latter case from the identify results dialog).
PS: sorry for being long (and maybe - not intentionally - pedantic 😞 ), but hope that helps. and feel free to ask if anything missing.