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

Scrolling part of a GraphicsView



  • I am trying to figure out a clever way to make something that looks a bit like the timeline in Premiere:
    https://www.mediacollege.com/adobe/premiere/version/pro-cs5/images/workspace/PPRO-CS5_Timeline_02.gif

    An arbitrary number of rows of content, but the left section always stays constant, while you can scroll left and right through the right section where the actual clips are. If I make one big QGraphicsScene with a bunch of Items, I can probably keep the left and right sections easily at the same height. But if I scroll the scene, the gutter on the left will scroll offscreen. If I make multiple GraphicsScenes, I can set up one to scroll but not the other. But it seems like it would be complicated to keep things consistent so that the rows always lined up, for example if I needed to wrap some content in the gutter on the left the height of that row would be increased, and I would need to write code to keep things in sync. That sync would need to be bidirectional, if the user adjusted the height of a track, the gutter on the left would need to be updated, etc.

    What's the best way to approach this sort of pattern? Widget layouts would do it, but I think I want the flexibility of something like GraphicsScene for the contents so I can drag items around, etc.


  • Lifetime Qt Champion

    Hi,

    The thing makes me think of the Frozen Column Example which is item view based rather a graphics view.

    You might want to check the kdenlive project for some more ideas.


Log in to reply