Skip to content

Commit

Permalink
Merge pull request #51511 from qgis/bugfix-attribute-form-dialog-miss…
Browse files Browse the repository at this point in the history
…ing-maximize-button

Fix missing maximize button for attribute  form dialog on Windows
  • Loading branch information
elpaso committed Jan 23, 2023
2 parents 42f4e1c + 345b4aa commit a7de457
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/qgsfeatureaction.cpp
Expand Up @@ -68,7 +68,15 @@ QgsAttributeDialog *QgsFeatureAction::newDialog( bool cloneFeature )
context.setFormMode( QgsAttributeEditorContext::StandaloneDialog );

QgsAttributeDialog *dialog = new QgsAttributeDialog( mLayer, f, cloneFeature, parentWidget(), true, context );

// Skip this code on windows, because the Qt::Tool flag prevents the maximize button to be shown
#ifndef Q_OS_WIN
dialog->setWindowFlags( dialog->windowFlags() | Qt::Tool );
#else
dialog->setWindowFlags( dialog->windowFlags() | Qt::CustomizeWindowHint | Qt::WindowMaximizeButtonHint );
if ( ! dialog->parent() )
dialog->setWindowFlag( Qt::WindowStaysOnTopHint );
#endif

dialog->setObjectName( QStringLiteral( "featureactiondlg:%1:%2" ).arg( mLayer->id() ).arg( f->id() ) );

Expand Down

0 comments on commit a7de457

Please sign in to comment.