[RQt-devel] possible bug in qtbase
Michael Lawrence
lawrence.michael at gene.com
Tue Sep 20 23:50:22 CEST 2011
On Tue, Sep 20, 2011 at 12:03 PM, Deepayan Sarkar <deepayan.sarkar at gmail.com
> wrote:
> On Tue, Sep 20, 2011 at 8:55 PM, Michael Lawrence
> <lawrence.michael at gene.com> wrote:
> > Hi Deepayan,
> >
> > Nice to hear you are back into the Qt stuff. I can indeed reproduce this.
> > But not anymore, because I've fixed it.
>
> Thanks, I can confirm the fix.
>
> I've decided to try out a different approach, managing the layout in R
> as much as possible, and target multiple backends. I'm initially
> experimenting with QGraphicsView/Scene, and now I'm getting much
> further with that thanks to your fix. At some point I'll start bugging
> you about qtpaint as well.
>
>
You might want to check out anypaint in the GGobi github. Gabriel Becker
(DTL's student) has been doing a lot of work on generic (pure R, backend
agnostic) implementations of things like layout. He's implementing anypaint
against HTML5/JS in Firefox, via RFirefox. I need to make sure that he is
committing his stuff back into github.
> I think there are still problems lurking around. Here is a protection
> bug: This gives an error because the gc() causes view$scene() to go
> away.
>
> ----
> library(qtbase)
>
> view <- Qt$QGraphicsView()
> view$size <- qsize(600, 600)
> view$setScene(Qt$QGraphicsScene())
> ## class(view$scene())
> gc()
> view$scene() # NULL
> view$scene()$clear()
> ----
>
> If I uncomment the 'class(view$scene())' then things are OK.
>
>
This is just Qt. Neither R nor QGraphicsView keep a reference to the scene.
This is why qtpaint sets the parent of the scene to the view, if it does not
already have a parent.
> In a more realistic example involving QGraphicsScene (that I haven't
> been able to simplify yet), having a gc() keeps things sane, and not
> having it leads to errors similar to the ones before, e.g.,
>
> Error in qinvokeStatic(cl, basename, ...) :
> Expected an instance of type 'QColor', not 'QGraphicsLineItem'
> Calls: print ... is -> qbrush -> <Anonymous> -> qinvokeStatic -> .Call
>
>
Looking forward to that simplified example.
> -Deepayan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/qtinterfaces-devel/attachments/20110920/0f8d370d/attachment.htm>
More information about the Qtinterfaces-devel
mailing list