Skip to content
Permalink
Browse files

save categories that were used in the XML

  • Loading branch information
3nids committed Oct 4, 2018
1 parent 0787a73 commit b004a415ac9ed799960f782d200e904e3c6af56d
Showing with 6 additions and 0 deletions.
  1. +1 −0 src/app/qgisapp.cpp
  2. +5 −0 src/core/qgsmaplayer.cpp
@@ -8884,6 +8884,7 @@ void QgisApp::copyStyle( QgsMapLayer *sourceLayer, QgsMapLayer::StyleCategories
}
// Copies data in text form as well, so the XML can be pasted into a text editor
clipboard()->setData( QGSCLIPBOARD_STYLE_MIME, doc.toByteArray(), doc.toString() );

// Enables the paste menu element
mActionPasteStyle->setEnabled( true );
}
@@ -551,6 +551,11 @@ bool QgsMapLayer::writeLayerXml( QDomElement &layerElement, QDomDocument &docume
void QgsMapLayer::writeCommonStyle( QDomElement &layerElement, QDomDocument &document,
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories ) const
{
// save categories
QMetaEnum metaEnum = QMetaEnum::fromType<QgsMapLayer::StyleCategories>();
QString categoriesKeys( metaEnum.valueToKeys( static_cast<int>( categories ) ) );
layerElement.setAttribute( QStringLiteral( "style_categories" ), categoriesKeys );

if ( categories.testFlag( Rendering ) )
{
// use scale dependent visibility flag

0 comments on commit b004a41

Please sign in to comment.
You can’t perform that action at this time.