Skip to content
Permalink
Browse files

construct the QgsFieldCalculator dialog with the correct parent

This is necessary to ensure proper modal behaviour.
  • Loading branch information
SebDieBln committed Jan 20, 2016
1 parent ed1efcb commit 6731ddfcdc0db0affc730be92993f7613e523180
@@ -5440,7 +5440,7 @@ void QgisApp::fieldCalculator()
return;
}

QgsFieldCalculator calc( myLayer );
QgsFieldCalculator calc( myLayer, this );
if ( calc.exec() )
{
mMapCanvas->refresh();
@@ -551,7 +551,7 @@ void QgsAttributeTableDialog::on_mOpenFieldCalculator_clicked()
{
QgsAttributeTableModel* masterModel = mMainView->masterModel();

QgsFieldCalculator calc( mLayer );
QgsFieldCalculator calc( mLayer, this );
if ( calc.exec() == QDialog::Accepted )
{
int col = masterModel->fieldCol( calc.changedAttributeId() );
@@ -27,8 +27,8 @@
#include <QMessageBox>
#include <QSettings>

QgsFieldCalculator::QgsFieldCalculator( QgsVectorLayer* vl )
: QDialog()
QgsFieldCalculator::QgsFieldCalculator( QgsVectorLayer* vl, QWidget* parent )
: QDialog( parent )
, mVectorLayer( vl )
, mAttributeId( -1 )
{
@@ -26,7 +26,7 @@ class APP_EXPORT QgsFieldCalculator: public QDialog, private Ui::QgsFieldCalcula
{
Q_OBJECT
public:
QgsFieldCalculator( QgsVectorLayer* vl );
QgsFieldCalculator( QgsVectorLayer* vl, QWidget* parent = nullptr );
~QgsFieldCalculator();

int changedAttributeId() const { return mAttributeId; }
@@ -762,7 +762,7 @@ void QgsFieldsProperties::on_mCalculateFieldButton_clicked()
return;
}

QgsFieldCalculator calc( mLayer );
QgsFieldCalculator calc( mLayer, this );
calc.exec();
}

0 comments on commit 6731ddf

Please sign in to comment.
You can’t perform that action at this time.