Bindings and API docs

This commit is contained in:
Matthias Kuhn 2016-09-09 09:49:25 +02:00
parent 1882cabea9
commit aa87113995
6 changed files with 86 additions and 4 deletions

View File

@ -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

View File

@ -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;
@ -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();

View File

@ -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 );
};

View File

@ -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:

View File

@ -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.

View File

@ -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();