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

List:       kde-devel
Subject:    Re: QPopupMenu::insertItem (KHelpMenu *&)
From:       Mike Richardson <mike () quaking ! demon ! co ! uk>
Date:       2001-12-19 13:03:33
[Download RAW message or body]

On Wednesday 19 December 2001 10:08 am, Chris Howells wrote:
> On Wednesday 19 December 2001 1:13 am, Waldo Bastian wrote:
> > Don't read too much into that. If you make a call like:
> > 	foo(5);
> > It's considered a call to "foo(int)"
> > But if you use:
> > 	int i = 5;
> > 	foo(i);
> > It's considered a call to "foo(int &)" (but if you only have "foo(int)"
> > it will use that one instead.)
>
> Oooh, that's really bizarre. I wouldn't have expected that at all ;)

I presume its because you can have

void foo (int &i) { i = 666 ; }

which is meaningless for a call of foo(5).

Actually, there used to be a Fortran compiler for the IBM/360s (Watfor?)
where you could do the equivalent, after which 5 became 666 under certain 
circumstances. It was a great one for fooling the duty programming advisor :))

Mike


>
> > The problem is probably something like that you forgot to include
> > "khelpmenu.h" so that the compiler doesn't know that "KHelpMenu *" can be
> > casted to "QWidget *".
>
> I do have KHelpMenu included.
>
> Actually, the solution turned out to be kgeoHelpMenu->menu(). Not that I
> understand why ;)
>
> But it works :)

-- 
mike@quaking.demon.co.uk
http://www.quaking.demon.co.uk
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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