Hi, If you are only going to be doing something relatively simple like this, then perhaps just making duplicates of the items and adding them to each ViewBox manually would be easiest. You can synchronise the pan/zoom of the ViewBoxes easily with existing axes linking methods. You would just need to manually update the data for the two plot items when it changes, or code in some signal/slot magic to do this automatically.
Sure, might seem inefficient, but if it get the job done... Patrick On Tuesday, 7 May 2019 16:58:04 UTC+9:30, Andre G wrote: > > Hi all, > > If anyone is interested, here is a corresponding SO question > <https://stackoverflow.com/questions/55882987/adding-graphicsobject-to-two-viewboxes-or-qgraphicsviews> > > with a minimum working example. In general I want to achieve something like > this: > > Add three Items to a scene. Then I want a ViewBox to show the first Item, > the second ViewBox to show the second Item. The third Item should be > displayed in both ViewBoxes. > > But as far as I know, this will be hard to do. Because either I have to > intercept PaintEvents, to transform the third Item just before the Event is > further propagated through the ViewBox. Will it might be possible, it seems > like an bad idea to me, introducing a lot of imponderabilities like > possible racing conditions between ViewBoxes. > > How hard will it be to implement all the nice pyqtgraph functionality, > like mouse panning, using Qt native Views and Scenes? 0Is there another > approach to achieve what I am looking for? > > > > > Best, > Acha > -- You received this message because you are subscribed to the Google Groups "pyqtgraph" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/5be4f056-b7f3-4558-a9ef-2e5f54a2b02e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
