Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework layer "Execute SQL" action to use non-modal dialog #60820

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

nyalldawson
Copy link
Collaborator

If the "Execute SQL" command is executed through the browser, then the window is opened as a non-modal QMainWindow. If however the same command was used via the layer right-click menu, the dialog would open as a blocking modal dialog.

Rework the layer right-click version to also use a non-modal QMainWindow, and ensure that no references to the layer instance are required in the connected slots

If the "Execute SQL" command is executed through the browser,
then the window is opened as a non-modal QMainWindow.
If however the same command was used via the layer right-click
menu, the dialog would open as a blocking modal dialog.

Rework the layer right-click version to also use a non-modal
QMainWindow, and ensure that no references to the layer instance
are required in the connected slots
@nyalldawson nyalldawson added the GUI/UX Related to QGIS application GUI or User Experience label Mar 2, 2025
@github-actions github-actions bot added this to the 3.44.0 milestone Mar 2, 2025
Copy link

github-actions bot commented Mar 2, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 4223c63)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 4223c63)

Copy link
Contributor

@nirvn nirvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice papercut fix.

std::unique_ptr<QgsAbstractDatabaseProviderConnection> conn2 { QgsMapLayerUtils::databaseConnection( layer ) };
if ( conn2 )
{
QAction *executeSqlAction = new QAction( QgsApplication::getThemeIcon( QStringLiteral( "/dbmanager.svg" ) ), tr( "Execute SQL…" ), menu );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO one day, copy/rename that icon to be slightly more generic than referring to DB Manager as we move forward to phasing that out.

@nyalldawson nyalldawson merged commit 38e2189 into qgis:master Mar 3, 2025
40 checks passed
@nyalldawson nyalldawson deleted the execute_sql_main_window branch March 3, 2025 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI/UX Related to QGIS application GUI or User Experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants