Hello,
I have the following problem. In this function:
void MyCanvasView::addSprite()
{
Q3CanvasItem* i = new BouncyLogo(myCanvas);
i->setZ(rand()%256);
i->show();
}
void MyCanvasView::addSprite()
{
Q3CanvasItem* i = new BouncyLogo(myCanvas);
i->setZ(rand()%256);
i->show();
}
To copy to clipboard, switch view to plain text mode
we create a new BouncyLogo item. The constructor for BouncyLogo is as follows:
BouncyLogo::BouncyLogo(Q3Canvas* canvas):
Q3CanvasSprite(0,canvas)
{
logo_rtti = 1234;
Q3CanvasPixmapArray logo(":/images/qt-trans.xpm");
setSequence(&logo);
setAnimated(TRUE);
initPos();
}
BouncyLogo::BouncyLogo(Q3Canvas* canvas):
Q3CanvasSprite(0,canvas)
{
logo_rtti = 1234;
Q3CanvasPixmapArray logo(":/images/qt-trans.xpm");
setSequence(&logo);
setAnimated(TRUE);
initPos();
}
To copy to clipboard, switch view to plain text mode
OK, the problem is that when I call the function addSprite() the application just crashes...
Can you see anything wrong with this code?
Thanks!
Bookmarks