Unsolved How to paint to pixmap ?
-
@mrjj Thanks for example & checking it! I created label in constructor, will try ur code next, thanks!
-
@Dariusz
Ok it was not dangling pointer then. :)
I tried for fun making invalid pixmap but i could make it crash.
Maximum effect was nothing shown.
So i have a feeling the crash might have been a bit unrelated to the pixmap.But if this code also crashes, we might found some binding bug :)
-
@mrjj Running this code causes crash:
def draw(self, iconMode): m = QPixmap(500,500) ...
Can't initialize QPixmap() with size.
If you could reproduce the crash, then we could post it to bug report :- )
-
Hi
is
m = QPixmap(500,500)like (c++)
QPixmap m(500,500);or
QPixmap *m = new QPixmap (500,500);Does it also crash there if you make new project and does nothing but
m = QPixmap(500,500)If you can make a small example that crash, its ok to open bug report.
-
@mrjj I did some tests. I looks like it crashes when I do this p= QPainter(m), so passing it as source to QPainter o.O
-
Hi
well M seems to be a class member so
out of scope issues should not be possible.So it could be a real bug if you can reproduce it in a minimal program.
-
Hi,
Add
p.end()
when you're done painting. So in your code, before you callsetPixmap
. -
@SGaist
Good call.
It still works without painter.end();
in the c++ version but could be critical for a binding. -
I don't know how the binding manages that but when testing the code, I got the following message:
QPaintDevice: Cannot destroy paint device that is being painted
-
@SGaist
Ok that sounds a bit bad like -
"delete while in use" situation.
So it seems plausible it could crash from that in some cases.