Skip to content

Commit 7ae3864

Browse files
committedOct 3, 2018
Correctly parent dialog to window, not browser
1 parent 5774b9a commit 7ae3864

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/core/qgsdataitem.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1530,8 +1530,12 @@ QList<QAction *> QgsProjectHomeItem::actions( QWidget *parent )
15301530
QAction *setHome = new QAction( tr( "Set Project Home…" ), parent );
15311531
connect( setHome, &QAction::triggered, this, [ = ]
15321532
{
1533+
QWidget *parentWindow = parent;
1534+
while ( parentWindow->parentWidget() )
1535+
parentWindow = parentWindow->parentWidget();
1536+
15331537
QString oldHome = QgsProject::instance()->homePath();
1534-
QString newPath = QFileDialog::getExistingDirectory( parent->window(), tr( "Select Project Home Directory" ), oldHome );
1538+
QString newPath = QFileDialog::getExistingDirectory( parentWindow, tr( "Select Project Home Directory" ), oldHome );
15351539
if ( !newPath.isEmpty() )
15361540
{
15371541
QgsProject::instance()->setPresetHomePath( newPath );

0 commit comments

Comments
 (0)
Please sign in to comment.