22 qDeleteAll( mChildren );
27 mChildren.append( widget );
37 return mVisibilityExpression;
50 return mCollapsedExpression;
63 return mBackgroundColor;
73 QList<QgsAttributeEditorElement *> results;
75 const auto constMChildren = mChildren;
78 if ( elem->type() ==
type )
80 results.append( elem );
96 qDeleteAll( mChildren );
114 const auto childElements =
children();
120 element->mIsGroupBox = mIsGroupBox;
121 element->mColumnCount = mColumnCount;
122 element->mVisibilityExpression = mVisibilityExpression;
123 element->mCollapsed = mCollapsed;
124 element->mCollapsedExpression = mCollapsedExpression;
130 void QgsAttributeEditorContainer::saveConfiguration( QDomElement &elem, QDomDocument &doc )
const
133 elem.setAttribute( QStringLiteral(
"columnCount" ), mColumnCount );
134 elem.setAttribute( QStringLiteral(
"groupBox" ), mIsGroupBox ? 1 : 0 );
135 elem.setAttribute( QStringLiteral(
"collapsed" ), mCollapsed );
136 elem.setAttribute( QStringLiteral(
"collapsedExpressionEnabled" ), mCollapsedExpression.
enabled() ? 1 : 0 );
137 elem.setAttribute( QStringLiteral(
"collapsedExpression" ), mCollapsedExpression->expression() );
138 elem.setAttribute( QStringLiteral(
"visibilityExpressionEnabled" ), mVisibilityExpression.
enabled() ? 1 : 0 );
139 elem.setAttribute( QStringLiteral(
"visibilityExpression" ), mVisibilityExpression->expression() );
140 if ( mBackgroundColor.isValid() )
141 elem.setAttribute( QStringLiteral(
"backgroundColor" ), mBackgroundColor.name( ) );
142 const auto constMChildren = mChildren;
145 QDomDocument doc = elem.ownerDocument();
146 elem.appendChild( child->toDomElement( doc ) );
150 void QgsAttributeEditorContainer::loadConfiguration(
const QDomElement &element,
const QString &layerId,
const QgsReadWriteContext &context,
const QgsFields &fields )
152 mBackgroundColor = element.attribute( QStringLiteral(
"backgroundColor" ), QString() );
154 int cc = element.attribute( QStringLiteral(
"columnCount" ) ).toInt( &ok );
159 const bool isGroupBox = element.attribute( QStringLiteral(
"groupBox" ) ).toInt( &ok );
165 const bool isCollapsed = element.attribute( QStringLiteral(
"collapsed" ) ).toInt( &ok );
171 const bool collapsedExpressionEnabled = element.attribute( QStringLiteral(
"collapsedExpressionEnabled" ) ).toInt( &ok );
181 const bool visibilityExpressionEnabled = element.attribute( QStringLiteral(
"visibilityExpressionEnabled" ) ).toInt( &ok );
190 const QDomNodeList childNodeList = element.childNodes();
192 for (
int i = 0; i < childNodeList.size(); i++ )
194 const QDomElement childElem = childNodeList.at( i ).toElement();
202 QString QgsAttributeEditorContainer::typeIdentifier()
const
204 return QStringLiteral(
"attributeEditorContainer" );