Skip to content

Add basic drag and drop support in the model designer #60664

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

Merged
merged 62 commits into from
Apr 29, 2025

Conversation

ValentinBuira
Copy link
Contributor

@ValentinBuira ValentinBuira commented Feb 19, 2025

Introduction

This PR add the new way to edit a model using a drag and drop interface. This is part of long waited improvements in the model designer capabilities.

The design is based of the Google Summer of code proposal I did last year, and that we discussed on the mailling list. Compared to the original proposal the UI looks more similar to the current modeler interface

I encourage anyone to open your existing models and give it a try !

Thanks to the Hauts-de-France region for sponsorising this work

How does it works ?

New sockets were added around each parameter and algorithm used in a model.

sockets.example.mp4

Those are interactive and are used to connect component between them. To connect component drag any output socket regardless of it's from a model parameter or a algorithm into an input socket. You can also remove a connection by dragging an edge out of the socket.

peek.drag.and.drop.mp4

Theses new capabilities have been added as part of the select/edit tool. No needs to switch to a new tool when you want to edit connection in your model.

This PR remain fully compatible with the previous user interface. When you connect sockets by drag and drop. The dialog used when opening an algorithm is updated as well.

retro.compatible.mp4

@github-actions github-actions bot added this to the 3.42.0 milestone Feb 19, 2025
Copy link
Contributor

github-actions bot commented Feb 19, 2025

🪟 Windows builds

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

🪟 Windows Qt6 builds

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

Copy link
Contributor

@troopa81 troopa81 left a comment

Choose a reason for hiding this comment

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

Good job! 👍

Please let me know when you have finished this work and the PR is not draft anymore, I would make a proper review.

@ValentinBuira
Copy link
Contributor Author

ValentinBuira commented Apr 8, 2025

I noticed that "input" types of node now have a little "+" icon, but while clicking on it it crashes and close. Below, a distance input node:

Seems to be working on my side ?

2025-04-08.mp4

I recall fixing something similar for algorithms, were you using the latest commit ?

@ValentinBuira
Copy link
Contributor Author

I adressed all the comments and should be ready for a final review @nyalldawson

@jonathanlurie
Copy link

QgsModelComponentGraphicItem::fold

Hey @ValentinBuira , OK,my bad, you're right! Apologies for the false alarm, the error comes from a silly mistake of mine.

@ValentinBuira
Copy link
Contributor Author

This PR was also impacted by #61528 so I had to add an extra check to make sure we properly return to the select tool

@nyalldawson
Copy link
Collaborator

Great work -- thanks for the responsive changes @ValentinBuira !!

@nyalldawson nyalldawson merged commit f56f85d into qgis:master Apr 29, 2025
32 checks passed
nyalldawson added a commit to nyalldawson/QGIS that referenced this pull request Apr 30, 2025
@nyalldawson
Copy link
Collaborator

@ValentinBuira there's now a warning shown when opening the modeler - "signal not found in QgsModelGraphicsView". I also get a crash when attempting to unlink two components via drag.

@ValentinBuira
Copy link
Contributor Author

there's now a warning shown when opening the modeler - "signal not found in QgsModelGraphicsView". I also get a crash when attempting to unlink two components via drag.

I'm looking into it thanks for the heads up

@DelazJ DelazJ added Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels May 4, 2025
@qgis-bot
Copy link
Collaborator

qgis-bot commented May 4, 2025

@ValentinBuira
This pull request has been tagged as requiring documentation.

A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged.

Please update the description (not the comments) with helpful description and screenshot to help the work from documentors.
Also, any commit having [needs-doc] or [Needs Documentation] in will see its message pushed to the issue, so please be as verbose as you can.

Thank you!

@qgis-bot
Copy link
Collaborator

qgis-bot commented May 4, 2025

@ValentinBuira
A documentation ticket has been opened at qgis/QGIS-Documentation#9849
It is your responsibility to visit this ticket and add as much detail as possible for the documentation team to correctly document this change.
Thank you!

@qgis-bot
Copy link
Collaborator

qgis-bot commented May 4, 2025

@ValentinBuira

This pull request has been tagged for the changelog.

  • The description will be harvested so please provide a "nearly-ready" text for the final changelog
  • If possible, add a nice illustration of the feature. Only the first one in the description will be harvested (GIF accepted as well)
  • If you can, it's better to give credits to your sponsor, see below for different formats.

You can edit the description.

Format available for credits
  • Funded by NAME
  • Funded by URL
  • Funded by NAME URL
  • Sponsored by NAME
  • Sponsored by URL
  • Sponsored by NAME URL

Thank you!

alexbruy added a commit that referenced this pull request May 7, 2025
followup #60664 - Fix warning when open  up the model (Qt: QObject::connect: signal not found in QgsModelGraphicsView )
@zacharlie zacharlie added ChangelogHarvested This PR description has been harvested in the Changelog already. and removed Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels May 7, 2025
nyalldawson added a commit that referenced this pull request May 8, 2025
@ValentinBuira
Copy link
Contributor Author

I also get a crash when attempting to unlink two components via drag.

Hi @nyalldawson #61758 was merged, can you confirm it fixed your issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ChangelogHarvested This PR description has been harvested in the Changelog already. Feature Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants