Qt-interest Archive, March 2002
Extending canvas
Message 1 in thread
I'm trying to extend canvas. I'm subclassing QCanvasItem.
What I can't figure out is how to correctly handle collidesWith(QCanvasItem *)
In the source, the trolls do this funky thing passing the question to the
other items collidesWith ([...all the five items...]).
However, c++ won't let me do this, as I am not passing one of their items.
I have to say their code for the hidden collidesWith makes me uneasy.
If anyone has a suggestion I'd love to hear it, but for now I'm going to
kludge together something that seems to work.
--
[ signature omitted ]
Message 2 in thread
As I look at it, it seems like I might have to Subclass QCnavasText, and
reimplement a significant portion of the functionality.
On the other hand, I'm not sure if it's not the wrong way to go. I eventually
want a very sophisticated item. The user will want to select just parts of it.
One comment I have is about the collidesWith functions. Why is it implemented
that way it is, instead of using the rtti functions for type identification?
It seems kind of kludgey.
--
[ signature omitted ]