Skip to content

Commit

Permalink
construct the QgsFieldCalculator dialog with the correct parent
Browse files Browse the repository at this point in the history
This is necessary to ensure proper modal behaviour.
  • Loading branch information
SebDieBln committed Jan 20, 2016
1 parent ed1efcb commit 6731ddf
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -5440,7 +5440,7 @@ void QgisApp::fieldCalculator()
return;
}

QgsFieldCalculator calc( myLayer );
QgsFieldCalculator calc( myLayer, this );
if ( calc.exec() )
{
mMapCanvas->refresh();
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsattributetabledialog.cpp
Expand Up @@ -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() );
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsfieldcalculator.cpp
Expand Up @@ -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 )
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsfieldcalculator.h
Expand Up @@ -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; }
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsfieldsproperties.cpp
Expand Up @@ -762,7 +762,7 @@ void QgsFieldsProperties::on_mCalculateFieldButton_clicked()
return;
}

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

Expand Down

0 comments on commit 6731ddf

Please sign in to comment.