<br><br><div class="gmail_quote">On Tue, Sep 20, 2011 at 12:03 PM, Deepayan Sarkar <span dir="ltr">&lt;<a href="mailto:deepayan.sarkar@gmail.com">deepayan.sarkar@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, Sep 20, 2011 at 8:55 PM, Michael Lawrence<br>
&lt;<a href="mailto:lawrence.michael@gene.com">lawrence.michael@gene.com</a>&gt; wrote:<br>
&gt; Hi Deepayan,<br>
&gt;<br>
&gt; Nice to hear you are back into the Qt stuff. I can indeed reproduce this.<br>
&gt; But not anymore, because I&#39;ve fixed it.<br>
<br>
</div>Thanks, I can confirm the fix.<br>
<br>
I&#39;ve decided to try out a different approach, managing the layout in R<br>
as much as possible, and target multiple backends. I&#39;m initially<br>
experimenting with QGraphicsView/Scene, and now I&#39;m getting much<br>
further with that thanks to your fix. At some point I&#39;ll start bugging<br>
you about qtpaint as well.<br>
<br></blockquote><div><br>You might want to check out anypaint in the GGobi github. Gabriel Becker (DTL&#39;s student) has been doing a lot of work on generic (pure R, backend agnostic) implementations of things like layout. He&#39;s implementing anypaint against HTML5/JS in Firefox, via RFirefox. I need to make sure that he is committing his stuff back into github.<br>
<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I think there are still problems lurking around. Here is a protection<br>
bug: This gives an error because the gc() causes view$scene() to go<br>
away.<br>
<br>
----<br>
library(qtbase)<br>
<br>
view &lt;- Qt$QGraphicsView()<br>
view$size &lt;- qsize(600, 600)<br>
view$setScene(Qt$QGraphicsScene())<br>
## class(view$scene())<br>
gc()<br>
view$scene() # NULL<br>
view$scene()$clear()<br>
----<br>
<br>
If I uncomment the &#39;class(view$scene())&#39; then things are OK.<br>
<br></blockquote><div><br>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.<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

In a more realistic example involving QGraphicsScene (that I haven&#39;t<br>
been able to simplify yet), having a gc() keeps things sane, and not<br>
having it leads to errors similar to the ones before, e.g.,<br>
<div class="im"><br>
Error in qinvokeStatic(cl, basename, ...) :<br>
</div>  Expected an instance of type &#39;QColor&#39;, not &#39;QGraphicsLineItem&#39;<br>
Calls: print ... is -&gt; qbrush -&gt; &lt;Anonymous&gt; -&gt; qinvokeStatic -&gt; .Call<br>
<font color="#888888"><br></font></blockquote><div><br>Looking forward to that simplified example.<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<font color="#888888">
-Deepayan<br>
</font></blockquote></div><br>