mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
Disable return to run field calc til 2.6. Disable button on invalid expression
This commit is contained in:
parent
0ce4cbf4ba
commit
0defbeb049
@ -56,7 +56,7 @@ class QgsFieldExpressionWidget : QWidget
|
||||
//! fieldChanged signal with indication of the validity of the expression
|
||||
void fieldChanged( QString fieldName, bool isValid );
|
||||
|
||||
void returnPressed();
|
||||
// void returnPressed();
|
||||
|
||||
public slots:
|
||||
//! set the layer used to display the fields and expression
|
||||
|
@ -205,7 +205,9 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
|
||||
mFieldModel->setLayer( mLayer );
|
||||
mFieldCombo->setModel( mFieldModel );
|
||||
connect( mRunFieldCalc, SIGNAL( clicked() ), this, SLOT( updateFieldFromExpression() ) );
|
||||
connect( mUpdateExpressionText, SIGNAL( returnPressed() ), this, SLOT( updateFieldFromExpression() ) );
|
||||
// NW TODO Fix in 2.6 - Doesn't work with field model for some reason.
|
||||
// connect( mUpdateExpressionText, SIGNAL( returnPressed() ), this, SLOT( updateFieldFromExpression() ) );
|
||||
connect( mUpdateExpressionText, SIGNAL( fieldChanged( QString , bool ) ), this, SLOT( updateButtonStatus( QString, bool ) ) );
|
||||
mUpdateExpressionText->setLayer( mLayer );
|
||||
mUpdateExpressionText->setLeftHandButtonStyle( true );
|
||||
editingToggled();
|
||||
@ -232,6 +234,11 @@ void QgsAttributeTableDialog::updateTitle()
|
||||
mRunFieldCalc->setText( tr( "Update Filtered" ) );
|
||||
}
|
||||
|
||||
void QgsAttributeTableDialog::updateButtonStatus( QString fieldName, bool isValid )
|
||||
{
|
||||
mRunFieldCalc->setEnabled( isValid );
|
||||
}
|
||||
|
||||
void QgsAttributeTableDialog::closeEvent( QCloseEvent* event )
|
||||
{
|
||||
QDialog::closeEvent( event );
|
||||
|
@ -153,6 +153,7 @@ class APP_EXPORT QgsAttributeTableDialog : public QDialog, private Ui::QgsAttrib
|
||||
*/
|
||||
void updateTitle();
|
||||
|
||||
void updateButtonStatus( QString fieldName, bool isValid );
|
||||
signals:
|
||||
/**
|
||||
* Informs that editing mode has been toggled
|
||||
|
@ -52,7 +52,8 @@ QgsFieldExpressionWidget::QgsFieldExpressionWidget( QWidget *parent )
|
||||
connect( mCombo->lineEdit(), SIGNAL( editingFinished() ), this, SLOT( expressionEditingFinished() ) );
|
||||
connect( mCombo, SIGNAL( activated( int ) ), this, SLOT( currentFieldChanged() ) );
|
||||
connect( mButton, SIGNAL( clicked() ), this, SLOT( editExpression() ) );
|
||||
connect( mCombo->lineEdit(), SIGNAL( returnPressed() ), this, SIGNAL( returnPressed() ) );
|
||||
// NW TODO - Fix in 2.6
|
||||
// connect( mCombo->lineEdit(), SIGNAL( returnPressed() ), this, SIGNAL( returnPressed() ) );
|
||||
}
|
||||
|
||||
void QgsFieldExpressionWidget::setExpressionDialogTitle( QString title )
|
||||
@ -181,6 +182,7 @@ void QgsFieldExpressionWidget::editExpression()
|
||||
void QgsFieldExpressionWidget::expressionEdited( const QString expression )
|
||||
{
|
||||
updateLineEditStyle( expression );
|
||||
emit fieldChanged( expression, isValidExpression());
|
||||
}
|
||||
|
||||
void QgsFieldExpressionWidget::expressionEditingFinished()
|
||||
|
@ -95,7 +95,7 @@ class GUI_EXPORT QgsFieldExpressionWidget : public QWidget
|
||||
//! fieldChanged signal with indication of the validity of the expression
|
||||
void fieldChanged( QString fieldName, bool isValid );
|
||||
|
||||
void returnPressed();
|
||||
// void returnPressed();
|
||||
|
||||
public slots:
|
||||
//! set the layer used to display the fields and expression
|
||||
|
Loading…
x
Reference in New Issue
Block a user