Commit graph

9 commits

Author SHA1 Message Date
Berthold Stoeger
bece0a0652 profile: port basic dive editing to QtQuick
This needed a bit of refactoring of the ChartItem code, because
we have to be signaled on drag start. Currently only one handle
can be selected at a time. This was (implicitly) the case anyway,
as far as I can tell.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-12 15:17:15 +02:00
Berthold Stoeger
ea0085fef6 profile: convert the "ruler item" to qt-quick
Code is mostly based on the "tooltip item". The dragging code was
slightly reworked to be more logical. A "disk item" was added for
the handles.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-12 15:17:14 +02:00
Berthold Stoeger
ebf9ce6d86 profile: port picture code to qt-quick
This was very painful, because I had to implement rearranging the
paint order of the QSGNodes. The resulting code appears quite
brittle. Let's see where that brings us.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-12 15:15:32 +02:00
Berthold Stoeger
d0c26f42d7 profile: implement animation of the tooltip item
To do so, generalize the animation routine.

This seems to expose a QtQuick bug: we get spurious
hover-events when the tooltip item is updated in the
animation. We have to check for that to prevent
en endless loop (until the user moves the mouse out
of the profile window).

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-12 15:15:32 +02:00
Berthold Stoeger
4c227aba42 profile: activate dragging of tooltipitem
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-12 15:15:31 +02:00
Berthold Stoeger
a527415ac9 profile: move dragging code from stats to general qt-code
So far, the only dragable item was the legend in the statistics
code. On the profile, we will have multiple dragable items.

Therefore, move the code up and make it more general. This
took some reorganization. Now, the size of the ChartItem
is saved in the base class. Also, setPos() became a virtual
function.

The dragable items are kept as an unsorted list.
If there will be many of them, this should be changed to
some sort of sorted list (maybe quadtree?).

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-12 15:15:31 +02:00
Berthold Stoeger
13c9218ecf profile: first rudimentary port of the ToolTipItem to qt-quick
Still behaves weirdly when panning the chart.

No support for moving the ToolTipItem.

Doesn't add information on bookmarks under the mouse cursor.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-12 15:15:30 +02:00
Berthold Stoeger
75886dd4d6 profile: render profile on desktop via QtQuick
This breaks all dynamic features, including animations,
zooming tooltips, planner-handles, etc. They will have to be
converted one-by-one to QtQuick, which will be a major pain,
as the ProfileView is destroyed by Qt6 on reparenting.
This means that the view cannot store any persistent state.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:35:04 +02:00
Berthold Stoeger
2eebae13dd stats: break out common QtQuick part of the code
Move most of the QtQuick code to its own directory, so that it
can be reused in the future for the chart.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:35:04 +02:00