diff --git a/python/gui/qgsfieldcombobox.sip b/python/gui/qgsfieldcombobox.sip index ceef9363f73a..87173fb008b3 100644 --- a/python/gui/qgsfieldcombobox.sip +++ b/python/gui/qgsfieldcombobox.sip @@ -23,13 +23,13 @@ class QgsFieldComboBox : QComboBox void setFilters( QgsFieldProxyModel::Filters filters ); //! currently used filter on list of fields - QgsFieldProxyModel::Filters filters(); + QgsFieldProxyModel::Filters filters() const; //! return the currently selected field - QString currentField(); + QString currentField() const; //! Returns the currently used layer - QgsVectorLayer* layer(); + QgsVectorLayer* layer() const; signals: //! the signal is emitted when the currently selected field changes diff --git a/python/gui/qgsfieldexpressionwidget.sip b/python/gui/qgsfieldexpressionwidget.sip index b145ebdae36b..613b8127e45e 100644 --- a/python/gui/qgsfieldexpressionwidget.sip +++ b/python/gui/qgsfieldexpressionwidget.sip @@ -23,7 +23,7 @@ class QgsFieldExpressionWidget : QWidget void setLeftHandButtonStyle( bool isLeft ); //! currently used filter on list of fields - QgsFieldProxyModel::Filters filters(); + QgsFieldProxyModel::Filters filters() const; //! set the geometry calculator used in the expression dialog void setGeomCalculator( const QgsDistanceArea &da ); @@ -33,21 +33,21 @@ class QgsFieldExpressionWidget : QWidget * @param isExpression determines if the string returned is the name of a field or an expression * @param isValid determines if the expression (or field) returned is valid */ - QString currentField( bool *isExpression = 0, bool *isValid = 0 ); + QString currentField( bool *isExpression = 0, bool *isValid = 0 ) const; /** * Return true if the current expression is valid */ - bool isValidExpression( QString *expressionError = 0 ); + bool isValidExpression( QString *expressionError = 0 ) const; - bool isExpression(); + bool isExpression() const; /** * Return the current text that is set in the expression area */ - QString currentText(); + QString currentText() const; //! Returns the currently used layer - QgsVectorLayer* layer(); + QgsVectorLayer* layer() const; signals: //! the signal is emitted when the currently selected field changes diff --git a/python/gui/qgsmaplayeractionregistry.sip b/python/gui/qgsmaplayeractionregistry.sip index e7e537deacfc..09d1cf857091 100644 --- a/python/gui/qgsmaplayeractionregistry.sip +++ b/python/gui/qgsmaplayeractionregistry.sip @@ -34,7 +34,7 @@ class QgsMapLayerAction : QAction /** Define the targets of the action */ void setTargets( Targets targets ); - Targets targets() const; + const Targets& targets() const; signals: /** Triggered when action has been run for a specific feature */ diff --git a/python/gui/qgsmaplayercombobox.sip b/python/gui/qgsmaplayercombobox.sip index cd0f7e4e66b9..475cee12c78c 100644 --- a/python/gui/qgsmaplayercombobox.sip +++ b/python/gui/qgsmaplayercombobox.sip @@ -20,7 +20,7 @@ class QgsMapLayerComboBox : QComboBox void setFilters( QgsMapLayerProxyModel::Filters filters ); //! currently used filter on list layers - QgsMapLayerProxyModel::Filters filters(); + QgsMapLayerProxyModel::Filters filters() const; //! currentLayer returns the current layer selected in the combo box QgsMapLayer* currentLayer(); diff --git a/src/gui/qgsfieldcombobox.cpp b/src/gui/qgsfieldcombobox.cpp index 4617ff41b657..ae5c0d134e59 100644 --- a/src/gui/qgsfieldcombobox.cpp +++ b/src/gui/qgsfieldcombobox.cpp @@ -46,7 +46,7 @@ void QgsFieldComboBox::setLayer( QgsVectorLayer *layer ) mFieldProxyModel->sourceFieldModel()->setLayer( layer ); } -QgsVectorLayer *QgsFieldComboBox::layer() +QgsVectorLayer *QgsFieldComboBox::layer() const { return mFieldProxyModel->sourceFieldModel()->layer(); } @@ -67,7 +67,7 @@ void QgsFieldComboBox::setField( QString fieldName ) setCurrentIndex( -1 ); } -QString QgsFieldComboBox::currentField() +QString QgsFieldComboBox::currentField() const { int i = currentIndex(); diff --git a/src/gui/qgsfieldcombobox.h b/src/gui/qgsfieldcombobox.h index 70fa1af7f2c9..2c5b5f14661f 100644 --- a/src/gui/qgsfieldcombobox.h +++ b/src/gui/qgsfieldcombobox.h @@ -47,13 +47,13 @@ class GUI_EXPORT QgsFieldComboBox : public QComboBox void setFilters( QgsFieldProxyModel::Filters filters ); //! currently used filter on list of fields - QgsFieldProxyModel::Filters filters() { return mFieldProxyModel->filters(); } + QgsFieldProxyModel::Filters filters() const { return mFieldProxyModel->filters(); } //! return the currently selected field - QString currentField(); + QString currentField() const; //! Returns the currently used layer - QgsVectorLayer* layer(); + QgsVectorLayer* layer() const; signals: //! the signal is emitted when the currently selected field changes diff --git a/src/gui/qgsfieldexpressionwidget.cpp b/src/gui/qgsfieldexpressionwidget.cpp index 4c5f8ca5d95b..ee3d47c83275 100644 --- a/src/gui/qgsfieldexpressionwidget.cpp +++ b/src/gui/qgsfieldexpressionwidget.cpp @@ -83,24 +83,24 @@ void QgsFieldExpressionWidget::setGeomCalculator( const QgsDistanceArea &da ) mDa = QSharedPointer( new QgsDistanceArea( da ) ); } -QString QgsFieldExpressionWidget::currentText() +QString QgsFieldExpressionWidget::currentText() const { return mCombo->currentText(); } -bool QgsFieldExpressionWidget::isValidExpression( QString *expressionError ) +bool QgsFieldExpressionWidget::isValidExpression( QString *expressionError ) const { QString temp; QgsVectorLayer* vl = layer(); return QgsExpression::isValid( currentText(), vl ? vl->pendingFields() : QgsFields(), expressionError ? *expressionError : temp ); } -bool QgsFieldExpressionWidget::isExpression() +bool QgsFieldExpressionWidget::isExpression() const { return !mFieldProxyModel->sourceFieldModel()->isField( currentText() ); } -QString QgsFieldExpressionWidget::currentField( bool *isExpression , bool *isValid ) +QString QgsFieldExpressionWidget::currentField( bool *isExpression , bool *isValid ) const { QString text = currentText(); if ( isValid ) @@ -114,7 +114,7 @@ QString QgsFieldExpressionWidget::currentField( bool *isExpression , bool *isVal return text; } -QgsVectorLayer *QgsFieldExpressionWidget::layer() +QgsVectorLayer *QgsFieldExpressionWidget::layer() const { return mFieldProxyModel->sourceFieldModel()->layer(); } diff --git a/src/gui/qgsfieldexpressionwidget.h b/src/gui/qgsfieldexpressionwidget.h index 395d7767e72c..ce96ffa07688 100644 --- a/src/gui/qgsfieldexpressionwidget.h +++ b/src/gui/qgsfieldexpressionwidget.h @@ -62,7 +62,7 @@ class GUI_EXPORT QgsFieldExpressionWidget : public QWidget void setLeftHandButtonStyle( bool isLeft ); //! currently used filter on list of fields - QgsFieldProxyModel::Filters filters() { return mFieldProxyModel->filters(); } + QgsFieldProxyModel::Filters filters() const { return mFieldProxyModel->filters(); } //! set the geometry calculator used in the expression dialog void setGeomCalculator( const QgsDistanceArea &da ); @@ -72,21 +72,21 @@ class GUI_EXPORT QgsFieldExpressionWidget : public QWidget * @param isExpression determines if the string returned is the name of a field or an expression * @param isValid determines if the expression (or field) returned is valid */ - QString currentField( bool *isExpression = 0, bool *isValid = 0 ); + QString currentField( bool *isExpression = 0, bool *isValid = 0 ) const; /** * Return true if the current expression is valid */ - bool isValidExpression( QString *expressionError = 0 ); + bool isValidExpression( QString *expressionError = 0 ) const; - bool isExpression(); + bool isExpression() const; /** * Return the current text that is set in the expression area */ - QString currentText(); + QString currentText() const; //! Returns the currently used layer - QgsVectorLayer* layer(); + QgsVectorLayer* layer() const; signals: //! the signal is emitted when the currently selected field changes diff --git a/src/gui/qgsmaplayeractionregistry.h b/src/gui/qgsmaplayeractionregistry.h index 905314f78f63..ad760bf635a4 100644 --- a/src/gui/qgsmaplayeractionregistry.h +++ b/src/gui/qgsmaplayeractionregistry.h @@ -70,7 +70,7 @@ class GUI_EXPORT QgsMapLayerAction : public QAction /** Define the targets of the action */ void setTargets( Targets targets ) {mTargets = targets;} /** Return availibity of action */ - Targets targets() const {return mTargets;} + const Targets& targets() const {return mTargets;} signals: /** Triggered when action has been run for a specific list of features */ diff --git a/src/gui/qgsmaplayercombobox.h b/src/gui/qgsmaplayercombobox.h index b2b160b718fe..8d5648af6cbf 100644 --- a/src/gui/qgsmaplayercombobox.h +++ b/src/gui/qgsmaplayercombobox.h @@ -44,7 +44,7 @@ class GUI_EXPORT QgsMapLayerComboBox : public QComboBox void setFilters( QgsMapLayerProxyModel::Filters filters ); //! currently used filter on list layers - QgsMapLayerProxyModel::Filters filters() { return mProxyModel->filters(); } + QgsMapLayerProxyModel::Filters filters() const { return mProxyModel->filters(); } //! currentLayer returns the current layer selected in the combo box QgsMapLayer* currentLayer();