What objects to use to make a timeline editor
-
Hello,
My goal is to achieve to make an editor of sequences of elements, based on a timeline. It would be very similar to common music editors.I don't need a zoom system, I will include all groups of "tracks" in a frame, that we can browse with a vertical scrollBar. The total duration will always be 100% of the width, we can't add time, we can't enlarge or zoom horizontally, we don't need to, because in my context, elements can't be too horizontally-small enough to need that.
When a track get focus, it will be enlarge on the timeline editor so it will be easy to manipulate.
Manipulate, why ? Because the user will have the possibility to change one parameter of an element by moving the orange diamonds.
We will also need the yellow time marker, to be able to move it, to generate a visual preview of combination of all elements on the single time selected on another screen, and also to follow the time position when we will "Play" all that.So, I did the wireframe, I have a certain idea how it will work, I will need your help for that question, so I can have a good working base :
What should I use in C++/Qt5.12 to achieve that the more efficiently ? Do I have to use graphicView, if yes, do I have to take some precautions, if no, what else can I use ?
Thank you in advance for your response :)
EDIT : since it's just a part of a larger project done in C++ Qt widgets, some gave me advice to not use QtQuick, in term of integration and performance
-
Hi and welcome to devnet,
Depending on the source of data for your timeline, using the model view paradigm could be the simplest. Implementing a custom view or item delegate.
You might want to check KDE's Kdenlive for inspiration.
-
@SGaist
Hey, thank you for greetings :)
Yes, it should be very powerfull to create a custom model/view system for all that.There are details in this little project that I have difficulties to figure :
If I choose to not use graphicView, will I be (pretty easily) able to make this yellow time marker with its line overlaping all elements of all tracks ( marker and line which also should "move auto" when we click "play") ? And what about those orange diamonds for element parameter without graphicView ?Finally, do you think that I won't be stuck if I choose to forget graphicView, and bet everything on widgets, such as labels, with custom model view/delegate ?
(even if I have a pretty good experience in C++/Qt, I almost never overlaped widgets...) -
Depending on what you want to paint, you can use overlays.
As for going with QLabels for everything, you would quickly get a number of widgets to would be impractical and in the end, rewrite some sort of graphics view.
You could also just paint everything by hand but that would likely be overkill.
I would recommend checking the various examples in Qt's documentation as well.