mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
[sip] fix editor widget bindings
This commit is contained in:
parent
182dd8a369
commit
bbbf8a5a27
@ -13,7 +13,7 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
class QgsEditorWidgetWrapper : QObject
|
||||
class QgsEditorWidgetWrapper : QgsWidgetWrapper
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qgseditorwidgetwrapper.h>
|
||||
@ -30,35 +30,6 @@ class QgsEditorWidgetWrapper : QObject
|
||||
*/
|
||||
explicit QgsEditorWidgetWrapper( QgsVectorLayer* vl, int fieldIdx, QWidget* editor = 0, QWidget* parent /TransferThis/ = 0 );
|
||||
|
||||
QWidget* widget();
|
||||
virtual void setConfig( QMap<QString, QVariant> config );
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
/**
|
||||
* Will be used to access the widget's value. Read the value from the widget and
|
||||
* return it properly formatted to be saved in the attribute.
|
||||
@ -68,7 +39,7 @@ class QgsEditorWidgetWrapper : QObject
|
||||
*
|
||||
* @return The current value the widget represents
|
||||
*/
|
||||
virtual QVariant value() = 0;
|
||||
virtual QVariant value() const = 0;
|
||||
|
||||
/**
|
||||
* Access the field index.
|
||||
@ -77,7 +48,7 @@ class QgsEditorWidgetWrapper : QObject
|
||||
*
|
||||
* @see layer()
|
||||
*/
|
||||
int fieldIdx();
|
||||
int fieldIdx() const;
|
||||
|
||||
/**
|
||||
* Access the field.
|
||||
@ -86,7 +57,7 @@ class QgsEditorWidgetWrapper : QObject
|
||||
*
|
||||
* @see layer()
|
||||
*/
|
||||
QgsField field();
|
||||
QgsField field() const;
|
||||
|
||||
/**
|
||||
* Access the default value of the field.
|
||||
@ -95,7 +66,7 @@ class QgsEditorWidgetWrapper : QObject
|
||||
*
|
||||
* @see layer()
|
||||
*/
|
||||
QVariant defaultValue();
|
||||
QVariant defaultValue() const;
|
||||
|
||||
/**
|
||||
* Will return a wrapper for a given widget
|
||||
@ -112,12 +83,6 @@ class QgsEditorWidgetWrapper : QObject
|
||||
*/
|
||||
void setEnabled( bool enabled );
|
||||
|
||||
virtual bool valid() = 0;
|
||||
protected:
|
||||
virtual QWidget* createWidget( QWidget* parent ) = 0;
|
||||
|
||||
virtual void initWidget( QWidget* editor );
|
||||
|
||||
signals:
|
||||
/**
|
||||
* Emit this signal, whenever the value changed.
|
||||
|
@ -79,21 +79,21 @@ class QgsWidgetWrapper : QObject
|
||||
*
|
||||
* @return the value assigned to this configuration option
|
||||
*/
|
||||
QVariant config( const QString& key, const QVariant& defaultVal = QVariant() );
|
||||
QVariant config( const QString& key, const QVariant& defaultVal = QVariant() ) const;
|
||||
|
||||
/**
|
||||
* Returns the whole config
|
||||
*
|
||||
* @return The configuration
|
||||
*/
|
||||
const QgsEditorWidgetConfig config();
|
||||
QgsEditorWidgetConfig config() const;
|
||||
|
||||
/**
|
||||
* Returns information about the context in which this widget is shown
|
||||
*
|
||||
* @return context information
|
||||
*/
|
||||
const QgsAttributeEditorContext& context();
|
||||
const QgsAttributeEditorContext& context() const;
|
||||
|
||||
/**
|
||||
* Access the QgsVectorLayer, you are working on
|
||||
@ -102,7 +102,7 @@ class QgsWidgetWrapper : QObject
|
||||
*
|
||||
* @see field()
|
||||
*/
|
||||
QgsVectorLayer* layer();
|
||||
QgsVectorLayer* layer() const;
|
||||
|
||||
/**
|
||||
* Will return a wrapper for a given widget
|
||||
@ -120,7 +120,7 @@ class QgsWidgetWrapper : QObject
|
||||
*
|
||||
* @return Validity status of this widget.
|
||||
*/
|
||||
virtual bool valid() = 0;
|
||||
virtual bool valid() const = 0;
|
||||
|
||||
protected:
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user