[RQt-devel] mosaiq

Michael Lawrence lawrence.michael at gene.com
Tue Oct 5 22:22:27 CEST 2010


On Tue, Sep 28, 2010 at 2:37 AM, Deepayan Sarkar
<deepayan.sarkar at gmail.com>wrote:

> On Mon, Sep 27, 2010 at 1:48 PM, Michael Lawrence
> <lawrence.michael at gene.com> wrote:
>
> > I've not had enough time to play around with the layout. There have been
> > many examples from others where the layout behaves strangely, and I don't
> > really have an explanation.
> >
> > The row/col stretch factors are the most obvious way to control the
> packing
> > of the rows and columns. In theory, the grid layout is considering the
> size
> > request of the widget, but in some simple attempts I did not have much
> luck
> > playing with that.
>
> OK, I will try to see if I can come up with anything.
>
> [...]
>
> > There is a cache mode, just pass cache=TRUE to qlayer(). Note that this
> will
> > basically require clip=TRUE, since the cache surface will be maximally
> > allocated to the size of the layer. Clipping can cause issues.
>
> No, I already have cache=TRUE set in qlayer(). Here is a nice simple
> example showing the problem:
>
> -------
>
> library(qtpaint)
>
> scene <- qscene()
> root <- qlayer(scene)
>
> points1 <-
>    qlayer(root,
>           paintFun = function(item, painter, exposed) {
>               qdrawGlyph(painter, qglyphCircle(10),
>                          runif(10), runif(10), stroke = NA,
>                          fill = sample(colors(), 1))
>           },
>           row = 1L, col = 0L,
>           cache = TRUE,
>           limits = qrect(c(0, 1), c(0, 1)))
>
> v <- qplotView(scene, opengl = FALSE)
>
> w <- Qt$QTabWidget()
> w$addTab(v, "view")
> w$addTab((ted <- Qt$QTextEdit()), "text")
> w
>
> -------
>
> If I now switch between the two tabs (either using mouse or keyboard),
> I see the paint function being called every time v becomes visible.
>
> The following is even more interesting. Start this infinite loop:
>
> while (TRUE) {
>    w$currentIndex <- 1
>    w$update()
>    Sys.sleep(0.2)
>    w$currentIndex <- 0
>    w$update()
>    Sys.sleep(0.2)
> }
>
> Then while the window with w
>
>  - does not have focus, there is no repaint,
>
>  - does have focus, there's a repaint on every run.
>
> This is fairly convincing evidence that this is a focus issue, but I
> haven't been able to find anything more specific.
>
>
I looked into this a bit. Even if one disables focusing of the view, e.g:
v$focusPolicy <- Qt$Qt$NoFocus
before adding it to the container, it still repaints when the parent window
has focus.

Who knows..


-Deepayan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/qtinterfaces-devel/attachments/20101005/85e20556/attachment-0001.htm>


More information about the Qtinterfaces-devel mailing list