[Kde-bindings] Problem with enums in modular smoke

Arno Rehn arno at arnorehn.de
Thu May 15 12:43:50 UTC 2008


Am Donnerstag 15 Mai 2008 13:48:27 schrieb Richard Dale:
> If I generate the Qt version of the smoke lib, any Qt enums are correctly
> recognised as enums:
>
> smokedata.cpp:  { "Qt::ScrollBarPolicy", 553, Smoke::t_enum |
> Smoke::tf_stack },
>
> However, if the same enums are referenced in the KDE version of the smoke
> lib, they are missed:
>
> Qt::ScrollBarPolicy isn't a known type (type=Qt::ScrollBarPolicy)
> ...
>
> smokedata.cpp:  { "Qt::ScrollBarPolicy", 0, Smoke::t_voidp |
> Smoke::tf_stack },//1481
>
> So we need to either copy the enums into the kde_types table, or label them
> as external like classes. But I don't think we have any way of looking them
> up like we have for classes, and so copying the entries seems better to me.
Ah, I see. The problem here is that the classes in which the enums are 
declared are not put into the *_classes array. Other Qt enums that are 
referenced in the KDE version and whose containing classes are in the classes 
array work:

class table:
{ "QTextEdit", true, 0, 0, 0, 0 }, 	// 651

types table:
{ "QTextEdit*", 651, Smoke::t_class | Smoke::tf_ptr },	//1416
{ "QTextEdit::AutoFormattingFlag", 651, Smoke::t_enum | 
Smoke::tf_stack },	//1418

So all we have to do is add the class to the class table and mark it external 
if it contains any referenced enums.

-- 
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list