Skip to content
Permalink
Browse files

separate QgsAttributeEditorElement into several files

  • Loading branch information
3nids committed Jan 12, 2021
1 parent cbfd7b0 commit a6404da8151cfa9fe97ba1d67fd5b7584abb27b9
Showing with 1,914 additions and 1,603 deletions.
  1. +1 −1 python/core/auto_additions/{qgsattributeeditorelement.py → qgsattributeeditorrelation.py}
  2. +1 −1 python/core/auto_additions/qgseditformconfig.py
  3. +140 −0 python/core/auto_generated/editform/qgsattributeeditorcontainer.sip.in
  4. +133 −0 python/core/auto_generated/editform/qgsattributeeditorelement.sip.in
  5. +49 −0 python/core/auto_generated/editform/qgsattributeeditorfield.sip.in
  6. +57 −0 python/core/auto_generated/editform/qgsattributeeditorhtmlelement.sip.in
  7. +54 −0 python/core/auto_generated/editform/qgsattributeeditorqmlelement.sip.in
  8. +174 −0 python/core/auto_generated/editform/qgsattributeeditorrelation.sip.in
  9. +2 −2 python/core/auto_generated/{ → editform}/qgseditformconfig.sip.in
  10. +0 −525 python/core/auto_generated/qgsattributeeditorelement.sip.in
  11. +7 −2 python/core/core_auto.sip
  12. +18 −5 src/core/CMakeLists.txt
  13. +166 −0 src/core/editform/qgsattributeeditorcontainer.cpp
  14. +155 −0 src/core/editform/qgsattributeeditorcontainer.h
  15. +89 −0 src/core/editform/qgsattributeeditorelement.cpp
  16. +175 −0 src/core/editform/qgsattributeeditorelement.h
  17. +42 −0 src/core/editform/qgsattributeeditorfield.cpp
  18. +59 −0 src/core/editform/qgsattributeeditorfield.h
  19. +55 −0 src/core/editform/qgsattributeeditorhtmlelement.cpp
  20. +66 −0 src/core/editform/qgsattributeeditorhtmlelement.h
  21. +56 −0 src/core/editform/qgsattributeeditorqmlelement.cpp
  22. +63 −0 src/core/editform/qgsattributeeditorqmlelement.h
  23. +157 −0 src/core/editform/qgsattributeeditorrelation.cpp
  24. +195 −0 src/core/editform/qgsattributeeditorrelation.h
  25. 0 src/core/{ → editform}/qgseditformconfig.cpp
  26. 0 src/core/{ → editform}/qgseditformconfig.h
  27. 0 src/core/{ → editform}/qgseditformconfig_p.h
  28. +0 −469 src/core/qgsattributeeditorelement.cpp
  29. +0 −598 src/core/qgsattributeeditorelement.h
@@ -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
@@ -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
@@ -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 *
************************************************************************/
@@ -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 *
************************************************************************/
@@ -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 a6404da

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