[Kde-bindings] Kalyptus - node types

Richard Dale Richard_Dale at tipitina.demon.co.uk
Thu Dec 8 19:39:09 UTC 2005


On Wednesday 07 December 2005 19:09, Thomas Moenicke wrote:
> Hi,
>
> I'm writing an extension for kalyptus which helps me to develop php_qt.
> Everything works fine and I can create most parts of php_qt, but I need to
> readout the class properties, e.g. 'accepted: bool' in QEvent.
> If I try to access $node childs I have enum and method types only.
>
> in writeClassDoc() I have the following code for testing:
>
>         Iter::MembersByType ( $node,
>                 sub { print CLASS "", $_[0], ""; print CLASS "", $_[0], "";
> }, sub {   my ($node, $kid ) = @_;
> 				print PHP_QT_CPP $kid->{astNodeName},$kid->{NodeType};
>                          },
>                 sub { print CLASS ""; print CLASS ""; }
>         );
>
> I found these node properties:
>
> $m->{astNodeNa}
> $m->{NodeType}
> $m->{Parent}
> $m->{KidHash}
> $m->{DocNode}
> $m->{Path}
> $m->{RootType}
> $m->{KidAccess}
> $m->{DcopExported}
> $m->{Source}
> $m->{Params}
> $m->{Tmpl}
> $m->{Deprecated}
> $m->{Type}
> $m->{TmplType}
> $m->{Flags}
> $m->{ReturnType}
> $m->{Pure}
> $m->{ParamList}
> $m->{ArgType}
> $m->{ArgName}
> $m->{DefaultValue}
> $m->{Value}
>
> but none can help me.
>
> Is there a way (designed) to parse the class properties?
I can't find any properties associated with QEvent, only this:

/* An internal class */
class Q_EXPORT QDragResponseEvent : public QEvent
{
public:
    QDragResponseEvent( bool accepted )
        : QEvent(DragResponse), a(accepted) {}
    bool   dragAccepted() const { return a; }
protected:
    bool a;
};

But Q_PROPERTY macros are currently skipped, by this code in 'kalyptus', at 
about line 540:

		next if ( $p =~ /^\s*Q_ENUMS/           # ignore Q_ENUMS
                        || $p =~ /^\s*Q_FLAGS/       # and Q_FLAGS
                        || $p =~ /^\s*Q_DECLARE_FLAGS/       # and 
Q_DECLARE_FLAGS
                        || $p =~ /^\s*Q_PROPERTY/       # and Q_PROPERTY
                        || $p =~ /^\s*QDOC_PROPERTY/
...

So you would need to change kalyptus to parse Q_PROPERTY macros, and add a 
suitable property that you could pick up during the code generation. I 
haven't found a need to get at properties because there are always ordinary 
methods that allow you to get at the same data.

-- Richard



More information about the Kde-bindings mailing list