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

List:       kde-core-devel
Subject:    Re: KSharedPixmap does not compile
From:       David Faure <faure () kde ! org>
Date:       1999-12-19 20:34:36
[Download RAW message or body]

On Sun, Dec 19, 1999 at 05:24:02PM +0100, Waldo Bastian wrote:
> On Sun, 19 Dec 1999, David Faure wrote:
> 
> > KPixmap:: doesn't help. Didn't try KPixmap::QPixmap:: :-)
> > 
> > I agree with you, this should compile.
> > But gcc-2.95 doesn't like it (looks like a bug in gcc-2.95 :
> > it resolves the call to QPaintDevice::handle() and _then_
> > looks at the inheritance tree and says it's ambiguous).
> 
> You inherit twice from QPaintDevice so the compiler doesn't know 
> _which_ QPaintDevice::handle() to call. The object contains _two_ 
> inherited QPaintDevice classes, one inherited via KPixmap and one 
> inherited via QWidget.

Which is why calling QPixmap::handle() [or KPixmap::handle()] 
_tells_ the compiler which one to use. This bug is really a bug.
Without -pedantic, it compiles fine.

The code _contained_ QPixmap::handle(). I said it resolved it
to QPaintDevice::handle(), I think that's what misled you.

> Double inheritance is _NOT_ a good idea. 
Well, sometimes you have to...
Don't mix this opinion of yours with a compiler bug :-)

-- 
David FAURE
david@mandrakesoft.com, faure@kde.org
http://home.clara.net/faure/
KDE, Making The Future of Computing Available Today

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

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