[RQt-devel] possible bug in qtbase

Deepayan Sarkar deepayan.sarkar at gmail.com
Tue Sep 20 21:03:36 CEST 2011


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.

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.

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

-Deepayan


More information about the Qtinterfaces-devel mailing list