Important: Please read the Qt Code of Conduct -

Timeline widget

  • I want to implement "this": control. I've implemented the ruler widget, Do you think that a QGraphicScene is good for the graphical part? the items can be expandable, movable...

  • No. Use a plain QWidget (+ subwidgets).

  • [quote author="peppe" date="1292425576"]No. Use a plain QWidget (+ subwidgets).[/quote]

    I think it could be done in either QML, GraphicsView or plain-old widgets. They all have their strongpoints.

  • forgot to add that I'll have a line over that control that will move horizontally over the control when I'll press a button. "This": is how the final widget should look,I've implemented the tree control too.

  • [quote author="Andre" date="1292426686"][quote author="peppe" date="1292425576"]No. Use a plain QWidget (+ subwidgets).[/quote]

    I think it could be done in either QML, GraphicsView or plain-old widgets. They all have their strongpoints.

    I simply think that plain, good ol' QWidgets are simply what he needs: they're easy to draw in a style-compliant manner, they're easy to lay out properly (especially in a "grid" like fashion, without any strange transformation applied), they work in integer coordinates, they're fast, they don't require too much memory nor any gpu acceleration to work properly, etc.

    Of course, I'm not saying that it's an easy job -- such a complex widget will probably require a lot of time to be written and tested :)

  • OK, so I guess it depends on the actual needs of Sorin. Personally, I think that if I'd have to write such a widget at this moment, I would give creating a widget based on a QDeclarativeView and implemented with QML serious considderation. That can be combined with custom drawing bits that need that, such as the wave forms. I don't see too many items in this widget where style compliance is of key importance.

    You name working with integers and not dealing with transformations a benefit, but I think it might be a drawback. If you have long timeline, zooming may be needed. Transformations are a real benefit to have available then, I think.

  • The problem is that you don't simply "zoom in" such widgets by transforming them. All the text and many other drawings must not be scaled when zooming in/out; the waveform and the ruler must change their level of detail while we zoom; we must guarrantee pixel exactness at each and every zoom factor; and so on. These things drive me to QWidget instead of QGraphicsView/QML.

    I know that it's perfectly doable even with them, and all in all, it's up to what one feels more comfortable to deal with :)
    That was my opinion and should be taken as such, and I don't want to make anyone change his/her mind :)

  • I am quite open to having my mind changed by good arguments, so thanks for providing them! Providing arguments for all possible approaches can only help Sorin (or anyone else interested) in making the right choice for his or her use case.

  • Hi.
    I am facing the same problem than some of you. Wondering what's the best approach in order to develop an advanced timeline component, with images, graphics, texts, etc, within it, with zoom in/out capabilities, custom background/colors, etc.

    Is there any sample code that i could use based on the discussion you had before in this thread? I assume is going to be some sort of mix of QTimeline, QSlider, QGraphics, and some other advanced graphics control usage.

    hope you can help me and eventually, share some pieces of code.



  • I don't know of anything concrete that came out of this discussion. However, you seem to have the wrong idea about what QTimeLine is. It is something to control animations, not a graphical widget.

  • I know what QTimeLine is and his purpose. I am just trying to build an advanced timeline control (Widget?) built with advanced graphical components (images, text, etc) and have the timeline itself move over that complex graphic (something like Movie Maker or Sony Vegas does with his timeline moving over photos and videos you add to the project).

    this is the sony vegas timeline for example, with several "channels" for audio and video. the vertical bar is where the time is:
    ! timeline.JPG(vegas timeline)!

Log in to reply