Commit graph

162 commits

Author SHA1 Message Date
Yann Lanthony
5a66087eac
Merge pull request #2680 from alicevision/fix/jsParamInjection
[qml] Fix QML warnings when dropping project files into the Graph Editor
2025-02-25 17:39:18 +01:00
Candice Bentéjac
bfb9ee3272 [GraphEditor] Convert file to string before testing its extension
This fixes the "Property 'endsWith' of object file xxx is not a function"
warning.
2025-02-20 11:06:07 +01:00
Candice Bentéjac
e214868d81 [ui] Fix injections into signal handlers with JS functions 2025-02-20 11:06:06 +01:00
Candice Bentéjac
1fbf42a3f4 [GraphEditor] Only display "Pipelines" menu when templates are available
In the node menu (displayed when pressing "Tab" or right-clicking in the
Graph Editor), the "Pipelines" menu entry used to be displayed even if
there was no available template (the entry would open to display an
empty list).

This commit adds a check to ensure that the "Pipelines" menu is only
added to the node menu if there is at least one template that is
available. Otherwise, it is not displayed.
2025-02-19 15:14:27 +01:00
Yann Lanthony
d54ba012a0 [ui] Refactor node pasting using graph partial serialization
Re-implement node pasting by relying on the graph partial serializer,
to serialize only the subset of selected nodes.
On pasting, use standard graph deserialization and import the content
of the serialized graph in the active graph instance.

Simplify the positioning of pasted nodes to only consider mouse position
or center of the graph, which works well for the major variety of use-cases.
Compute the offset to apply to imported nodes by using the de-serialized
graph content's bounding box.
2025-02-06 16:46:04 +01:00
waaake
a5e6d61730 [ui] GraphEditor: Added Fit to Selected Nodes in the Graph
Pressing F or invoking GraphEditor.fit() now considers the selected nodes and fits/focusses on the overall selection if present, else fits/focusses all of available nodes
2025-01-21 09:45:46 +05:30
Candice Bentéjac
6071a914bc
Merge pull request #2646 from alicevision/dev/AutoLayoutMenu
[ui] Moved Auto-Layout Depth Settings under Graph Editor Menu
2025-01-17 14:42:54 +00:00
waaake
bf857bc6e4 [ui] GraphEditor: Setting the drag.smoothed property of the MouseArea to false when the selection is started
Setting the drag.smoothed to false ensures that the target will be moved straight to the current mouse position
2025-01-15 16:20:38 +05:30
waaake
c9b85ce137 [ui] Graph Editor: With the Auto-Layout Depth setting moved to the graph editor menu, the quick setting in the floating pane is removed 2025-01-15 09:14:33 +05:30
waaake
b31da19e66 [ui] GraphEditor: Fixed Key handling for Node creation Menu
Keys.AfterItem as the priority ensures the Item's own key events are handled before Forwarding it to specified items. This handles all defined Enter and Return key presses
2024-12-19 06:05:11 +01:00
Yann Lanthony
944ff15002 [ui] Additive mode for select following Nodes
Implement additive selection behavior when selecting downstream
nodes from a node, using Alt+Shift+Click.
2024-12-09 11:16:33 +01:00
Yann Lanthony
fc85999011 [ui] GraphEditor: toggle node selected state on Ctrl+click
Closer to the standard behavior of the Ctrl modifier key for selection.
2024-12-09 10:18:48 +01:00
Yann Lanthony
87c0cef605 [ui] GraphEditor: fix indentation 2024-12-06 11:03:30 +01:00
Yann Lanthony
4a60e24c2e [ui] GraphEditor: Improve node selected status logic
Instead of connecting to onSelectionChanged, use ItemSelectionModel.hasSelection
property, that can be use for direct bindings with the same behavior.
https://doc.qt.io/qt-6/qml-qtqml-models-itemselectionmodel.html#hasSelection-prop
2024-12-06 10:47:20 +01:00
Yann Lanthony
67bd43e040 [ui] Graph: remove selectedNodes model
Expose `getSelectedNode` that relies on the QItemSelectionModel
for imperative code in QML that still requires to access the
selected node instances.
2024-12-06 10:14:50 +01:00
Yann Lanthony
cdfa6186b1 [ui] Graph: Add clearSelectedNodesData method
Convenient function to directly work on the current node selection.
2024-12-06 10:14:50 +01:00
Yann Lanthony
d11a1f62cc [ui] Graph Editor: fix remaining use of deleted function 2024-12-06 10:14:50 +01:00
Yann Lanthony
107b1e959a [ui] GraphEditor: cache selected node computability status
Avoid to evaluate the computability/submitability status of each
node twice by caching the information when creating the node
context menu.
2024-12-06 10:14:50 +01:00
Yann Lanthony
ade1f87b8f [ui] GraphEditor: Centralize node selection computability status
Re-write the computability status of the current node selection
as properties within the node menu component.
Note that this should be further improved to better scale with the size
of the selection, as it requires to traverse the graph for each node.
2024-12-06 10:14:50 +01:00
Yann Lanthony
b5836d96ed [ui] GraphEditor: Create node context menu after selection update
Delay the loading of the node context menu once the node selection
has been updated, for it to consider the proper selection.
2024-12-06 10:14:50 +01:00
Yann Lanthony
b3a8c6a1f2 [ui] GraphEditor: move node context menu to a Loader
Avoid having the node context menu always evaluating the current
state of the selected nodes for its own display, by dynamically
creating it on demand with a Loader.
Use callbacks for recomputing/resubmitting actions, instead of
storing state in the UI components.
2024-12-06 10:14:50 +01:00
Yann Lanthony
686927a92d [ui] Graph: add removeSelectedNodes method
Add and use an explicit method to remove the currently selected nodes
in a graph.
2024-12-06 10:14:43 +01:00
Yann Lanthony
05eabb2b13 [ui] Graph: Node selection refactor (1)
Switch selection management backend to a QItemSelectionModel,
while keeping the current 'selectedNodes' API for now.
Use DelegateSectionBox for node selection in the graph, and
rewrite the handling of node selection / displacement.
2024-12-06 10:13:51 +01:00
waaake
3a04ce668f [ui] GraphEditor: Search filtering fix
Fixed the issue where navigation arrows on the Filtering was allowing to set an index even when the search had null as the result.

Accepted signal on the Seach invokes the function rather than invoking the sigal for the button
2024-11-30 20:14:13 +05:30
waaake
b0ed5e465e [ui] GraphEditor: Graph Editor gets the toggle based search
Search bar is now placed in the bottom pane of the Graph Editor making it non-obstructing for navigating nodes across Graph Editor
2024-11-30 20:09:04 +05:30
waaake
225f4dc7e5 [ui] Color Selector Shortcut Fix: Fixed the shortcut clash with node copy 2024-11-29 09:51:13 +05:30
waaake
233bbb76c8 [ui] Graph: Updating the way how color gets set on the selected nodes
Coloring the nodes now uses setAttribute command instead of relying on refrences to Nodes within the graph.
2024-11-28 09:28:36 +05:30
waaake
d77b7a398a [ui] Coloring a Node: Added ColorSelector to the Graph Editor
The color selector in the Graph Editor provides a quick way to color nodes with predefined palette of colors.

Added Command to allow the Coloring to be undone and redone using QUndoStack
2024-11-25 09:22:14 +05:30
Candice Bentéjac
5a0b1c0c95 [qt6][qml] Clean-up code and harmonize comments 2024-11-07 18:15:37 +01:00
Candice Bentéjac
05e7d9eaee [qt6] Use JS functions format to declare explicit parameters in slots 2024-11-07 18:09:14 +01:00
Candice Bentéjac
0e71f2a520 [qt6] Update versions for all the imported modules
Qt3D.Extras cannot be updated to 2.6 yet, otherwise there are errors.
2024-11-07 18:09:01 +01:00
Candice Bentéjac
6d845376eb [qt6] Use JS functions format to declare explicit parameters in slots
This fixes all the "Injection of parameters into signal handlers
is deprecated. Use JavaScript functions with formal parameters instead."
warnings.
2024-11-07 18:08:59 +01:00
Candice Bentéjac
12249de216 [GraphEditor] Stop manually editing pins based on the edge's visibility
Editing the pins manually was useful when trying to hide fully the
connection whenever there was an edge connected to an attribute that
was disabled. Disabled attributes now have a special display if they are
connected, meaning both ends of the edge do not need artificial updates.
2024-10-15 16:05:41 +02:00
Candice Bentéjac
d563451a53 [ui] GraphEditor: check node is valid
Only count valid nodes
2024-10-15 15:05:11 +02:00
Aurore LAFAURIE
b6df2852e7 [ui] Recompute and Re-submit not allowed with Compatibility Nodes
Renaming of canCompute to canComputeTopologically to understand the static aspect of the function
2024-09-13 18:32:46 +02:00
Aurore LAFAURIE
7d93a54b4c [ui] Fix click on Category in Node Menu to keep the nodes displayed 2024-09-10 12:37:44 +02:00
Candice Bentéjac
801ac369cd [GraphEditor] Do not update pins when the app is closing
When an edge is removed, the pins it is connected to are
updated depending on their status while the edge is getting destroyed. When the window is
closing, all the components are being destroyed while the QML context is being invalidated: no function call to components that are being destroyed should be made in that context.
2024-09-05 09:36:17 +02:00
Aurore LAFAURIE
85bfc5614b [ui] Thicker edges for for loops and better draw of them
If it's a for loop edge, it needs 2 shapes to draw from each side of the info section
2024-09-02 19:04:22 +02:00
Aurore LAFAURIE
f9ec52a39b [ui] Prevent modification of iterations while expanded for loop 2024-09-02 17:08:04 +02:00
Aurore LAFAURIE
0d346ab2da [ui] Value of current edge iteration and TaskManager protected 2024-09-02 17:08:04 +02:00
Fabien Castan
a9b22b0aaa [ui] GraphEditor: fix tooltip camel case 2024-09-02 17:08:03 +02:00
Fabien Castan
62ea6924f6 [ui] GraphEditor: simplify foreach loop menu 2024-09-02 17:08:03 +02:00
Fabien Castan
48d08b1f88 [ui] GraphEditor: improve alignments
Reduce usage of anchors (except centerIn/fill).
Display of Next/Previous for IntSelector.
2024-09-02 17:08:02 +02:00
Aurore LAFAURIE
ff86a5182e [GraphEditor] Close edge popup when action is triggered 2024-09-02 17:08:02 +02:00
Aurore LAFAURIE
c60c4d4d6c [ui] Collapse and Expand for loop are not allowed for Compatibility Nodes 2024-09-02 17:08:02 +02:00
Aurore LAFAURIE
aba045f4aa [ui] Display for loop size on edges 2024-09-02 17:08:02 +02:00
Aurore LAFAURIE
019e137386 [ui/core] First version of For Loop implementation
If you connect a list to an attribute, you can iterate over the list as a for loop
2024-09-02 17:08:01 +02:00
Candice Bentéjac
da2c3fda05 [GraphEditor] Return empty bbox if the graph is empty
This commit checks whether there is a node in the graph before trying
to determine the size and position of the bounding box. If the graph is
empty, an bounding box set with 0s is returned.
2024-08-26 16:21:28 +02:00
Fabien Castan
6646bde7a9 [ui] GraphEditor.newNodeMenu: fix unstable menu height
Use an explicit height on the newNodeMenu, this fixes the issue with
unstable size of the menu.
2024-08-22 22:23:28 +02:00
Candice Bentéjac
16e951bad8 [ui] Update Delete data label according to selected nodes 2024-08-01 14:53:43 +02:00