Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add RelationReferenceWidgetWrapper to SIP + complete RelationReferenc…
…eWidget
  • Loading branch information
3nids committed Sep 15, 2014
1 parent e1cb437 commit 8cd5e59
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
Expand Up @@ -13,7 +13,7 @@ class QgsRelationReferenceWidget : QWidget
Scale
};

explicit QgsRelationReferenceWidget( QWidget* parent );
explicit QgsRelationReferenceWidget( QWidget* parent /TransferThis/ );

~QgsRelationReferenceWidget();

Expand All @@ -22,7 +22,7 @@ class QgsRelationReferenceWidget : QWidget
void setRelationEditable( bool editable );

//! this sets the related feature using from the foreign key
void setRelatedFeature( const QVariant &value );
void setForeignKey( const QVariant &value );

//! returns the related feature foreign key
QVariant foreignKey();
Expand Down
23 changes: 23 additions & 0 deletions python/gui/editorwidgets/qgsrelationreferencewidgetwrapper.sip
@@ -0,0 +1,23 @@

class QgsRelationReferenceWidgetWrapper : QgsEditorWidgetWrapper
{
%TypeHeaderCode
#include <qgsrelationreferencewidgetwrapper.h>
%End

public:
explicit QgsRelationReferenceWidgetWrapper( QgsVectorLayer* vl,
int fieldIdx,
QWidget* editor,
QgsMapCanvas* canvas,
QgsMessageBar* messageBar,
QWidget* parent /TransferThis/ = 0 );

virtual QWidget* createWidget( QWidget* parent );
virtual void initWidget( QWidget* editor );
virtual QVariant value();

public slots:
virtual void setValue( const QVariant& value );
virtual void setEnabled( bool enabled );
};
2 changes: 2 additions & 0 deletions python/gui/gui.sip
Expand Up @@ -174,5 +174,7 @@
%Include editorwidgets/core/qgseditorwidgetfactory.sip
%Include editorwidgets/core/qgseditorwidgetregistry.sip
%Include editorwidgets/core/qgseditorwidgetwrapper.sip
%Include editorwidgets/qgsrelationreferencewidget.sip
%Include editorwidgets/qgsrelationreferencewidgetwrapper.sip

%Include layertree/qgslayertreeview.sip
@@ -1,5 +1,5 @@
/***************************************************************************
qgsrelationreferencewidget.cpp
qgsrelationreferencewidgetwrapper.cpp
--------------------------------------
Date : 20.4.2013
Copyright : (C) 2013 Matthias Kuhn
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/qgsrelationreferencewidgetwrapper.h
@@ -1,5 +1,5 @@
/***************************************************************************
qgsrelationreferencewidget.h
qgsrelationreferencewidgetwrapper.h
--------------------------------------
Date : 20.4.2013
Copyright : (C) 2013 Matthias Kuhn
Expand Down

0 comments on commit 8cd5e59

Please sign in to comment.