-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add basic drag and drop support in the model designer #60664
base: master
Are you sure you want to change the base?
Conversation
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
There was a problem hiding this 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.
|
||
painter->setRenderHint( QPainter::Antialiasing ); | ||
|
||
float display_size = 3.2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a static constant ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced as constexpr
This is great! 🥳 I haven't done a code review yet, but just a couple of quick thoughts based on the screencasts:
|
for more information, see https://pre-commit.ci
* manner. | ||
* \see outputDefinitions() | ||
*/ | ||
int outputDefinitionIndex( const QString &name ) const SIP_HOLDGIL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of cluttering the (already large) QgsProcessingAlgorithm API with this, let's move it to a static method in QgsProcessingUtils instead.
int index() { return mIndex; }; | ||
Qt::Edge edge() { return mEdge; }; | ||
|
||
bool isInput() { return mEdge == Qt::TopEdge; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing docs, const
// ReOrder in out socket | ||
// always fix on the input end receiving |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unclear -- can you elaborate?
|
||
emit view() -> endCommand(); | ||
// Redraw | ||
emit scene() -> rebuildRequired(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar here -- externally emitting a signal is ugly
QgsProcessingModelChildAlgorithm *_alg; | ||
// This is not so nice to have the UI tangled gotta think of a better abstraction later | ||
// Loop trought all items to get the output socket |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you already planning on reworking all this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not at the moment, I had in mind something similar to the separation between QgsProcessingModelComponent
and QgsModelComponentGraphicItem
but that would require more signifant work
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. The icon has been updated in consequence.
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