Commit graph

55 commits

Author SHA1 Message Date
Candice Bentéjac
0716f0046f [GraphEditor] AttributePin: Handle width and elide for attributes' name 2025-01-10 15:38:28 +00:00
Candice Bentéjac
d5a7e2572a [GraphEditor] AttributePin: Do not start dragging edge on pressed
Prior to this commit, the edge that was being dragged to be connected
appeared as soon as the `pressed` signal was emitted by the mouse. Now
that the user can actually click (press & release) without dragging the
mouse to expand or collapse groups, we want to be able to distinguish
cases where the user presses the mouse to click (to expand/collapse
groups) from those where the user presses the mouse to drag it (to
connect edges).

Instead of triggering the drag as soon as the `pressed` signal is
emitted, we wait to see if the mouse moves significantly enough to
indicate the will to drag; an arbitrary limit of 10 pixels along the
X- or Y-axis is used to determine that the user means to drag the mouse.
2024-12-31 13:36:28 +01:00
Candice Bentéjac
431c5288d3 [GraphEditor] AttributePin: Disable connections between GroupAttributes
As connections between groups are currently not supported, add connecting
any `GroupAttribute` to the list of connections to refuse.
2024-12-31 13:21:05 +01:00
Candice Bentéjac
3a1ab9b9df [GraphEditor] AttributePin: Use root accessor for QML properties 2024-12-31 13:21:04 +01:00
Candice Bentéjac
f6c9da1d1a [GraphEditor] AttributePin: Add a delay before displaying the tooltip 2024-12-30 19:02:38 +01:00
Candice Bentéjac
f521bfa663 [GraphEditor] Remove enabling/disabling pins depending on edge's visibility
When edges could exist while being invisible in the graph, pins needed
to be enabled/disabled manually according to the visibility of the edge.
This was especially important when closing the application and removing
all the (hidden) edges as the pins needed to be properly destryed as well.

Edges are not hidden anymore, and any attribute that should be hidden
but is in fact connected remains visible as long as the connection exists.
2024-12-30 19:02:38 +01:00
Candice Bentéjac
4280295e90 [GraphEditor] Node: Display connected children when the parent is collapsed
Just like any other connected attribute, any child attribute within a
Group that is either the source or destination of an edge needs to remain
on display, independently from the status of its parent (collapsed or
expanded).
2024-12-30 19:02:37 +01:00
Candice Bentéjac
201c961f4f [GraphEditor] AttributePin: Add a tree view for children attributes 2024-12-30 19:02:37 +01:00
Candice Bentéjac
55ae221724 [GraphEditor] Refer to an attribute's parent in its tooltip
If an attribute belongs to a `GroupAttribute` or a `ListAttribute`,
it has a parent, and its full name is "parentName.attributeName".
Instead of displaying only "attributeName" in the tooltip, this commit
now displays "parentName.attributeName" to ensure that the link is obvious.
2024-12-30 19:02:35 +01:00
Candice Bentéjac
a97778f2c2 [GraphEditor] Allow to display and connect attributes within GroupAttribute 2024-12-30 19:02:34 +01:00
Candice Bentéjac
5a0b1c0c95 [qt6][qml] Clean-up code and harmonize comments 2024-11-07 18:15:37 +01:00
Candice Bentéjac
b12d1fed06 [qt6][qml] Remove unnecessary module imports 2024-11-07 18:13:36 +01:00
Candice Bentéjac
039504782f [qt6][GraphEditor] Fix connections to ListAttribute pins
The callbacks of `childrenRepeater` (which was used to "fill"
`ListAttributes` with children) were not correctly set. Their prototypes
were missing the `index` argument, meaning that instead of being
provided with the child attribute that was added or deleted,
they were provided with its index in the model.

The added children attributes were also instatiated as empty attribute
pins that were still visible, thus increasing indirectly the spacing of
the initial pin.
2024-11-07 18:13:34 +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
3bac0d0e37 [GraphEditor] AttributePin: Fix condition for the highlight pin display 2024-10-15 16:05:40 +02:00
Aurore LAFAURIE
23caca0a36 [AttributePin] Fix set position tooltip in custom component to not override all tooltips position 2024-09-16 11:52:54 +02:00
Aurore LAFAURIE
de5ca552f7 [AttributePin] Add tooltip to display type of attribute 2024-09-11 11:34:40 +02:00
Candice Bentéjac
7686c48e89 [GraphEditor] Do not assign undefined to edge-related properties
This fixes the following QML warnings that may appear when performing
lots of operations on edges:
`Unable to assign [undefined] to QString/bool`

These warnings do not seem to have any functional impact on the connection
processes.
2024-09-05 09:36:18 +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
Aurore LAFAURIE
0a770f474f [ui] Disabled behavior applied to all types of parameters and attributes
Disabled behavior applied to all types of parameters and attributes
2024-04-19 17:16:21 +02:00
Aurore LAFAURIE
8d0dc4d62e [ui] Usage of Colors palette
Use of Colors palette instead of Qt palette because doesn't work by now
for disabled elements (until Qt6).
2024-04-19 17:16:21 +02:00
Aurore LAFAURIE
1b55dc8649 [ui] Attribute becomes grey in graph editor and attribute editor when connected but disabled
If attribute is disabled but has output connections, it becomes grey.
If the connection is removed while being disabled, it hides itself.

Both is working in GraphEditor on the nodes and in the AttributeEditor.
2024-04-19 17:16:20 +02:00
Candice Bentéjac
6f1ac9a06e [ui] Hide disabled File attributes and their edges but keep the connections
This commit effectively hides a node's attributes when they are disabled.
If these attributes have connections, the edges representing these
connections are hidden but not destroyed. When the edges are hidden, if
one of the connected attributes is still enabled, its pin becomes empty as
if it was not connected to anything.

If the disabled attribute is re-enabled and the connection has not been
broken (if the enabled attribute on the other side of the edge has not
been reconnected to another attribute, for example), the edge re-appears.
If the connection has been broken, then the attribute will be unconnected.

Hidden connections are saved in project files and taken into account when
a project file containing some is loaded.
2024-04-19 17:16:20 +02:00
Candice Bentéjac
e9d80611c7 [GraphEditor] Clean-up: Harmonize syntax across all files 2023-11-06 16:28:22 +01:00
Candice Bentéjac
091346cbb8 [qml] Optimize QML files and fix syntax warnings
This commit addresses warnings that were raised by QtCreator's linter:
- IDs declared more than once
- variables declared more than once in the same scope
- type coercions
- variables declared as "var" when their type is known
- unclosed "case" in switch-case
2023-07-04 12:04:14 +02:00
Candice Bentéjac
9b5dd40b02 [qml] Qt5.15: Upgrade all QtQuick modules 2023-07-03 12:11:29 +02:00
Candice Bentéjac
8310b5c532 [ui] Highlight attributes' pins correctly
Harmonize the highlighting of the attributes' pins when they
are hovered and clicked on, may they already be connected to
other nodes or not.
2022-07-19 10:57:16 +02:00
Candice Bentéjac
352c8403e1 [ui] Fix vertical alignment of attributes' pins
The attributes' pins are now vertically aligned with their
matching labels.
2022-07-19 10:55:50 +02:00
Candice Bentéjac
47a99963fb [ui] Ensure the edge connecting two nodes is following the mouse
Moving the mouse rapidly when starting to connect two nodes'
attributes could lead to an unwanted offset between the tip of
the edge and the mouse's position; it forced the user to move
the mouse further than the attribute pin they wanted to connect
to in order to actually be able to connect to it.
2022-07-19 10:49:52 +02:00
ChemicalXandco
ecb1662b6b [ui] GraphEditor: highlight the edge that will be deleted when it is replaced with another edge 2021-06-04 19:59:49 +01:00
ChemicalXandco
3ea721a2ed [ui] GraphEditor: allow replacing edges 2021-04-09 16:28:15 +01:00
Fabien Castan
e5ad4b2e64 [ui] GraphEditor: improve readOnly behavior on attributes 2021-01-22 14:53:57 +01:00
Fabien Castan
8ef793a488 [ui] GraphEditor: output attributes are never read-only
Also allow to expand attributes list on a locked node.
2020-12-28 19:01:36 +01:00
Fabien Castan
5fb6a5fb0f [ui] GraphEditor: only connect compatible attributes 2020-12-28 16:18:51 +01:00
Julien-Haudegond
ae7daf0365 [ui] GraphEditor: fix binding warnings 2020-08-24 15:34:51 +02:00
Julien-Haudegond
79e1c69d5d Merge remote-tracking branch 'origin/develop' into dev/nodesAndTaskManager 2020-08-24 15:19:31 +02:00
Julien-Haudegond
12de900e96 [ui] fix binding warnings when closing Meshroom 2020-08-17 17:50:44 +02:00
Yann Lanthony
79d35ac5e3 [ui] Node: display Attribute labels instead of technical names 2020-01-24 12:00:35 +01:00
Yann Lanthony
e2ef6520d7 [ui] Node: improve attribute display
* display filled pin when attribute has output connections
* start removing duplicated code
* tweak sizing/spacing 
* fix anchor errors
2020-01-24 11:37:59 +01:00
Fabien Castan
72e0e64e27
[ui] GraphEditor: fix QML errors
- fix anchors/layout/padding conflicts
- fix references to non-existing variables
- fix anchors to a position and not to an object
2019-11-29 11:34:15 +01:00
Lee Geertsen
f083309973
AttributePin: move drag functionality to state 2019-11-29 11:34:15 +01:00
Lee Geertsen
9f5775cc6b
[ui]Do not allow to start a new connection on an already connected input 2019-11-29 11:34:15 +01:00
Lee Geertsen
502e912f77
[UI] change node attributePin ui 2019-11-29 11:34:15 +01:00
Lee Geertsen
f4e5e84478
Redesign node UI, added state icons and separate inputs and outputs 2019-11-29 11:34:10 +01:00
Yann Lanthony
4d6195cf81 [ui] Node: use TextMetrics to expand elided attribute pins at hover 2019-01-29 16:12:19 +01:00
Yann Lanthony
713ca7c6a3 [ui] GraphEditor: simplify attributes connection
* make Drag/DropArea overflow on the attribute's label to be more tolerant when connecting attributes
* add visual feedback when hovering interactive areas
* tweak spacings between attributes
2018-07-27 19:12:53 +02:00
Yann Lanthony
d5d8fa77dc [ui] graph: better ListAttribute connections filtering
* fix ListAttribute => ListAttribute with children (was breaking multiple simple connections to a ListAttribute)
* add missing case ListAttribute => Attribute
2018-06-26 12:29:55 +02:00
Yann Lanthony
99d6068250 [graph] make ListAttribute connectable at root level
ListAttribute can now be connected :
 * at root level to another ListAttribute (new)
 * at child level to basic Attributes
2018-06-18 14:58:35 +02:00