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

Achieve the Microsoft Excel scroll effect in a QGraphicsScene



  • How can I scroll my QGraphicsScene like Microsoft Excel without setting a max size?
    In Excel, the Scroll Bar appears large, and you can only scroll down a little. As you scroll down, the scroll bar shrinks and you scroll endlessly down. I would like my QGraphicsScene to do this. At first, it will appear you can only scroll down a little, but as you scroll down, the size increases. Can I do this and keep my performance of my Scene?



  • @johnratius
    I don't have any code for you, and I don't know if there is anything special about QGraphicsScene, but I assume you only wanted the approach, right?

    I presume:

    1. You react to the user scrollling, either paging or dragging as necessary.

    2. In the handler, you increase the maximum range/limit of the scrollbar. You make the QGraphicsScene, or the view, larger, if that's appropriate.

    That way the scroll button will get smaller in proportion to the newly increased size.

    ?



  • @johnratius
    I don't have any code for you, and I don't know if there is anything special about QGraphicsScene, but I assume you only wanted the approach, right?

    I presume:

    1. You react to the user scrollling, either paging or dragging as necessary.

    2. In the handler, you increase the maximum range/limit of the scrollbar. You make the QGraphicsScene, or the view, larger, if that's appropriate.

    That way the scroll button will get smaller in proportion to the newly increased size.

    ?



  • @JonB Yes, I am asking for an approach, and this or other approaches will work well without affecting performance greatly. I'll take a look at implementing this, thanks.


Log in to reply