[RQt-devel] possible bug in qtbase

Deepayan Sarkar deepayan.sarkar at gmail.com
Mon Sep 19 14:28:14 CEST 2011


Hi,

I'm working with qtbase after a long gap. In some code making use of
QGraphicsView/Scene, I'm intermittently (but frequently) encountering
what look like memory problems. I've simplified my code to a
sort-of-reproducible minimal example, available at

http://www.isid.ac.in/~deepayan/tmp/foo.R

Running this (a couple of times) gives:

deepayan at kanika:/tmp$ R --slave < foo.R
NULL
QGraphicsView instance
1       QPen
2       QPen
3       QPen
4       QPen
5       QPen
6       QPen
7       QPen
8       QPen
9       QPen
10      QPen
11      QPen
12      QPen
13      QGraphicsEllipseItem
Error in qinvoke(<environment>, "addRect", ...) :
  Expected an instance of type 'QPen', not 'QGraphicsEllipseItem'
Calls: <Anonymous> -> qinvoke -> .Call
Execution halted

deepayan at kanika:/tmp$ R --slave < foo.R
NULL
QGraphicsView instance
1       QPen
2       QPen
3       QPen
4       QPen
5       QPen
6       QPen
7       QPen
8       QPen
Error in qinvokeStatic(cl, basename, ...) :
  Wrong number or types of arguments passed to 'QColor::QColor'
Calls: qpen ... qbrush -> qcolor -> <Anonymous> -> qinvokeStatic -> .Call
Execution halted


I get no error if I comment out the scene$addRect and scene$addEllipse
calls.  If I move the pen <- qpen(...) call outside the loop, then the
error still happens, but typically takes much longer; e.g.,

...
259     QPen
260     QPen
261     QPen
Error in qinvoke(<environment>, "setScene", ...) :
  Expected an instance of type 'QGraphicsScene', not 'QGraphicsEllipseItem'
Calls: <Anonymous> -> qinvoke -> .Call
Execution halted

Can anyone reproduce?

(I have added a few missing break statements in qtbase/src/module.cpp,
but they don't seem to be relevant.)

I am using Qt 4.7.2 on Debian.

-Deepayan


More information about the Qtinterfaces-devel mailing list