PDA

View Full Version : One QGraphicsScene in two QGraphicsViews



klaviaturist
29th March 2011, 00:36
Is it possible to have one scene in two views with two different sizes?

dbzhang800
29th March 2011, 02:56
Of course.

klaviaturist
29th March 2011, 21:39
:) I forgot to tell that the same scene should be scaled to fit the view

SixDegrees
29th March 2011, 22:00
That doesn't change anything.

klaviaturist
29th March 2011, 22:08
So how do i do that?

wysota
29th March 2011, 22:18
You set the same scene on both views and call fitInView (or apply whatever else transformation you want) on each of them.

klaviaturist
29th March 2011, 22:55
Thanks, I will try that

Added after 16 minutes:

That was a nice solution but it doenn't help me all the way. The pixmaps gets to distorted when scaling from 1280 px to 280 px so I will use me previous code for that part.

One issue remains: I'm having a video player that needs to be displayed at two scenes and controlled from one place. How do i connect two players to one seekslider and play and stop button?

wysota
29th March 2011, 23:50
The pixmaps gets to distorted when scaling from 1280 px to 280 px
Enable smooth pixmap transformations render hint on the view.

klaviaturist
30th March 2011, 01:56
Hmm, I still get the pixmap distorted. Is there any other settings that affects the rendering of the view?

wysota
30th March 2011, 10:37
Please post your code for setting up the view.