[Kde-bindings] possible conflicts in enums

Petr Vanek petr at scribus.info
Mon Sep 7 10:33:28 UTC 2009


On Sep 7, 2009, at 11:47 AM, Richard Dale wrote:

> On Monday 07 September 2009 10:25:02 am Petr Vanek wrote:
>> Let's take for example these enums
>> enum Qt::GlobalColor
>> enum Qt::PenStyle
>>
>> and available constructors (Qt):
>> QPen ( Qt::PenStyle style )
>> QPen ( const QColor & color )
>>
>> If I use it in special case (pseudocode)
>>
>> // "enum", but it's just an alias for 3
>> foo = Qt::DotLine
>> // then call
>> pen = new QPen(foo)
>>
>> so it's unclear which constructor to call. Just because Qt::DotLine
>> equals Qt::white in this case.
>>
> In QtRuby a Qt::Enum value is returned for enums. I don't think we  
> need to add
> anything to smoke because converting from the long on the smoke  
> stack to a
> Ruby Qt::Enum or whatever is needed for other languages, is  
> something than a
> language specific marshaller can do. The enum 'MethodFlags' in  
> smoke.h has a
> value mf_enum, and so it is easy to know if the method being called is
> returning an enum value, and the stack union ha an 's_enum' variant:

OK, it's clear. But it doesn't explain how to find QPen constructor  
from my example above. Both constructors are accepting enum as an  
argument, both have the same signature "QPen#".
I still think there should be any way how to identify *type of enum*  
in smoke.

I mean - there is a "white" method in "Qt" class (it's a namespace,  
but listed in classes in smoke). It's enum in MethodFlags. But there  
should be (IMHO) some link between an enum value (method) and  
Smoke::Type list.

petr




More information about the Kde-bindings mailing list