Skip to content
Permalink
Browse files

No more Q_NOWARN_DEPRECATED_POP

  • Loading branch information
suricactus committed Jan 8, 2021
1 parent 71baf2b commit a54483457c4ff280d19a57d95931be08dadd06b2
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/core/qgseditformconfig.cpp
@@ -668,14 +668,12 @@ QgsAttributeEditorElement *QgsEditFormConfig::attributeEditorElementFromDomEleme
config = relElement->config();

// pre QGIS 3.18 compatibility
Q_NOWARN_DEPRECATED_PUSH
if ( ! config.contains( QStringLiteral( "buttons" ) ) )
{
if ( elem.hasAttribute( "buttons" ) )
{
QString buttonString = elem.attribute( QStringLiteral( "buttons" ), qgsFlagValueToKeys( QgsAttributeEditorRelation::Button::AllButtons ) );
relElement->setVisibleButtons( qgsFlagKeysToValue( buttonString, QgsAttributeEditorRelation::Button::AllButtons ) );
config.insert( "buttons", qgsFlagValueToKeys( relElement->visibleButtons() ) );
config.insert( "buttons", qgsFlagValueToKeys( qgsFlagKeysToValue( buttonString, QgsAttributeEditorRelation::Button::AllButtons ) ) );
}
else
{
@@ -684,10 +682,9 @@ QgsAttributeEditorElement *QgsEditFormConfig::attributeEditorElementFromDomEleme
buttons.setFlag( QgsAttributeEditorRelation::Button::Link, elem.attribute( QStringLiteral( "showLinkButton" ), QStringLiteral( "1" ) ).toInt() );
buttons.setFlag( QgsAttributeEditorRelation::Button::Unlink, elem.attribute( QStringLiteral( "showUnlinkButton" ), QStringLiteral( "1" ) ).toInt() );
buttons.setFlag( QgsAttributeEditorRelation::Button::SaveChildEdits, elem.attribute( QStringLiteral( "showSaveChildEditsButton" ), QStringLiteral( "1" ) ).toInt() );
config.insert( "buttons", qgsFlagValueToKeys( relElement->visibleButtons() ) );
config.insert( "buttons", qgsFlagValueToKeys( buttons ) );
}
}
Q_NOWARN_DEPRECATED_POP

relElement->setConfig( config );

0 comments on commit a544834

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