November 9, 2011

Fenix Voltres Fenix Voltres
Lab Rat
23 posts

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,
Fenix

 Signature 

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

2 replies

November 9, 2011

Andre Andre
Robot Herder
6396 posts

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?

November 16, 2011

Fenix Voltres Fenix Voltres
Lab Rat
23 posts

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 2×2 and two views 1×1. 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?

 Signature 

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

 
  ‹‹ hooking up qDebug() to console.log()?      fast NPAPI plugin wrapper to QML ››

You must log in to post a reply. Not a member yet? Register here!