Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Two QDeclarativeViews with one scene - how differ their cameras?

    QML and Qt Quick
    2
    3
    2226
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      Fenix Voltres last edited by

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

      Thanks in advance for thousands of replies,
      Fenix

      When temptation brings me to my knees
      And I lay here drained of strength
      Show me kindness
      Show me beauty
      Show me truth

      1 Reply Last reply Reply Quote 0
      • A
        andre last edited by

        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?

        1 Reply Last reply Reply Quote 0
        • F
          Fenix Voltres last edited by

          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?

          When temptation brings me to my knees
          And I lay here drained of strength
          Show me kindness
          Show me beauty
          Show me truth

          1 Reply Last reply Reply Quote 0
          • First post
            Last post