Skip to content
Permalink
Browse files

Correctly parent dialog to window, not browser

  • Loading branch information
nyalldawson committed Oct 3, 2018
1 parent 5774b9a commit 7ae3864b632d8dfbd90b4f99ed1e559174e41f1e
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/core/qgsdataitem.cpp
@@ -1530,8 +1530,12 @@ QList<QAction *> QgsProjectHomeItem::actions( QWidget *parent )
QAction *setHome = new QAction( tr( "Set Project Home…" ), parent );
connect( setHome, &QAction::triggered, this, [ = ]
{
QWidget *parentWindow = parent;
while ( parentWindow->parentWidget() )
parentWindow = parentWindow->parentWidget();

QString oldHome = QgsProject::instance()->homePath();
QString newPath = QFileDialog::getExistingDirectory( parent->window(), tr( "Select Project Home Directory" ), oldHome );
QString newPath = QFileDialog::getExistingDirectory( parentWindow, tr( "Select Project Home Directory" ), oldHome );
if ( !newPath.isEmpty() )
{
QgsProject::instance()->setPresetHomePath( newPath );

0 comments on commit 7ae3864

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