QGIS/python/core/auto_generated/qgseditformconfig.sip.in

286 lines
8.3 KiB
Plaintext
Raw Normal View History

2017-05-14 09:48:41 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgseditformconfig.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsEditFormConfig
{
2017-05-14 09:48:41 +02:00
%TypeHeaderCode
2017-05-14 09:48:41 +02:00
#include "qgseditformconfig.h"
%End
public:
2017-05-14 09:48:41 +02:00
enum EditorLayout
{
2017-05-14 09:48:41 +02:00
GeneratedLayout,
TabLayout,
UiFileLayout
};
struct GroupData
{
GroupData();
2017-11-11 15:22:19 +10:00
%Docstring
Constructor for GroupData
%End
GroupData( const QString &name, const QList<QString> &fields );
QString mName;
QList<QString> mFields;
};
struct TabData
{
TabData();
2017-11-11 15:22:19 +10:00
%Docstring
Constructor for TabData
%End
TabData( const QString &name, const QList<QString> &fields, const QList<QgsEditFormConfig::GroupData> &groups );
QString mName;
QList<QString> mFields;
QList<QgsEditFormConfig::GroupData> mGroups;
};
enum FeatureFormSuppress
{
2017-05-14 09:48:41 +02:00
SuppressDefault,
SuppressOn,
SuppressOff
};
enum PythonInitCodeSource
{
2017-05-14 09:48:41 +02:00
CodeSourceNone,
CodeSourceFile,
CodeSourceDialog,
CodeSourceEnvironment
};
2017-05-14 09:48:41 +02:00
QgsEditFormConfig( const QgsEditFormConfig &o );
%Docstring
2017-12-15 10:36:55 -04:00
Copy constructor
2017-05-14 09:48:41 +02:00
.. versionadded:: 3.0
%End
~QgsEditFormConfig();
bool operator==( const QgsEditFormConfig &o );
void addTab( QgsAttributeEditorElement *data /Transfer/ );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Adds a new element to the invisible root container in the layout.
2017-12-15 10:36:55 -04:00
This is only useful in combination with EditorLayout.TabLayout.
2017-05-14 09:48:41 +02:00
%End
QList< QgsAttributeEditorElement * > tabs() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of tabs for EditorLayout.TabLayout obtained from the invisible root container.
2017-05-14 09:48:41 +02:00
%End
void clearTabs();
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Clears all the tabs for the attribute editor form with EditorLayout.TabLayout.
2017-05-14 09:48:41 +02:00
%End
QgsAttributeEditorContainer *invisibleRootContainer();
2017-05-14 09:48:41 +02:00
%Docstring
Gets the invisible root container for the drag and drop designer form (EditorLayout.TabLayout).
2017-12-15 10:36:55 -04:00
2017-05-14 09:48:41 +02:00
.. versionadded:: 3
%End
EditorLayout layout() const;
%Docstring
Gets the active layout style for the attribute editor for this layer
2017-05-14 09:48:41 +02:00
%End
void setLayout( EditorLayout editorLayout );
2017-05-14 09:48:41 +02:00
%Docstring
Sets the active layout style for the attribute editor for this layer
2017-05-14 09:48:41 +02:00
%End
2018-04-27 14:16:54 -04:00
QString uiForm() const;
2017-05-14 09:48:41 +02:00
%Docstring
Returns the path or URL to the .ui form. Only meaningful with EditorLayout.UiFileLayout
2017-05-14 09:48:41 +02:00
%End
2018-05-09 11:25:56 -04:00
void setUiForm( const QString &ui );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set path to the .ui form.
When a string is provided in ``ui``, the layout style will be set to EditorLayout.UiFileLayout,
2017-12-15 10:36:55 -04:00
if an empty or a null string is provided, the layout style will be set to
EditorLayout.GeneratedLayout.
If ``ui`` is a URL, a local copy of the file will be made and will be used to create the forms
``context`` is provided to save error messages
2017-05-14 09:48:41 +02:00
%End
bool setWidgetConfig( const QString &widgetName, const QVariantMap &config );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set the editor widget config for a widget which is not for a simple field.
2017-05-14 09:48:41 +02:00
2017-12-15 10:36:55 -04:00
Example:
2017-12-19 16:36:51 -04:00
.. code-block:: python
editFormConfig = layer.editFormConfig()
editFormConfig.setWidgetConfig( 'relation_id', { 'nm-rel': 'other_relation' } )
layer.setEditFormConfig(editFormConfig)
2017-05-14 09:48:41 +02:00
:param widgetName: The name of the widget to configure
:param config: The config to set for this widget
2017-12-15 10:36:55 -04:00
2019-02-26 19:54:09 +10:00
:return: ``False`` if a field exists with the provided widgetName. In this case
QgsVectorLayer.setEditorWidgetSetup should be used.
2017-05-14 09:48:41 +02:00
.. seealso:: :py:func:`QgsVectorLayer.setEditorWidgetSetup`
2017-05-14 09:48:41 +02:00
%End
QVariantMap widgetConfig( const QString &widgetName ) const;
2017-05-14 09:48:41 +02:00
%Docstring
Gets the configuration for the editor widget with the given name.
2017-05-14 09:48:41 +02:00
2017-12-15 10:36:55 -04:00
:param widgetName: The name of the widget.
:return: The configuration for the editor widget or an empty config if the field does not exist
2017-05-14 09:48:41 +02:00
%End
bool removeWidgetConfig( const QString &widgetName );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Remove the configuration for the editor widget with the given name
:param widgetName: The name of the widget.
2017-05-14 09:48:41 +02:00
2019-02-26 19:54:09 +10:00
:return: ``True`` if a configuration has been removed
2017-05-14 09:48:41 +02:00
%End
bool readOnly( int idx ) const;
2017-05-14 09:48:41 +02:00
%Docstring
2019-02-26 19:54:09 +10:00
This returns ``True`` if the field is manually set to read only or if the field
2017-12-15 10:36:55 -04:00
does not support editing like joins or virtual fields.
2017-05-14 09:48:41 +02:00
%End
void setReadOnly( int idx, bool readOnly = true );
2017-05-14 09:48:41 +02:00
%Docstring
2019-02-26 19:54:09 +10:00
If set to ``False``, the widget at the given index will be read-only.
2017-05-14 09:48:41 +02:00
%End
bool labelOnTop( int idx ) const;
2017-05-14 09:48:41 +02:00
%Docstring
2019-02-26 19:54:09 +10:00
If this returns ``True``, the widget at the given index will receive its label on the previous line
while if it returns ``False``, the widget will receive its label on the left hand side.
2017-12-15 10:36:55 -04:00
Labeling on top leaves more horizontal space for the widget itself.
2017-05-14 09:48:41 +02:00
%End
void setLabelOnTop( int idx, bool onTop );
2017-05-14 09:48:41 +02:00
%Docstring
2019-02-26 19:54:09 +10:00
If this is set to ``True``, the widget at the given index will receive its label on
the previous line while if it is set to ``False``, the widget will receive its label
2017-12-15 10:36:55 -04:00
on the left hand side.
Labeling on top leaves more horizontal space for the widget itself.
2017-05-14 09:48:41 +02:00
%End
QString initFunction() const;
2017-05-14 09:48:41 +02:00
%Docstring
Gets Python function for edit form initialization.
2017-12-15 10:36:55 -04:00
Will be looked up in a Python file relative to the project folder if it
includes a module name or if it's a pure function name it will searched
in the Python code set with setInitCode().
2017-05-14 09:48:41 +02:00
%End
void setInitFunction( const QString &function );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set Python function for edit form initialization.
Will be looked up in a Python file relative to the project folder if it
includes a module name or if it's a pure function name it will searched
in the Python code set with setInitCode().
2017-05-14 09:48:41 +02:00
%End
QString initCode() const;
2017-05-14 09:48:41 +02:00
%Docstring
Gets Python code for edit form initialization.
2017-05-14 09:48:41 +02:00
%End
void setInitCode( const QString &code );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set Python code for edit form initialization.
Make sure that you also set the appropriate function name in
setInitFunction().
2017-05-14 09:48:41 +02:00
%End
2016-02-14 03:50:23 +01:00
QString initFilePath() const;
2017-05-14 09:48:41 +02:00
%Docstring
Gets Python external file path for edit form initialization.
2017-05-14 09:48:41 +02:00
%End
void setInitFilePath( const QString &filePath );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set Python external file path for edit form initialization.
Make sure that you also set the appropriate function name in
setInitFunction().
2017-05-14 09:48:41 +02:00
%End
PythonInitCodeSource initCodeSource() const;
2017-05-14 09:48:41 +02:00
%Docstring
Returns Python code source for edit form initialization
2017-12-15 10:36:55 -04:00
(if it shall be loaded from a file, read from the
provided dialog editor or inherited from the environment)
2017-05-14 09:48:41 +02:00
%End
void setInitCodeSource( PythonInitCodeSource initCodeSource );
2017-05-14 09:48:41 +02:00
%Docstring
Sets if Python code shall be used for edit form initialization and its origin
2017-05-14 09:48:41 +02:00
%End
FeatureFormSuppress suppress() const;
2017-05-14 09:48:41 +02:00
%Docstring
Type of feature form pop-up suppression after feature creation (overrides app setting)
%End
void setSuppress( FeatureFormSuppress s );
%Docstring
Sets type of feature form pop-up suppression after feature creation (overrides app setting)
2017-05-14 09:48:41 +02:00
%End
2016-02-14 03:50:23 +01:00
2015-12-01 15:35:21 +01:00
void readXml( const QDomNode &node, QgsReadWriteContext &context );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Read XML information
Deserialize on project load
2017-05-14 09:48:41 +02:00
%End
2015-12-01 15:35:21 +01:00
void writeXml( QDomNode &node, const QgsReadWriteContext &context ) const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write XML information
Serialize on project save
2017-05-14 09:48:41 +02:00
%End
2015-12-01 15:35:21 +01:00
QgsAttributeEditorElement *attributeEditorElementFromDomElement( QDomElement &elem, QgsAttributeEditorElement *parent, const QString &layerId = QString(), const QgsReadWriteContext &context = QgsReadWriteContext() );
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Deserialize drag and drop designer elements.
2017-05-14 09:48:41 +02:00
%End
explicit QgsEditFormConfig();
%Docstring
2017-12-19 11:43:52 -04:00
Create a new edit form config. Normally invoked by :py:class:`QgsVectorLayer`
2017-05-14 09:48:41 +02:00
%End
};
2017-05-14 09:48:41 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgseditformconfig.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/