[PyQt] SIP: overloaded functions with the same Python signature

GOO Creations goocreations at gmail.com
Thu Jul 8 15:42:27 BST 2010


You are correct. I can't believe I didn't see this.
Thank you

Chris



On 2010/07/08 04:33 PM, Andreas Pakulat wrote:
> On 08.07.10 14:01:21, GOO Creations wrote:
>    
>> With getFileHash(QString()) the first overload is being called.
>>      
> No its not, the code doesn't even compile if you call getFileHash with
> anything but 3 arguments. See this example (its the same thing, except no
> Qt depdendencies):
>
> #include<stdio.h>
> class Bar {
>      public:
> void foo( char* data, bool f = true, int x = 10 ) {
>      fprintf(stderr, "1\n");
> }
> void foo( char* data, bool f = true ) {
>      fprintf(stderr, "1\n");
> }
> };
>
> int main()
> {
>      Bar b;
>      b.foo( "test" );
> }
>
> This doesn't compile with either gcc or msvc and I doubt you'll find any
> C++ compiler compiling this code.
>
> Andreas
>
>    



More information about the PyQt mailing list