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

QAbstractScrollArea or QGraphicsView



  • I want to make a scrolling timeline and piano roll like what is used in most DAW software.

    I have had a look at similar projects and related topics and generally they seem to subclass QAbstractScrollArea, however most of those are from 10 years ago and I am wondering if this is still the best way to do it. It seems from a glance that QGraphicsView would be equally suited to the task, but I don't know if it adds unnecessary overheads at the cost of convenience features.

    (Preempting the why not use QT Quick/QML crowd... I want an MDI structure for starters, certainly possible but more work for me, I've also done a lot of work with Android's Activity/Fragments framework in the past which is similar and that's not the direction I want to go).


  • Moderators

    @pmckeon said in QAbstractScrollArea or QGraphicsView:

    It seems from a glance that QGraphicsView would be equally suited to the task, but I don't know if it adds unnecessary overheads at the cost of convenience features.

    no, QtQuick1 was based on the graphics view framework. Of course there is nothing wrong going this way



  • @raven-worx I haven't used the original QT Quick so I assume you mean to say that the graphics view framework is fairly well optimized and fast when it comes to 2D rendering?



  • After fighting with QGraphicsView most of a day to make it do what I want I think in my case it is not a good fit and I'm better off using QAbstractScrollArea.

    My reasoning is with the former there seems to be a lot of setup in creating items to add to a scene, but with the latter I can basically use paintEvent to draw the scene and update based on custom logic for the scene.

    I shall mark this as solved.


Log in to reply