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

List:       kde-bindings
Subject:    Re: [Kde-bindings] Duplicate methods for QByteArray::data()
From:       Arno Rehn <arno () arnorehn ! de>
Date:       2009-11-06 14:14:12
Message-ID: 200911061514.12470.arno () arnorehn ! de
[Download RAW message or body]

On Friday 06 November 2009 04:32:23 Chris Burel wrote:
> I was trying out the new smokeqt object that's generated with Arno's
> new generator, and I discovered that there are 2 methods for
> QByteArray::data(), one that returns const data and one that doesn't.
> Is this by design?  I thought that the only methods that were
> considered ambiguous were ones that have the same name and number of
> arguments, but different types of arguments.  Should I change the
> ambiguous method resolution code in PerlQt4 to handle this case, or is
> it something that can be fixed in smoke?
> 
> grep QByteArray::data smokedata.cpp
>     {64, 7190, 0, 0, 0, 1692, 17},      //1927 QByteArray::data()
>     {64, 7190, 0, 0, Smoke::mf_const, 2113, 18},        //1928
> QByteArray::data() const
This is done on purpose. There are some use cases, especially in QtDBus, where 
you need the 'const' version of a method. Depending on whether the method is 
const or not the returned value differs. Most of the time it will suffice to 
simply call the non-const method, though.

-- 
Arno Rehn
arno@arnorehn.de
_______________________________________________
Kde-bindings mailing list
Kde-bindings@kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings
[prev in list] [next in list] [prev in thread] [next in thread] 

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