[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-multimedia
Subject: Re: adding properties to a C++ class
From: Guillaume Laurent <glaurent () telegraph-road ! org>
Date: 2001-12-18 9:34:49
[Download RAW message or body]
On Tuesday 18 December 2001 10:20, Scott Wheeler wrote:
> Then QListView sends a signal which passes a pointer to a QListViewItem,
> which I've implemented a slot for. In the slot's implementation I do a
> static cast:
>
> myListItem *item=static_cast<myListItem*>(QLVitem);
It will work if QLVitem* is really a myListItem*, but you can't check that so
it isn't really safe. Use dynamic_cast<> instead, which performs the check.
I suggest you get a copy of "C++ Primer", by Stanley Lippman, Addison Wesley
Ed.
--
Guillaume
http://www.telegraph-road.org
_______________________________________________
kde-multimedia mailing list
kde-multimedia@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-multimedia
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic