Important: Please read the Qt Code of Conduct -

Two QDeclarativeViews with one scene - how differ their cameras?

  • Hey,
    is it possible to have two QDeclarativeViews sharing one scene but displaying differenr parts of scene?

    Thanks in advance for thousands of replies,

  • Only one reply from me: yes, that is possible. Each QGraphicsView has it's own transformation. A quick look at the QGraphicsView documentation will reveal a lot of methods to manipulate what part of the scene is visible on the view. Do you have a specific problem with those?

  • Yes, I have - I just simply can't set different parts of one scene to be visible on two QGraphicViews. Of course I've read the documentation, but none of solutions which are there helped me.

    Let's say I have a scene which's 2x2 and two views 1x1. Now I want to display upper left square in first view and upper right square in second - how can I achieve this?

    Neither setSceneRect() nor setTransform( QTransform().translate(1,1) ) works. Actually, if it comes to transformations, scale() and rotate() works fine, but translate() seems to do nothing.

    Any help?

Log in to reply