4 changes: 2 additions & 2 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3052,7 +3052,7 @@ void QgisApp::newPrintComposer()

void QgisApp::showComposerManager()
{
QgsComposerManager m;
QgsComposerManager m( this );
m.exec();
}

Expand Down Expand Up @@ -5139,7 +5139,7 @@ void QgisApp::addMapLayer( QgsMapLayer *theMapLayer )
void QgisApp::embedLayers()
{
//dialog to select groups/layers from other project files
QgsEmbedLayerDialog d;
QgsEmbedLayerDialog d( this );
if ( d.exec() == QDialog::Accepted )
{
mMapCanvas->freeze( true );
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/grass/qgsgrassbrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void QgsGrassBrowser::copyMap()
typeName = "region";
}

QgsGrassElementDialog ed;
QgsGrassElementDialog ed( this );
bool ok;
QString source;
QString suggest;
Expand Down Expand Up @@ -344,7 +344,7 @@ void QgsGrassBrowser::renameMap()
typeName = "region";
}

QgsGrassElementDialog ed;
QgsGrassElementDialog ed( this );
bool ok;
QString newName = ed.getItem( element, tr( "New name" ),
tr( "New name for layer \"%1\"" ).arg( map ), "", map, &ok );
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/grass/qgsgrassmapcalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ QgsGrassMapcalc::QgsGrassMapcalc(
QgsGrassTools *tools, QgsGrassModule *module,
QgisInterface *iface,
QWidget * parent, Qt::WFlags f )
: QMainWindow( 0, Qt::Dialog )
: QMainWindow( iface->mainWindow(), Qt::Dialog )
, QgsGrassMapcalcBase( )
, QgsGrassModuleOptions( tools, module, iface )
, mTool( -1 )
Expand Down Expand Up @@ -1255,7 +1255,7 @@ void QgsGrassMapcalc::load()
{
QgsDebugMsg( "entered." );

QgsGrassSelect *sel = new QgsGrassSelect( QgsGrassSelect::MAPCALC );
QgsGrassSelect *sel = new QgsGrassSelect( this, QgsGrassSelect::MAPCALC );
if ( sel->exec() == QDialog::Rejected )
return;

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassmodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class QgsGrassModule: public QDialog, private Ui::QgsGrassModuleBase
public:
//! Constructor
QgsGrassModule( QgsGrassTools *tools, QString moduleName, QgisInterface *iface,
QString path, QWidget * parent = 0, Qt::WFlags f = 0 );
QString path, QWidget *parent, Qt::WFlags f = 0 );

//! Destructor
~QgsGrassModule();
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/grass/qgsgrassplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ void QgsGrassPlugin::addVector()
// QgsDebugMsg("entered.");
QString uri;

QgsGrassSelect *sel = new QgsGrassSelect( QgsGrassSelect::VECTOR );
QgsGrassSelect *sel = new QgsGrassSelect( qGisInterface->mainWindow(), QgsGrassSelect::VECTOR );
if ( sel->exec() )
{
uri = sel->gisdbase + "/" + sel->location + "/" + sel->mapset + "/" + sel->map + "/" + sel->layer;
Expand Down Expand Up @@ -381,7 +381,7 @@ void QgsGrassPlugin::addRaster()
// QgsDebugMsg("entered.");
QString uri;

QgsGrassSelect *sel = new QgsGrassSelect( QgsGrassSelect::RASTER );
QgsGrassSelect *sel = new QgsGrassSelect( qGisInterface->mainWindow(), QgsGrassSelect::RASTER );
if ( sel->exec() )
{
QString element;
Expand Down Expand Up @@ -514,7 +514,7 @@ void QgsGrassPlugin::newVector()
bool ok;
QString name;

QgsGrassElementDialog dialog;
QgsGrassElementDialog dialog( qGisInterface->mainWindow() );
name = dialog.getItem( "vector", tr( "New vector name" ),
tr( "New vector name" ), "", "", &ok );

Expand Down Expand Up @@ -704,7 +704,7 @@ void QgsGrassPlugin::openMapset()

QString element;

QgsGrassSelect *sel = new QgsGrassSelect( QgsGrassSelect::MAPSET );
QgsGrassSelect *sel = new QgsGrassSelect( qGisInterface->mainWindow(), QgsGrassSelect::MAPSET );

if ( !sel->exec() )
return;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extern "C"
}


QgsGrassSelect::QgsGrassSelect( int type ): QgsGrassSelectBase()
QgsGrassSelect::QgsGrassSelect( QWidget *parent, int type ): QDialog( parent ), QgsGrassSelectBase()
{
QgsDebugMsg( QString( "QgsGrassSelect() type = %1" ).arg( type ) );

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassselect.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class QgsGrassSelect: public QDialog, private Ui::QgsGrassSelectBase
public:
//! Constructor
//QgsGrassSelect(QWidget *parent = 0, int type = VECTOR );
QgsGrassSelect( int type = VECTOR );
QgsGrassSelect( QWidget *parent, int type = VECTOR );
//! Destructor
~QgsGrassSelect();

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/grass/qgsgrassutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ bool QgsGrassUtils::itemExists( QString element, QString item )
return fi.exists();
}

QgsGrassElementDialog::QgsGrassElementDialog() : QObject()
QgsGrassElementDialog::QgsGrassElementDialog( QWidget *parent ) : QObject(), mParent( parent )
{
}

Expand All @@ -80,7 +80,7 @@ QString QgsGrassElementDialog::getItem( QString element,
*ok = false;
mElement = element;
mSource = source;
mDialog = new QDialog();
mDialog = new QDialog( mParent );
mDialog->setWindowTitle( title );
QVBoxLayout *layout = new QVBoxLayout( mDialog );
QHBoxLayout *buttonLayout = new QHBoxLayout( );
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/grass/qgsgrassutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class QgsGrassElementDialog: public QObject

public:
//! Constructor
QgsGrassElementDialog();
QgsGrassElementDialog( QWidget *parent );

//! Destructor
~QgsGrassElementDialog();
Expand All @@ -83,6 +83,7 @@ class QgsGrassElementDialog: public QObject
QLabel *mErrorLabel;
QPushButton *mOkButton;
QPushButton *mCancelButton;
QWidget *mParent;
};

#endif // QGSGRASSUTILS_H
3 changes: 2 additions & 1 deletion src/plugins/zonal_statistics/qgszonalstatisticsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
#include "qgsrasterlayer.h"
#include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h"
#include "qgisinterface.h"

#include <QSettings>

QgsZonalStatisticsDialog::QgsZonalStatisticsDialog( QgisInterface* iface ): QDialog(), mIface( iface )
QgsZonalStatisticsDialog::QgsZonalStatisticsDialog( QgisInterface* iface ): QDialog( iface->mainWindow() ), mIface( iface )
{
setupUi( this );

Expand Down