Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Best way to create video/sound editor timeline



  • Hi! I'm new to Qt and QML GUI programming and I'm trying to make something similar to a video or sound editor timeline, where the user can move the blocks vertically through rows, horizontally through the time and resize them in length. This could be an example:

    fa3498ecf91a18abc2f3be41e365c9ff.png

    I'm stuck on which view structure to choose to develop this and maintain the model/view workflow. So far, I thought two options, but both present difficulties that I can't resolve:

    • Use a ListView with a ListModel where each ListElement is a row of the editor and each element can have several blocks with their origin point and length. The problem here is how to make a delegate capable of distributing each block along the row and maintain the possibility of dragging and resizing the block horizontally. Another thing to take into account is the facility to move blocks from one row to another.

    • Use a Rectangle element as the "blackboard" and have a model with the blocks as elements where each one has the horizontal and vertical position and its length. This would help to make it easier to drag and resize the blocks, but the problem is how to connect the model and its delegate with the Rectangle element since it is not a View element.

    As I said, I'm new to Qt and QML and I don't know if there is a better way to handle this. I'd appreciate it if someone could give me some suggestions on how to go about this.

    Thanks!


Log in to reply