Skip to content

Commit 03475be

Browse files
committedJun 14, 2014
fix build error and update sips
1 parent 5d70839 commit 03475be

File tree

6 files changed

+24
-6
lines changed

6 files changed

+24
-6
lines changed
 

‎python/core/qgsexpression.sip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ class QgsExpression
6666
//! @note added in 2.2
6767
static bool hasSpecialColumn( const QString& name );
6868

69+
static bool isValid( const QString& text, const QgsFields& fields, QString &errorMessage );
70+
6971
void setScale( double scale );
7072

7173
double scale();

‎python/gui/qgsfieldexpressionwidget.sip

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class QgsFieldExpressionWidget : QWidget
2020
//! setFilters allows fitering according to the type of field
2121
void setFilters( QgsFieldProxyModel::Filters filters );
2222

23+
void setLeftHandButtonStyle( bool isLeft );
24+
2325
//! currently used filter on list of fields
2426
QgsFieldProxyModel::Filters filters();
2527

@@ -33,6 +35,17 @@ class QgsFieldExpressionWidget : QWidget
3335
*/
3436
QString currentField( bool *isExpression = 0, bool *isValid = 0 );
3537

38+
/**
39+
* Return true if the current expression is valid
40+
*/
41+
bool isValidExpression( QString *expressionError = 0 );
42+
43+
bool isExpression();
44+
/**
45+
* Return the current text that is set in the expression area
46+
*/
47+
QString currentText();
48+
3649
//! Returns the currently used layer
3750
QgsVectorLayer* layer();
3851

@@ -43,6 +56,8 @@ class QgsFieldExpressionWidget : QWidget
4356
//! fieldChanged signal with indication of the validity of the expression
4457
void fieldChanged( QString fieldName, bool isValid );
4558

59+
void returnPressed();
60+
4661
public slots:
4762
//! set the layer used to display the fields and expression
4863
void setLayer( QgsVectorLayer* layer );

‎src/core/qgsexpression.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,7 @@ bool QgsExpression::hasSpecialColumn( const QString& name )
17291729
return gmSpecialColumns.contains( name );
17301730
}
17311731

1732-
bool QgsExpression::isValid( const QString &text, const QgsFields &fields, QString errorMessage )
1732+
bool QgsExpression::isValid( const QString &text, const QgsFields &fields, QString &errorMessage )
17331733
{
17341734
QgsExpression exp( text );
17351735
exp.prepare( fields );

‎src/core/qgsexpression.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class CORE_EXPORT QgsExpression
152152
//! @note added in 2.2
153153
static bool hasSpecialColumn( const QString& name );
154154

155-
static bool isValid( const QString& text, const QgsFields& fields, QString errorMessage );
155+
static bool isValid( const QString& text, const QgsFields& fields, QString &errorMessage );
156156

157157
void setScale( double scale ) { mScale = scale; }
158158

‎src/gui/qgsfieldexpressionwidget.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@ QString QgsFieldExpressionWidget::currentText()
8787
return mCombo->currentText();
8888
}
8989

90-
bool QgsFieldExpressionWidget::isValidExpression( QString& expressionError )
90+
bool QgsFieldExpressionWidget::isValidExpression( QString *expressionError )
9191
{
92-
return QgsExpression::isValid( currentText(), layer()->pendingFields(), expressionError );
92+
QString temp;
93+
return QgsExpression::isValid( currentText(), layer()->pendingFields(), expressionError ? *expressionError : temp );
9394
}
9495

9596
bool QgsFieldExpressionWidget::isExpression()

‎src/gui/qgsfieldexpressionwidget.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ class GUI_EXPORT QgsFieldExpressionWidget : public QWidget
7777
/**
7878
* Return true if the current expression is valid
7979
*/
80-
bool isValidExpression( QString& expressionError = QString() );
80+
bool isValidExpression( QString *expressionError = 0 );
8181

8282
bool isExpression();
8383
/**
84-
* Retun the current text that is set in the expression area
84+
* Return the current text that is set in the expression area
8585
*/
8686
QString currentText();
8787

0 commit comments

Comments
 (0)
Please sign in to comment.