Skip to content

Commit bbbf8a5

Browse files
committedNov 20, 2015
[sip] fix editor widget bindings
1 parent 182dd8a commit bbbf8a5

File tree

2 files changed

+10
-45
lines changed

2 files changed

+10
-45
lines changed
 

‎python/gui/editorwidgets/core/qgseditorwidgetwrapper.sip

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* *
1414
***************************************************************************/
1515

16-
class QgsEditorWidgetWrapper : QObject
16+
class QgsEditorWidgetWrapper : QgsWidgetWrapper
1717
{
1818
%TypeHeaderCode
1919
#include <qgseditorwidgetwrapper.h>
@@ -30,35 +30,6 @@ class QgsEditorWidgetWrapper : QObject
3030
*/
3131
explicit QgsEditorWidgetWrapper( QgsVectorLayer* vl, int fieldIdx, QWidget* editor = 0, QWidget* parent /TransferThis/ = 0 );
3232

33-
QWidget* widget();
34-
virtual void setConfig( QMap<QString, QVariant> config );
35-
36-
/**
37-
* Use this to access the configuration.
38-
*
39-
* @param key The configuration option you want to load
40-
* @param defaultVal Default value
41-
*
42-
* @return the value assigned to this configuration option
43-
*/
44-
const QVariant config( const QString& key, const QVariant& defaultVal = QVariant() );
45-
46-
/**
47-
* Returns the whole config
48-
*
49-
* @return The configuration
50-
*/
51-
const QgsEditorWidgetConfig config();
52-
53-
/**
54-
* Access the QgsVectorLayer, you are working on
55-
*
56-
* @return The layer
57-
*
58-
* @see field()
59-
*/
60-
QgsVectorLayer* layer();
61-
Code has comments. Press enter to view.
6233
/**
6334
* Will be used to access the widget's value. Read the value from the widget and
6435
* return it properly formatted to be saved in the attribute.
@@ -68,7 +39,7 @@ class QgsEditorWidgetWrapper : QObject
6839
*
6940
* @return The current value the widget represents
7041
*/
71-
virtual QVariant value() = 0;
42+
virtual QVariant value() const = 0;
7243

7344
/**
7445
* Access the field index.
@@ -77,7 +48,7 @@ class QgsEditorWidgetWrapper : QObject
7748
*
7849
* @see layer()
7950
*/
80-
int fieldIdx();
51+
int fieldIdx() const;
8152

8253
/**
8354
* Access the field.
@@ -86,7 +57,7 @@ class QgsEditorWidgetWrapper : QObject
8657
*
8758
* @see layer()
8859
*/
89-
QgsField field();
60+
QgsField field() const;
9061

9162
/**
9263
* Access the default value of the field.
@@ -95,7 +66,7 @@ class QgsEditorWidgetWrapper : QObject
9566
*
9667
* @see layer()
9768
*/
98-
QVariant defaultValue();
69+
QVariant defaultValue() const;
9970

10071
/**
10172
* Will return a wrapper for a given widget
@@ -112,12 +83,6 @@ class QgsEditorWidgetWrapper : QObject
11283
*/
11384
void setEnabled( bool enabled );
11485

115-
virtual bool valid() = 0;
116-
protected:
117-
virtual QWidget* createWidget( QWidget* parent ) = 0;
118-
119-
virtual void initWidget( QWidget* editor );
120-
12186
signals:
12287
/**
12388
* Emit this signal, whenever the value changed.

‎python/gui/editorwidgets/core/qgswidgetwrapper.sip

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,21 @@ class QgsWidgetWrapper : QObject
7979
*
8080
* @return the value assigned to this configuration option
8181
*/
82-
QVariant config( const QString& key, const QVariant& defaultVal = QVariant() );
82+
QVariant config( const QString& key, const QVariant& defaultVal = QVariant() ) const;
8383

8484
/**
8585
* Returns the whole config
8686
*
8787
* @return The configuration
8888
*/
89-
const QgsEditorWidgetConfig config();
89+
QgsEditorWidgetConfig config() const;
9090

9191
/**
9292
* Returns information about the context in which this widget is shown
9393
*
9494
* @return context information
9595
*/
96-
const QgsAttributeEditorContext& context();
96+
const QgsAttributeEditorContext& context() const;
9797

9898
/**
9999
* Access the QgsVectorLayer, you are working on
@@ -102,7 +102,7 @@ class QgsWidgetWrapper : QObject
102102
*
103103
* @see field()
104104
*/
105-
QgsVectorLayer* layer();
105+
QgsVectorLayer* layer() const;
106106

107107
/**
108108
* Will return a wrapper for a given widget
@@ -120,7 +120,7 @@ class QgsWidgetWrapper : QObject
120120
*
121121
* @return Validity status of this widget.
122122
*/
123-
virtual bool valid() = 0;
123+
virtual bool valid() const = 0;
124124

125125
protected:
126126
/**

0 commit comments

Comments
 (0)
Please sign in to comment.