[Kde-bindings] KDE/kdebindings
Arno Rehn
arno at arnorehn.de
Wed Nov 25 21:24:14 UTC 2009
On Wednesday 25 November 2009 20:15:12 Richard Dale wrote:
> On Wednesday 25 November 2009 07:10:32 pm Arno Rehn wrote:
> > SVN commit 1054240 by arnorehn:
> >
> > Add mf_virtual and mf_purevirtual method flags to SMOKE and make
> > generator flag the methods accordingly.
> >
> > CCMAIL: kde-bindings at kde.org
> >
> >
> >
> > M +10 -0 generator/generators/smoke/writeSmokeDataFile.cpp
> > M +3 -1 smoke/smoke.h
> >
> >
> > ---
> > trunk/KDE/kdebindings/generator/generators/smoke/writeSmokeDataFile.cpp
> > #1054239:1054240 @@ -451,6 +451,8 @@
> > if (isExternal && !declaredVirtualMethods.contains(klass))
> > continue;
> >
> > + QList<const Method*> virtualMethods =
> > Util::virtualMethodsForClass(klass); +
> > int xcall_index = 1;
> > foreach (const Method& meth, klass->methods()) {
> > if (isExternal &&
> > !declaredVirtualMethods[klass].contains(&meth)) @@ -486,6 +488,14 @@
> > flags += "|Smoke::mf_attribute";
> > if (meth.isQPropertyAccessor())
> > flags += "|Smoke::mf_property";
> > +
> > + // Simply checking for flags() & Method::Virtual won't be
> > enough, because methods can override virtuals without being +
> > // declared 'virtual' themselves (and they're still virtual, then). +
> > if (virtualMethods.contains(&meth))
> > + flags += "|Smoke::mf_virtual";
> > + if (meth.flags() & Method::PureVirtual)
> > + flags += "|Smoke::mf_purevirtual";
> > +
> > flags.replace("0|", "");
> > out << flags;
> > if (meth.type() == Type::Void) {
> > --- trunk/KDE/kdebindings/smoke/smoke.h #1054239:1054240
> > @@ -131,7 +131,9 @@
> > mf_dtor = 0x40,
> > mf_protected = 0x80,
> > mf_attribute = 0x100,
> > - mf_property = 0x200
> > + mf_property = 0x200,
> > + mf_virtual = 0x400,
> > + mf_purevirtual = 0x800
> > };
> > /**
> > * Describe one method of one class.
>
> Looks good. Would it be possible to have an mf_signal attribute too? That
> would be useful for the QtScript bindings which need to do something
> different for calls on signal methods.
Yes, but you can obtain information about signals and slots from the meta
object anyway. That's how I want to do it in the C# assembly generator, too.
Just call staticMetaObject() via smoke and you have all the information
available in the QMetaObject.
--
Arno Rehn
arno at arnorehn.de
More information about the Kde-bindings
mailing list