[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-games-devel
Subject:    [Kde-games-devel] QCanvasSprite + QObject
From:       Johnny Andersson <johnny () johnnys ! info>
Date:       2001-12-12 19:08:36
[Download RAW message or body]

Hi. Is it possible to inherit from both QCanvasSprite and QObject at the same 
time? My program doesn't compile when I do. I've written my own sprite class, 
derived from QObject. I started having trouble when I wanted to use collision 
detection; to use RTTI, I have to derive from QCanvasItem. 

As a temporary solution, I created a small class derived form QCanvasSprite 
with the rtti-stuff. This class contains a pointer to my "real" sprite 
object, so that I can find it when Qt reports a collision. An ugly hack.

Is it just me, or does the QCanvas extension not feel as polished as the rest 
of Qt? While very useful, there are some things that I've had to re-design in 
my program to work around. For example, QCanvasPixmapArray has a method 
setImage(...) to set a specific image in the list, and if needed, it extends 
the list. But I can't create an empty QCanvasPixmapArray and then add items 
to it using setImage, I have to create a dummy array first *or* create an 
empty QCanvasPixmapArray and then call readPixmaps (which if of course only 
relevant if you have the graphics in a file, and not generate them yourself).

_______________________________________________
kde-games-devel mailing list
kde-games-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-games-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic