[vlc-devel] commit: Qt4: implement PlaylistEventManager functionality in MainInputManager ( Jakob Leben )

Jean-Baptiste Kempf jb at videolan.org
Mon Nov 9 09:01:22 CET 2009


On Mon, Nov 09, 2009 at 03:51:31AM +0100, Jakob Leben wrote :
> On Sun, Nov 8, 2009 at 4:40 PM, Jean-Baptiste Kempf <jb at videolan.org> wrote:
> 
> > Why so many static_cast? Can't we avoid that?

> ..
> from the playlist in which you have to lock the playlist again. Using QEvent
> postpones the processing of the callback until Qt reaches main event loop
> again.

> Otherwise, C++ static_cast is completely equivalent to old-school (or
> ...

First, you don't need to explain to us basics of C++/Qt programming.

Then, MainInputManager is a QObject derivative, so I believe that the
static_casts around MainInputManager could be replaced with success by
using qobject_cast, which is better for QObjects.
For QEvent, that don't inherit from QObjects, you haven't the choice,
you are right.

Sorry, I should have detailed more my question in the first place.

> BTW, these callbacks where implemented in PLModel exactly the same way, only
> the text had C-style casts instead of static_cast. I saw elsewhere in Remi's
> code that he used static_cast notation and I decided I'd use that notation
> too.
Well, while you may have a point here, this doesn't mean that this code
should be kept. ;)

Best Regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/



More information about the vlc-devel mailing list