[RQt-devel] mosaiq
Deepayan Sarkar
deepayan.sarkar at gmail.com
Tue Sep 28 11:37:25 CEST 2010
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.
-Deepayan
More information about the Qtinterfaces-devel
mailing list