Skip to content

Commit

Permalink
sipify gui editor widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed May 9, 2017
1 parent 6aa10c6 commit 0824280
Show file tree
Hide file tree
Showing 34 changed files with 1,953 additions and 1,185 deletions.
21 changes: 0 additions & 21 deletions python/auto_sip.blacklist
Expand Up @@ -448,27 +448,6 @@ gui/effects/qgseffectdrawmodecombobox.sip
gui/effects/qgseffectstackpropertieswidget.sip
gui/effects/qgspainteffectpropertieswidget.sip
gui/effects/qgspainteffectwidget.sip
gui/editorwidgets/core/qgseditorconfigwidget.sip
gui/editorwidgets/core/qgseditorwidgetautoconf.sip
gui/editorwidgets/core/qgseditorwidgetfactory.sip
gui/editorwidgets/core/qgseditorwidgetregistry.sip
gui/editorwidgets/core/qgseditorwidgetwrapper.sip
gui/editorwidgets/core/qgssearchwidgetwrapper.sip
gui/editorwidgets/core/qgswidgetwrapper.sip
gui/editorwidgets/qgscheckboxsearchwidgetwrapper.sip
gui/editorwidgets/qgsdatetimeedit.sip
gui/editorwidgets/qgsdatetimesearchwidgetwrapper.sip
gui/editorwidgets/qgsdefaultsearchwidgetwrapper.sip
gui/editorwidgets/qgsdoublespinbox.sip
gui/editorwidgets/qgsmultiedittoolbutton.sip
gui/editorwidgets/qgsrelationreferencesearchwidgetwrapper.sip
gui/editorwidgets/qgsrelationreferencewidget.sip
gui/editorwidgets/qgsrelationreferencewidgetwrapper.sip
gui/editorwidgets/qgsrelationwidgetwrapper.sip
gui/editorwidgets/qgssearchwidgettoolbutton.sip
gui/editorwidgets/qgsspinbox.sip
gui/editorwidgets/qgsvaluemapsearchwidgetwrapper.sip
gui/editorwidgets/qgsvaluerelationsearchwidgetwrapper.sip
gui/layertree/qgslayertreeview.sip
analysis/vector/qgsgeometryanalyzer.sip
analysis/vector/qgsgeometrysnapper.sip
Expand Down
107 changes: 88 additions & 19 deletions python/gui/editorwidgets/core/qgseditorconfigwidget.sip
@@ -1,38 +1,107 @@
/***************************************************************************
qgseditorconfigwidget.sip
--------------------------------------
Date : 24.4.2013
Copyright : (C) 2013 Matthias Kuhn
Email : matthias at opengis dot ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

class QgsEditorConfigWidget : QWidget
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/editorwidgets/core/qgseditorconfigwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsEditorConfigWidget : QWidget, QgsExpressionContextGenerator
{
%TypeHeaderCode
#include <qgseditorconfigwidget.h>
%Docstring
This class should be subclassed for every configurable editor widget type.

It implements the GUI configuration widget and transforms this to/from a configuration.

.. seealso:: QgsEditorWidgetFactory}
%End

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

explicit QgsEditorConfigWidget( QgsVectorLayer *vl, int fieldIdx, QWidget *parent /TransferThis/ );
%Docstring
Create a new configuration widget

\param vl The layer for which the configuration dialog will be created
\param fieldIdx The index of the field on the layer for which this dialog will be created
\param parent A parent widget
%End

virtual QVariantMap config() = 0;
%Docstring
Create a configuration from the current GUI state

:return: A widget configuration
:rtype: QVariantMap
%End

virtual void setConfig( const QVariantMap &config ) = 0;
%Docstring
Update the configuration widget to represent the given configuration.

\param config The configuration which should be represented by this widget
%End

int field();
%Docstring
Returns the field for which this configuration widget applies

:return: The field index
:rtype: int
%End

QgsVectorLayer *layer();
QgsExpressionContext createExpressionContext() const;
%Docstring
Returns the layer for which this configuration widget applies

:return: The layer
:rtype: QgsVectorLayer
%End

virtual QgsExpressionContext createExpressionContext() const;


signals:

void changed();
%Docstring
Emitted when the configuration of the widget is changed.
.. versionadded:: 3.0
%End

protected:

void initializeDataDefinedButton( QgsPropertyOverrideButton *button, QgsWidgetWrapper::Property key );
%Docstring
Registers a property override button, setting up its initial value, connections and description.
\param button button to register
\param key corresponding data defined property key
%End

void updateDataDefinedButtons();
%Docstring
Updates all property override buttons to reflect the widgets's current properties.
%End

void updateDataDefinedButton( QgsPropertyOverrideButton *button );
%Docstring
Updates a specific property override ``button`` to reflect the widgets's current properties.
%End


};

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/editorwidgets/core/qgseditorconfigwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
79 changes: 44 additions & 35 deletions python/gui/editorwidgets/core/qgseditorwidgetautoconf.sip
@@ -1,41 +1,50 @@
/***************************************************************************
qgseditorwidgetautoconf.sip
---------------------
begin : July 2016
copyright : (C) 2016 by Patrick Valsecchi
email : patrick.valsecchi at camptocamp.com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

/**
* Base class for plugins allowing to pick automatically a widget type for editing fields.
*
* @note added in QGIS 3.0
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/editorwidgets/core/qgseditorwidgetautoconf.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/



class QgsEditorWidgetAutoConfPlugin
{
%TypeHeaderCode
#include <qgseditorwidgetautoconf.h>
%End
%Docstring
Base class for plugins allowing to pick automatically a widget type for editing fields.

.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgseditorwidgetautoconf.h"
%End
public:
/**
* Typical scores are:
* * 0: no matching type found.
* * 10: a widget has been guessed from the type of field.
* * 20: a widget has been determined from an external configuration (for example a database table)
*
* @param vl The vector layer for which this widget will be created
* @param fieldName The field name on the specified layer for which this widget will be created
* @param score Where the score is returned (default to 0)
*
* @return and integer value rating how good is the setup provided by this plugin.
*/

virtual QgsEditorWidgetSetup editorWidgetSetup( const QgsVectorLayer *vl, const QString &fieldName, int &score /Out/ ) const = 0;
%Docstring
Typical scores are:
* 0: no matching type found.
* 10: a widget has been guessed from the type of field.
* 20: a widget has been determined from an external configuration (for example a database table)

\param vl The vector layer for which this widget will be created
\param fieldName The field name on the specified layer for which this widget will be created
\param score Where the score is returned (default to 0)

:return: and integer value rating how good is the setup provided by this plugin.
:rtype: QgsEditorWidgetSetup
%End

};




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

0 comments on commit 0824280

Please sign in to comment.