Skip to content

Commit

Permalink
Merge pull request #40959 from 3nids/rel-reg-f3
Browse files Browse the repository at this point in the history
separate QgsAttributeEditorElement into several files
  • Loading branch information
3nids committed Jan 12, 2021
2 parents 3798eda + 84313c9 commit 82d3b0f
Show file tree
Hide file tree
Showing 44 changed files with 1,960 additions and 1,610 deletions.
@@ -1,4 +1,4 @@
# The following has been generated automatically from src/core/qgsattributeeditorelement.h
# The following has been generated automatically from src/core/editform/qgsattributeeditorrelation.h
QgsAttributeEditorRelation.Button.baseClass = QgsAttributeEditorRelation
QgsAttributeEditorRelation.Buttons.baseClass = QgsAttributeEditorRelation
Buttons = QgsAttributeEditorRelation # dirty hack since SIP seems to introduce the flags in module
2 changes: 1 addition & 1 deletion python/core/auto_additions/qgseditformconfig.py
@@ -1,4 +1,4 @@
# The following has been generated automatically from src/core/qgseditformconfig.h
# The following has been generated automatically from src/core/editform/qgseditformconfig.h
QgsEditFormConfig.EditorLayout.baseClass = QgsEditFormConfig
QgsEditFormConfig.FeatureFormSuppress.baseClass = QgsEditFormConfig
QgsEditFormConfig.PythonInitCodeSource.baseClass = QgsEditFormConfig
140 changes: 140 additions & 0 deletions python/core/auto_generated/editform/qgsattributeeditorcontainer.sip.in
@@ -0,0 +1,140 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/editform/qgsattributeeditorcontainer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/


class QgsAttributeEditorContainer : QgsAttributeEditorElement
{
%Docstring
This is a container for attribute editors, used to group them visually in the
attribute form if it is set to the drag and drop designer.
%End

%TypeHeaderCode
#include "qgsattributeeditorcontainer.h"
%End
public:

QgsAttributeEditorContainer( const QString &name, QgsAttributeEditorElement *parent, const QColor &backgroundColor = QColor() );
%Docstring
Creates a new attribute editor container

:param name: The name to show as title
:param parent: The parent. May be another container.
:param backgroundColor: The optional background color of the container.
%End


~QgsAttributeEditorContainer();

virtual void addChildElement( QgsAttributeEditorElement *element /Transfer/ );
%Docstring
Add a child element to this container. This may be another container, a field or a relation.

:param element: The element to add as child
%End

virtual void setIsGroupBox( bool isGroupBox );
%Docstring
Determines if this container is rendered as collapsible group box or tab in a tabwidget

:param isGroupBox: If ``True``, this will be a group box
%End

virtual bool isGroupBox() const;
%Docstring
Returns if this container is going to be rendered as a group box

:return: ``True`` if it will be a group box, ``False`` if it will be a tab
%End

QList<QgsAttributeEditorElement *> children() const;
%Docstring
Gets a list of the children elements of this container

:return: A list of elements
%End

virtual QList<QgsAttributeEditorElement *> findElements( AttributeEditorType type ) const;
%Docstring
Traverses the element tree to find any element of the specified type

:param type: The type which should be searched

:return: A list of elements of the type which has been searched for
%End

void clear();
%Docstring
Clear all children from this container.
%End

void setName( const QString &name );
%Docstring
Change the name of this container
%End

int columnCount() const;
%Docstring
Gets the number of columns in this group
%End

void setColumnCount( int columnCount );
%Docstring
Set the number of columns in this group
%End

virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const /Factory/;

%Docstring
Creates a deep copy of this element. To be implemented by subclasses.

.. versionadded:: 3.0
%End

QgsOptionalExpression visibilityExpression() const;
%Docstring
The visibility expression is used in the attribute form to
show or hide this container based on an expression incorporating
the field value controlled by editor widgets.

.. versionadded:: 3.0
%End

void setVisibilityExpression( const QgsOptionalExpression &visibilityExpression );
%Docstring
The visibility expression is used in the attribute form to
show or hide this container based on an expression incorporating
the field value controlled by editor widgets.

.. versionadded:: 3.0
%End

QColor backgroundColor() const;
%Docstring
backgroundColor

:return: background color of the container

.. versionadded:: 3.8
%End

void setBackgroundColor( const QColor &backgroundColor );
%Docstring
Sets the background color to ``backgroundColor``
%End

};


/************************************************************************
* This file has been generated automatically from *
* *
* src/core/editform/qgsattributeeditorcontainer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
133 changes: 133 additions & 0 deletions python/core/auto_generated/editform/qgsattributeeditorelement.sip.in
@@ -0,0 +1,133 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/editform/qgsattributeeditorelement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/



class QgsAttributeEditorElement /Abstract/
{
%Docstring
This is an abstract base class for any elements of a drag and drop form.

This can either be a container which will be represented on the screen
as a tab widget or a collapsible group box. Or it can be a field which will
then be represented based on the QgsEditorWidget type and configuration.
Or it can be a relation and embed the form of several children of another
layer.
%End

%TypeHeaderCode
#include "qgsattributeeditorelement.h"
%End
%ConvertToSubClassCode
switch ( sipCpp->type() )
{
case QgsAttributeEditorElement::AeTypeContainer:
sipType = sipType_QgsAttributeEditorContainer;
break;
case QgsAttributeEditorElement::AeTypeField:
sipType = sipType_QgsAttributeEditorField;
break;
case QgsAttributeEditorElement::AeTypeRelation:
sipType = sipType_QgsAttributeEditorRelation;
break;
default:
sipType = nullptr;
break;
}
%End
public:
enum AttributeEditorType
{
AeTypeContainer,
AeTypeField,
AeTypeRelation,
AeTypeInvalid,
AeTypeQmlElement,
AeTypeHtmlElement
};

QgsAttributeEditorElement( AttributeEditorType type, const QString &name, QgsAttributeEditorElement *parent = 0 );
%Docstring
Constructor

:param type: The type of the new element.
:param name:
:param parent:
%End

virtual ~QgsAttributeEditorElement();

static QgsAttributeEditorElement *create( const QDomElement &element, const QString &layerId, const QgsFields &fields, const QgsReadWriteContext &context, QgsAttributeEditorElement *parent = 0 ) /Factory/;
%Docstring
Constructs the editor element from the given element

.. versionadded:: 3.18
%End

QString name() const;
%Docstring
Returns the name of this element

:return: The name for this element
%End

AttributeEditorType type() const;
%Docstring
The type of this element

:return: The type
%End

QgsAttributeEditorElement *parent() const;
%Docstring
Gets the parent of this element.

.. versionadded:: 3.0
%End

QDomElement toDomElement( QDomDocument &doc ) const;
%Docstring
Gets the XML Dom element to save this element.

:param doc: The QDomDocument which is used to create new XML elements

:return: A DOM element to serialize this element
%End

virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const = 0 /Factory/;
%Docstring
Returns a clone of this element. To be implemented by subclasses.

.. versionadded:: 3.0
%End

bool showLabel() const;
%Docstring
Controls if this element should be labeled with a title (field, relation or groupname).

.. versionadded:: 2.18
%End

void setShowLabel( bool showLabel );
%Docstring
Controls if this element should be labeled with a title (field, relation or groupname).

.. versionadded:: 2.18
%End

protected:

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/editform/qgsattributeeditorelement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
49 changes: 49 additions & 0 deletions python/core/auto_generated/editform/qgsattributeeditorfield.sip.in
@@ -0,0 +1,49 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/editform/qgsattributeeditorfield.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/



class QgsAttributeEditorField : QgsAttributeEditorElement
{
%Docstring
This element will load a field's widget onto the form.
%End

%TypeHeaderCode
#include "qgsattributeeditorfield.h"
%End
public:

QgsAttributeEditorField( const QString &name, int idx, QgsAttributeEditorElement *parent );
%Docstring
Creates a new attribute editor element which represents a field

:param name: The name of the element
:param idx: The index of the field which should be embedded
:param parent: The parent of this widget (used as container)
%End

int idx() const;
%Docstring
Returns the index of the field.
%End

virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const /Factory/;


};



/************************************************************************
* This file has been generated automatically from *
* *
* src/core/editform/qgsattributeeditorfield.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -0,0 +1,57 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/editform/qgsattributeeditorhtmlelement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/




class QgsAttributeEditorHtmlElement : QgsAttributeEditorElement
{
%Docstring
An attribute editor widget that will represent arbitrary HTML code.

.. versionadded:: 3.4
%End

%TypeHeaderCode
#include "qgsattributeeditorhtmlelement.h"
%End
public:

QgsAttributeEditorHtmlElement( const QString &name, QgsAttributeEditorElement *parent );
%Docstring
Creates a new element which can display HTML

:param name: The name of the widget
:param parent: The parent (used as container)
%End

virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const /Factory/;


QString htmlCode() const;
%Docstring
The Html code that will be represented within this widget.

.. versionadded:: 3.4
%End

void setHtmlCode( const QString &htmlCode );
%Docstring
Sets the HTML code that will be represented within this widget to ``htmlCode``.
%End

};


/************************************************************************
* This file has been generated automatically from *
* *
* src/core/editform/qgsattributeeditorhtmlelement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

0 comments on commit 82d3b0f

Please sign in to comment.