Skip to content
Permalink
Browse files

[Relation Reference Widget] allow removing open form button (option n…

…ot available in QGIS)
  • Loading branch information
3nids committed Sep 15, 2014
1 parent 98e0023 commit e1cb4370d7c92520219ffca5d83c1ae0906efc0e
@@ -29,15 +29,18 @@ class QgsRelationReferenceWidget : QWidget

void setEditorContext( QgsAttributeEditorContext context, QgsMapCanvas* canvas, QgsMessageBar* messageBar );

bool embedForm() {return mEmbedForm;}
bool embedForm();
void setEmbedForm( bool display );

bool readOnlySelector() {return mReadOnlySelector;}
bool readOnlySelector();
void setReadOnlySelector( bool readOnly );

bool allowMapIdentification() {return mAllowMapIdentification;}
bool allowMapIdentification();
void setAllowMapIdentification( bool allowMapIdentification );

bool openFormButtonVisible();
void setOpenFormButtonVisible( bool openFormButtonVisible );

protected:
virtual void showEvent( QShowEvent* e );

@@ -55,6 +55,7 @@ QgsRelationReferenceWidget::QgsRelationReferenceWidget( QWidget* parent )
, mEmbedForm( false )
, mReadOnlySelector( false )
, mAllowMapIdentification( false )
, mOpenFormButtonVisible( true )
{
mTopLayout = new QVBoxLayout( this );
mTopLayout->setContentsMargins( 0, 0, 0, 0 );
@@ -350,6 +351,12 @@ void QgsRelationReferenceWidget::setAllowMapIdentification( bool allowMapIdentif
mAllowMapIdentification = allowMapIdentification;
}

void QgsRelationReferenceWidget::setOpenFormButtonVisible(bool openFormButtonVisible)
{
mOpenFormButton->setVisible(openFormButtonVisible);
mOpenFormButtonVisible = openFormButtonVisible;
}

void QgsRelationReferenceWidget::showEvent( QShowEvent* e )
{
Q_UNUSED( e )
@@ -33,6 +33,7 @@ class QgsVectorLayerTools;
class GUI_EXPORT QgsRelationReferenceWidget : public QWidget
{
Q_OBJECT
Q_PROPERTY( bool openFormButtonVisible READ openFormButtonVisible WRITE setOpenFormButtonVisible )

public:
enum CanvasExtent
@@ -67,6 +68,9 @@ class GUI_EXPORT QgsRelationReferenceWidget : public QWidget
bool allowMapIdentification() {return mAllowMapIdentification;}
void setAllowMapIdentification( bool allowMapIdentification );

bool openFormButtonVisible() {return mOpenFormButtonVisible;}
void setOpenFormButtonVisible( bool openFormButtonVisible );

protected:
virtual void showEvent( QShowEvent* e );

@@ -114,6 +118,7 @@ class GUI_EXPORT QgsRelationReferenceWidget : public QWidget
bool mEmbedForm;
bool mReadOnlySelector;
bool mAllowMapIdentification;
bool mOpenFormButtonVisible;

// UI
QVBoxLayout* mTopLayout;

0 comments on commit e1cb437

Please sign in to comment.
You can’t perform that action at this time.