Skip to content

Commit

Permalink
Bindings and API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 9, 2016
1 parent 1882cab commit aa87113
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 4 deletions.
18 changes: 18 additions & 0 deletions python/core/qgsattributeeditorelement.sip
Expand Up @@ -217,6 +217,24 @@ class QgsAttributeEditorContainer : QgsAttributeEditorElement
* @note Added in QGIS 3.0
*/
virtual QgsAttributeEditorElement* clone(QgsAttributeEditorElement* parent) const /Factory/;

/**
* The visibility expression is used in the attribute form to
* show or hide this container based on an expression incorporating
* the field value controlled by editor widgets.
*
* @note Added in QGIS 3.0
*/
QgsOptionalExpression visibilityExpression() const;

/**
* The visibility expression is used in the attribute form to
* show or hide this container based on an expression incorporating
* the field value controlled by editor widgets.
*
* @note Added in QGIS 3.0
*/
void setVisibilityExpression( const QgsOptionalExpression& visibilityExpression );
};

/** \ingroup core
Expand Down
19 changes: 19 additions & 0 deletions python/gui/qgsfieldexpressionwidget.sip
Expand Up @@ -53,6 +53,17 @@ class QgsFieldExpressionWidget : QWidget
*/
QString asExpression() const;

/**
* Returns the currently selected field or expression. If a field is currently selected, the returned
* value will be converted to a valid expression referencing this field (ie enclosing the field name with
* appropriate quotations).
*
* Alias for asExpression()
*
* @note added in QGIS 3.0
*/
QString expression() const;

//! Returns the currently used layer
QgsVectorLayer* layer() const;

Expand Down Expand Up @@ -87,6 +98,14 @@ class QgsFieldExpressionWidget : QWidget
//! sets the current field or expression in the widget
void setField( const QString &fieldName );

/**
* Sets the current expression text and if applicable also the field.
* Alias for setField.
*
* @note Added in QGIS 3.0
*/
void setExpression( const QString& expression );

protected slots:
//! open the expression dialog to edit the current or add a new expression
void editExpression();
Expand Down
15 changes: 15 additions & 0 deletions python/gui/qgstabwidget.sip
Expand Up @@ -64,6 +64,21 @@ class QgsTabWidget : QTabWidget
*/
int realTabIndex( QWidget* widget );

/**
* Is called internally whenever a new tab has been inserted.
*
* Is used to keep track of currently available and visible tabs.
*
* @note Added in QGIS 3.0
*/
virtual void tabInserted( int index );

/**
* Is called internally whenever a tab has been removed.
*
* Is used to keep track of currently available and visible tabs.
*
* @note Added in QGIS 3.0
*/
virtual void tabRemoved( int index );
};
15 changes: 15 additions & 0 deletions src/core/qgsattributeeditorelement.h
Expand Up @@ -220,7 +220,22 @@ class CORE_EXPORT QgsAttributeEditorContainer : public QgsAttributeEditorElement
*/
virtual QgsAttributeEditorElement* clone( QgsAttributeEditorElement* parent ) const override;

/**
* The visibility expression is used in the attribute form to
* show or hide this container based on an expression incorporating
* the field value controlled by editor widgets.
*
* @note Added in QGIS 3.0
*/
QgsOptionalExpression visibilityExpression() const;

/**
* The visibility expression is used in the attribute form to
* show or hide this container based on an expression incorporating
* the field value controlled by editor widgets.
*
* @note Added in QGIS 3.0
*/
void setVisibilityExpression( const QgsOptionalExpression& visibilityExpression );

private:
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsoptional.h
Expand Up @@ -16,11 +16,11 @@
#ifndef QGSOPTIONAL_H
#define QGSOPTIONAL_H


/**
* \ingroup core
*
* \brief
* QgsOptional is a container for other classes and adds an additional enabled/disabled flag.
* \brief QgsOptional is a container for other classes and adds an additional enabled/disabled flag.
*
* Often it is used for configuration options which can be enabled or disabled but also have
* more internal configuration information that should not be lost when disabling and re-enabling.
Expand Down
19 changes: 17 additions & 2 deletions src/gui/qgstabwidget.h
Expand Up @@ -66,8 +66,23 @@ class GUI_EXPORT QgsTabWidget : public QTabWidget
*/
int realTabIndex( QWidget* widget );

virtual void tabInserted( int index );
virtual void tabRemoved( int index );
/**
* Is called internally whenever a new tab has been inserted.
*
* Is used to keep track of currently available and visible tabs.
*
* @note Added in QGIS 3.0
*/
virtual void tabInserted( int index ) override;

/**
* Is called internally whenever a tab has been removed.
*
* Is used to keep track of currently available and visible tabs.
*
* @note Added in QGIS 3.0
*/
virtual void tabRemoved( int index ) override;

private:
void synchronizeIndexes();
Expand Down

0 comments on commit aa87113

Please sign in to comment.