Skip to content

Commit

Permalink
Merge pull request #2489 from elpaso/qgseditorwidgetwrapper-config-added
Browse files Browse the repository at this point in the history
Added config() to QgsEditorWidgetWrapper SIP wrapper
  • Loading branch information
elpaso committed Nov 20, 2015
2 parents ecfdde5 + 8c24e1e commit 4180c1e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
26 changes: 25 additions & 1 deletion python/gui/editorwidgets/core/qgseditorwidgetwrapper.sip
Expand Up @@ -32,7 +32,31 @@ class QgsEditorWidgetWrapper : QObject

QWidget* widget();
virtual void setConfig( QMap<QString, QVariant> config );
QVariant config( QString key );

/**
* Use this to access the configuration.
*
* @param key The configuration option you want to load
* @param defaultVal Default value
*
* @return the value assigned to this configuration option
*/
const QVariant config( const QString& key, const QVariant& defaultVal = QVariant() );

/**
* Returns the whole config
*
* @return The configuration
*/
const QgsEditorWidgetConfig config();

/**
* Access the QgsVectorLayer, you are working on
*
* @return The layer
*
* @see field()
*/
QgsVectorLayer* layer();

/**
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/core/qgswidgetwrapper.cpp
Expand Up @@ -52,7 +52,7 @@ void QgsWidgetWrapper::setContext( const QgsAttributeEditorContext &context )
mContext = context;
}

QVariant QgsWidgetWrapper::config( const QString& key, const QVariant& defaultVal )
const QVariant QgsWidgetWrapper::config( const QString& key, const QVariant& defaultVal )
{
if ( mConfig.contains( key ) )
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/core/qgswidgetwrapper.h
Expand Up @@ -87,7 +87,7 @@ class GUI_EXPORT QgsWidgetWrapper : public QObject
*
* @return the value assigned to this configuration option
*/
QVariant config( const QString& key, const QVariant& defaultVal = QVariant() );
const QVariant config( const QString& key, const QVariant& defaultVal = QVariant() );

/**
* Returns the whole config
Expand Down

0 comments on commit 4180c1e

Please sign in to comment.